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 // $Id: PhysicsList.cc 82042 2014-06-10 08:02:58Z gcosmo $ 26 // 27 // 27 /// \file medical/electronScattering2/src/Phys 28 /// \file medical/electronScattering2/src/PhysicsList.cc 28 /// \brief Implementation of the PhysicsList c 29 /// \brief Implementation of the PhysicsList class 29 30 30 #include "PhysicsList.hh" 31 #include "PhysicsList.hh" 31 << 32 #include "PhysicsListMessenger.hh" 32 #include "PhysicsListMessenger.hh" 33 #include "StepMax.hh" << 34 33 35 #include "G4Decay.hh" << 34 #include "PhysListEmStandard.hh" 36 #include "G4EmBuilder.hh" << 35 #include "PhysListEmStandardSS.hh" 37 #include "G4EmLivermorePhysics.hh" << 36 #include "PhysListEmStandardGS.hh" 38 #include "G4EmLowEPPhysics.hh" << 37 #include "PhysListEmStandardWVI.hh" 39 #include "G4EmPenelopePhysics.hh" << 38 40 #include "G4EmStandardPhysics.hh" 39 #include "G4EmStandardPhysics.hh" 41 #include "G4EmStandardPhysicsGS.hh" << 42 #include "G4EmStandardPhysicsSS.hh" << 43 #include "G4EmStandardPhysicsWVI.hh" << 44 #include "G4EmStandardPhysics_option1.hh" 40 #include "G4EmStandardPhysics_option1.hh" 45 #include "G4EmStandardPhysics_option2.hh" 41 #include "G4EmStandardPhysics_option2.hh" 46 #include "G4EmStandardPhysics_option3.hh" 42 #include "G4EmStandardPhysics_option3.hh" 47 #include "G4EmStandardPhysics_option4.hh" 43 #include "G4EmStandardPhysics_option4.hh" 48 #include "G4LossTableManager.hh" << 44 #include "G4EmLowEPPhysics.hh" >> 45 >> 46 #include "G4UnitsTable.hh" >> 47 49 #include "G4ParticleDefinition.hh" 48 #include "G4ParticleDefinition.hh" 50 #include "G4ProcessManager.hh" 49 #include "G4ProcessManager.hh" >> 50 >> 51 // Bosons >> 52 #include "G4ChargedGeantino.hh" >> 53 #include "G4Geantino.hh" >> 54 #include "G4Gamma.hh" >> 55 #include "G4OpticalPhoton.hh" >> 56 >> 57 // leptons >> 58 #include "G4MuonPlus.hh" >> 59 #include "G4MuonMinus.hh" >> 60 #include "G4NeutrinoMu.hh" >> 61 #include "G4AntiNeutrinoMu.hh" >> 62 >> 63 #include "G4Electron.hh" >> 64 #include "G4Positron.hh" >> 65 #include "G4NeutrinoE.hh" >> 66 #include "G4AntiNeutrinoE.hh" >> 67 >> 68 // Hadrons >> 69 #include "G4MesonConstructor.hh" >> 70 #include "G4BaryonConstructor.hh" >> 71 #include "G4IonConstructor.hh" >> 72 #include "G4GenericIon.hh" >> 73 51 #include "G4SystemOfUnits.hh" 74 #include "G4SystemOfUnits.hh" 52 #include "G4UnitsTable.hh" << 53 75 54 //....oooOO0OOooo........oooOO0OOooo........oo 76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 55 77 56 PhysicsList::PhysicsList() : G4VModularPhysics << 78 PhysicsList::PhysicsList() >> 79 : G4VModularPhysicsList(), fMessenger(0), fEmPhysicsList(0) 57 { 80 { 58 fMessenger = new PhysicsListMessenger(this); << 81 fMessenger = new PhysicsListMessenger(this); 59 << 82 60 // EM physics << 83 // EM physics 61 fEmName = G4String("emstandard_opt4"); << 84 fEmName = G4String("local"); 62 fEmPhysicsList = new G4EmStandardPhysics_opt << 85 fEmPhysicsList = new PhysListEmStandard(fEmName); 63 if (verboseLevel > -1) { << 86 64 G4cout << "PhysicsList::Constructor with d << 87 SetVerboseLevel(1); 65 } << 66 << 67 G4LossTableManager::Instance(); << 68 SetVerboseLevel(1); << 69 } 88 } 70 89 71 //....oooOO0OOooo........oooOO0OOooo........oo 90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 72 91 73 PhysicsList::~PhysicsList() 92 PhysicsList::~PhysicsList() 74 { 93 { 75 delete fEmPhysicsList; << 94 delete fEmPhysicsList; 76 delete fMessenger; << 95 delete fMessenger; 77 } 96 } 78 97 79 //....oooOO0OOooo........oooOO0OOooo........oo 98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 80 99 81 void PhysicsList::ConstructParticle() 100 void PhysicsList::ConstructParticle() 82 { 101 { 83 // minimal set of particles for EM physics << 102 // pseudo-particles 84 G4EmBuilder::ConstructMinimalEmSet(); << 103 G4Geantino::GeantinoDefinition(); >> 104 G4ChargedGeantino::ChargedGeantinoDefinition(); >> 105 >> 106 // gamma >> 107 G4Gamma::GammaDefinition(); >> 108 >> 109 // optical photon >> 110 G4OpticalPhoton::OpticalPhotonDefinition(); >> 111 >> 112 // leptons >> 113 G4Electron::ElectronDefinition(); >> 114 G4Positron::PositronDefinition(); >> 115 G4MuonPlus::MuonPlusDefinition(); >> 116 G4MuonMinus::MuonMinusDefinition(); >> 117 >> 118 G4NeutrinoE::NeutrinoEDefinition(); >> 119 G4AntiNeutrinoE::AntiNeutrinoEDefinition(); >> 120 G4NeutrinoMu::NeutrinoMuDefinition(); >> 121 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition(); >> 122 >> 123 // mesons >> 124 G4MesonConstructor mConstructor; >> 125 mConstructor.ConstructParticle(); >> 126 >> 127 // barions >> 128 G4BaryonConstructor bConstructor; >> 129 bConstructor.ConstructParticle(); >> 130 >> 131 // ions >> 132 G4IonConstructor iConstructor; >> 133 iConstructor.ConstructParticle(); >> 134 >> 135 // Required by MT even if ion physics not used >> 136 G4GenericIon::GenericIonDefinition(); 85 } 137 } 86 138 87 //....oooOO0OOooo........oooOO0OOooo........oo 139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 88 140 89 void PhysicsList::ConstructProcess() 141 void PhysicsList::ConstructProcess() 90 { 142 { 91 AddTransportation(); << 143 AddTransportation(); 92 fEmPhysicsList->ConstructProcess(); << 144 fEmPhysicsList->ConstructProcess(); 93 AddDecay(); << 145 AddDecay(); 94 AddStepMax(); << 146 AddStepMax(); 95 } 147 } 96 148 97 //....oooOO0OOooo........oooOO0OOooo........oo 149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 98 150 >> 151 #include "G4Decay.hh" >> 152 99 void PhysicsList::AddDecay() 153 void PhysicsList::AddDecay() 100 { 154 { 101 // Add Decay Process << 155 // Add Decay Process 102 << 156 103 G4Decay* fDecayProcess = new G4Decay(); << 157 G4Decay* fDecayProcess = new G4Decay(); 104 << 158 105 auto particleIterator = GetParticleIterator( << 159 theParticleIterator->reset(); 106 particleIterator->reset(); << 160 while( (*theParticleIterator)() ){ 107 while ((*particleIterator)()) { << 161 G4ParticleDefinition* particle = theParticleIterator->value(); 108 G4ParticleDefinition* particle = particleI << 162 G4ProcessManager* pmanager = particle->GetProcessManager(); 109 G4ProcessManager* pmanager = particle->Get << 163 110 << 164 if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) { 111 if (fDecayProcess->IsApplicable(*particle) << 165 112 pmanager->AddProcess(fDecayProcess); << 166 pmanager ->AddProcess(fDecayProcess); 113 << 167 114 // set ordering for PostStepDoIt and AtR << 168 // set ordering for PostStepDoIt and AtRestDoIt 115 pmanager->SetProcessOrdering(fDecayProce << 169 pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep); 116 pmanager->SetProcessOrdering(fDecayProce << 170 pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest); >> 171 >> 172 } 117 } 173 } 118 } << 119 } 174 } 120 175 121 //....oooOO0OOooo........oooOO0OOooo........oo 176 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 122 177 >> 178 #include "StepMax.hh" >> 179 123 void PhysicsList::AddStepMax() 180 void PhysicsList::AddStepMax() 124 { 181 { 125 // Step limitation seen as a process << 182 // Step limitation seen as a process 126 StepMax* stepMaxProcess = new StepMax(); << 183 StepMax* stepMaxProcess = new StepMax(); 127 << 184 128 auto particleIterator = GetParticleIterator( << 185 theParticleIterator->reset(); 129 particleIterator->reset(); << 186 while ((*theParticleIterator)()){ 130 while ((*particleIterator)()) { << 187 G4ParticleDefinition* particle = theParticleIterator->value(); 131 G4ParticleDefinition* particle = particleI << 188 G4ProcessManager* pmanager = particle->GetProcessManager(); 132 G4ProcessManager* pmanager = particle->Get << 189 133 << 190 if (stepMaxProcess->IsApplicable(*particle)) 134 if (stepMaxProcess->IsApplicable(*particle << 191 { 135 pmanager->AddDiscreteProcess(stepMaxProc << 192 pmanager ->AddDiscreteProcess(stepMaxProcess); >> 193 } 136 } 194 } 137 } << 138 } 195 } 139 196 140 //....oooOO0OOooo........oooOO0OOooo........oo 197 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 141 198 142 void PhysicsList::AddPhysicsList(const G4Strin 199 void PhysicsList::AddPhysicsList(const G4String& name) 143 { 200 { 144 if (verboseLevel > -1) { << 201 if (verboseLevel>-1) { 145 G4cout << "PhysicsList::AddPhysicsList: <" << 202 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl; 146 } << 203 } 147 << 204 148 if (name == fEmName) return; << 205 if (name == fEmName) return; 149 << 206 150 if (name == "emstandard_opt0") { << 207 if (name == "local") { 151 fEmName = name; << 208 152 delete fEmPhysicsList; << 209 fEmName = name; 153 fEmPhysicsList = new G4EmStandardPhysics(1 << 210 delete fEmPhysicsList; 154 } << 211 fEmPhysicsList = new PhysListEmStandard(name); 155 else if (name == "emstandard_opt1") { << 212 156 fEmName = name; << 213 } else if (name == "emstandard_opt0") { 157 delete fEmPhysicsList; << 214 158 fEmPhysicsList = new G4EmStandardPhysics_o << 215 fEmName = name; 159 } << 216 delete fEmPhysicsList; 160 else if (name == "emstandard_opt2") { << 217 fEmPhysicsList = new G4EmStandardPhysics(); 161 fEmName = name; << 218 162 delete fEmPhysicsList; << 219 } else if (name == "emstandard_opt1") { 163 fEmPhysicsList = new G4EmStandardPhysics_o << 220 164 } << 221 fEmName = name; 165 else if (name == "emstandard_opt3") { << 222 delete fEmPhysicsList; 166 fEmName = name; << 223 fEmPhysicsList = new G4EmStandardPhysics_option1(); 167 delete fEmPhysicsList; << 224 168 fEmPhysicsList = new G4EmStandardPhysics_o << 225 } else if (name == "emstandard_opt2") { 169 } << 226 170 else if (name == "emstandard_opt4") { << 227 fEmName = name; 171 fEmName = name; << 228 delete fEmPhysicsList; 172 delete fEmPhysicsList; << 229 fEmPhysicsList = new G4EmStandardPhysics_option2(); 173 fEmPhysicsList = new G4EmStandardPhysics_o << 230 174 } << 231 } else if (name == "emstandard_opt3") { 175 else if (name == "emlowenergy") { << 232 176 fEmName = name; << 233 fEmName = name; 177 delete fEmPhysicsList; << 234 delete fEmPhysicsList; 178 fEmPhysicsList = new G4EmLowEPPhysics(1); << 235 fEmPhysicsList = new G4EmStandardPhysics_option3(); 179 } << 236 180 else if (name == "emstandardSS") { << 237 } else if (name == "emstandard_opt4") { 181 fEmName = name; << 238 182 delete fEmPhysicsList; << 239 fEmName = name; 183 fEmPhysicsList = new G4EmStandardPhysicsSS << 240 delete fEmPhysicsList; 184 } << 241 fEmPhysicsList = new G4EmStandardPhysics_option4(); 185 else if (name == "emstandardWVI") { << 242 186 fEmName = name; << 243 } else if (name == "emlowenergy") { 187 delete fEmPhysicsList; << 244 fEmName = name; 188 fEmPhysicsList = new G4EmStandardPhysicsWV << 245 delete fEmPhysicsList; 189 } << 246 fEmPhysicsList = new G4EmLowEPPhysics(); 190 else if (name == "emstandardGS") { << 247 191 fEmName = name; << 248 } else if (name == "standardSS") { 192 delete fEmPhysicsList; << 249 193 fEmPhysicsList = new G4EmStandardPhysicsGS << 250 fEmName = name; 194 } << 251 delete fEmPhysicsList; 195 else if (name == "emlivermore") { << 252 fEmPhysicsList = new PhysListEmStandardSS(name); 196 fEmName = name; << 253 197 delete fEmPhysicsList; << 254 } else if (name == "standardGS") { 198 fEmPhysicsList = new G4EmLivermorePhysics( << 255 199 } << 256 fEmName = name; 200 else if (name == "empenelope") { << 257 delete fEmPhysicsList; 201 fEmName = name; << 258 fEmPhysicsList = new PhysListEmStandardGS(name); 202 delete fEmPhysicsList; << 259 203 fEmPhysicsList = new G4EmPenelopePhysics(1 << 260 } else if (name == "standardWVI") { 204 } << 261 205 else { << 262 fEmName = name; 206 G4ExceptionDescription description; << 263 delete fEmPhysicsList; 207 description << " " << 264 fEmPhysicsList = new PhysListEmStandardWVI(name); 208 << "PhysicsList::AddPhysicsLis << 265 209 G4Exception("PhysicsList::AddPhysicsList", << 266 } else { 210 description); << 267 211 } << 268 G4ExceptionDescription description; >> 269 description >> 270 << " " >> 271 << "PhysicsList::AddPhysicsList: <" << name << "> is not defined"; >> 272 G4Exception("PhysicsList::AddPhysicsList", >> 273 "electronScattering2_F001", FatalException, description); >> 274 } 212 } 275 } 213 276 214 //....oooOO0OOooo........oooOO0OOooo........oo 277 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 215 278