Geant4 Cross Reference |
1 // 2 // ******************************************************************** 3 // * License and Disclaimer * 4 // * * 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. * 10 // * * 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitation of liability. * 17 // * * 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************************************** 25 // 26 // This example is provided by the Geant4-DNA collaboration 27 // Any report or published results obtained using the Geant4-DNA software 28 // shall cite the following Geant4-DNA collaboration publication: 29 // Med. Phys. 37 (2010) 4692-4708 30 // and papers 31 // M. Batmunkh et al. J Radiat Res Appl Sci 8 (2015) 498-507 32 // O. Belov et al. Physica Medica 32 (2016) 1510-1520 33 // The Geant4-DNA web site is available at http://geant4-dna.org 34 // 35 // ------------------------------------------------------------------- 36 // November 2016 37 // ------------------------------------------------------------------- 38 // 39 // 40 /// \file PhysicsList.cc 41 /// \brief Implementation of the PhysicsList class 42 43 #include "PhysicsList.hh" 44 45 #include "CommandLineParser.hh" 46 47 #include "G4EmParameters.hh" 48 #include "G4SystemOfUnits.hh" 49 // for discrete physics constructors! 50 #include "G4EmDNAChemistry.hh" 51 #include "G4EmDNAChemistry_option1.hh" 52 #include "G4EmDNAPhysics.hh" 53 #include "G4EmDNAPhysics_option1.hh" 54 #include "G4EmDNAPhysics_option2.hh" 55 #include "G4EmDNAPhysics_option3.hh" 56 #include "G4EmDNAPhysics_option4.hh" 57 #include "G4EmDNAPhysics_option5.hh" 58 #include "G4EmDNAPhysics_option6.hh" 59 #include "G4EmDNAPhysics_option7.hh" 60 #include "G4EmDNAPhysics_option8.hh" 61 // for condensed physics constructors! 62 #include "G4EmLivermorePhysics.hh" 63 #include "G4EmPenelopePhysics.hh" 64 #include "G4EmStandardPhysics.hh" 65 #include "G4EmStandardPhysics_option3.hh" 66 #include "G4EmStandardPhysics_option4.hh" 67 // for hadronic physics constructors! 68 #include "G4DecayPhysics.hh" 69 #include "G4EmDNAPhysicsActivator.hh" 70 #include "G4EmExtraPhysics.hh" 71 #include "G4HadronElasticPhysics.hh" 72 #include "G4HadronPhysicsQGSP_BIC.hh" 73 #include "G4IonPhysics.hh" 74 #include "G4NeutronTrackingCut.hh" 75 #include "G4RadioactiveDecayPhysics.hh" 76 #include "G4StoppingPhysics.hh" 77 78 using namespace G4DNAPARSER; 79 80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 81 82 PhysicsList::PhysicsList() 83 : G4VModularPhysicsList(), 84 fEmPhysicsList(nullptr), 85 fDNAActivator(nullptr), 86 fEmDNAChemistryList(nullptr), 87 fEmDNAChemistryList1(nullptr), 88 fEmName(""), 89 fHadronic(false) 90 { 91 G4double currentDefaultCut = 1. * micrometer; 92 SetDefaultCutValue(currentDefaultCut); 93 SetVerboseLevel(1); 94 // fixe lower limit for cut 95 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100 * eV, 1 * GeV); 96 97 // Options of combination Geant4-DNA processes (Physics/Chemistry) 98 // with Standard and Hadronic Physics: 99 100 // a) DNAphysics and Livermore physics inside and outside neuron 101 G4cout << "Livermore + DNAphysics is activated!" << G4endl; 102 RegisterConstructor("emlivermore"); 103 104 // 'G4EmParameters' works together with 'G4EmDNAPhysicsActivator' 105 // VI: in this example Livermore is a default in any way 106 // DNA option4 is the default configuration as well 107 fDNAActivator = new G4EmDNAPhysicsActivator(); 108 /* 109 G4EmParameters::Instance()->AddDNA("Soma","Opt4"); 110 G4EmParameters::Instance()->AddDNA("Dendrites","Opt4"); 111 G4EmParameters::Instance()->AddDNA("Axon","Opt4"); 112 */ 113 // b) Livermore + DNAPhysics + DNAChemistry 114 if (CommandLineParser::GetParser()->GetCommandIfActive("-dnachemON")) { 115 G4cout << "DNAChemistry is activated!" << G4endl; 116 RegisterPhysics(new G4EmDNAChemistry()); 117 } 118 119 // d) "QGSP_BIC_EMY" package from hadrontherapy advanced example 120 if (CommandLineParser::GetParser()->GetCommandIfActive("-dnahad")) { 121 G4cout << "QGSP_BIC is activated!" << G4endl; 122 RegisterConstructor("QGSP_BIC"); 123 fHadronic = true; 124 } 125 } 126 127 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 128 129 PhysicsList::~PhysicsList() {} 130 131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 132 133 void PhysicsList::ConstructParticle() 134 { 135 if (fEmPhysicsList) { 136 fEmPhysicsList->ConstructParticle(); 137 } 138 if (fDNAActivator) { 139 fDNAActivator->ConstructParticle(); 140 } 141 if (fEmDNAChemistryList) { 142 fEmDNAChemistryList->ConstructParticle(); 143 } 144 if (fEmDNAChemistryList1) { 145 fEmDNAChemistryList1->ConstructParticle(); 146 } 147 G4VModularPhysicsList::ConstructParticle(); 148 } 149 150 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 151 152 void PhysicsList::ConstructProcess() 153 { 154 if (fEmPhysicsList) { 155 fEmPhysicsList->ConstructProcess(); 156 } 157 if (fDNAActivator) { 158 fDNAActivator->ConstructProcess(); 159 } 160 if (fEmDNAChemistryList) { 161 fEmDNAChemistryList->ConstructProcess(); 162 } 163 if (fEmDNAChemistryList1) { 164 fEmDNAChemistryList1->ConstructProcess(); 165 } 166 G4VModularPhysicsList::ConstructProcess(); 167 } 168 169 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 170 171 void PhysicsList::RegisterConstructor(const G4String& name) 172 { 173 if (name == fEmName) { 174 return; 175 } 176 if (name == "emstandard_opt0") { 177 fEmName = name; 178 delete fEmPhysicsList; 179 fEmPhysicsList = new G4EmStandardPhysics(); 180 } 181 else if (name == "emstandard_opt3") { 182 fEmName = name; 183 delete fEmPhysicsList; 184 fEmPhysicsList = new G4EmStandardPhysics_option3(); 185 } 186 else if (name == "emstandard_opt4") { 187 fEmName = name; 188 delete fEmPhysicsList; 189 fEmPhysicsList = new G4EmStandardPhysics_option4(); 190 } 191 else if (name == "empenelope") { 192 fEmName = name; 193 delete fEmPhysicsList; 194 fEmPhysicsList = new G4EmPenelopePhysics(); 195 } 196 else if (name == "emlivermore") { 197 fEmName = name; 198 delete fEmPhysicsList; 199 fEmPhysicsList = new G4EmLivermorePhysics(); 200 } 201 else if (name == "G4EmDNAPhysics") { 202 delete fEmPhysicsList; 203 fEmPhysicsList = new G4EmDNAPhysics(verboseLevel); 204 fEmName = name; 205 } 206 else if (name == "G4EmDNAPhysics_option1") { 207 delete fEmPhysicsList; 208 fEmPhysicsList = new G4EmDNAPhysics_option1(verboseLevel); 209 fEmName = name; 210 } 211 else if (name == "G4EmDNAPhysics_option2") { 212 delete fEmPhysicsList; 213 fEmPhysicsList = new G4EmDNAPhysics_option2(verboseLevel); 214 fEmName = name; 215 } 216 else if (name == "G4EmDNAPhysics_option3") { 217 delete fEmPhysicsList; 218 fEmPhysicsList = new G4EmDNAPhysics_option3(verboseLevel); 219 fEmName = name; 220 } 221 else if (name == "G4EmDNAPhysics_option4") { 222 delete fEmPhysicsList; 223 fEmPhysicsList = new G4EmDNAPhysics_option4(verboseLevel); 224 fEmName = name; 225 } 226 else if (name == "G4EmDNAPhysics_option5") { 227 delete fEmPhysicsList; 228 fEmPhysicsList = new G4EmDNAPhysics_option5(verboseLevel); 229 fEmName = name; 230 } 231 else if (name == "G4EmDNAPhysics_option6") { 232 delete fEmPhysicsList; 233 fEmPhysicsList = new G4EmDNAPhysics_option6(verboseLevel); 234 fEmName = name; 235 } 236 else if (name == "G4EmDNAPhysics_option7") { 237 delete fEmPhysicsList; 238 fEmPhysicsList = new G4EmDNAPhysics_option7(verboseLevel); 239 fEmName = name; 240 } 241 else if (name == "G4EmDNAPhysics_option8") { 242 delete fEmPhysicsList; 243 fEmPhysicsList = new G4EmDNAPhysics_option8(verboseLevel); 244 fEmName = name; 245 } 246 else if (name == "QGSP_BIC") { 247 if (fHadronic) { 248 return; 249 } 250 // Hadron Elastic Physics 251 RegisterConstructor("G4HadronElasticPhysics"); 252 // Hadron Inelastic Physics 253 RegisterConstructor("G4HadronPhysicsQGSP_BIC"); 254 // Stopping 255 RegisterConstructor("G4StoppingPhysics"); 256 // Ion Physics 257 RegisterConstructor("G4IonBinaryCascadePhysics"); 258 // Gamma-Lepto nuclear 259 RegisterConstructor("G4EmExtraPhysics"); 260 // Limiters 261 RegisterConstructor("G4NeutronTrackingCut"); 262 // Decay 263 RegisterConstructor("G4DecayPhysics"); 264 // Radioactive decay 265 RegisterConstructor("G4RadioactiveDecayPhysics"); 266 } 267 else if (name == "G4EmDNAChemistry") { 268 if (fEmDNAChemistryList || fEmDNAChemistryList1) { 269 return; 270 } 271 fEmDNAChemistryList = new G4EmDNAChemistry(); 272 } 273 else if (name == "G4EmDNAChemistry_option1") { 274 if (fEmDNAChemistryList || fEmDNAChemistryList1) { 275 return; 276 } 277 fEmDNAChemistryList1 = new G4EmDNAChemistry_option1(); 278 } 279 else { 280 G4cout << "PhysicsList::RegisterConstructor: <" << name << ">" 281 << " fails - name is not defined" << G4endl; 282 } 283 } 284 285 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 286