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