Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:04

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // This example is provided by the Geant4-DNA collaboration
0027 // Any report or published results obtained using the Geant4-DNA software
0028 // shall cite the following Geant4-DNA collaboration publication:
0029 // Med. Phys. 37 (2010) 4692-4708
0030 // and papers
0031 // M. Batmunkh et al. J Radiat Res Appl Sci 8 (2015) 498-507
0032 // O. Belov et al. Physica Medica 32 (2016) 1510-1520
0033 // The Geant4-DNA web site is available at http://geant4-dna.org
0034 //
0035 // -------------------------------------------------------------------
0036 // November 2016
0037 // -------------------------------------------------------------------
0038 //
0039 //
0040 /// \file PhysicsList.cc
0041 /// \brief Implementation of the PhysicsList class
0042 
0043 #include "PhysicsList.hh"
0044 
0045 #include "CommandLineParser.hh"
0046 
0047 #include "G4EmParameters.hh"
0048 #include "G4SystemOfUnits.hh"
0049 // for discrete physics constructors!
0050 #include "G4EmDNAChemistry.hh"
0051 #include "G4EmDNAChemistry_option1.hh"
0052 #include "G4EmDNAPhysics.hh"
0053 #include "G4EmDNAPhysics_option1.hh"
0054 #include "G4EmDNAPhysics_option2.hh"
0055 #include "G4EmDNAPhysics_option3.hh"
0056 #include "G4EmDNAPhysics_option4.hh"
0057 #include "G4EmDNAPhysics_option5.hh"
0058 #include "G4EmDNAPhysics_option6.hh"
0059 #include "G4EmDNAPhysics_option7.hh"
0060 #include "G4EmDNAPhysics_option8.hh"
0061 // for condensed physics constructors!
0062 #include "G4EmLivermorePhysics.hh"
0063 #include "G4EmPenelopePhysics.hh"
0064 #include "G4EmStandardPhysics.hh"
0065 #include "G4EmStandardPhysics_option3.hh"
0066 #include "G4EmStandardPhysics_option4.hh"
0067 // for hadronic physics constructors!
0068 #include "G4DecayPhysics.hh"
0069 #include "G4EmDNAPhysicsActivator.hh"
0070 #include "G4EmExtraPhysics.hh"
0071 #include "G4HadronElasticPhysics.hh"
0072 #include "G4HadronPhysicsQGSP_BIC.hh"
0073 #include "G4IonPhysics.hh"
0074 #include "G4NeutronTrackingCut.hh"
0075 #include "G4RadioactiveDecayPhysics.hh"
0076 #include "G4StoppingPhysics.hh"
0077 
0078 using namespace G4DNAPARSER;
0079 
0080 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0081 
0082 PhysicsList::PhysicsList()
0083   : G4VModularPhysicsList(),
0084     fEmPhysicsList(nullptr),
0085     fDNAActivator(nullptr),
0086     fEmDNAChemistryList(nullptr),
0087     fEmDNAChemistryList1(nullptr),
0088     fEmName(""),
0089     fHadronic(false)
0090 {
0091   G4double currentDefaultCut = 1. * micrometer;
0092   SetDefaultCutValue(currentDefaultCut);
0093   SetVerboseLevel(1);
0094   // fixe lower limit for cut
0095   G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100 * eV, 1 * GeV);
0096 
0097   // Options of combination Geant4-DNA processes (Physics/Chemistry)
0098   // with Standard and Hadronic Physics:
0099 
0100   // a) DNAphysics and Livermore physics inside and outside neuron
0101   G4cout << "Livermore + DNAphysics is activated!" << G4endl;
0102   RegisterConstructor("emlivermore");
0103 
0104   // 'G4EmParameters' works together with 'G4EmDNAPhysicsActivator'
0105   // VI: in this example Livermore is a default in any way
0106   //     DNA option4 is the default configuration as well
0107   fDNAActivator = new G4EmDNAPhysicsActivator();
0108   /*
0109   G4EmParameters::Instance()->AddDNA("Soma","Opt4");
0110   G4EmParameters::Instance()->AddDNA("Dendrites","Opt4");
0111   G4EmParameters::Instance()->AddDNA("Axon","Opt4");
0112   */
0113   //  b) Livermore + DNAPhysics + DNAChemistry
0114   if (CommandLineParser::GetParser()->GetCommandIfActive("-dnachemON")) {
0115     G4cout << "DNAChemistry is activated!" << G4endl;
0116     RegisterPhysics(new G4EmDNAChemistry());
0117   }
0118 
0119   //  d) "QGSP_BIC_EMY" package from hadrontherapy advanced example
0120   if (CommandLineParser::GetParser()->GetCommandIfActive("-dnahad")) {
0121     G4cout << "QGSP_BIC is activated!" << G4endl;
0122     RegisterConstructor("QGSP_BIC");
0123     fHadronic = true;
0124   }
0125 }
0126 
0127 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0128 
0129 PhysicsList::~PhysicsList() {}
0130 
0131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0132 
0133 void PhysicsList::ConstructParticle()
0134 {
0135   if (fEmPhysicsList) {
0136     fEmPhysicsList->ConstructParticle();
0137   }
0138   if (fDNAActivator) {
0139     fDNAActivator->ConstructParticle();
0140   }
0141   if (fEmDNAChemistryList) {
0142     fEmDNAChemistryList->ConstructParticle();
0143   }
0144   if (fEmDNAChemistryList1) {
0145     fEmDNAChemistryList1->ConstructParticle();
0146   }
0147   G4VModularPhysicsList::ConstructParticle();
0148 }
0149 
0150 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0151 
0152 void PhysicsList::ConstructProcess()
0153 {
0154   if (fEmPhysicsList) {
0155     fEmPhysicsList->ConstructProcess();
0156   }
0157   if (fDNAActivator) {
0158     fDNAActivator->ConstructProcess();
0159   }
0160   if (fEmDNAChemistryList) {
0161     fEmDNAChemistryList->ConstructProcess();
0162   }
0163   if (fEmDNAChemistryList1) {
0164     fEmDNAChemistryList1->ConstructProcess();
0165   }
0166   G4VModularPhysicsList::ConstructProcess();
0167 }
0168 
0169 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0170 
0171 void PhysicsList::RegisterConstructor(const G4String& name)
0172 {
0173   if (name == fEmName) {
0174     return;
0175   }
0176   if (name == "emstandard_opt0") {
0177     fEmName = name;
0178     delete fEmPhysicsList;
0179     fEmPhysicsList = new G4EmStandardPhysics();
0180   }
0181   else if (name == "emstandard_opt3") {
0182     fEmName = name;
0183     delete fEmPhysicsList;
0184     fEmPhysicsList = new G4EmStandardPhysics_option3();
0185   }
0186   else if (name == "emstandard_opt4") {
0187     fEmName = name;
0188     delete fEmPhysicsList;
0189     fEmPhysicsList = new G4EmStandardPhysics_option4();
0190   }
0191   else if (name == "empenelope") {
0192     fEmName = name;
0193     delete fEmPhysicsList;
0194     fEmPhysicsList = new G4EmPenelopePhysics();
0195   }
0196   else if (name == "emlivermore") {
0197     fEmName = name;
0198     delete fEmPhysicsList;
0199     fEmPhysicsList = new G4EmLivermorePhysics();
0200   }
0201   else if (name == "G4EmDNAPhysics") {
0202     delete fEmPhysicsList;
0203     fEmPhysicsList = new G4EmDNAPhysics(verboseLevel);
0204     fEmName = name;
0205   }
0206   else if (name == "G4EmDNAPhysics_option1") {
0207     delete fEmPhysicsList;
0208     fEmPhysicsList = new G4EmDNAPhysics_option1(verboseLevel);
0209     fEmName = name;
0210   }
0211   else if (name == "G4EmDNAPhysics_option2") {
0212     delete fEmPhysicsList;
0213     fEmPhysicsList = new G4EmDNAPhysics_option2(verboseLevel);
0214     fEmName = name;
0215   }
0216   else if (name == "G4EmDNAPhysics_option3") {
0217     delete fEmPhysicsList;
0218     fEmPhysicsList = new G4EmDNAPhysics_option3(verboseLevel);
0219     fEmName = name;
0220   }
0221   else if (name == "G4EmDNAPhysics_option4") {
0222     delete fEmPhysicsList;
0223     fEmPhysicsList = new G4EmDNAPhysics_option4(verboseLevel);
0224     fEmName = name;
0225   }
0226   else if (name == "G4EmDNAPhysics_option5") {
0227     delete fEmPhysicsList;
0228     fEmPhysicsList = new G4EmDNAPhysics_option5(verboseLevel);
0229     fEmName = name;
0230   }
0231   else if (name == "G4EmDNAPhysics_option6") {
0232     delete fEmPhysicsList;
0233     fEmPhysicsList = new G4EmDNAPhysics_option6(verboseLevel);
0234     fEmName = name;
0235   }
0236   else if (name == "G4EmDNAPhysics_option7") {
0237     delete fEmPhysicsList;
0238     fEmPhysicsList = new G4EmDNAPhysics_option7(verboseLevel);
0239     fEmName = name;
0240   }
0241   else if (name == "G4EmDNAPhysics_option8") {
0242     delete fEmPhysicsList;
0243     fEmPhysicsList = new G4EmDNAPhysics_option8(verboseLevel);
0244     fEmName = name;
0245   }
0246   else if (name == "QGSP_BIC") {
0247     if (fHadronic) {
0248       return;
0249     }
0250     // Hadron Elastic Physics
0251     RegisterConstructor("G4HadronElasticPhysics");
0252     // Hadron Inelastic Physics
0253     RegisterConstructor("G4HadronPhysicsQGSP_BIC");
0254     // Stopping
0255     RegisterConstructor("G4StoppingPhysics");
0256     // Ion Physics
0257     RegisterConstructor("G4IonBinaryCascadePhysics");
0258     // Gamma-Lepto nuclear
0259     RegisterConstructor("G4EmExtraPhysics");
0260     // Limiters
0261     RegisterConstructor("G4NeutronTrackingCut");
0262     // Decay
0263     RegisterConstructor("G4DecayPhysics");
0264     // Radioactive decay
0265     RegisterConstructor("G4RadioactiveDecayPhysics");
0266   }
0267   else if (name == "G4EmDNAChemistry") {
0268     if (fEmDNAChemistryList || fEmDNAChemistryList1) {
0269       return;
0270     }
0271     fEmDNAChemistryList = new G4EmDNAChemistry();
0272   }
0273   else if (name == "G4EmDNAChemistry_option1") {
0274     if (fEmDNAChemistryList || fEmDNAChemistryList1) {
0275       return;
0276     }
0277     fEmDNAChemistryList1 = new G4EmDNAChemistry_option1();
0278   }
0279   else {
0280     G4cout << "PhysicsList::RegisterConstructor: <" << name << ">"
0281            << " fails - name is not defined" << G4endl;
0282   }
0283 }
0284 
0285 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......