Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 /// \file medical/electronScattering/src/Physi 27 /// \brief Implementation of the PhysicsList c 28 // 29 // 30 //....oooOO0OOooo........oooOO0OOooo........oo 31 //....oooOO0OOooo........oooOO0OOooo........oo 32 33 #include "PhysicsList.hh" 34 35 #include "PhysicsListMessenger.hh" 36 #include "StepMax.hh" 37 38 #include "G4Decay.hh" 39 #include "G4EmStandardPhysics.hh" 40 #include "G4EmStandardPhysicsGS.hh" 41 #include "G4EmStandardPhysicsSS.hh" 42 #include "G4EmStandardPhysicsWVI.hh" 43 #include "G4EmStandardPhysics_option1.hh" 44 #include "G4EmStandardPhysics_option2.hh" 45 #include "G4EmStandardPhysics_option3.hh" 46 #include "G4EmStandardPhysics_option4.hh" 47 #include "G4ParticleDefinition.hh" 48 #include "G4ProcessManager.hh" 49 #include "G4UnitsTable.hh" 50 51 // Bosons 52 #include "G4ChargedGeantino.hh" 53 #include "G4Gamma.hh" 54 #include "G4Geantino.hh" 55 #include "G4OpticalPhoton.hh" 56 57 // leptons 58 #include "G4AntiNeutrinoE.hh" 59 #include "G4AntiNeutrinoMu.hh" 60 #include "G4Electron.hh" 61 #include "G4MuonMinus.hh" 62 #include "G4MuonPlus.hh" 63 #include "G4NeutrinoE.hh" 64 #include "G4NeutrinoMu.hh" 65 #include "G4Positron.hh" 66 67 // Hadrons 68 #include "G4BaryonConstructor.hh" 69 #include "G4IonConstructor.hh" 70 #include "G4MesonConstructor.hh" 71 #include "G4SystemOfUnits.hh" 72 73 //....oooOO0OOooo........oooOO0OOooo........oo 74 75 PhysicsList::PhysicsList() 76 : G4VModularPhysicsList(), fMessenger(0), fE 77 { 78 fMessenger = new PhysicsListMessenger(this); 79 80 // EM physics 81 fEmPhysicsList = new G4EmStandardPhysics(); 82 83 SetDefaultCutValue(1. * mm); 84 SetVerboseLevel(1); 85 } 86 87 //....oooOO0OOooo........oooOO0OOooo........oo 88 89 PhysicsList::~PhysicsList() 90 { 91 delete fEmPhysicsList; 92 delete fMessenger; 93 } 94 95 //....oooOO0OOooo........oooOO0OOooo........oo 96 97 void PhysicsList::ConstructParticle() 98 { 99 // pseudo-particles 100 G4Geantino::GeantinoDefinition(); 101 G4ChargedGeantino::ChargedGeantinoDefinition 102 103 // gamma 104 G4Gamma::GammaDefinition(); 105 106 // optical photon 107 G4OpticalPhoton::OpticalPhotonDefinition(); 108 109 // leptons 110 G4Electron::ElectronDefinition(); 111 G4Positron::PositronDefinition(); 112 G4MuonPlus::MuonPlusDefinition(); 113 G4MuonMinus::MuonMinusDefinition(); 114 115 G4NeutrinoE::NeutrinoEDefinition(); 116 G4AntiNeutrinoE::AntiNeutrinoEDefinition(); 117 G4NeutrinoMu::NeutrinoMuDefinition(); 118 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition() 119 120 // mesons 121 G4MesonConstructor mConstructor; 122 mConstructor.ConstructParticle(); 123 124 // barions 125 G4BaryonConstructor bConstructor; 126 bConstructor.ConstructParticle(); 127 128 // ions 129 G4IonConstructor iConstructor; 130 iConstructor.ConstructParticle(); 131 } 132 133 //....oooOO0OOooo........oooOO0OOooo........oo 134 135 void PhysicsList::ConstructProcess() 136 { 137 AddTransportation(); 138 fEmPhysicsList->ConstructProcess(); 139 AddDecay(); 140 AddStepMax(); 141 } 142 143 //....oooOO0OOooo........oooOO0OOooo........oo 144 145 void PhysicsList::AddDecay() 146 { 147 // Add Decay Process 148 149 G4Decay* fDecayProcess = new G4Decay(); 150 151 auto particleIterator = GetParticleIterator( 152 particleIterator->reset(); 153 while ((*particleIterator)()) { 154 G4ParticleDefinition* particle = particleI 155 G4ProcessManager* pmanager = particle->Get 156 157 if (fDecayProcess->IsApplicable(*particle) 158 pmanager->AddProcess(fDecayProcess); 159 160 // set ordering for PostStepDoIt and AtR 161 pmanager->SetProcessOrdering(fDecayProce 162 pmanager->SetProcessOrdering(fDecayProce 163 } 164 } 165 } 166 167 //....oooOO0OOooo........oooOO0OOooo........oo 168 169 void PhysicsList::AddStepMax() 170 { 171 // Step limitation seen as a process 172 StepMax* stepMaxProcess = new StepMax(); 173 174 auto particleIterator = GetParticleIterator( 175 particleIterator->reset(); 176 while ((*particleIterator)()) { 177 G4ParticleDefinition* particle = particleI 178 G4ProcessManager* pmanager = particle->Get 179 180 if (stepMaxProcess->IsApplicable(*particle 181 pmanager->AddDiscreteProcess(stepMaxProc 182 } 183 } 184 } 185 186 //....oooOO0OOooo........oooOO0OOooo........oo 187 188 void PhysicsList::AddPhysicsList(const G4Strin 189 { 190 if (verboseLevel > -1) { 191 G4cout << "PhysicsList::AddPhysicsList: <" 192 } 193 194 if (name == fEmName) return; 195 196 if (name == "emstandard_opt0") { 197 fEmName = name; 198 delete fEmPhysicsList; 199 fEmPhysicsList = new G4EmStandardPhysics() 200 } 201 else if (name == "emstandard_opt1") { 202 fEmName = name; 203 delete fEmPhysicsList; 204 fEmPhysicsList = new G4EmStandardPhysics_o 205 } 206 else if (name == "emstandard_opt2") { 207 fEmName = name; 208 delete fEmPhysicsList; 209 fEmPhysicsList = new G4EmStandardPhysics_o 210 } 211 else if (name == "emstandard_opt3") { 212 fEmName = name; 213 delete fEmPhysicsList; 214 fEmPhysicsList = new G4EmStandardPhysics_o 215 } 216 else if (name == "emstandard_opt4") { 217 fEmName = name; 218 delete fEmPhysicsList; 219 fEmPhysicsList = new G4EmStandardPhysics_o 220 } 221 else if (name == "standardSS") { 222 fEmName = name; 223 delete fEmPhysicsList; 224 fEmPhysicsList = new G4EmStandardPhysicsSS 225 } 226 else if (name == "standardGS") { 227 fEmName = name; 228 delete fEmPhysicsList; 229 fEmPhysicsList = new G4EmStandardPhysicsGS 230 } 231 else if (name == "standardWVI") { 232 fEmName = name; 233 delete fEmPhysicsList; 234 fEmPhysicsList = new G4EmStandardPhysicsWV 235 } 236 else { 237 G4cout << "PhysicsList::AddPhysicsList: <" 238 << " is not defined" << G4endl; 239 } 240 } 241 242 //....oooOO0OOooo........oooOO0OOooo........oo 243