G4StationPhysicsList.cc
Go to the documentation of this file.
1 #include "G4StationPhysicsList.h"
2 
3 #include <G4ParticleTypes.hh>
4 #include <G4Decay.hh>
5 #include <G4LeptonConstructor.hh>
6 #include <G4MesonConstructor.hh>
7 #include <G4BaryonConstructor.hh>
8 #include <G4ProcessManager.hh>
9 #include <G4PhotoElectricEffect.hh>
10 #include <G4ComptonScattering.hh>
11 #include <G4GammaConversion.hh>
12 #include <G4eMultipleScattering.hh>
13 #include <G4eIonisation.hh>
14 #include <G4eBremsstrahlung.hh>
15 #include <G4eplusAnnihilation.hh>
16 #include <G4MuMultipleScattering.hh>
17 #include <G4MuIonisation.hh>
18 #include <G4MuBremsstrahlung.hh>
19 #include <G4MuPairProduction.hh>
20 #include <G4MuonMinusCapture.hh>
21 #include <G4hMultipleScattering.hh>
22 #include <G4hIonisation.hh>
23 #include <G4OpAbsorption.hh>
24 #include <G4OpRayleigh.hh>
25 #include <G4OpBoundaryProcess.hh>
26 #include <G4OpWLS.hh>
27 #include <G4Scintillation.hh>
28 #include <G4Cerenkov.hh>
29 
31 #include "G4StationFastCerenkov.h"
32 #include "G4StationSimulator.h"
33 
34 #include <iostream>
35 
36 using namespace std;
37 
38 
39 namespace G4StationSimulatorOG {
40 
41  G4StationPhysicsList::G4StationPhysicsList(G4StationSimulator& sim, const bool fastCerenkov) :
42  G4VUserPhysicsList(),
43  fFastCerenkov(fastCerenkov),
44  fG4StationSimulator(sim)
45  { }
46 
47 
48  void
50  {
51  // pseudo-particle: useful for testing
52  G4Geantino::GeantinoDefinition();
53  G4ChargedGeantino::ChargedGeantinoDefinition();
54 
55  G4Gamma::GammaDefinition();
56 
57  G4OpticalPhoton::OpticalPhotonDefinition();
58 
59  G4LeptonConstructor::ConstructParticle();
60 
61  // hadrons
62  G4MesonConstructor::ConstructParticle();
63  G4BaryonConstructor::ConstructParticle();
64  }
65 
66 
67  void
69  {
70  G4VUserPhysicsList::AddTransportation();
71 
72  // muon decay
73  {
74  const auto decayProcess = new G4Decay;
75 
76  auto& mumManager = *G4MuonMinus::MuonMinusDefinition()->GetProcessManager();
77  mumManager.AddDiscreteProcess(decayProcess);
78  mumManager.SetProcessOrdering(decayProcess, idxPostStep);
79  mumManager.SetProcessOrdering(decayProcess, idxAtRest);
80 
81  auto& mupManager = *G4MuonPlus::MuonPlusDefinition()->GetProcessManager();
82  mupManager.AddDiscreteProcess(decayProcess);
83  mupManager.SetProcessOrdering(decayProcess, idxPostStep);
84  mupManager.SetProcessOrdering(decayProcess, idxAtRest);
85  }
86 
87  // EM processes
88 
89  auto& it = *G4ParticleTable::GetParticleTable()->GetIterator();
90  for (it.reset(); it(); ) {
91  const G4ParticleDefinition& particle = *it.value();
92  auto& pManager = *particle.GetProcessManager();
93 
94  if (particle == *G4Gamma::Gamma()) {
95 
96  pManager.AddDiscreteProcess(new G4PhotoElectricEffect);
97  pManager.AddDiscreteProcess(new G4ComptonScattering);
98  pManager.AddDiscreteProcess(new G4GammaConversion);
99 
100  } else if (particle == *G4Electron::Electron()) {
101 
102  pManager.AddProcess(new G4eMultipleScattering, -1, 1, 1);
103  pManager.AddProcess(new G4eIonisation, -1, 2, 2);
104  pManager.AddProcess(new G4eBremsstrahlung, -1, 3, 3);
105 
106  } else if (particle == *G4Positron::Positron()) {
107 
108  pManager.AddProcess(new G4eMultipleScattering, -1, 1, 1);
109  pManager.AddProcess(new G4eIonisation, -1, 2, 2);
110  pManager.AddProcess(new G4eBremsstrahlung, -1, 3, 3);
111  pManager.AddProcess(new G4eplusAnnihilation, 0, -1, 4);
112 
113  } else if (particle == *G4MuonPlus::MuonPlus() ||
114  particle == *G4MuonMinus::MuonMinus()) {
115 
116  pManager.AddProcess(new G4MuMultipleScattering, -1, 1, 1);
117  pManager.AddProcess(new G4MuIonisation, -1, 2, 2);
118  pManager.AddProcess(new G4MuBremsstrahlung, -1, 3, 3);
119  pManager.AddProcess(new G4MuPairProduction, -1, 4, 4);
120  if (particle == *G4MuonMinus::MuonMinus() &&
122  pManager.AddProcess(new G4MuonMinusCapture);
123 
124  } else if (particle.GetPDGCharge() &&
125  particle != *G4ChargedGeantino::ChargedGeantino()) {
126 
127  // all others charged particles except geantino
128  pManager.AddProcess(new G4hMultipleScattering, -1, 1, 1);
129  pManager.AddProcess(new G4hIonisation, -1, 2, 2);
130 
131  }
132  }
133 
134  // optical processes
135  {
136  const G4int maxNumPhotons = 3;
137 
138  const auto absorption = new G4OpAbsorption;
139 
140  const auto rayleighScattering = new G4OpRayleigh;
141 
142  const auto boundary = new G4OpBoundaryProcess;
143  boundary->SetVerboseLevel(0);
144 
145  const auto wlsProcess = new G4OpWLS;
146  wlsProcess->UseTimeProfile("exponential");
147 
148  // Scintillation process
149  const auto scintProcess = new G4Scintillation("Scintillation");
150  scintProcess->SetScintillationYieldFactor(1.);
151  scintProcess->SetTrackSecondariesFirst(true);
152  scintProcess->SetVerboseLevel(0);
153 
154  // Use Birks Correction in the Scintillation process
155  //const auto emSaturation = G4LossTableManager::Instance()->EmSaturation();
156  //scintProcess->AddSaturation(emSaturation);
157 
158  auto& it = *G4ParticleTable::GetParticleTable()->GetIterator();
159 
160  // Cerenkov process
161  if (!fFastCerenkov) {
162 
163  const auto cerenkov = new G4Cerenkov("Cerenkov");
164  // NOTE: At low energy, where dE/dX is large for the muon, it is best
165  // to set the following number to something low
166  cerenkov->SetTrackSecondariesFirst(true);
167  cerenkov->SetMaxNumPhotonsPerStep(maxNumPhotons);
168  cerenkov->SetVerboseLevel(0);
169 
170  for (it.reset(); it(); ) {
171  const G4ParticleDefinition& particle = *it.value();
172  auto& pManager = *particle.GetProcessManager();
173  if (cerenkov->IsApplicable(particle)) {
174  pManager.AddProcess(cerenkov);
175  pManager.SetProcessOrdering(cerenkov, idxPostStep);
176  }
177  }
178 
179  } else {
180 
181  const auto cerenkov = new G4StationFastCerenkov("Cerenkov");
182  // NOTE: At low energy, where dE/dX is large for the muon, it is best
183  // to set the following number to something low
184  cerenkov->SetTrackSecondariesFirst(true);
185  cerenkov->SetMaxNumPhotonsPerStep(maxNumPhotons);
186  G4Electron::Electron()->GetProcessManager()->AddContinuousProcess(cerenkov);
187  G4Positron::Positron()->GetProcessManager()->AddContinuousProcess(cerenkov);
188  G4MuonMinus::MuonMinusDefinition()->GetProcessManager()->AddContinuousProcess(cerenkov);
189  G4MuonPlus::MuonPlusDefinition()->GetProcessManager()->AddContinuousProcess(cerenkov);
190 
191  }
192 
193  // Scintillation & discrete optical processes
194  for (it.reset(); it(); ) {
195  const G4ParticleDefinition& particle = *it.value();
196  auto& pManager = *particle.GetProcessManager();
197  if (scintProcess->IsApplicable(particle)) {
198  pManager.AddProcess(scintProcess);
199  pManager.SetProcessOrderingToLast(scintProcess, idxAtRest);
200  pManager.SetProcessOrderingToLast(scintProcess, idxPostStep);
201  }
202  if (particle == *G4OpticalPhoton::OpticalPhoton()) {
203  pManager.AddDiscreteProcess(absorption);
204  pManager.AddDiscreteProcess(rayleighScattering);
205  pManager.AddDiscreteProcess(boundary);
206  pManager.AddDiscreteProcess(wlsProcess);
207  }
208  }
209  }
210  }
211 
212 
213  void
215  {
216  const double meterConv = CLHEP::meter / utl::meter;
217  this->defaultCutValue = fG4StationSimulator.fRangeCutDefault * meterConv;
218 
219  // set cut values for gamma at first and for e- second and next for e+,
220  // because some processes for e+/e- need cut values for gamma
221  const double cutForGamma = fG4StationSimulator.fRangeCutGamma * meterConv;
222  this->SetParticleCuts(cutForGamma, G4Gamma::Gamma());
223 
224  const double cutForElectron = fG4StationSimulator.fRangeCutElectron * meterConv;
225  this->SetParticleCuts(cutForElectron, G4Electron::Electron());
226 
227  const double cutForPositron = fG4StationSimulator.fRangeCutPositron * meterConv;
228  this->SetParticleCuts(cutForPositron, G4Positron::Positron());
229 
230  const double cutForMuonPlus = fG4StationSimulator.fRangeCutMuonPlus * meterConv;
231  this->SetParticleCuts(cutForMuonPlus, G4MuonPlus::MuonPlus());
232 
233  const double cutForMuonMinus = fG4StationSimulator.fRangeCutMuonMinus * meterConv;
234  this->SetParticleCuts(cutForMuonMinus, G4MuonMinus::MuonMinus());
235 
236  const double cutForOpticalPhotons = fG4StationSimulator.fRangeCutOpticalPhoton * meterConv;
237  this->SetParticleCuts(cutForOpticalPhotons, G4OpticalPhoton::OpticalPhoton());
238 
239  this->SetVerboseLevel(0);
240  this->DumpCutValuesTable(0);
241  }
242 
243 }
const double meter
Definition: GalacticUnits.h:29
constexpr double meter
Definition: AugerUnits.h:81
class that handles Geant4 SD Station simulation adopted from G4TankSimulator
struct particle_info particle[80]

, generated on Tue Sep 26 2023.