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 electromagnetic/TestEm5/src/PhysicsL 26 /// \file electromagnetic/TestEm5/src/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 #include "PhysListEm19DStandard.hh" 38 39 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" 40 #include "G4EmStandardPhysics.hh" 48 #include "G4EmStandardPhysicsGS.hh" << 49 #include "G4EmStandardPhysicsSS.hh" << 50 #include "G4EmStandardPhysicsWVI.hh" << 51 #include "G4EmStandardPhysics_option1.hh" 41 #include "G4EmStandardPhysics_option1.hh" 52 #include "G4EmStandardPhysics_option2.hh" 42 #include "G4EmStandardPhysics_option2.hh" 53 #include "G4EmStandardPhysics_option3.hh" 43 #include "G4EmStandardPhysics_option3.hh" 54 #include "G4EmStandardPhysics_option4.hh" 44 #include "G4EmStandardPhysics_option4.hh" >> 45 #include "G4EmStandardPhysicsWVI.hh" >> 46 #include "G4EmStandardPhysicsGS.hh" >> 47 #include "G4EmStandardPhysicsSS.hh" >> 48 >> 49 #include "G4EmLivermorePhysics.hh" >> 50 #include "G4EmPenelopePhysics.hh" >> 51 #include "G4EmLowEPPhysics.hh" >> 52 >> 53 #include "G4EmDNAPhysics.hh" >> 54 #include "G4EmDNAPhysics_option2.hh" >> 55 #include "G4EmDNAPhysics_option4.hh" >> 56 #include "G4EmDNAPhysics_option6.hh" >> 57 55 #include "G4HadronElasticPhysics.hh" 58 #include "G4HadronElasticPhysics.hh" >> 59 >> 60 #include "G4DecayPhysics.hh" >> 61 #include "StepMax.hh" >> 62 >> 63 #include "G4UnitsTable.hh" >> 64 #include "G4SystemOfUnits.hh" >> 65 56 #include "G4ParticleDefinition.hh" 66 #include "G4ParticleDefinition.hh" 57 #include "G4ProcessManager.hh" 67 #include "G4ProcessManager.hh" 58 #include "G4SystemOfUnits.hh" << 59 #include "G4UnitsTable.hh" << 60 68 61 // particles 69 // particles 62 70 63 #include "G4BaryonConstructor.hh" << 64 #include "G4BosonConstructor.hh" 71 #include "G4BosonConstructor.hh" 65 #include "G4DNAGenericIonsManager.hh" << 66 #include "G4IonConstructor.hh" << 67 #include "G4LeptonConstructor.hh" 72 #include "G4LeptonConstructor.hh" 68 #include "G4MesonConstructor.hh" 73 #include "G4MesonConstructor.hh" >> 74 #include "G4BosonConstructor.hh" >> 75 #include "G4BaryonConstructor.hh" >> 76 #include "G4IonConstructor.hh" 69 #include "G4ShortLivedConstructor.hh" 77 #include "G4ShortLivedConstructor.hh" >> 78 #include "G4DNAGenericIonsManager.hh" 70 79 71 //....oooOO0OOooo........oooOO0OOooo........oo 80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 72 81 73 PhysicsList::PhysicsList() << 82 PhysicsList::PhysicsList() : G4VModularPhysicsList(), 74 { << 83 fHadPhysicsList(nullptr) 75 fMessenger = new PhysicsListMessenger(this); << 84 { >> 85 fMessenger = new PhysicsListMessenger(this); 76 SetVerboseLevel(1); 86 SetVerboseLevel(1); 77 << 87 78 // EM physics 88 // EM physics 79 fEmName = G4String("emstandard_opt4"); 89 fEmName = G4String("emstandard_opt4"); 80 fEmPhysicsList = new G4EmStandardPhysics_opt 90 fEmPhysicsList = new G4EmStandardPhysics_option4(); 81 91 82 // Decay physics << 92 // Decay physics 83 fDecayPhysics = new G4DecayPhysics(1); 93 fDecayPhysics = new G4DecayPhysics(1); 84 << 94 85 SetDefaultCutValue(1 * mm); << 95 SetDefaultCutValue(1*mm); 86 } 96 } 87 97 88 //....oooOO0OOooo........oooOO0OOooo........oo 98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 89 99 90 PhysicsList::~PhysicsList() 100 PhysicsList::~PhysicsList() 91 { 101 { 92 delete fEmPhysicsList; 102 delete fEmPhysicsList; 93 delete fMessenger; << 103 delete fMessenger; 94 } 104 } 95 105 96 //....oooOO0OOooo........oooOO0OOooo........oo 106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 97 107 98 void PhysicsList::ConstructParticle() 108 void PhysicsList::ConstructParticle() 99 { 109 { 100 G4BosonConstructor pBosonConstructor; << 110 G4BosonConstructor pBosonConstructor; 101 pBosonConstructor.ConstructParticle(); 111 pBosonConstructor.ConstructParticle(); 102 112 103 G4LeptonConstructor pLeptonConstructor; 113 G4LeptonConstructor pLeptonConstructor; 104 pLeptonConstructor.ConstructParticle(); 114 pLeptonConstructor.ConstructParticle(); 105 115 106 G4MesonConstructor pMesonConstructor; 116 G4MesonConstructor pMesonConstructor; 107 pMesonConstructor.ConstructParticle(); 117 pMesonConstructor.ConstructParticle(); 108 118 109 G4BaryonConstructor pBaryonConstructor; 119 G4BaryonConstructor pBaryonConstructor; 110 pBaryonConstructor.ConstructParticle(); 120 pBaryonConstructor.ConstructParticle(); 111 121 112 G4IonConstructor pIonConstructor; 122 G4IonConstructor pIonConstructor; 113 pIonConstructor.ConstructParticle(); 123 pIonConstructor.ConstructParticle(); 114 124 115 G4ShortLivedConstructor sLivedConstructor; 125 G4ShortLivedConstructor sLivedConstructor; 116 sLivedConstructor.ConstructParticle(); 126 sLivedConstructor.ConstructParticle(); 117 127 118 // Geant4-DNA 128 // Geant4-DNA 119 129 120 G4DNAGenericIonsManager* genericIonsManager; 130 G4DNAGenericIonsManager* genericIonsManager; 121 genericIonsManager = G4DNAGenericIonsManager << 131 genericIonsManager=G4DNAGenericIonsManager::Instance(); 122 genericIonsManager->GetIon("alpha++"); 132 genericIonsManager->GetIon("alpha++"); 123 genericIonsManager->GetIon("alpha+"); 133 genericIonsManager->GetIon("alpha+"); 124 genericIonsManager->GetIon("helium"); 134 genericIonsManager->GetIon("helium"); 125 genericIonsManager->GetIon("hydrogen"); << 135 genericIonsManager->GetIon("hydrogen"); 126 } 136 } 127 137 128 //....oooOO0OOooo........oooOO0OOooo........oo 138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 129 139 130 void PhysicsList::ConstructProcess() 140 void PhysicsList::ConstructProcess() 131 { 141 { 132 AddTransportation(); 142 AddTransportation(); 133 fEmPhysicsList->ConstructProcess(); 143 fEmPhysicsList->ConstructProcess(); 134 fDecayPhysics->ConstructProcess(); 144 fDecayPhysics->ConstructProcess(); 135 if (fHadPhysicsList) { << 145 if(fHadPhysicsList) { fHadPhysicsList->ConstructProcess(); } 136 fHadPhysicsList->ConstructProcess(); << 137 } << 138 AddStepMax(); 146 AddStepMax(); 139 } 147 } 140 148 141 //....oooOO0OOooo........oooOO0OOooo........oo 149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 142 150 143 void PhysicsList::AddStepMax() 151 void PhysicsList::AddStepMax() 144 { 152 { 145 // Step limitation seen as a process 153 // Step limitation seen as a process 146 StepMax* stepMaxProcess = new StepMax(); << 154 StepMax* stepMaxProcess = new StepMax(fMessenger); 147 155 148 auto particleIterator = GetParticleIterator( << 156 auto particleIterator=GetParticleIterator(); 149 particleIterator->reset(); 157 particleIterator->reset(); 150 while ((*particleIterator)()) { << 158 while ((*particleIterator)()){ 151 G4ParticleDefinition* particle = particleI 159 G4ParticleDefinition* particle = particleIterator->value(); 152 G4ProcessManager* pmanager = particle->Get 160 G4ProcessManager* pmanager = particle->GetProcessManager(); 153 161 154 if (stepMaxProcess->IsApplicable(*particle << 162 if (stepMaxProcess->IsApplicable(*particle)) 155 pmanager->AddDiscreteProcess(stepMaxProc << 163 { 156 } << 164 pmanager ->AddDiscreteProcess(stepMaxProcess); >> 165 } 157 } 166 } 158 } 167 } 159 168 160 //....oooOO0OOooo........oooOO0OOooo........oo 169 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 161 170 162 void PhysicsList::AddPhysicsList(const G4Strin 171 void PhysicsList::AddPhysicsList(const G4String& name) 163 { 172 { 164 if (verboseLevel > -1) { << 173 if (verboseLevel>-1) { 165 G4cout << "PhysicsList::AddPhysicsList: <" 174 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl; 166 } 175 } 167 176 168 if (name == fEmName) return; 177 if (name == fEmName) return; 169 178 170 if (name == "local") { 179 if (name == "local") { >> 180 171 fEmName = name; 181 fEmName = name; 172 delete fEmPhysicsList; 182 delete fEmPhysicsList; 173 fEmPhysicsList = new PhysListEmStandard(na 183 fEmPhysicsList = new PhysListEmStandard(name); 174 } << 184 175 else if (name == "emstandard_opt0") { << 185 } else if (name == "emstandard_opt0") { >> 186 176 fEmName = name; 187 fEmName = name; 177 delete fEmPhysicsList; 188 delete fEmPhysicsList; 178 fEmPhysicsList = new G4EmStandardPhysics() 189 fEmPhysicsList = new G4EmStandardPhysics(); 179 } << 190 180 else if (name == "emstandard_opt1") { << 191 } else if (name == "emstandard_opt1") { >> 192 181 fEmName = name; 193 fEmName = name; 182 delete fEmPhysicsList; 194 delete fEmPhysicsList; 183 fEmPhysicsList = new G4EmStandardPhysics_o 195 fEmPhysicsList = new G4EmStandardPhysics_option1(); 184 } << 196 185 else if (name == "emstandard_opt2") { << 197 } else if (name == "emstandard_opt2") { >> 198 186 fEmName = name; 199 fEmName = name; 187 delete fEmPhysicsList; 200 delete fEmPhysicsList; 188 fEmPhysicsList = new G4EmStandardPhysics_o 201 fEmPhysicsList = new G4EmStandardPhysics_option2(); 189 } << 202 190 else if (name == "emstandard_opt3") { << 203 } else if (name == "emstandard_opt3") { >> 204 191 fEmName = name; 205 fEmName = name; 192 delete fEmPhysicsList; 206 delete fEmPhysicsList; 193 fEmPhysicsList = new G4EmStandardPhysics_o 207 fEmPhysicsList = new G4EmStandardPhysics_option3(); 194 } << 208 195 else if (name == "emstandard_opt4") { << 209 } else if (name == "emstandard_opt4") { >> 210 196 fEmName = name; 211 fEmName = name; 197 delete fEmPhysicsList; 212 delete fEmPhysicsList; 198 fEmPhysicsList = new G4EmStandardPhysics_o 213 fEmPhysicsList = new G4EmStandardPhysics_option4(); 199 } << 214 200 else if (name == "emstandardSS") { << 215 } else if (name == "emstandardATIMA") { >> 216 >> 217 fEmName = name; >> 218 delete fEmPhysicsList; >> 219 fEmPhysicsList = new PhysListEm19DStandard(); >> 220 >> 221 } else if (name == "emstandardSS") { >> 222 201 fEmName = name; 223 fEmName = name; 202 delete fEmPhysicsList; 224 delete fEmPhysicsList; 203 fEmPhysicsList = new G4EmStandardPhysicsSS 225 fEmPhysicsList = new G4EmStandardPhysicsSS(); 204 } << 226 205 else if (name == "emstandardWVI") { << 227 } else if (name == "emstandard5D") { >> 228 >> 229 fEmName = name; >> 230 delete fEmPhysicsList; >> 231 fEmPhysicsList = new PhysListEm5DStandard(); >> 232 >> 233 } else if (name == "emstandardWVI") { >> 234 206 fEmName = name; 235 fEmName = name; 207 delete fEmPhysicsList; 236 delete fEmPhysicsList; 208 fEmPhysicsList = new G4EmStandardPhysicsWV 237 fEmPhysicsList = new G4EmStandardPhysicsWVI(); 209 } << 238 210 else if (name == "emstandardGS") { << 239 } else if (name == "emstandardGS") { >> 240 211 fEmName = name; 241 fEmName = name; 212 delete fEmPhysicsList; 242 delete fEmPhysicsList; 213 fEmPhysicsList = new G4EmStandardPhysicsGS 243 fEmPhysicsList = new G4EmStandardPhysicsGS(); 214 } << 244 215 else if (name == "empenelope") { << 245 } else if (name == "empenelope") { 216 fEmName = name; 246 fEmName = name; 217 delete fEmPhysicsList; 247 delete fEmPhysicsList; 218 fEmPhysicsList = new G4EmPenelopePhysics() 248 fEmPhysicsList = new G4EmPenelopePhysics(); 219 } << 249 220 else if (name == "emlowenergy") { << 250 } else if (name == "emlowenergy") { 221 fEmName = name; 251 fEmName = name; 222 delete fEmPhysicsList; 252 delete fEmPhysicsList; 223 fEmPhysicsList = new G4EmLowEPPhysics(); 253 fEmPhysicsList = new G4EmLowEPPhysics(); 224 } << 254 225 else if (name == "emlivermore") { << 255 } else if (name == "emlivermore") { 226 fEmName = name; 256 fEmName = name; 227 delete fEmPhysicsList; 257 delete fEmPhysicsList; 228 fEmPhysicsList = new G4EmLivermorePhysics( 258 fEmPhysicsList = new G4EmLivermorePhysics(); 229 } << 259 230 else if (name == "dna") { << 260 } else if (name == "dna") { 231 fEmName = name; 261 fEmName = name; 232 delete fEmPhysicsList; 262 delete fEmPhysicsList; 233 fEmPhysicsList = new G4EmDNAPhysics(); 263 fEmPhysicsList = new G4EmDNAPhysics(); 234 } << 264 235 else if (name == "dna_opt2") { << 265 } else if (name == "dna_opt2") { 236 fEmName = name; 266 fEmName = name; 237 delete fEmPhysicsList; 267 delete fEmPhysicsList; 238 fEmPhysicsList = new G4EmDNAPhysics_option 268 fEmPhysicsList = new G4EmDNAPhysics_option2(); 239 } << 269 240 else if (name == "dna_opt4") { << 270 } else if (name == "dna_opt4") { 241 fEmName = name; 271 fEmName = name; 242 delete fEmPhysicsList; 272 delete fEmPhysicsList; 243 fEmPhysicsList = new G4EmDNAPhysics_option 273 fEmPhysicsList = new G4EmDNAPhysics_option4(); 244 } << 274 245 else if (name == "dna_opt6") { << 275 } else if (name == "dna_opt6") { 246 fEmName = name; 276 fEmName = name; 247 delete fEmPhysicsList; 277 delete fEmPhysicsList; 248 fEmPhysicsList = new G4EmDNAPhysics_option 278 fEmPhysicsList = new G4EmDNAPhysics_option6(); 249 } << 279 250 else if (name == "had_elastic" && !fHadPhysi << 280 } else if (name == "had_elastic" && !fHadPhysicsList) { 251 fHadPhysicsList = new G4HadronElasticPhysi 281 fHadPhysicsList = new G4HadronElasticPhysics(); 252 } << 282 253 else { << 283 } else { >> 284 254 G4cout << "PhysicsList::AddPhysicsList: <" 285 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" 255 << " is not defined" << G4endl; << 286 << " is not defined" >> 287 << G4endl; 256 } 288 } 257 } 289 } 258 290 259 //....oooOO0OOooo........oooOO0OOooo........oo 291 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 260 292