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 "PhysListEmStandardSSM.hh"
38 
39 #include "G4EmStandardPhysics.hh"
45 #include "G4EmStandardPhysicsGS.hh"
46 #include "G4EmStandardPhysicsSS.hh"
47 #include "G4EmLivermorePhysics.hh"
48 #include "G4EmPenelopePhysics.hh"
49 #include "G4EmLowEPPhysics.hh"
50 #include "G4EmDNAPhysics.hh"
58 
59 #include "G4LossTableManager.hh"
60 #include "G4UnitsTable.hh"
61 #include "G4SystemOfUnits.hh"
62 
63 // particles
64 
65 #include "G4BosonConstructor.hh"
66 #include "G4LeptonConstructor.hh"
67 #include "G4MesonConstructor.hh"
68 #include "G4BosonConstructor.hh"
69 #include "G4BaryonConstructor.hh"
70 #include "G4IonConstructor.hh"
73 
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77 
79 {
80  fMessenger = new PhysicsListMessenger(this);
81 
82  SetVerboseLevel(1);
83 
84  // EM physics
85  fEmPhysicsList = new PhysListEmStandard(fEmName = "local");
86 
87  // Em options
88  //
90 
92 }
93 
94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
95 
97 {
98  delete fMessenger;
99  delete fEmPhysicsList;
100 }
101 
102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
103 
105 {
106  G4BosonConstructor pBosonConstructor;
107  pBosonConstructor.ConstructParticle();
108 
109  G4LeptonConstructor pLeptonConstructor;
110  pLeptonConstructor.ConstructParticle();
111 
112  G4MesonConstructor pMesonConstructor;
113  pMesonConstructor.ConstructParticle();
114 
115  G4BaryonConstructor pBaryonConstructor;
116  pBaryonConstructor.ConstructParticle();
117 
118  G4IonConstructor pIonConstructor;
119  pIonConstructor.ConstructParticle();
120 
121  G4ShortLivedConstructor pShortLivedConstructor;
122  pShortLivedConstructor.ConstructParticle();
123 
124 // DNA
125  G4DNAGenericIonsManager* genericIonsManager;
126  genericIonsManager=G4DNAGenericIonsManager::Instance();
127  genericIonsManager->GetIon("alpha++");
128  genericIonsManager->GetIon("alpha+");
129  genericIonsManager->GetIon("helium");
130  genericIonsManager->GetIon("hydrogen");
131 }
132 
133 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
134 
135 #include "G4ProcessManager.hh"
136 
138 {
139  // transportation
140  //
142 
143  // electromagnetic physics list
144  //
146 
147  // decay process
148  //
149  AddDecay();
150 
151  // step limitation (as a full process)
152  //
153  AddStepMax();
154 }
155 
156 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
157 
159 {
160  if (verboseLevel>-1) {
161  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
162  }
163 
164  if (name == fEmName) return;
165 
166  if (name == "local") {
167 
168  fEmName = name;
169  delete fEmPhysicsList;
171 
172  } else if (name == "emstandard_opt0") {
173 
174  fEmName = name;
175  delete fEmPhysicsList;
177 
178  } else if (name == "emstandard_opt1") {
179 
180  fEmName = name;
181  delete fEmPhysicsList;
183 
184  } else if (name == "emstandard_opt2") {
185 
186  fEmName = name;
187  delete fEmPhysicsList;
189 
190  } else if (name == "emstandard_opt3") {
191 
192  fEmName = name;
193  delete fEmPhysicsList;
195 
196  } else if (name == "emstandard_opt4") {
197 
198  fEmName = name;
199  delete fEmPhysicsList;
201 
202  } else if (name == "emstandardSS") {
203 
204  fEmName = name;
205  delete fEmPhysicsList;
207 
208  } else if (name == "standardSSM") {
209 
210  fEmName = name;
211  delete fEmPhysicsList;
213 
214  } else if (name == "emstandardWVI") {
215 
216  fEmName = name;
217  delete fEmPhysicsList;
219 
220  } else if (name == "standardGS") {
221 
222  fEmName = name;
223  delete fEmPhysicsList;
225 
226  } else if (name == "emlivermore") {
227  fEmName = name;
228  delete fEmPhysicsList;
230 
231  } else if (name == "empenelope") {
232  fEmName = name;
233  delete fEmPhysicsList;
235 
236  } else if (name == "emlowenergy") {
237  fEmName = name;
238  delete fEmPhysicsList;
240 
241  } else if (name == "dna") {
242  fEmName = name;
243  delete fEmPhysicsList;
245 
246  } else if (name == "dna_opt1") {
247  fEmName = name;
248  delete fEmPhysicsList;
250 
251  } else if (name == "dna_opt2") {
252  fEmName = name;
253  delete fEmPhysicsList;
255 
256  } else if (name == "dna_opt3") {
257  fEmName = name;
258  delete fEmPhysicsList;
260 
261  } else if (name == "dna_opt4") {
262  fEmName = name;
263  delete fEmPhysicsList;
265 
266  } else if (name == "dna_opt5") {
267  fEmName = name;
268  delete fEmPhysicsList;
270 
271  } else if (name == "dna_opt6") {
272  fEmName = name;
273  delete fEmPhysicsList;
275 
276  } else if (name == "dna_opt7") {
277  fEmName = name;
278  delete fEmPhysicsList;
280 
281  } else {
282 
283  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
284  << " is not defined"
285  << G4endl;
286  }
288 }
289 
290 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
291 
292 #include "G4Decay.hh"
293 
295 {
296  // decay process
297  //
298  G4Decay* fDecayProcess = new G4Decay();
299 
301  particleIterator->reset();
302  while( (*particleIterator)() ){
304  G4ProcessManager* pmanager = particle->GetProcessManager();
305 
306  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
307 
308  pmanager ->AddProcess(fDecayProcess);
309 
310  // set ordering for PostStepDoIt and AtRestDoIt
311  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
312  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
313 
314  }
315  }
316 }
317 
318 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
319 
320 #include "StepMax.hh"
321 
323 {
324  // Step limitation seen as a process
325  fStepMaxProcess = new StepMax();
326 
328  particleIterator->reset();
329  while ((*particleIterator)()){
330  G4ParticleDefinition* particle = particleIterator->value();
331  G4ProcessManager* pmanager = particle->GetProcessManager();
332 
333  if (fStepMaxProcess->IsApplicable(*particle))
334  {
336  }
337  }
338 }
339 
340 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......