1 #include <G4Version.hh>
5 #include <utl/ErrorLogger.h>
7 #include <G4UImanager.hh>
8 #include <G4ParticleDefinition.hh>
9 #include <G4ParticleTypes.hh>
10 #include <G4ParticleWithCuts.hh>
11 #include <G4ParticleTable.hh>
12 #include <G4ProcessManager.hh>
14 #if (G4VERSION_NUMBER >= 930)
15 # include <G4hMultipleScattering.hh>
16 # include <G4eMultipleScattering.hh>
17 # include <G4MuMultipleScattering.hh>
19 # include "G4MultipleScattering.hh"
23 #include <G4ComptonScattering.hh>
24 #include <G4GammaConversion.hh>
25 #include <G4PhotoElectricEffect.hh>
27 #include <G4eIonisation.hh>
28 #include <G4eBremsstrahlung.hh>
29 #include <G4eplusAnnihilation.hh>
31 #include <G4MuIonisation.hh>
32 #include <G4MuBremsstrahlung.hh>
33 #include <G4MuPairProduction.hh>
35 #include <G4hIonisation.hh>
37 #include <G4Cerenkov.hh>
39 #include <G4IonConstructor.hh>
40 #include <G4BaryonConstructor.hh>
41 #include <G4MesonConstructor.hh>
42 #include <G4LeptonConstructor.hh>
46 #include <G4OpAbsorption.hh>
47 #include <G4OpRayleigh.hh>
49 #if (G4VERSION_NUMBER >= 920)
50 # include "tls/DummyProcessAtRest.h"
60 G4VUserPhysicsList::SetVerboseLevel(
fVerbosity);
68 INFO(
"destructing physics list");
78 G4Gamma::GammaDefinition();
80 G4OpticalPhoton::OpticalPhotonDefinition();
82 G4LeptonConstructor::ConstructParticle();
83 G4MesonConstructor::ConstructParticle();
84 G4BaryonConstructor::ConstructParticle();
100 auto decayProcess =
new G4Decay();
102 auto& mumProcMan = *G4MuonMinus::MuonMinusDefinition()->GetProcessManager();
103 mumProcMan.AddDiscreteProcess(decayProcess);
104 mumProcMan.SetProcessOrdering(decayProcess, idxPostStep);
105 mumProcMan.SetProcessOrdering(decayProcess, idxAtRest);
107 auto& mupProcMan = *G4MuonPlus::MuonPlusDefinition()->GetProcessManager();
108 mupProcMan.AddDiscreteProcess(decayProcess);
109 mupProcMan.SetProcessOrdering(decayProcess, idxPostStep);
110 mupProcMan.SetProcessOrdering(decayProcess, idxAtRest);
112 #if (G4VERSION_NUMBER >= 920)
119 mumProcMan.AddProcess(dummyProcess);
120 mumProcMan.SetProcessOrdering(dummyProcess, idxAtRest);
121 mupProcMan.AddProcess(dummyProcess);
122 mupProcMan.SetProcessOrdering(dummyProcess, idxAtRest);
130 auto& procMan = *G4OpticalPhoton::OpticalPhotonDefinition()->GetProcessManager();
131 procMan.AddDiscreteProcess(
new G4OpAbsorption());
132 procMan.AddDiscreteProcess(
new G4OpRayleigh());
139 auto& partIt = *G4ParticleTable::GetParticleTable()->GetIterator();
140 for (partIt.reset(); partIt(); ) {
142 auto& procMan = *
particle.GetProcessManager();
143 const G4String& particleName =
particle.GetParticleName();
145 if (particleName ==
"gamma") {
146 procMan.AddDiscreteProcess(
new G4PhotoElectricEffect);
147 procMan.AddDiscreteProcess(
new G4ComptonScattering);
148 procMan.AddDiscreteProcess(
new G4GammaConversion);
149 }
else if (particleName ==
"e-") {
150 procMan.AddProcess(
new G4eMultipleScattering, -1, 1, 1);
151 procMan.AddProcess(
new G4eIonisation, -1, 2, 2);
152 procMan.AddProcess(
new G4eBremsstrahlung, -1, 3, 3);
153 }
else if (particleName ==
"e+") {
154 procMan.AddProcess(
new G4eMultipleScattering, -1, 1, 1);
155 procMan.AddProcess(
new G4eIonisation, -1, 2, 2);
156 procMan.AddProcess(
new G4eBremsstrahlung, -1, 3, 3);
157 procMan.AddProcess(
new G4eplusAnnihilation, 0, -1, 4);
158 }
else if (particleName ==
"mu+" || particleName ==
"mu-") {
159 procMan.AddProcess(
new G4MuMultipleScattering, -1, 1, 1);
160 procMan.AddProcess(
new G4MuIonisation, -1, 2, 2);
161 procMan.AddProcess(
new G4MuBremsstrahlung, -1, 3, 3);
162 procMan.AddProcess(
new G4MuPairProduction, -1, 4, 4);
163 }
else if (
particle.GetPDGCharge() &&
164 particle.GetParticleName() !=
"chargedgeantino") {
166 procMan.AddProcess(
new G4hMultipleScattering, -1, 1, 1);
167 procMan.AddProcess(
new G4hIonisation, -1, 2, 2);
173 const G4int maxNumPhotons = 3;
174 auto cerenkov =
new G4Cerenkov(
"StandardCerenkov");
175 cerenkov->SetTrackSecondariesFirst(
true);
176 cerenkov->SetMaxNumPhotonsPerStep(maxNumPhotons);
177 for (partIt.reset(); partIt(); ) {
179 auto& procMan = *
particle.GetProcessManager();
180 if (cerenkov->IsApplicable(
particle)) {
181 procMan.AddProcess(cerenkov);
182 procMan.SetProcessOrdering(cerenkov, idxPostStep);
193 G4cerr <<
"activating DummyProcessAtRest for mu+" << G4endl;
194 fUImanager->ApplyCommand(
"/process/activate DummyProcessAtRest mu+");
195 G4cerr <<
"activating DummyProcessAtRest for mu-" << G4endl;
196 fUImanager->ApplyCommand(
"/process/activate DummyProcessAtRest mu-");
205 G4cerr <<
"de-activating DummyProcessAtRest for mu+" << G4endl;
206 fUImanager->ApplyCommand(
"/process/inactivate DummyProcessAtRest mu+");
207 G4cerr <<
"de-activating DummyProcessAtRest for mu-" << G4endl;
208 fUImanager->ApplyCommand(
"/process/inactivate DummyProcessAtRest mu-");
virtual void ConstructProcess() override
Construct processes.
void ConstructEMProcesses()
#define INFO(message)
Macro for logging informational messages.
virtual bool InactivateCustomProcesses() override
void ConstructOpticalProcesses()
void ConstructDecayProcesses()
DefaultPhysicsList(const int verbosity=0)
virtual void ConstructParticle() override
Construct particles.
virtual bool ActivateCustomProcesses() override
struct particle_info particle[80]