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