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 //
28 //
29 //
30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 
33 #include "PhysicsList.hh"
34 #include "PhysicsListMessenger.hh"
35 
36 #include "PhysListEmStandard.hh"
37 #include "PhysListEmStandardSS.hh"
38 #include "PhysListEmStandardGS.hh"
39 #include "PhysListEmStandardWVI.hh"
40 
41 #include "G4EmStandardPhysics.hh"
45 
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 
73 #include "G4SystemOfUnits.hh"
74 
75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
76 
78  fMessenger(0), fEmName("local"), fEmPhysicsList(0)
79 {
80  fMessenger = new PhysicsListMessenger(this);
81 
82  // EM physics
83  fEmName = G4String("local");
85 
87  SetVerboseLevel(1);
88 }
89 
90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
91 
93 {
94  delete fEmPhysicsList;
95  delete fMessenger;
96 }
97 
98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
99 
101 {
102 // pseudo-particles
105 
106 // gamma
108 
109 // optical photon
111 
112 // leptons
117 
122 
123 // mesons
124  G4MesonConstructor mConstructor;
125  mConstructor.ConstructParticle();
126 
127 // barions
128  G4BaryonConstructor bConstructor;
129  bConstructor.ConstructParticle();
130 
131 // ions
132  G4IonConstructor iConstructor;
133  iConstructor.ConstructParticle();
134 }
135 
136 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
137 
139 {
142  AddDecay();
143  AddStepMax();
144 }
145 
146 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
147 
148 #include "G4Decay.hh"
149 
151 {
152  // Add Decay Process
153 
154  G4Decay* fDecayProcess = new G4Decay();
155 
157  particleIterator->reset();
158  while( (*particleIterator)() ){
160  G4ProcessManager* pmanager = particle->GetProcessManager();
161 
162  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
163 
164  pmanager ->AddProcess(fDecayProcess);
165 
166  // set ordering for PostStepDoIt and AtRestDoIt
167  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
168  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
169 
170  }
171  }
172 }
173 
174 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
175 
176 #include "StepMax.hh"
177 
179 {
180  // Step limitation seen as a process
181  StepMax* stepMaxProcess = new StepMax();
182 
184  particleIterator->reset();
185  while ((*particleIterator)()){
186  G4ParticleDefinition* particle = particleIterator->value();
187  G4ProcessManager* pmanager = particle->GetProcessManager();
188 
189  if (stepMaxProcess->IsApplicable(*particle))
190  {
191  pmanager ->AddDiscreteProcess(stepMaxProcess);
192  }
193  }
194 }
195 
196 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
197 
199 {
200  if (verboseLevel>-1) {
201  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
202  }
203 
204  if (name == fEmName) return;
205 
206  if (name == "local") {
207 
208  fEmName = name;
209  delete fEmPhysicsList;
211 
212  } else if (name == "emstandard_opt0") {
213 
214  fEmName = name;
215  delete fEmPhysicsList;
217 
218  } else if (name == "emstandard_opt1") {
219 
220  fEmName = name;
221  delete fEmPhysicsList;
223 
224  } else if (name == "emstandard_opt2") {
225 
226  fEmName = name;
227  delete fEmPhysicsList;
229 
230  } else if (name == "emstandard_opt3") {
231 
232  fEmName = name;
233  delete fEmPhysicsList;
235 
236  } else if (name == "standardSS") {
237 
238  fEmName = name;
239  delete fEmPhysicsList;
241 
242  } else if (name == "standardGS") {
243 
244  fEmName = name;
245  delete fEmPhysicsList;
247 
248  } else if (name == "standardWVI") {
249 
250  fEmName = name;
251  delete fEmPhysicsList;
253 
254  } else {
255 
256  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
257  << " is not defined"
258  << G4endl;
259  }
260 }
261 
262 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......