ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PhysicsList.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file PhysicsList.cc
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
29 
30 #include "PhysicsList.hh"
31 #include "PhysicsListMessenger.hh"
32 
33 #include "G4EmStandardPhysics.hh"
38 #include "G4EmStandardPhysicsSS.hh"
40 #include "G4EmStandardPhysicsGS.hh"
41 #include "G4EmLivermorePhysics.hh"
42 #include "G4EmPenelopePhysics.hh"
43 #include "G4EmLowEPPhysics.hh"
44 
45 #include "G4LossTableManager.hh"
46 #include "G4UnitsTable.hh"
47 
48 #include "G4ParticleDefinition.hh"
49 #include "G4ProcessManager.hh"
50 
51 // Bosons
52 #include "G4ChargedGeantino.hh"
53 #include "G4Geantino.hh"
54 #include "G4Gamma.hh"
55 #include "G4OpticalPhoton.hh"
56 
57 // leptons
58 #include "G4MuonPlus.hh"
59 #include "G4MuonMinus.hh"
60 #include "G4NeutrinoMu.hh"
61 #include "G4AntiNeutrinoMu.hh"
62 
63 #include "G4Electron.hh"
64 #include "G4Positron.hh"
65 #include "G4NeutrinoE.hh"
66 #include "G4AntiNeutrinoE.hh"
67 
68 // Hadrons
69 #include "G4MesonConstructor.hh"
70 #include "G4BaryonConstructor.hh"
71 #include "G4IonConstructor.hh"
72 #include "G4GenericIon.hh"
73 
74 #include "G4SystemOfUnits.hh"
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77 
79 : G4VModularPhysicsList(), fMessenger(0), fEmPhysicsList(0)
80 {
81  fMessenger = new PhysicsListMessenger(this);
82 
83  // EM physics
84  fEmName = G4String("emstandard_opt4");
86  if (verboseLevel>-1) {
87  G4cout << "PhysicsList::Constructor with default list: <"
88  << fEmName << ">" << G4endl;
89  }
90 
92  SetVerboseLevel(1);
93 }
94 
95 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
96 
98 {
99  delete fEmPhysicsList;
100  delete fMessenger;
101 }
102 
103 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
104 
106 {
107  // pseudo-particles
110 
111  // gamma
113 
114  // optical photon
116 
117  // leptons
122 
127 
128  // mesons
129  G4MesonConstructor mConstructor;
130  mConstructor.ConstructParticle();
131 
132  // barions
133  G4BaryonConstructor bConstructor;
134  bConstructor.ConstructParticle();
135 
136  // ions
137  G4IonConstructor iConstructor;
138  iConstructor.ConstructParticle();
139 
140  // Required by MT even if ion physics not used
142 }
143 
144 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
145 
147 {
150  AddDecay();
151  AddStepMax();
152 }
153 
154 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
155 
156 #include "G4Decay.hh"
157 
159 {
160  // Add Decay Process
161 
162  G4Decay* fDecayProcess = new G4Decay();
163 
165  particleIterator->reset();
166  while( (*particleIterator)() ){
168  G4ProcessManager* pmanager = particle->GetProcessManager();
169 
170  if (fDecayProcess->IsApplicable(*particle) &&
171  !particle->IsShortLived()) {
172 
173  pmanager ->AddProcess(fDecayProcess);
174 
175  // set ordering for PostStepDoIt and AtRestDoIt
176  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
177  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
178 
179  }
180  }
181 }
182 
183 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
184 
185 #include "StepMax.hh"
186 
188 {
189  // Step limitation seen as a process
190  StepMax* stepMaxProcess = new StepMax();
191 
193  particleIterator->reset();
194  while ((*particleIterator)()){
195  G4ParticleDefinition* particle = particleIterator->value();
196  G4ProcessManager* pmanager = particle->GetProcessManager();
197 
198  if (stepMaxProcess->IsApplicable(*particle))
199  {
200  pmanager ->AddDiscreteProcess(stepMaxProcess);
201  }
202  }
203 }
204 
205 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
206 
208 {
209  if (verboseLevel>-1) {
210  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
211  }
212 
213  if (name == fEmName) return;
214 
215  if (name == "emstandard_opt0") {
216 
217  fEmName = name;
218  delete fEmPhysicsList;
220 
221  } else if (name == "emstandard_opt1") {
222 
223  fEmName = name;
224  delete fEmPhysicsList;
226 
227  } else if (name == "emstandard_opt2") {
228 
229  fEmName = name;
230  delete fEmPhysicsList;
232 
233  } else if (name == "emstandard_opt3") {
234 
235  fEmName = name;
236  delete fEmPhysicsList;
238 
239  } else if (name == "emstandard_opt4") {
240 
241  fEmName = name;
242  delete fEmPhysicsList;
244 
245  } else if (name == "emlowenergy") {
246  fEmName = name;
247  delete fEmPhysicsList;
249 
250  } else if (name == "emstandardSS") {
251  fEmName = name;
252  delete fEmPhysicsList;
254 
255  } else if (name == "emstandardWVI") {
256  fEmName = name;
257  delete fEmPhysicsList;
259 
260  } else if (name == "emstandardGS") {
261  fEmName = name;
262  delete fEmPhysicsList;
264 
265  } else if (name == "emlivermore") {
266  fEmName = name;
267  delete fEmPhysicsList;
269 
270  } else if (name == "empenelope") {
271  fEmName = name;
272  delete fEmPhysicsList;
274 
275  } else {
276 
277  G4ExceptionDescription description;
278  description
279  << " "
280  << "PhysicsList::AddPhysicsList: <" << name << "> is not defined";
281  G4Exception("PhysicsList::AddPhysicsList",
282  "electronScattering2_F001", FatalException, description);
283  }
284 }
285 
286 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......