Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 /// \file PhysicsList.cc 26 /// \file PhysicsList.cc 27 /// \brief Implementation of the PhysicsList c 27 /// \brief Implementation of the PhysicsList class 28 // 28 // 29 // 29 // 30 //....oooOO0OOooo........oooOO0OOooo........oo 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 31 //....oooOO0OOooo........oooOO0OOooo........oo 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 32 32 33 #include "PhysicsList.hh" 33 #include "PhysicsList.hh" >> 34 #include "PhysicsListMessenger.hh" 34 35 35 #include "PhysListEmStandard.hh" 36 #include "PhysListEmStandard.hh" 36 #include "PhysicsListMessenger.hh" << 37 #include "PhysListEm5DStandard.hh" 37 #include "StepMax.hh" << 38 38 39 #include "G4DecayPhysics.hh" << 40 #include "G4EmDNAPhysics.hh" << 41 #include "G4EmDNAPhysics_option2.hh" << 42 #include "G4EmDNAPhysics_option4.hh" << 43 #include "G4EmDNAPhysics_option6.hh" << 44 #include "G4EmLivermorePhysics.hh" << 45 #include "G4EmLowEPPhysics.hh" << 46 #include "G4EmPenelopePhysics.hh" << 47 #include "G4EmStandardPhysics.hh" 39 #include "G4EmStandardPhysics.hh" 48 #include "G4EmStandardPhysicsGS.hh" << 49 #include "G4EmStandardPhysicsSS.hh" << 50 #include "G4EmStandardPhysicsWVI.hh" << 51 #include "G4EmStandardPhysics_option1.hh" 40 #include "G4EmStandardPhysics_option1.hh" 52 #include "G4EmStandardPhysics_option2.hh" 41 #include "G4EmStandardPhysics_option2.hh" 53 #include "G4EmStandardPhysics_option3.hh" 42 #include "G4EmStandardPhysics_option3.hh" 54 #include "G4EmStandardPhysics_option4.hh" 43 #include "G4EmStandardPhysics_option4.hh" >> 44 #include "G4EmStandardPhysicsWVI.hh" >> 45 #include "G4EmStandardPhysicsGS.hh" >> 46 #include "G4EmStandardPhysicsSS.hh" >> 47 >> 48 #include "G4EmLivermorePhysics.hh" >> 49 #include "G4EmPenelopePhysics.hh" >> 50 #include "G4EmLowEPPhysics.hh" >> 51 >> 52 #include "G4EmDNAPhysics.hh" >> 53 #include "G4EmDNAPhysics_option2.hh" >> 54 #include "G4EmDNAPhysics_option4.hh" >> 55 #include "G4EmDNAPhysics_option6.hh" >> 56 55 #include "G4HadronElasticPhysics.hh" 57 #include "G4HadronElasticPhysics.hh" >> 58 >> 59 #include "G4DecayPhysics.hh" >> 60 #include "StepMax.hh" >> 61 >> 62 #include "G4UnitsTable.hh" >> 63 #include "G4SystemOfUnits.hh" >> 64 56 #include "G4ParticleDefinition.hh" 65 #include "G4ParticleDefinition.hh" 57 #include "G4ProcessManager.hh" 66 #include "G4ProcessManager.hh" 58 #include "G4SystemOfUnits.hh" << 59 #include "G4UnitsTable.hh" << 60 67 61 // particles 68 // particles 62 69 63 #include "G4BaryonConstructor.hh" << 64 #include "G4BosonConstructor.hh" 70 #include "G4BosonConstructor.hh" 65 #include "G4DNAGenericIonsManager.hh" << 66 #include "G4IonConstructor.hh" << 67 #include "G4LeptonConstructor.hh" 71 #include "G4LeptonConstructor.hh" 68 #include "G4MesonConstructor.hh" 72 #include "G4MesonConstructor.hh" >> 73 #include "G4BosonConstructor.hh" >> 74 #include "G4BaryonConstructor.hh" >> 75 #include "G4IonConstructor.hh" 69 #include "G4ShortLivedConstructor.hh" 76 #include "G4ShortLivedConstructor.hh" >> 77 #include "G4DNAGenericIonsManager.hh" 70 78 71 //....oooOO0OOooo........oooOO0OOooo........oo 79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 72 80 73 PhysicsList::PhysicsList() << 81 PhysicsList::PhysicsList() : G4VModularPhysicsList(), 74 { << 82 fHadPhysicsList(nullptr) 75 fMessenger = new PhysicsListMessenger(this); << 83 { >> 84 fMessenger = new PhysicsListMessenger(this); 76 SetVerboseLevel(1); 85 SetVerboseLevel(1); 77 << 86 78 // EM physics 87 // EM physics 79 fEmName = G4String("emstandard_opt4"); 88 fEmName = G4String("emstandard_opt4"); 80 fEmPhysicsList = new G4EmStandardPhysics_opt 89 fEmPhysicsList = new G4EmStandardPhysics_option4(); 81 90 82 // Decay physics << 91 // Decay physics 83 fDecayPhysics = new G4DecayPhysics(1); 92 fDecayPhysics = new G4DecayPhysics(1); 84 << 93 85 SetDefaultCutValue(1 * mm); << 94 SetDefaultCutValue(1*mm); 86 } 95 } 87 96 88 //....oooOO0OOooo........oooOO0OOooo........oo 97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 89 98 90 PhysicsList::~PhysicsList() 99 PhysicsList::~PhysicsList() 91 { 100 { 92 delete fEmPhysicsList; 101 delete fEmPhysicsList; 93 delete fMessenger; << 102 delete fMessenger; 94 } 103 } 95 104 96 //....oooOO0OOooo........oooOO0OOooo........oo 105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 97 106 98 void PhysicsList::ConstructParticle() 107 void PhysicsList::ConstructParticle() 99 { 108 { 100 G4BosonConstructor pBosonConstructor; << 109 G4BosonConstructor pBosonConstructor; 101 pBosonConstructor.ConstructParticle(); 110 pBosonConstructor.ConstructParticle(); 102 111 103 G4LeptonConstructor pLeptonConstructor; 112 G4LeptonConstructor pLeptonConstructor; 104 pLeptonConstructor.ConstructParticle(); 113 pLeptonConstructor.ConstructParticle(); 105 114 106 G4MesonConstructor pMesonConstructor; 115 G4MesonConstructor pMesonConstructor; 107 pMesonConstructor.ConstructParticle(); 116 pMesonConstructor.ConstructParticle(); 108 117 109 G4BaryonConstructor pBaryonConstructor; 118 G4BaryonConstructor pBaryonConstructor; 110 pBaryonConstructor.ConstructParticle(); 119 pBaryonConstructor.ConstructParticle(); 111 120 112 G4IonConstructor pIonConstructor; 121 G4IonConstructor pIonConstructor; 113 pIonConstructor.ConstructParticle(); 122 pIonConstructor.ConstructParticle(); 114 123 115 G4ShortLivedConstructor sLivedConstructor; 124 G4ShortLivedConstructor sLivedConstructor; 116 sLivedConstructor.ConstructParticle(); 125 sLivedConstructor.ConstructParticle(); 117 126 118 // Geant4-DNA 127 // Geant4-DNA 119 128 120 G4DNAGenericIonsManager* genericIonsManager; 129 G4DNAGenericIonsManager* genericIonsManager; 121 genericIonsManager = G4DNAGenericIonsManager << 130 genericIonsManager=G4DNAGenericIonsManager::Instance(); 122 genericIonsManager->GetIon("alpha++"); 131 genericIonsManager->GetIon("alpha++"); 123 genericIonsManager->GetIon("alpha+"); 132 genericIonsManager->GetIon("alpha+"); 124 genericIonsManager->GetIon("helium"); 133 genericIonsManager->GetIon("helium"); 125 genericIonsManager->GetIon("hydrogen"); << 134 genericIonsManager->GetIon("hydrogen"); 126 } 135 } 127 136 128 //....oooOO0OOooo........oooOO0OOooo........oo 137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 129 138 130 void PhysicsList::ConstructProcess() 139 void PhysicsList::ConstructProcess() 131 { 140 { 132 AddTransportation(); 141 AddTransportation(); 133 fEmPhysicsList->ConstructProcess(); 142 fEmPhysicsList->ConstructProcess(); 134 fDecayPhysics->ConstructProcess(); 143 fDecayPhysics->ConstructProcess(); 135 if (fHadPhysicsList) { << 144 if(fHadPhysicsList) { fHadPhysicsList->ConstructProcess(); } 136 fHadPhysicsList->ConstructProcess(); << 137 } << 138 AddStepMax(); 145 AddStepMax(); 139 } 146 } 140 147 141 //....oooOO0OOooo........oooOO0OOooo........oo 148 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 142 149 143 void PhysicsList::AddStepMax() 150 void PhysicsList::AddStepMax() 144 { 151 { 145 // Step limitation seen as a process 152 // Step limitation seen as a process 146 StepMax* stepMaxProcess = new StepMax(); << 153 StepMax* stepMaxProcess = new StepMax(fMessenger); 147 154 148 auto particleIterator = GetParticleIterator( << 155 auto particleIterator=GetParticleIterator(); 149 particleIterator->reset(); 156 particleIterator->reset(); 150 while ((*particleIterator)()) { << 157 while ((*particleIterator)()){ 151 G4ParticleDefinition* particle = particleI 158 G4ParticleDefinition* particle = particleIterator->value(); 152 G4ProcessManager* pmanager = particle->Get 159 G4ProcessManager* pmanager = particle->GetProcessManager(); 153 160 154 if (stepMaxProcess->IsApplicable(*particle << 161 if (stepMaxProcess->IsApplicable(*particle)) 155 pmanager->AddDiscreteProcess(stepMaxProc << 162 { 156 } << 163 pmanager->AddDiscreteProcess(stepMaxProcess); >> 164 } 157 } 165 } 158 } 166 } 159 167 160 //....oooOO0OOooo........oooOO0OOooo........oo 168 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 161 169 162 void PhysicsList::AddPhysicsList(const G4Strin 170 void PhysicsList::AddPhysicsList(const G4String& name) 163 { 171 { 164 if (verboseLevel > 1) { << 172 if (verboseLevel>1) { 165 G4cout << "PhysicsList::AddPhysicsList: <" 173 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl; 166 } 174 } 167 175 168 if (name == fEmName) return; 176 if (name == fEmName) return; 169 177 170 if (name == "local") { 178 if (name == "local") { >> 179 171 fEmName = name; 180 fEmName = name; 172 delete fEmPhysicsList; 181 delete fEmPhysicsList; 173 fEmPhysicsList = new PhysListEmStandard(na 182 fEmPhysicsList = new PhysListEmStandard(name); 174 } << 183 175 else if (name == "emstandard_opt0") { << 184 } else if (name == "emstandard_opt0") { >> 185 176 fEmName = name; 186 fEmName = name; 177 delete fEmPhysicsList; 187 delete fEmPhysicsList; 178 fEmPhysicsList = new G4EmStandardPhysics() 188 fEmPhysicsList = new G4EmStandardPhysics(); 179 } << 189 180 else if (name == "emstandard_opt1") { << 190 } else if (name == "emstandard_opt1") { >> 191 181 fEmName = name; 192 fEmName = name; 182 delete fEmPhysicsList; 193 delete fEmPhysicsList; 183 fEmPhysicsList = new G4EmStandardPhysics_o 194 fEmPhysicsList = new G4EmStandardPhysics_option1(); 184 } << 195 185 else if (name == "emstandard_opt2") { << 196 } else if (name == "emstandard_opt2") { >> 197 186 fEmName = name; 198 fEmName = name; 187 delete fEmPhysicsList; 199 delete fEmPhysicsList; 188 fEmPhysicsList = new G4EmStandardPhysics_o 200 fEmPhysicsList = new G4EmStandardPhysics_option2(); 189 } << 201 190 else if (name == "emstandard_opt3") { << 202 } else if (name == "emstandard_opt3") { >> 203 191 fEmName = name; 204 fEmName = name; 192 delete fEmPhysicsList; 205 delete fEmPhysicsList; 193 fEmPhysicsList = new G4EmStandardPhysics_o 206 fEmPhysicsList = new G4EmStandardPhysics_option3(); 194 } << 207 195 else if (name == "emstandard_opt4") { << 208 } else if (name == "emstandard_opt4") { >> 209 196 fEmName = name; 210 fEmName = name; 197 delete fEmPhysicsList; 211 delete fEmPhysicsList; 198 fEmPhysicsList = new G4EmStandardPhysics_o 212 fEmPhysicsList = new G4EmStandardPhysics_option4(); 199 } << 213 200 else if (name == "emstandardSS") { << 214 } else if (name == "emstandardSS") { >> 215 201 fEmName = name; 216 fEmName = name; 202 delete fEmPhysicsList; 217 delete fEmPhysicsList; 203 fEmPhysicsList = new G4EmStandardPhysicsSS 218 fEmPhysicsList = new G4EmStandardPhysicsSS(); 204 } << 219 205 else if (name == "emstandardWVI") { << 220 } else if (name == "emstandard5D") { >> 221 >> 222 fEmName = name; >> 223 delete fEmPhysicsList; >> 224 fEmPhysicsList = new PhysListEm5DStandard(); >> 225 >> 226 } else if (name == "emstandardWVI") { >> 227 206 fEmName = name; 228 fEmName = name; 207 delete fEmPhysicsList; 229 delete fEmPhysicsList; 208 fEmPhysicsList = new G4EmStandardPhysicsWV 230 fEmPhysicsList = new G4EmStandardPhysicsWVI(); 209 } << 231 210 else if (name == "emstandardGS") { << 232 } else if (name == "emstandardGS") { >> 233 211 fEmName = name; 234 fEmName = name; 212 delete fEmPhysicsList; 235 delete fEmPhysicsList; 213 fEmPhysicsList = new G4EmStandardPhysicsGS 236 fEmPhysicsList = new G4EmStandardPhysicsGS(); 214 } << 237 215 else if (name == "empenelope") { << 238 } else if (name == "empenelope") { 216 fEmName = name; 239 fEmName = name; 217 delete fEmPhysicsList; 240 delete fEmPhysicsList; 218 fEmPhysicsList = new G4EmPenelopePhysics() 241 fEmPhysicsList = new G4EmPenelopePhysics(); 219 } << 242 220 else if (name == "emlowenergy") { << 243 } else if (name == "emlowenergy") { 221 fEmName = name; 244 fEmName = name; 222 delete fEmPhysicsList; 245 delete fEmPhysicsList; 223 fEmPhysicsList = new G4EmLowEPPhysics(); 246 fEmPhysicsList = new G4EmLowEPPhysics(); 224 } << 247 225 else if (name == "emlivermore") { << 248 } else if (name == "emlivermore") { 226 fEmName = name; 249 fEmName = name; 227 delete fEmPhysicsList; 250 delete fEmPhysicsList; 228 fEmPhysicsList = new G4EmLivermorePhysics( 251 fEmPhysicsList = new G4EmLivermorePhysics(); 229 } << 252 230 else if (name == "dna") { << 253 } else if (name == "dna") { 231 fEmName = name; 254 fEmName = name; 232 delete fEmPhysicsList; 255 delete fEmPhysicsList; 233 fEmPhysicsList = new G4EmDNAPhysics(); 256 fEmPhysicsList = new G4EmDNAPhysics(); 234 } << 257 235 else if (name == "dna_opt2") { << 258 } else if (name == "dna_opt2") { 236 fEmName = name; 259 fEmName = name; 237 delete fEmPhysicsList; 260 delete fEmPhysicsList; 238 fEmPhysicsList = new G4EmDNAPhysics_option 261 fEmPhysicsList = new G4EmDNAPhysics_option2(); 239 } << 262 240 else if (name == "dna_opt4") { << 263 } else if (name == "dna_opt4") { 241 fEmName = name; 264 fEmName = name; 242 delete fEmPhysicsList; 265 delete fEmPhysicsList; 243 fEmPhysicsList = new G4EmDNAPhysics_option 266 fEmPhysicsList = new G4EmDNAPhysics_option4(); 244 } << 267 245 else if (name == "dna_opt6") { << 268 } else if (name == "dna_opt6") { 246 fEmName = name; 269 fEmName = name; 247 delete fEmPhysicsList; 270 delete fEmPhysicsList; 248 fEmPhysicsList = new G4EmDNAPhysics_option 271 fEmPhysicsList = new G4EmDNAPhysics_option6(); 249 } << 272 250 else if (name == "had_elastic" && !fHadPhysi << 273 } else if (name == "had_elastic" && !fHadPhysicsList) { 251 fHadPhysicsList = new G4HadronElasticPhysi 274 fHadPhysicsList = new G4HadronElasticPhysics(); 252 } << 275 253 else { << 276 } else { >> 277 254 G4cout << "PhysicsList::AddPhysicsList: <" 278 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" 255 << " is not defined" << G4endl; << 279 << " is not defined" >> 280 << G4endl; 256 } 281 } 257 } 282 } 258 283 259 //....oooOO0OOooo........oooOO0OOooo........oo 284 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 260 285