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,v 1.1 2009-04-16 11:05:40 maire Exp $ >> 27 // GEANT4 tag $Name: geant4-09-04-patch-02 $ 26 // 28 // 27 //....oooOO0OOooo........oooOO0OOooo........oo 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 28 //....oooOO0OOooo........oooOO0OOooo........oo 30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 29 31 30 #include "PhysicsList.hh" 32 #include "PhysicsList.hh" 31 #include "PhysicsListMessenger.hh" 33 #include "PhysicsListMessenger.hh" 32 34 33 #include "PhysListEmStandard.hh" 35 #include "PhysListEmStandard.hh" 34 36 35 #include "G4EmStandardPhysics.hh" 37 #include "G4EmStandardPhysics.hh" 36 #include "G4EmStandardPhysics_option1.hh" 38 #include "G4EmStandardPhysics_option1.hh" 37 #include "G4EmStandardPhysics_option2.hh" 39 #include "G4EmStandardPhysics_option2.hh" 38 #include "G4EmStandardPhysics_option3.hh" 40 #include "G4EmStandardPhysics_option3.hh" 39 41 40 #include "G4LossTableManager.hh" 42 #include "G4LossTableManager.hh" 41 #include "G4SystemOfUnits.hh" << 42 #include "G4UnitsTable.hh" 43 #include "G4UnitsTable.hh" 43 44 44 //....oooOO0OOooo........oooOO0OOooo........oo 45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 45 46 46 PhysicsList::PhysicsList() : G4VModularPhysics 47 PhysicsList::PhysicsList() : G4VModularPhysicsList() 47 { 48 { >> 49 G4LossTableManager::Instance(); >> 50 currentDefaultCut = 1.0*mm; >> 51 cutForGamma = currentDefaultCut; >> 52 cutForElectron = currentDefaultCut; >> 53 cutForPositron = currentDefaultCut; >> 54 48 pMessenger = new PhysicsListMessenger(this); 55 pMessenger = new PhysicsListMessenger(this); >> 56 49 SetVerboseLevel(1); 57 SetVerboseLevel(1); 50 58 51 // EM physics 59 // EM physics 52 emName = G4String("local"); << 60 emName = G4String("emstandard_local"); 53 emPhysicsList = new PhysListEmStandard(emNam 61 emPhysicsList = new PhysListEmStandard(emName); 54 << 62 55 SetDefaultCutValue(1*mm); << 56 G4LossTableManager::Instance(); << 57 } 63 } 58 64 59 //....oooOO0OOooo........oooOO0OOooo........oo 65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 60 66 61 PhysicsList::~PhysicsList() 67 PhysicsList::~PhysicsList() 62 { 68 { 63 delete pMessenger; 69 delete pMessenger; 64 } 70 } 65 71 66 //....oooOO0OOooo........oooOO0OOooo........oo 72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 67 73 68 #include "G4BosonConstructor.hh" << 74 // Bosons 69 #include "G4LeptonConstructor.hh" << 75 #include "G4ChargedGeantino.hh" 70 #include "G4MesonConstructor.hh" << 76 #include "G4Geantino.hh" 71 #include "G4BosonConstructor.hh" << 77 #include "G4Gamma.hh" 72 #include "G4BaryonConstructor.hh" << 78 #include "G4OpticalPhoton.hh" 73 #include "G4IonConstructor.hh" << 79 74 #include "G4ShortLivedConstructor.hh" << 80 // leptons >> 81 #include "G4MuonPlus.hh" >> 82 #include "G4MuonMinus.hh" >> 83 #include "G4NeutrinoMu.hh" >> 84 #include "G4AntiNeutrinoMu.hh" >> 85 >> 86 #include "G4Electron.hh" >> 87 #include "G4Positron.hh" >> 88 #include "G4NeutrinoE.hh" >> 89 #include "G4AntiNeutrinoE.hh" >> 90 >> 91 // Mesons >> 92 #include "G4PionPlus.hh" >> 93 #include "G4PionMinus.hh" >> 94 #include "G4PionZero.hh" >> 95 #include "G4Eta.hh" >> 96 #include "G4EtaPrime.hh" >> 97 >> 98 #include "G4KaonPlus.hh" >> 99 #include "G4KaonMinus.hh" >> 100 #include "G4KaonZero.hh" >> 101 #include "G4AntiKaonZero.hh" >> 102 #include "G4KaonZeroLong.hh" >> 103 #include "G4KaonZeroShort.hh" >> 104 >> 105 // Baryons >> 106 #include "G4Proton.hh" >> 107 #include "G4AntiProton.hh" >> 108 #include "G4Neutron.hh" >> 109 #include "G4AntiNeutron.hh" >> 110 >> 111 // Nuclei >> 112 #include "G4Deuteron.hh" >> 113 #include "G4Triton.hh" >> 114 #include "G4Alpha.hh" >> 115 #include "G4GenericIon.hh" 75 116 76 void PhysicsList::ConstructParticle() 117 void PhysicsList::ConstructParticle() 77 { 118 { 78 G4BosonConstructor pBosonConstructor; << 119 // pseudo-particles 79 pBosonConstructor.ConstructParticle(); << 120 G4Geantino::GeantinoDefinition(); 80 << 121 G4ChargedGeantino::ChargedGeantinoDefinition(); 81 G4LeptonConstructor pLeptonConstructor; << 122 82 pLeptonConstructor.ConstructParticle(); << 123 // gamma 83 << 124 G4Gamma::GammaDefinition(); 84 G4MesonConstructor pMesonConstructor; << 125 85 pMesonConstructor.ConstructParticle(); << 126 // optical photon 86 << 127 G4OpticalPhoton::OpticalPhotonDefinition(); 87 G4BaryonConstructor pBaryonConstructor; << 88 pBaryonConstructor.ConstructParticle(); << 89 << 90 G4IonConstructor pIonConstructor; << 91 pIonConstructor.ConstructParticle(); << 92 128 93 G4ShortLivedConstructor pShortLivedConstru << 129 // leptons 94 pShortLivedConstructor.ConstructParticle() << 130 G4Electron::ElectronDefinition(); >> 131 G4Positron::PositronDefinition(); >> 132 G4MuonPlus::MuonPlusDefinition(); >> 133 G4MuonMinus::MuonMinusDefinition(); >> 134 >> 135 G4NeutrinoE::NeutrinoEDefinition(); >> 136 G4AntiNeutrinoE::AntiNeutrinoEDefinition(); >> 137 G4NeutrinoMu::NeutrinoMuDefinition(); >> 138 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition(); >> 139 >> 140 // mesons >> 141 G4PionPlus::PionPlusDefinition(); >> 142 G4PionMinus::PionMinusDefinition(); >> 143 G4PionZero::PionZeroDefinition(); >> 144 G4Eta::EtaDefinition(); >> 145 G4EtaPrime::EtaPrimeDefinition(); >> 146 G4KaonPlus::KaonPlusDefinition(); >> 147 G4KaonMinus::KaonMinusDefinition(); >> 148 G4KaonZero::KaonZeroDefinition(); >> 149 G4AntiKaonZero::AntiKaonZeroDefinition(); >> 150 G4KaonZeroLong::KaonZeroLongDefinition(); >> 151 G4KaonZeroShort::KaonZeroShortDefinition(); >> 152 >> 153 // barions >> 154 G4Proton::ProtonDefinition(); >> 155 G4AntiProton::AntiProtonDefinition(); >> 156 G4Neutron::NeutronDefinition(); >> 157 G4AntiNeutron::AntiNeutronDefinition(); >> 158 >> 159 // ions >> 160 G4Deuteron::DeuteronDefinition(); >> 161 G4Triton::TritonDefinition(); >> 162 G4Alpha::AlphaDefinition(); >> 163 G4GenericIon::GenericIonDefinition(); 95 } 164 } 96 165 97 //....oooOO0OOooo........oooOO0OOooo........oo 166 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 98 167 99 #include "G4PhysicsListHelper.hh" << 168 #include "G4ProcessManager.hh" 100 #include "G4Decay.hh" 169 #include "G4Decay.hh" 101 170 102 void PhysicsList::ConstructProcess() 171 void PhysicsList::ConstructProcess() 103 { 172 { 104 AddTransportation(); 173 AddTransportation(); 105 174 106 // electromagnetic Physics List 175 // electromagnetic Physics List 107 // 176 // 108 emPhysicsList->ConstructProcess(); 177 emPhysicsList->ConstructProcess(); 109 178 110 // Add Decay Process 179 // Add Decay Process 111 // 180 // 112 G4Decay* fDecayProcess = new G4Decay(); 181 G4Decay* fDecayProcess = new G4Decay(); 113 G4PhysicsListHelper* ph = G4PhysicsListHelpe << 182 114 << 183 theParticleIterator->reset(); 115 auto particleIterator=GetParticleIterator(); << 184 while( (*theParticleIterator)() ){ 116 particleIterator->reset(); << 185 G4ParticleDefinition* particle = theParticleIterator->value(); 117 while( (*particleIterator)() ){ << 186 G4ProcessManager* pmanager = particle->GetProcessManager(); 118 G4ParticleDefinition* particle = particleI << 187 119 if (fDecayProcess->IsApplicable(*particle) << 188 if (fDecayProcess->IsApplicable(*particle)) { 120 ph ->RegisterProcess(fDecayProcess, part << 189 >> 190 pmanager ->AddProcess(fDecayProcess); >> 191 >> 192 // set ordering for PostStepDoIt and AtRestDoIt >> 193 pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep); >> 194 pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest); >> 195 >> 196 } 121 } 197 } 122 } 198 } 123 199 124 //....oooOO0OOooo........oooOO0OOooo........oo 200 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 125 201 126 void PhysicsList::AddPhysicsList(const G4Strin 202 void PhysicsList::AddPhysicsList(const G4String& name) 127 { 203 { 128 if (verboseLevel>1) { 204 if (verboseLevel>1) { 129 G4cout << "PhysicsList::AddPhysicsList: <" 205 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl; 130 } 206 } 131 207 132 if (name == emName) return; 208 if (name == emName) return; 133 209 134 if (name == "local") { << 210 if (name == "emstandard_local") { 135 211 136 emName = name; 212 emName = name; 137 delete emPhysicsList; 213 delete emPhysicsList; 138 emPhysicsList = new PhysListEmStandard(nam 214 emPhysicsList = new PhysListEmStandard(name); 139 215 140 } else if (name == "emstandard_opt0") { 216 } else if (name == "emstandard_opt0") { 141 217 142 emName = name; 218 emName = name; 143 delete emPhysicsList; 219 delete emPhysicsList; 144 emPhysicsList = new G4EmStandardPhysics(); 220 emPhysicsList = new G4EmStandardPhysics(); 145 221 146 } else if (name == "emstandard_opt1") { 222 } else if (name == "emstandard_opt1") { 147 223 148 emName = name; 224 emName = name; 149 delete emPhysicsList; 225 delete emPhysicsList; 150 emPhysicsList = new G4EmStandardPhysics_op 226 emPhysicsList = new G4EmStandardPhysics_option1(); 151 227 152 } else if (name == "emstandard_opt2") { 228 } else if (name == "emstandard_opt2") { 153 229 154 emName = name; 230 emName = name; 155 delete emPhysicsList; 231 delete emPhysicsList; 156 emPhysicsList = new G4EmStandardPhysics_op 232 emPhysicsList = new G4EmStandardPhysics_option2(); 157 233 158 } else if (name == "emstandard_opt3") { 234 } else if (name == "emstandard_opt3") { 159 235 160 emName = name; 236 emName = name; 161 delete emPhysicsList; 237 delete emPhysicsList; 162 emPhysicsList = new G4EmStandardPhysics_op 238 emPhysicsList = new G4EmStandardPhysics_option3(); 163 239 164 } else { 240 } else { 165 241 166 G4cout << "PhysicsList::AddPhysicsList: <" 242 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" 167 << " is not defined" 243 << " is not defined" 168 << G4endl; 244 << G4endl; 169 } 245 } 170 } 246 } 171 247 172 //....oooOO0OOooo........oooOO0OOooo........oo 248 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 249 >> 250 void PhysicsList::SetCuts() >> 251 { >> 252 >> 253 if (verboseLevel >0){ >> 254 G4cout << "PhysicsList::SetCuts:"; >> 255 G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl; >> 256 } >> 257 >> 258 // set cut values for gamma at first and for e- second and next for e+, >> 259 // because some processes for e+/e- need cut values for gamma >> 260 SetCutValue(cutForGamma, "gamma"); >> 261 SetCutValue(cutForElectron, "e-"); >> 262 SetCutValue(cutForPositron, "e+"); >> 263 >> 264 if (verboseLevel>0) DumpCutValuesTable(); >> 265 } >> 266 >> 267 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 268 >> 269 #include "G4Gamma.hh" >> 270 #include "G4Electron.hh" >> 271 #include "G4Positron.hh" >> 272 >> 273 void PhysicsList::SetCutForGamma(G4double cut) >> 274 { >> 275 cutForGamma = cut; >> 276 SetParticleCuts(cutForGamma, G4Gamma::Gamma()); >> 277 } >> 278 >> 279 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 280 >> 281 void PhysicsList::SetCutForElectron(G4double cut) >> 282 { >> 283 cutForElectron = cut; >> 284 SetParticleCuts(cutForElectron, G4Electron::Electron()); >> 285 } >> 286 >> 287 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 288 >> 289 void PhysicsList::SetCutForPositron(G4double cut) >> 290 { >> 291 cutForPositron = cut; >> 292 SetParticleCuts(cutForPositron, G4Positron::Positron()); >> 293 } >> 294 >> 295 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 296 173 297