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/TestEm1/src/PhysicsL 26 /// \file electromagnetic/TestEm1/src/PhysicsList.cc 27 /// \brief Implementation of the PhysicsList c 27 /// \brief Implementation of the PhysicsList class 28 // << 28 // >> 29 // $Id: PhysicsList.cc 74734 2013-10-21 09:00:00Z gcosmo $ 29 // 30 // 30 //....oooOO0OOooo........oooOO0OOooo........oo 31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 31 //....oooOO0OOooo........oooOO0OOooo........oo 32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 32 33 33 #include "PhysicsList.hh" 34 #include "PhysicsList.hh" 34 << 35 #include "DetectorConstruction.hh" << 36 #include "PhysListEmStandard.hh" << 37 #include "PhysicsListMessenger.hh" 35 #include "PhysicsListMessenger.hh" >> 36 >> 37 #include "PhysListEmStandard.hh" >> 38 #include "PhysListEmStandardSS.hh" 38 39 39 #include "G4EmLivermorePhysics.hh" << 40 #include "G4EmLowEPPhysics.hh" << 41 #include "G4EmParameters.hh" << 42 #include "G4EmPenelopePhysics.hh" << 43 #include "G4EmStandardPhysics.hh" 40 #include "G4EmStandardPhysics.hh" 44 #include "G4EmStandardPhysicsGS.hh" << 45 #include "G4EmStandardPhysicsSS.hh" << 46 #include "G4EmStandardPhysicsWVI.hh" << 47 #include "G4EmStandardPhysics_option1.hh" 41 #include "G4EmStandardPhysics_option1.hh" 48 #include "G4EmStandardPhysics_option2.hh" 42 #include "G4EmStandardPhysics_option2.hh" 49 #include "G4EmStandardPhysics_option3.hh" 43 #include "G4EmStandardPhysics_option3.hh" 50 #include "G4EmStandardPhysics_option4.hh" 44 #include "G4EmStandardPhysics_option4.hh" 51 #include "G4LossTableManager.hh" << 45 #include "G4EmLivermorePhysics.hh" 52 #include "G4SystemOfUnits.hh" << 46 #include "G4EmPenelopePhysics.hh" 53 #include "G4UnitsTable.hh" << 54 << 55 // particles << 56 47 57 #include "StepMax.hh" << 48 #include "DetectorConstruction.hh" 58 49 59 #include "G4BaryonConstructor.hh" << 50 #include "G4LossTableManager.hh" 60 #include "G4BosonConstructor.hh" << 51 #include "G4UnitsTable.hh" 61 #include "G4Decay.hh" << 52 #include "G4SystemOfUnits.hh" 62 #include "G4Electron.hh" << 63 #include "G4Gamma.hh" << 64 #include "G4GenericIon.hh" << 65 #include "G4IonConstructor.hh" << 66 #include "G4LeptonConstructor.hh" << 67 #include "G4Material.hh" << 68 #include "G4MesonConstructor.hh" << 69 #include "G4NuclideTable.hh" << 70 #include "G4PhysicsListHelper.hh" << 71 #include "G4ProcessManager.hh" << 72 #include "G4Proton.hh" << 73 #include "G4RadioactiveDecay.hh" << 74 #include "G4ShortLivedConstructor.hh" << 75 53 76 //....oooOO0OOooo........oooOO0OOooo........oo 54 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 77 55 78 PhysicsList::PhysicsList(DetectorConstruction* << 56 PhysicsList::PhysicsList(DetectorConstruction* p) >> 57 : G4VModularPhysicsList(), >> 58 fEmPhysicsList(0), >> 59 fDet(0), >> 60 fMessenger(0) 79 { 61 { >> 62 G4LossTableManager::Instance(); >> 63 fDet = p; >> 64 >> 65 fCurrentDefaultCut = 1.0*mm; >> 66 fCutForGamma = fCurrentDefaultCut; >> 67 fCutForElectron = fCurrentDefaultCut; >> 68 fCutForPositron = fCurrentDefaultCut; >> 69 80 fMessenger = new PhysicsListMessenger(this); 70 fMessenger = new PhysicsListMessenger(this); >> 71 81 SetVerboseLevel(1); 72 SetVerboseLevel(1); 82 73 83 // EM physics 74 // EM physics 84 AddPhysicsList("emstandard_opt3"); << 75 fEmName = G4String("local"); >> 76 fEmPhysicsList = new PhysListEmStandard(fEmName); 85 77 86 // fix lower limit for cut << 87 G4ProductionCutsTable::GetProductionCutsTabl << 88 SetDefaultCutValue(1 * mm); << 89 } 78 } 90 79 91 //....oooOO0OOooo........oooOO0OOooo........oo 80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 92 81 93 PhysicsList::~PhysicsList() 82 PhysicsList::~PhysicsList() 94 { 83 { 95 delete fMessenger; 84 delete fMessenger; 96 } 85 } 97 86 98 //....oooOO0OOooo........oooOO0OOooo........oo 87 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 99 88 100 void PhysicsList::ConstructParticle() << 89 // Bosons 101 { << 90 #include "G4ChargedGeantino.hh" 102 G4BosonConstructor pBosonConstructor; << 91 #include "G4Geantino.hh" 103 pBosonConstructor.ConstructParticle(); << 92 #include "G4Gamma.hh" >> 93 #include "G4OpticalPhoton.hh" 104 94 105 G4LeptonConstructor pLeptonConstructor; << 95 // leptons 106 pLeptonConstructor.ConstructParticle(); << 96 #include "G4MuonPlus.hh" >> 97 #include "G4MuonMinus.hh" >> 98 #include "G4NeutrinoMu.hh" >> 99 #include "G4AntiNeutrinoMu.hh" 107 100 108 G4MesonConstructor pMesonConstructor; << 101 #include "G4Electron.hh" 109 pMesonConstructor.ConstructParticle(); << 102 #include "G4Positron.hh" >> 103 #include "G4NeutrinoE.hh" >> 104 #include "G4AntiNeutrinoE.hh" >> 105 >> 106 // Mesons >> 107 #include "G4PionPlus.hh" >> 108 #include "G4PionMinus.hh" >> 109 #include "G4PionZero.hh" >> 110 #include "G4Eta.hh" >> 111 #include "G4EtaPrime.hh" >> 112 >> 113 #include "G4KaonPlus.hh" >> 114 #include "G4KaonMinus.hh" >> 115 #include "G4KaonZero.hh" >> 116 #include "G4AntiKaonZero.hh" >> 117 #include "G4KaonZeroLong.hh" >> 118 #include "G4KaonZeroShort.hh" 110 119 111 G4BaryonConstructor pBaryonConstructor; << 120 // Baryons 112 pBaryonConstructor.ConstructParticle(); << 121 #include "G4Proton.hh" >> 122 #include "G4AntiProton.hh" >> 123 #include "G4Neutron.hh" >> 124 #include "G4AntiNeutron.hh" >> 125 >> 126 // Nuclei >> 127 #include "G4Deuteron.hh" >> 128 #include "G4Triton.hh" >> 129 #include "G4Alpha.hh" >> 130 #include "G4GenericIon.hh" 113 131 114 G4IonConstructor pIonConstructor; << 132 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 115 pIonConstructor.ConstructParticle(); << 116 133 117 G4ShortLivedConstructor pShortLivedConstruct << 134 void PhysicsList::ConstructParticle() 118 pShortLivedConstructor.ConstructParticle(); << 135 { >> 136 // pseudo-particles >> 137 G4Geantino::GeantinoDefinition(); >> 138 G4ChargedGeantino::ChargedGeantinoDefinition(); >> 139 >> 140 // gamma >> 141 G4Gamma::GammaDefinition(); >> 142 >> 143 // optical photon >> 144 G4OpticalPhoton::OpticalPhotonDefinition(); >> 145 >> 146 // leptons >> 147 G4Electron::ElectronDefinition(); >> 148 G4Positron::PositronDefinition(); >> 149 G4MuonPlus::MuonPlusDefinition(); >> 150 G4MuonMinus::MuonMinusDefinition(); >> 151 >> 152 G4NeutrinoE::NeutrinoEDefinition(); >> 153 G4AntiNeutrinoE::AntiNeutrinoEDefinition(); >> 154 G4NeutrinoMu::NeutrinoMuDefinition(); >> 155 G4AntiNeutrinoMu::AntiNeutrinoMuDefinition(); >> 156 >> 157 // mesons >> 158 G4PionPlus::PionPlusDefinition(); >> 159 G4PionMinus::PionMinusDefinition(); >> 160 G4PionZero::PionZeroDefinition(); >> 161 G4Eta::EtaDefinition(); >> 162 G4EtaPrime::EtaPrimeDefinition(); >> 163 G4KaonPlus::KaonPlusDefinition(); >> 164 G4KaonMinus::KaonMinusDefinition(); >> 165 G4KaonZero::KaonZeroDefinition(); >> 166 G4AntiKaonZero::AntiKaonZeroDefinition(); >> 167 G4KaonZeroLong::KaonZeroLongDefinition(); >> 168 G4KaonZeroShort::KaonZeroShortDefinition(); >> 169 >> 170 // barions >> 171 G4Proton::ProtonDefinition(); >> 172 G4AntiProton::AntiProtonDefinition(); >> 173 G4Neutron::NeutronDefinition(); >> 174 G4AntiNeutron::AntiNeutronDefinition(); >> 175 >> 176 // ions >> 177 G4Deuteron::DeuteronDefinition(); >> 178 G4Triton::TritonDefinition(); >> 179 G4Alpha::AlphaDefinition(); >> 180 G4GenericIon::GenericIonDefinition(); 119 } 181 } 120 182 121 //....oooOO0OOooo........oooOO0OOooo........oo 183 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 122 184 >> 185 #include "G4EmProcessOptions.hh" >> 186 123 void PhysicsList::ConstructProcess() 187 void PhysicsList::ConstructProcess() 124 { 188 { 125 // Transportation 189 // Transportation 126 // 190 // 127 AddTransportation(); 191 AddTransportation(); 128 192 129 // Electromagnetic physics list 193 // Electromagnetic physics list 130 // 194 // 131 fEmPhysicsList->ConstructProcess(); 195 fEmPhysicsList->ConstructProcess(); 132 << 196 >> 197 // Em options >> 198 // >> 199 G4EmProcessOptions emOptions; >> 200 emOptions.SetBuildCSDARange(true); >> 201 emOptions.SetDEDXBinningForCSDARange(10*10); >> 202 133 // Decay Process 203 // Decay Process 134 // 204 // 135 AddDecay(); 205 AddDecay(); 136 << 206 137 // Decay Process 207 // Decay Process 138 // 208 // 139 AddRadioactiveDecay(); << 209 AddRadioactiveDecay(); 140 210 141 // step limitation (as a full process) 211 // step limitation (as a full process) 142 // << 212 // 143 AddStepMax(); << 213 AddStepMax(); 144 << 145 // example of Get process << 146 auto process = GetProcess("RadioactiveDecay" << 147 if (process != nullptr) { << 148 G4cout << "\n GetProcess : " << process-> << 149 } << 150 } 214 } 151 215 152 //....oooOO0OOooo........oooOO0OOooo........oo 216 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 153 217 154 void PhysicsList::AddPhysicsList(const G4Strin 218 void PhysicsList::AddPhysicsList(const G4String& name) 155 { 219 { 156 if (verboseLevel > 0) { << 220 if (verboseLevel>1) { 157 G4cout << "PhysicsList::AddPhysicsList: <" 221 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl; 158 } 222 } 159 << 223 160 if (name == fEmName) return; 224 if (name == fEmName) return; 161 225 162 if (name == "local") { 226 if (name == "local") { >> 227 163 fEmName = name; 228 fEmName = name; 164 delete fEmPhysicsList; 229 delete fEmPhysicsList; 165 fEmPhysicsList = new PhysListEmStandard(na 230 fEmPhysicsList = new PhysListEmStandard(name); 166 } << 231 167 else if (name == "emstandard_opt0") { << 232 } else if (name == "emstandard_opt0") { >> 233 168 fEmName = name; 234 fEmName = name; 169 delete fEmPhysicsList; 235 delete fEmPhysicsList; 170 fEmPhysicsList = new G4EmStandardPhysics() 236 fEmPhysicsList = new G4EmStandardPhysics(); 171 } << 237 172 else if (name == "emstandard_opt1") { << 238 } else if (name == "emstandard_opt1") { >> 239 173 fEmName = name; 240 fEmName = name; 174 delete fEmPhysicsList; 241 delete fEmPhysicsList; 175 fEmPhysicsList = new G4EmStandardPhysics_o 242 fEmPhysicsList = new G4EmStandardPhysics_option1(); 176 } << 243 177 else if (name == "emstandard_opt2") { << 244 } else if (name == "emstandard_opt2") { >> 245 178 fEmName = name; 246 fEmName = name; 179 delete fEmPhysicsList; 247 delete fEmPhysicsList; 180 fEmPhysicsList = new G4EmStandardPhysics_o 248 fEmPhysicsList = new G4EmStandardPhysics_option2(); 181 } << 249 182 else if (name == "emstandard_opt3") { << 250 } else if (name == "emstandard_opt3") { >> 251 183 fEmName = name; 252 fEmName = name; 184 delete fEmPhysicsList; 253 delete fEmPhysicsList; 185 fEmPhysicsList = new G4EmStandardPhysics_o 254 fEmPhysicsList = new G4EmStandardPhysics_option3(); 186 } << 255 187 else if (name == "emstandard_opt4") { << 256 } else if (name == "emstandard_opt4") { >> 257 188 fEmName = name; 258 fEmName = name; 189 delete fEmPhysicsList; 259 delete fEmPhysicsList; 190 fEmPhysicsList = new G4EmStandardPhysics_o 260 fEmPhysicsList = new G4EmStandardPhysics_option4(); 191 } << 261 192 else if (name == "emstandardSS") { << 262 } else if (name == "standardSS") { 193 fEmName = name; << 263 194 delete fEmPhysicsList; << 195 fEmPhysicsList = new G4EmStandardPhysicsSS << 196 } << 197 else if (name == "emstandardGS") { << 198 fEmName = name; << 199 delete fEmPhysicsList; << 200 fEmPhysicsList = new G4EmStandardPhysicsGS << 201 } << 202 else if (name == "emstandardWVI") { << 203 fEmName = name; 264 fEmName = name; 204 delete fEmPhysicsList; 265 delete fEmPhysicsList; 205 fEmPhysicsList = new G4EmStandardPhysicsWV << 266 fEmPhysicsList = new PhysListEmStandardSS(name); 206 } << 267 207 else if (name == "emlivermore") { << 268 } else if (name == "emlivermore") { 208 fEmName = name; 269 fEmName = name; 209 delete fEmPhysicsList; 270 delete fEmPhysicsList; 210 fEmPhysicsList = new G4EmLivermorePhysics( 271 fEmPhysicsList = new G4EmLivermorePhysics(); 211 } << 272 212 else if (name == "empenelope") { << 273 } else if (name == "empenelope") { 213 fEmName = name; 274 fEmName = name; 214 delete fEmPhysicsList; 275 delete fEmPhysicsList; 215 fEmPhysicsList = new G4EmPenelopePhysics() 276 fEmPhysicsList = new G4EmPenelopePhysics(); 216 } << 277 217 else if (name == "emlowenergy") { << 278 } else { 218 fEmName = name; << 279 219 delete fEmPhysicsList; << 220 fEmPhysicsList = new G4EmLowEPPhysics(); << 221 } << 222 else { << 223 G4cout << "PhysicsList::AddPhysicsList: <" 280 G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" 224 << " is not defined" << G4endl; << 281 << " is not defined" >> 282 << G4endl; 225 } 283 } 226 << 227 // Em options << 228 // << 229 G4EmParameters::Instance()->SetBuildCSDARang << 230 G4EmParameters::Instance()->SetGeneralProces << 231 } 284 } 232 << 233 //....oooOO0OOooo........oooOO0OOooo........oo 285 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 234 286 >> 287 #include "G4PhysicsListHelper.hh" >> 288 #include "G4Decay.hh" >> 289 235 void PhysicsList::AddDecay() 290 void PhysicsList::AddDecay() 236 { 291 { 237 G4PhysicsListHelper* ph = G4PhysicsListHelpe 292 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper(); 238 << 293 239 // Decay Process 294 // Decay Process 240 // 295 // 241 G4Decay* fDecayProcess = new G4Decay(); 296 G4Decay* fDecayProcess = new G4Decay(); 242 297 243 auto particleIterator = GetParticleIterator( << 298 theParticleIterator->reset(); 244 particleIterator->reset(); << 299 while( (*theParticleIterator)() ){ 245 while ((*particleIterator)()) { << 300 G4ParticleDefinition* particle = theParticleIterator->value(); 246 G4ParticleDefinition* particle = particleI << 301 if (fDecayProcess->IsApplicable(*particle)) 247 if (fDecayProcess->IsApplicable(*particle) << 302 ph->RegisterProcess(fDecayProcess, particle); 248 ph->RegisterProcess(fDecayProcess, parti << 249 } 303 } 250 } 304 } 251 305 252 //....oooOO0OOooo........oooOO0OOooo........oo 306 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 253 307 >> 308 #include "G4PhysicsListHelper.hh" >> 309 #include "G4RadioactiveDecay.hh" >> 310 254 void PhysicsList::AddRadioactiveDecay() 311 void PhysicsList::AddRadioactiveDecay() 255 { << 312 { 256 G4RadioactiveDecay* radioactiveDecay = new G 313 G4RadioactiveDecay* radioactiveDecay = new G4RadioactiveDecay(); >> 314 radioactiveDecay->SetHLThreshold(-1.*s); >> 315 radioactiveDecay->SetICM(true); //Internal Conversion >> 316 radioactiveDecay->SetARM(true); //Atomic Rearangement >> 317 >> 318 G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper(); >> 319 ph->RegisterProcess(radioactiveDecay, G4GenericIon::GenericIon()); >> 320 } >> 321 >> 322 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 257 323 258 G4bool armFlag = false; << 324 #include "G4ProcessManager.hh" 259 radioactiveDecay->SetARM(armFlag); // Atomi << 325 #include "StepMax.hh" 260 326 261 // atomic de-excitation module << 327 void PhysicsList::AddStepMax() 262 if (armFlag) { << 328 { 263 G4EmParameters::Instance()->SetAuger(true) << 329 // Step limitation seen as a process 264 G4EmParameters::Instance()->SetDeexcitatio << 330 StepMax* stepMaxProcess = new StepMax(); >> 331 >> 332 theParticleIterator->reset(); >> 333 while ((*theParticleIterator)()){ >> 334 G4ParticleDefinition* particle = theParticleIterator->value(); >> 335 G4ProcessManager* pmanager = particle->GetProcessManager(); >> 336 >> 337 if (stepMaxProcess->IsApplicable(*particle)) >> 338 { >> 339 pmanager ->AddDiscreteProcess(stepMaxProcess); >> 340 } 265 } 341 } >> 342 } 266 343 267 G4PhysicsListHelper* ph = G4PhysicsListHelpe << 344 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 268 ph->RegisterProcess(radioactiveDecay, G4Gene << 269 345 270 // mandatory for G4NuclideTable << 346 #include "G4Gamma.hh" 271 // << 347 #include "G4Electron.hh" 272 const G4double meanLife = 1 * picosecond, ha << 348 #include "G4Positron.hh" 273 G4NuclideTable::GetInstance()->SetThresholdO << 349 >> 350 void PhysicsList::SetCuts() >> 351 { >> 352 if (verboseLevel >0) { >> 353 G4cout << "PhysicsList::SetCuts:"; >> 354 G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl; >> 355 } >> 356 // fixe lower limit for cut >> 357 G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(10*eV, 1*GeV); >> 358 >> 359 // set cut values for gamma at first and for e- second and next for e+, >> 360 // because some processes for e+/e- need cut values for gamma >> 361 SetCutValue(fCutForGamma, "gamma"); >> 362 SetCutValue(fCutForElectron, "e-"); >> 363 SetCutValue(fCutForPositron, "e+"); >> 364 >> 365 if (verboseLevel>0) DumpCutValuesTable(); 274 } 366 } 275 367 276 //....oooOO0OOooo........oooOO0OOooo........oo 368 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 277 369 278 void PhysicsList::AddStepMax() << 370 void PhysicsList::SetCutForGamma(G4double cut) 279 { 371 { 280 // Step limitation seen as a process << 372 fCutForGamma = cut; 281 StepMax* stepMaxProcess = new StepMax(); << 373 SetParticleCuts(fCutForGamma, G4Gamma::Gamma()); >> 374 } 282 375 283 auto particleIterator = GetParticleIterator( << 376 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 284 particleIterator->reset(); << 285 while ((*particleIterator)()) { << 286 G4ParticleDefinition* particle = particleI << 287 G4ProcessManager* pmanager = particle->Get << 288 377 289 if (stepMaxProcess->IsApplicable(*particle << 378 void PhysicsList::SetCutForElectron(G4double cut) 290 pmanager->AddDiscreteProcess(stepMaxProc << 379 { 291 } << 380 fCutForElectron = cut; >> 381 SetParticleCuts(fCutForElectron, G4Electron::Electron()); 292 } 382 } 293 383 294 //....oooOO0OOooo........oooOO0OOooo........oo 384 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 295 385 >> 386 void PhysicsList::SetCutForPositron(G4double cut) >> 387 { >> 388 fCutForPositron = cut; >> 389 SetParticleCuts(fCutForPositron, G4Positron::Positron()); >> 390 } >> 391 >> 392 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... >> 393 >> 394 #include "G4Material.hh" >> 395 296 void PhysicsList::GetRange(G4double val) 396 void PhysicsList::GetRange(G4double val) 297 { 397 { 298 G4LogicalVolume* lBox = fDet->GetWorld()->Ge 398 G4LogicalVolume* lBox = fDet->GetWorld()->GetLogicalVolume(); >> 399 G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable(); 299 const G4MaterialCutsCouple* couple = lBox->G 400 const G4MaterialCutsCouple* couple = lBox->GetMaterialCutsCouple(); 300 const G4Material* currMat = lBox->GetMateria 401 const G4Material* currMat = lBox->GetMaterial(); 301 402 302 G4ParticleDefinition* part; 403 G4ParticleDefinition* part; 303 G4double cut; 404 G4double cut; 304 part = G4Electron::Electron(); << 405 part = particleTable->FindParticle("e-"); 305 cut = G4LossTableManager::Instance()->GetRan << 406 cut = G4LossTableManager::Instance()->GetRange(part,val,couple); 306 G4cout << "material : " << currMat->GetName( << 407 G4cout << "material : " << currMat->GetName() << G4endl; 307 G4cout << "particle : " << part->GetParticle << 408 G4cout << "particle : " << part->GetParticleName() << G4endl; 308 G4cout << "energy : " << G4BestUnit(val, " << 409 G4cout << "energy : " << G4BestUnit(val,"Energy") << G4endl; 309 G4cout << "range : " << G4BestUnit(cut, " << 410 G4cout << "range : " << G4BestUnit(cut,"Length") << G4endl; 310 } 411 } 311 412 312 //....oooOO0OOooo........oooOO0OOooo........oo 413 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 313 414 314 G4VProcess* PhysicsList::GetProcess(const G4St << 315 { << 316 G4ParticleDefinition* particle = G4GenericIo << 317 G4ProcessVector* procList = particle->GetPro << 318 G4int nbProc = particle->GetProcessManager() << 319 for (G4int k = 0; k < nbProc; k++) { << 320 G4VProcess* process = (*procList)[k]; << 321 if (process->GetProcessName() == processNa << 322 } << 323 return nullptr; << 324 } << 325 415 326 //....oooOO0OOooo........oooOO0OOooo........oo << 327 416