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/TestEm15/src/Physics 26 /// \file electromagnetic/TestEm15/src/PhysicsList.cc 27 /// \brief Implementation of the PhysicsList c 27 /// \brief Implementation of the PhysicsList class 28 // 28 // 29 // << 29 // >> 30 // $Id: PhysicsList.cc 68585 2013-04-01 23:35:07Z adotti $ 30 // 31 // 31 //....oooOO0OOooo........oooOO0OOooo........oo 32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 32 //....oooOO0OOooo........oooOO0OOooo........oo 33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 33 34 34 #include "PhysicsList.hh" 35 #include "PhysicsList.hh" 35 << 36 #include "PhysListEmStandard.hh" << 37 #include "PhysicsListMessenger.hh" 36 #include "PhysicsListMessenger.hh" >> 37 >> 38 #include "PhysListEmStandard.hh" 38 39 39 #include "G4EmStandardPhysicsGS.hh" << 40 #include "G4EmStandardPhysicsSS.hh" << 41 #include "G4EmStandardPhysicsWVI.hh" << 42 #include "G4EmStandardPhysics_option3.hh" << 43 #include "G4EmStandardPhysics_option4.hh" << 44 #include "G4LossTableManager.hh" 40 #include "G4LossTableManager.hh" 45 #include "G4SystemOfUnits.hh" << 46 #include "G4UnitsTable.hh" 41 #include "G4UnitsTable.hh" >> 42 #include "G4SystemOfUnits.hh" >> 43 >> 44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 45 >> 46 PhysicsList::PhysicsList() >> 47 : G4VModularPhysicsList(), >> 48 fEmPhysicsList(0), >> 49 fMessenger(0) >> 50 { >> 51 G4LossTableManager::Instance(); >> 52 >> 53 fCurrentDefaultCut = 1.0*mm; >> 54 fCutForGamma = fCurrentDefaultCut; >> 55 fCutForElectron = fCurrentDefaultCut; >> 56 fCutForPositron = fCurrentDefaultCut; >> 57 >> 58 fMessenger = new PhysicsListMessenger(this); >> 59 >> 60 SetVerboseLevel(1); >> 61 >> 62 // EM physics >> 63 fEmName = G4String("standard"); >> 64 fEmPhysicsList = new PhysListEmStandard(fEmName); >> 65 >> 66 } >> 67 >> 68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 69 >> 70 PhysicsList::~PhysicsList() >> 71 { >> 72 delete fMessenger; >> 73 } >> 74 >> 75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 47 76 48 // Bosons 77 // Bosons 49 #include "G4ChargedGeantino.hh" 78 #include "G4ChargedGeantino.hh" 50 #include "G4Gamma.hh" << 51 #include "G4Geantino.hh" 79 #include "G4Geantino.hh" >> 80 #include "G4Gamma.hh" 52 #include "G4OpticalPhoton.hh" 81 #include "G4OpticalPhoton.hh" 53 82 54 // leptons 83 // leptons 55 #include "G4AntiNeutrinoE.hh" << 56 #include "G4AntiNeutrinoMu.hh" << 57 #include "G4Electron.hh" << 58 #include "G4MuonMinus.hh" << 59 #include "G4MuonPlus.hh" 84 #include "G4MuonPlus.hh" 60 #include "G4NeutrinoE.hh" << 85 #include "G4MuonMinus.hh" 61 #include "G4NeutrinoMu.hh" 86 #include "G4NeutrinoMu.hh" >> 87 #include "G4AntiNeutrinoMu.hh" >> 88 >> 89 #include "G4Electron.hh" 62 #include "G4Positron.hh" 90 #include "G4Positron.hh" >> 91 #include "G4NeutrinoE.hh" >> 92 #include "G4AntiNeutrinoE.hh" 63 93 64 // Mesons 94 // Mesons 65 #include "G4AntiKaonZero.hh" << 95 #include "G4PionPlus.hh" >> 96 #include "G4PionMinus.hh" >> 97 #include "G4PionZero.hh" 66 #include "G4Eta.hh" 98 #include "G4Eta.hh" 67 #include "G4EtaPrime.hh" 99 #include "G4EtaPrime.hh" 68 #include "G4KaonMinus.hh" << 100 69 #include "G4KaonPlus.hh" 101 #include "G4KaonPlus.hh" >> 102 #include "G4KaonMinus.hh" 70 #include "G4KaonZero.hh" 103 #include "G4KaonZero.hh" >> 104 #include "G4AntiKaonZero.hh" 71 #include "G4KaonZeroLong.hh" 105 #include "G4KaonZeroLong.hh" 72 #include "G4KaonZeroShort.hh" 106 #include "G4KaonZeroShort.hh" 73 #include "G4PionMinus.hh" << 74 #include "G4PionPlus.hh" << 75 #include "G4PionZero.hh" << 76 107 77 // Baryons 108 // Baryons 78 #include "G4AntiNeutron.hh" << 109 #include "G4Proton.hh" 79 #include "G4AntiProton.hh" 110 #include "G4AntiProton.hh" 80 #include "G4Neutron.hh" 111 #include "G4Neutron.hh" 81 #include "G4Proton.hh" << 112 #include "G4AntiNeutron.hh" 82 113 83 // Nuclei 114 // Nuclei 84 #include "StepMax.hh" << 85 << 86 #include "G4Alpha.hh" << 87 #include "G4Deuteron.hh" 115 #include "G4Deuteron.hh" 88 #include "G4GenericIon.hh" << 89 #include "G4ProcessManager.hh" << 90 #include "G4Triton.hh" 116 #include "G4Triton.hh" 91 << 117 #include "G4Alpha.hh" 92 //....oooOO0OOooo........oooOO0OOooo........oo << 118 #include "G4GenericIon.hh" 93 << 94 PhysicsList::PhysicsList() : G4VModularPhysics << 95 { << 96 G4LossTableManager::Instance(); << 97 SetDefaultCutValue(1 * mm); << 98 << 99 fMessenger = new PhysicsListMessenger(this); << 100 << 101 SetVerboseLevel(1); << 102 << 103 // EM physics << 104 fEmName = G4String("local"); << 105 fEmPhysicsList = new PhysListEmStandard(fEmN << 106 } << 107 << 108 //....oooOO0OOooo........oooOO0OOooo........oo << 109 << 110 PhysicsList::~PhysicsList() << 111 { << 112 delete fMessenger; << 113 } << 114 119 115 //....oooOO0OOooo........oooOO0OOooo........oo 120 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 116 121 117 void PhysicsList::ConstructParticle() 122 void PhysicsList::ConstructParticle() 118 { 123 { 119 // pseudo-particles << 124 // pseudo-particles 120 G4Geantino::GeantinoDefinition(); 125 G4Geantino::GeantinoDefinition(); 121 G4ChargedGeantino::ChargedGeantinoDefinition 126 G4ChargedGeantino::ChargedGeantinoDefinition(); 122 << 127 123 // gamma << 128 // gamma 124 G4Gamma::GammaDefinition(); 129 G4Gamma::GammaDefinition(); 125 << 130 126 // optical photon << 131 // optical photon 127 G4OpticalPhoton::OpticalPhotonDefinition(); 132 G4OpticalPhoton::OpticalPhotonDefinition(); 128 133 129 // leptons << 134 // leptons 130 G4Electron::ElectronDefinition(); 135 G4Electron::ElectronDefinition(); 131 G4Positron::PositronDefinition(); 136 G4Positron::PositronDefinition(); 132 G4MuonPlus::MuonPlusDefinition(); 137 G4MuonPlus::MuonPlusDefinition(); 133 G4MuonMinus::MuonMinusDefinition(); 138 G4MuonMinus::MuonMinusDefinition(); 134 139 135 G4NeutrinoE::NeutrinoEDefinition(); 140 G4NeutrinoE::NeutrinoEDefinition(); 136 G4AntiNeutrinoE::AntiNeutrinoEDefinition(); 141 G4AntiNeutrinoE::AntiNeutrinoEDefinition(); 137 G4NeutrinoMu::NeutrinoMuDefinition(); 142 G4NeutrinoMu::NeutrinoMuDefinition(); 138 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition() << 143 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition(); 139 144 140 // mesons << 145 // mesons 141 G4PionPlus::PionPlusDefinition(); 146 G4PionPlus::PionPlusDefinition(); 142 G4PionMinus::PionMinusDefinition(); 147 G4PionMinus::PionMinusDefinition(); 143 G4PionZero::PionZeroDefinition(); 148 G4PionZero::PionZeroDefinition(); 144 G4Eta::EtaDefinition(); 149 G4Eta::EtaDefinition(); 145 G4EtaPrime::EtaPrimeDefinition(); 150 G4EtaPrime::EtaPrimeDefinition(); 146 G4KaonPlus::KaonPlusDefinition(); 151 G4KaonPlus::KaonPlusDefinition(); 147 G4KaonMinus::KaonMinusDefinition(); 152 G4KaonMinus::KaonMinusDefinition(); 148 G4KaonZero::KaonZeroDefinition(); 153 G4KaonZero::KaonZeroDefinition(); 149 G4AntiKaonZero::AntiKaonZeroDefinition(); 154 G4AntiKaonZero::AntiKaonZeroDefinition(); 150 G4KaonZeroLong::KaonZeroLongDefinition(); 155 G4KaonZeroLong::KaonZeroLongDefinition(); 151 G4KaonZeroShort::KaonZeroShortDefinition(); 156 G4KaonZeroShort::KaonZeroShortDefinition(); 152 157 153 // barions << 158 // barions 154 G4Proton::ProtonDefinition(); 159 G4Proton::ProtonDefinition(); 155 G4AntiProton::AntiProtonDefinition(); 160 G4AntiProton::AntiProtonDefinition(); 156 G4Neutron::NeutronDefinition(); 161 G4Neutron::NeutronDefinition(); 157 G4AntiNeutron::AntiNeutronDefinition(); 162 G4AntiNeutron::AntiNeutronDefinition(); 158 163 159 // ions << 164 // ions 160 G4Deuteron::DeuteronDefinition(); 165 G4Deuteron::DeuteronDefinition(); 161 G4Triton::TritonDefinition(); 166 G4Triton::TritonDefinition(); 162 G4Alpha::AlphaDefinition(); 167 G4Alpha::AlphaDefinition(); 163 G4GenericIon::GenericIonDefinition(); 168 G4GenericIon::GenericIonDefinition(); 164 } 169 } 165 170 166 //....oooOO0OOooo........oooOO0OOooo........oo 171 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 167 172 >> 173 #include "G4EmProcessOptions.hh" >> 174 168 void PhysicsList::ConstructProcess() 175 void PhysicsList::ConstructProcess() 169 { 176 { 170 // Transportation 177 // Transportation 171 // 178 // 172 AddTransportation(); 179 AddTransportation(); 173 180 174 // Electromagnetic physics list 181 // Electromagnetic physics list 175 // 182 // 176 fEmPhysicsList->ConstructProcess(); 183 fEmPhysicsList->ConstructProcess(); 177 << 184 178 // Em options 185 // Em options 179 // 186 // 180 G4EmParameters* param = G4EmParameters::Inst << 187 G4EmProcessOptions emOptions; 181 param->SetIntegral(false); << 188 emOptions.SetStepFunction(1., 1*mm); 182 param->SetStepFunction(1., 1 * mm); << 189 emOptions.SetIntegral(false); 183 param->SetLossFluctuations(false); << 190 emOptions.SetLossFluctuations(false); 184 << 191 185 // step limitation (as a full process) 192 // step limitation (as a full process) 186 // << 193 // 187 AddStepMax(); << 194 AddStepMax(); 188 } 195 } 189 196 190 //....oooOO0OOooo........oooOO0OOooo........oo 197 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 191 198 >> 199 #include "G4EmStandardPhysics_option3.hh" >> 200 192 void PhysicsList::AddPhysicsList(const G4Strin 201 void PhysicsList::AddPhysicsList(const G4String& name) 193 { 202 { 194 if (verboseLevel > 0) { << 203 if (verboseLevel>0) { 195 G4cout << "PhysicsList::AddPhysicsList: <" 204 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl; 196 } 205 } 197 << 206 198 if (name == fEmName) return; 207 if (name == fEmName) return; 199 208 200 if (name == "local") { << 209 if (name == "standard") { >> 210 201 fEmName = name; 211 fEmName = name; 202 delete fEmPhysicsList; 212 delete fEmPhysicsList; 203 fEmPhysicsList = new PhysListEmStandard(na 213 fEmPhysicsList = new PhysListEmStandard(name); 204 } << 214 205 else if (name == "emstandard_opt3") { << 215 } else if (name == "emstandard_opt3") { >> 216 206 fEmName = name; 217 fEmName = name; 207 delete fEmPhysicsList; 218 delete fEmPhysicsList; 208 fEmPhysicsList = new G4EmStandardPhysics_o 219 fEmPhysicsList = new G4EmStandardPhysics_option3(); 209 } << 220 210 else if (name == "emstandard_opt4") { << 221 } else { 211 fEmName = name; << 212 delete fEmPhysicsList; << 213 fEmPhysicsList = new G4EmStandardPhysics_o << 214 } << 215 else if (name == "emstandardSS") { << 216 fEmName = name; << 217 delete fEmPhysicsList; << 218 fEmPhysicsList = new G4EmStandardPhysicsSS << 219 } << 220 else if (name == "emstandardWVI") { << 221 fEmName = name; << 222 delete fEmPhysicsList; << 223 fEmPhysicsList = new G4EmStandardPhysicsWV << 224 } << 225 else if (name == "emstandardGS") { << 226 fEmName = name; << 227 delete fEmPhysicsList; << 228 fEmPhysicsList = new G4EmStandardPhysicsGS << 229 } << 230 else { << 231 G4cout << "PhysicsList::AddPhysicsList: <" 222 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" 232 << " is not defined" << G4endl; << 223 << " is not defined" >> 224 << G4endl; 233 } 225 } 234 } 226 } 235 227 236 //....oooOO0OOooo........oooOO0OOooo........oo 228 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 237 229 >> 230 #include "G4ProcessManager.hh" >> 231 #include "StepMax.hh" >> 232 238 void PhysicsList::AddStepMax() 233 void PhysicsList::AddStepMax() 239 { 234 { 240 // Step limitation seen as a process 235 // Step limitation seen as a process 241 StepMax* stepMaxProcess = new StepMax(); 236 StepMax* stepMaxProcess = new StepMax(); 242 237 243 auto particleIterator = GetParticleIterator( << 238 theParticleIterator->reset(); 244 particleIterator->reset(); << 239 while ((*theParticleIterator)()){ 245 while ((*particleIterator)()) { << 240 G4ParticleDefinition* particle = theParticleIterator->value(); 246 G4ParticleDefinition* particle = particleI << 241 G4ProcessManager* pmanager = particle->GetProcessManager(); 247 G4ProcessManager* pmanager = particle->Get << 242 248 << 243 if (stepMaxProcess->IsApplicable(*particle) && pmanager) 249 if (stepMaxProcess->IsApplicable(*particle << 244 { 250 pmanager->AddDiscreteProcess(stepMaxProc << 245 pmanager ->AddDiscreteProcess(stepMaxProcess); 251 } << 246 } 252 } 247 } >> 248 } >> 249 >> 250 >> 251 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 252 >> 253 #include "G4Gamma.hh" >> 254 #include "G4Electron.hh" >> 255 #include "G4Positron.hh" >> 256 >> 257 void PhysicsList::SetCuts() >> 258 { >> 259 // set cut values for gamma at first and for e- second and next for e+, >> 260 // because some processes for e+/e- need cut values for gamma >> 261 SetCutValue(fCutForGamma, "gamma"); >> 262 SetCutValue(fCutForElectron, "e-"); >> 263 SetCutValue(fCutForPositron, "e+"); >> 264 } >> 265 >> 266 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 267 >> 268 void PhysicsList::SetCutForGamma(G4double cut) >> 269 { >> 270 fCutForGamma = cut; >> 271 SetParticleCuts(fCutForGamma, G4Gamma::Gamma()); >> 272 } >> 273 >> 274 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 275 >> 276 void PhysicsList::SetCutForElectron(G4double cut) >> 277 { >> 278 fCutForElectron = cut; >> 279 SetParticleCuts(fCutForElectron, G4Electron::Electron()); >> 280 } >> 281 >> 282 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 283 >> 284 void PhysicsList::SetCutForPositron(G4double cut) >> 285 { >> 286 fCutForPositron = cut; >> 287 SetParticleCuts(fCutForPositron, G4Positron::Positron()); 253 } 288 } 254 289 255 //....oooOO0OOooo........oooOO0OOooo........oo 290 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 256 291