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

, generated on Tue Sep 26 2023.