#include "PhysicList.hh" #include "PhysicListMessenger.hh" #include "StepMax.hh" #include "G4SystemOfUnits.hh" #include "G4LossTableManager.hh" #include "G4EmParameters.hh" #include "G4ProcessManager.hh" #include "G4UnitsTable.hh" #include "G4ParticleDefinition.hh" //#include "PhysListEmStandard.hh" #include "G4EmStandardPhysics.hh" #include "G4EmStandardPhysics_option1.hh" #include "G4EmStandardPhysics_option2.hh" #include "G4EmStandardPhysics_option3.hh" //#include "XrayFluoPhysListEmStandardFLUO.hh" #include "G4EmLivermorePhysics.hh" #include "G4EmPenelopePhysics.hh" //#include "G4UAtomicDeexcitation.hh" #include "G4eplusAnnihilation.hh" #include "G4Decay.hh" // Bosons #include "G4ChargedGeantino.hh" #include "G4Geantino.hh" #include "G4Gamma.hh" #include "G4OpticalPhoton.hh" // leptons #include "G4MuonPlus.hh" #include "G4MuonMinus.hh" #include "G4NeutrinoMu.hh" #include "G4AntiNeutrinoMu.hh" #include "G4Electron.hh" #include "G4Positron.hh" #include "G4NeutrinoE.hh" #include "G4AntiNeutrinoE.hh" // Hadrons #include "G4Proton.hh" #include "G4MesonConstructor.hh" #include "G4BaryonConstructor.hh" #include "G4IonConstructor.hh" PhysicList::PhysicList() : G4VModularPhysicsList() { pMessenger = new PhysicListMessenger(this); defaultCutValue = 1.*mm; cutForGamma = defaultCutValue; cutForElectron = defaultCutValue; cutForPositron = defaultCutValue; cutForProton = defaultCutValue; SetCutValue(cutForGamma, "gamma"); SetCutValue(cutForElectron, "e-"); SetCutValue(cutForPositron, "e+"); DumpCutValuesTable(); SetVerboseLevel(1); emName = G4String("emlivermore"); emPhysicsList = new G4EmLivermorePhysics; } PhysicList::~PhysicList() { delete emPhysicsList; delete pMessenger; } void PhysicList::ConstructParticle() { // pseudo-particles G4Geantino::GeantinoDefinition(); G4ChargedGeantino::ChargedGeantinoDefinition(); // gamma G4Gamma::GammaDefinition(); // leptons G4Electron::ElectronDefinition(); G4Positron::PositronDefinition(); G4MuonPlus::MuonPlusDefinition(); G4MuonMinus::MuonMinusDefinition(); G4NeutrinoE::NeutrinoEDefinition(); G4AntiNeutrinoE::AntiNeutrinoEDefinition(); G4NeutrinoMu::NeutrinoMuDefinition(); G4AntiNeutrinoMu::AntiNeutrinoMuDefinition(); // mesons G4MesonConstructor mConstructor; mConstructor.ConstructParticle(); // barions G4BaryonConstructor bConstructor; bConstructor.ConstructParticle(); // ions G4IonConstructor iConstructor; iConstructor.ConstructParticle(); } void PhysicList::ConstructProcess() { AddTransportation(); emPhysicsList->ConstructProcess(); AddDecay(); AddStepMax(); // EM options G4EmParameters* param = G4EmParameters::Instance(); param->SetFluo(true); param->SetAuger(true); param->SetPixe(true); } void PhysicList::AddDecay() { G4Decay* fDecayProcess = new G4Decay(); auto particleIterator = GetParticleIterator(); while((*particleIterator)()) { G4ParticleDefinition* particle = particleIterator->value(); G4ProcessManager* pmanager = particle->GetProcessManager(); if(fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) { pmanager ->AddProcess(fDecayProcess); // set ordering for PostStepDoIt and AtRestDoIt pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep); pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest); } } } void PhysicList::AddStepMax() { StepMax* stepMaxProcess = new StepMax(); auto particleIterator = GetParticleIterator(); particleIterator->reset(); while ((*particleIterator)()) { G4ParticleDefinition* particle = particleIterator->value(); G4ProcessManager* pmanager = particle->GetProcessManager(); if(stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived()) { pmanager ->AddDiscreteProcess(stepMaxProcess); } } } void PhysicList::AddPhysicsList(const G4String& name) { if (name == emName) return; if (name == "emlivermore") { emName = name; delete emPhysicsList; emPhysicsList = new G4EmLivermorePhysics; } else if (name == "emstandard") { emName = name; delete emPhysicsList; emPhysicsList = new G4EmStandardPhysics(); } else if (name == "emstandard_opt1") { emName = name; delete emPhysicsList; emPhysicsList = new G4EmStandardPhysics_option1(); } else if (name == "emstandard_opt2") { emName = name; delete emPhysicsList; emPhysicsList = new G4EmStandardPhysics_option2(); } else if (name == "emstandard_opt3") { emName = name; delete emPhysicsList; emPhysicsList = new G4EmStandardPhysics_option3(); } else if (name == "empenelope") { emName = name; delete emPhysicsList; emPhysicsList = new G4EmPenelopePhysics(); } else { G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << " is not defined" << G4endl; } } void PhysicList::SetCutForGamma(G4double cut) { cutForGamma = cut; SetParticleCuts(cutForGamma, G4Gamma::Gamma()); } void PhysicList::SetCutForElectron(G4double cut) { cutForElectron = cut; SetParticleCuts(cutForElectron, G4Electron::Electron()); } void PhysicList::SetCutForPositron(G4double cut) { cutForPositron = cut; SetParticleCuts(cutForPositron, G4Positron::Positron()); } void PhysicList::SetCutForProton(G4double cut) { cutForProton = cut; SetParticleCuts(cutForProton, G4Proton::Proton()); } // void PhysicList::SetFluorescence(G4bool value) // { // G4VAtomDeexcitation* de = G4LossTableManager::Instance()->AtomDeexcitation(); // if(de) { de->SetFluo(value); } // } // void PhysicList::SetPIXE(G4bool value) // { // G4VAtomDeexcitation* de = G4LossTableManager::Instance()->AtomDeexcitation(); // if(de) { de->SetPIXE(value); } // }