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

, generated on Tue Sep 26 2023.