G4XTankPhysicsList.cc
Go to the documentation of this file.
1 #include "G4XTankPhysicsList.h"
2 
3 #include <G4ParticleDefinition.hh>
4 #include <G4ParticleTypes.hh>
5 #include <G4ParticleWithCuts.hh>
6 #include <G4ParticleTable.hh>
7 #include <G4Material.hh>
8 #include <G4MaterialTable.hh>
9 #include <G4ProcessManager.hh>
10 #include <G4ProcessVector.hh>
11 #include <G4MuonMinusCaptureAtRest.hh>
12 #include <G4IonConstructor.hh>
13 #include <G4ComptonScattering.hh>
14 #include <G4GammaConversion.hh>
15 #include <G4PhotoElectricEffect.hh>
16 #include <G4Version.hh>
17 
18 #if (G4VERSION_NUMBER>=930)
19 #include "G4eMultipleScattering.hh"
20 #include "G4MuMultipleScattering.hh"
21 #include "G4hMultipleScattering.hh"
22 #else
23 #include "G4MultipleScattering.hh"
24 #endif
25 
26 #include <G4Decay.hh>
27 #include <G4eIonisation.hh>
28 #include <G4eBremsstrahlung.hh>
29 #include <G4eplusAnnihilation.hh>
30 #include <G4MuIonisation.hh>
31 #include <G4MuBremsstrahlung.hh>
32 #include <G4MuPairProduction.hh>
33 #include <G4hIonisation.hh>
34 #include <G4Cerenkov.hh>
35 #include <G4OpAbsorption.hh>
36 #include <G4OpRayleigh.hh>
37 //#include <G4OpBoundaryProcess.hh>
38 
39 #include <G4BaryonConstructor.hh>
40 #include <G4MesonConstructor.hh>
41 #include <G4LeptonConstructor.hh>
42 
44 
45 #include "G4XTankFastCerenkov.h"
46 #include "G4XTankSimulator.h"
47 
48 #include <iostream>
49 
50 using namespace std;
51 using namespace G4XTankSimulatorAG;
52 
53 
54 G4XTankPhysicsList::G4XTankPhysicsList(const bool fastCerenkov) :
55  G4VUserPhysicsList(),
56  fFastCerenkov(fastCerenkov)
57 {
58 }
59 
60 
61 void
63 {
68 }
69 
70 
71 void
73 {
74  // pseudo-particle: useful for testing
75  G4Geantino::GeantinoDefinition();
76 
77  // gamma
78  G4Gamma::GammaDefinition();
79 
80  // optical photon
81  G4OpticalPhoton::OpticalPhotonDefinition();
82 }
83 
84 
85 void
87 {
88  G4LeptonConstructor::ConstructParticle();
89 }
90 
91 
92 void
94 {
95  G4MesonConstructor::ConstructParticle();
96 }
97 
98 
99 void
101 {
102  G4BaryonConstructor::ConstructParticle();
103 }
104 
105 
106 void
108 {
109  AddTransportation();
111  ConstructEM();
112  ConstructOp();
113 }
114 
115 
116 void
118 {
119  G4Decay* const decayProcess = new G4Decay();
120 
121  G4ProcessManager& mumManager =
122  *G4MuonMinus::MuonMinusDefinition()->GetProcessManager();
123  mumManager.AddDiscreteProcess(decayProcess);
124  mumManager.SetProcessOrdering(decayProcess, idxPostStep);
125  mumManager.SetProcessOrdering(decayProcess, idxAtRest);
126 
127  G4ProcessManager& mupManager =
128  *G4MuonPlus::MuonPlusDefinition()->GetProcessManager();
129  mupManager.AddDiscreteProcess(decayProcess);
130  mupManager.SetProcessOrdering(decayProcess, idxPostStep);
131  mupManager.SetProcessOrdering(decayProcess, idxAtRest);
132 }
133 
134 
135 void
137 {
138  theParticleIterator->reset();
139  while ((*theParticleIterator)()) {
140  const G4ParticleDefinition& particle = *theParticleIterator->value();
141  G4ProcessManager& pManager = *particle.GetProcessManager();
142  const G4String& particleName = particle.GetParticleName();
143 
144  if (particleName == "gamma") {
145  // gamma
146  pManager.AddDiscreteProcess(new G4PhotoElectricEffect);
147  pManager.AddDiscreteProcess(new G4ComptonScattering);
148  pManager.AddDiscreteProcess(new G4GammaConversion);
149 
150  } else if (particleName == "e-") {
151  //electron
152 #if (G4VERSION_NUMBER>=930)
153  pManager.AddProcess(new G4eMultipleScattering, -1, 1, 1);
154 #else
155  pManager.AddProcess(new G4MultipleScattering, -1, 1, 1);
156 #endif
157  pManager.AddProcess(new G4eIonisation, -1, 2, 2);
158  pManager.AddProcess(new G4eBremsstrahlung, -1, 3, 3);
159 
160  } else if (particleName == "e+") {
161  //positron
162 #if (G4VERSION_NUMBER>=930)
163  pManager.AddProcess(new G4eMultipleScattering, -1, 1, 1);
164 #else
165  pManager.AddProcess(new G4MultipleScattering, -1, 1, 1);
166 #endif
167  pManager.AddProcess(new G4eIonisation, -1, 2, 2);
168  pManager.AddProcess(new G4eBremsstrahlung, -1, 3, 3);
169  pManager.AddProcess(new G4eplusAnnihilation, 0, -1, 4);
170 
171  } else if (particleName == "mu+" ||
172  particleName == "mu-") {
173  //muon
174 #if (G4VERSION_NUMBER>=930)
175  pManager.AddProcess(new G4MuMultipleScattering, -1, 1, 1);
176 #else
177  pManager.AddProcess(new G4MultipleScattering, -1, 1, 1);
178 #endif
179  pManager.AddProcess(new G4MuIonisation, -1, 2, 2);
180  pManager.AddProcess(new G4MuBremsstrahlung, -1, 3, 3);
181  pManager.AddProcess(new G4MuPairProduction, -1, 4, 4);
182  if (particleName == "mu-" &&
184  pManager.AddProcess(new G4MuonMinusCaptureAtRest);
185  }
186 
187  } else if (particle.GetPDGCharge() &&
188  particle.GetParticleName() != "chargedgeantino") {
189  // all others charged particles except geantino
190 #if (G4VERSION_NUMBER>=930)
191  pManager.AddProcess(new G4hMultipleScattering, -1, 1, 1);
192 #else
193  pManager.AddProcess(new G4MultipleScattering, -1, 1, 1);
194 #endif
195  pManager.AddProcess(new G4hIonisation, -1, 2, 2);
196  }
197  }
198 
199  if (!fFastCerenkov) {
200 
201  G4Cerenkov* const cerenkov = new G4Cerenkov("Cerenkov");
202  // NOTE: At low energy, where dE/dX is large for the muon, it is best
203  // to set the following number to something low
204  const G4int maxNumPhotons = 3;
205  cerenkov->SetTrackSecondariesFirst(true);
206  cerenkov->SetMaxNumPhotonsPerStep(maxNumPhotons);
207 
208  theParticleIterator->reset();
209  while ((*theParticleIterator)()) {
210  G4ParticleDefinition& particle = *theParticleIterator->value();
211  G4ProcessManager& pManager = *particle.GetProcessManager();
212  if (cerenkov->IsApplicable(particle)) {
213  pManager.AddProcess(cerenkov);
214  pManager.SetProcessOrdering(cerenkov, idxPostStep);
215  }
216  }
217 
218  } else {
219 
220  G4XTankFastCerenkov* const cerenkov = new G4XTankFastCerenkov("Cerenkov");
221  // NOTE: At low energy, where dE/dX is large for the muon, it is best
222  // to set the following number to something low
223  const G4int maxNumPhotons = 3;
224  cerenkov->SetTrackSecondariesFirst(true);
225  cerenkov->SetMaxNumPhotonsPerStep(maxNumPhotons);
226 
227  G4Electron::Electron()->GetProcessManager()->AddContinuousProcess(cerenkov);
228 
229  G4Positron::Positron()->GetProcessManager()->AddContinuousProcess(cerenkov);
230 
231  G4MuonMinus::MuonMinusDefinition()->GetProcessManager()->AddContinuousProcess(cerenkov);
232 
233  G4MuonPlus::MuonPlusDefinition()->GetProcessManager()->AddContinuousProcess(cerenkov);
234 
235  }
236 }
237 
238 
239 void
241 {
242  G4OpAbsorption* const absorption = new G4OpAbsorption();
243  G4OpRayleigh* const rayleighScattering = new G4OpRayleigh();
244  // G4OpBoundaryProcess *boundary = new G4OpBoundaryProcess();
245  G4XTankOpBoundaryProcess* const boundary = new G4XTankOpBoundaryProcess();
246 
247  // ATTENTION : Isn't this set in the DetectorConstruction as well?
248  const G4OpticalSurfaceModel model = unified;
249  boundary->SetModel(model);
250 
251  G4ProcessManager& pManager =
252  *G4OpticalPhoton::OpticalPhotonDefinition()->GetProcessManager();
253  pManager.AddDiscreteProcess(absorption);
254  pManager.AddDiscreteProcess(rayleighScattering);
255  pManager.AddDiscreteProcess(boundary);
256 }
257 
258 
259 void
261 {
262  defaultCutValue = 0.1*mm;
263 
264  const double cutForGamma = 30*mm;
265  const double cutForElectron = 0.5*mm;
266  const double cutForPositron = 1e-5*mm;
267 
268  // set cut values for gamma at first and for e- second and next for e+,
269  // because some processes for e+/e- need cut values for gamma
270  SetCutValue(cutForGamma, "gamma");
271  SetCutValue(cutForElectron, "e-");
272  SetCutValue(cutForPositron, "e+");
273 
274  DumpCutValuesTable();
275 }
constexpr double mm
Definition: AugerUnits.h:113
struct particle_info particle[80]

, generated on Tue Sep 26 2023.