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 
38 #include "G4EmStandardPhysics.hh"
44 #include "G4EmStandardPhysicsGS.hh"
45 #include "G4EmStandardPhysicsSS.hh"
46 
47 #include "G4EmLivermorePhysics.hh"
48 #include "G4EmPenelopePhysics.hh"
49 #include "G4EmLowEPPhysics.hh"
50 
51 #include "G4EmDNAPhysics.hh"
55 
57 
58 #include "G4DecayPhysics.hh"
59 #include "StepMax.hh"
60 
61 #include "G4UnitsTable.hh"
62 #include "G4SystemOfUnits.hh"
63 
64 #include "G4ParticleDefinition.hh"
65 #include "G4ProcessManager.hh"
66 
67 // particles
68 
69 #include "G4BosonConstructor.hh"
70 #include "G4LeptonConstructor.hh"
71 #include "G4MesonConstructor.hh"
72 #include "G4BosonConstructor.hh"
73 #include "G4BaryonConstructor.hh"
74 #include "G4IonConstructor.hh"
77 
78 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
79 
81  fHadPhysicsList(nullptr)
82 {
83  fMessenger = new PhysicsListMessenger(this);
84  SetVerboseLevel(1);
85 
86  // EM physics
87  fEmName = G4String("emstandard_opt4");
89 
90  // Decay physics
92 
94 }
95 
96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
97 
99 {
100  delete fEmPhysicsList;
101  delete fMessenger;
102 }
103 
104 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
105 
107 {
108  G4BosonConstructor pBosonConstructor;
109  pBosonConstructor.ConstructParticle();
110 
111  G4LeptonConstructor pLeptonConstructor;
112  pLeptonConstructor.ConstructParticle();
113 
114  G4MesonConstructor pMesonConstructor;
115  pMesonConstructor.ConstructParticle();
116 
117  G4BaryonConstructor pBaryonConstructor;
118  pBaryonConstructor.ConstructParticle();
119 
120  G4IonConstructor pIonConstructor;
121  pIonConstructor.ConstructParticle();
122 
123  G4ShortLivedConstructor sLivedConstructor;
124  sLivedConstructor.ConstructParticle();
125 
126  // Geant4-DNA
127 
128  G4DNAGenericIonsManager* genericIonsManager;
129  genericIonsManager=G4DNAGenericIonsManager::Instance();
130  genericIonsManager->GetIon("alpha++");
131  genericIonsManager->GetIon("alpha+");
132  genericIonsManager->GetIon("helium");
133  genericIonsManager->GetIon("hydrogen");
134 }
135 
136 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
137 
139 {
144  AddStepMax();
145 }
146 
147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
148 
150 {
151  // Step limitation seen as a process
152  StepMax* stepMaxProcess = new StepMax(fMessenger);
153 
155  particleIterator->reset();
156  while ((*particleIterator)()){
158  G4ProcessManager* pmanager = particle->GetProcessManager();
159 
160  if (stepMaxProcess->IsApplicable(*particle))
161  {
162  pmanager ->AddDiscreteProcess(stepMaxProcess);
163  }
164  }
165 }
166 
167 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
168 
170 {
171  if (verboseLevel>-1) {
172  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
173  }
174 
175  if (name == fEmName) return;
176 
177  if (name == "local") {
178 
179  fEmName = name;
180  delete fEmPhysicsList;
182 
183  } else if (name == "emstandard_opt0") {
184 
185  fEmName = name;
186  delete fEmPhysicsList;
188 
189  } else if (name == "emstandard_opt1") {
190 
191  fEmName = name;
192  delete fEmPhysicsList;
194 
195  } else if (name == "emstandard_opt2") {
196 
197  fEmName = name;
198  delete fEmPhysicsList;
200 
201  } else if (name == "emstandard_opt3") {
202 
203  fEmName = name;
204  delete fEmPhysicsList;
206 
207  } else if (name == "emstandard_opt4") {
208 
209  fEmName = name;
210  delete fEmPhysicsList;
212 
213  } else if (name == "emstandardSS") {
214 
215  fEmName = name;
216  delete fEmPhysicsList;
218 
219  } else if (name == "emstandardWVI") {
220 
221  fEmName = name;
222  delete fEmPhysicsList;
224 
225  } else if (name == "emstandardGS") {
226 
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 == "emlivermore") {
242  fEmName = name;
243  delete fEmPhysicsList;
245 
246  } else if (name == "dna") {
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_opt4") {
257  fEmName = name;
258  delete fEmPhysicsList;
260 
261  } else if (name == "dna_opt6") {
262  fEmName = name;
263  delete fEmPhysicsList;
265 
266  } else if (name == "had_elastic" && !fHadPhysicsList) {
268 
269  } else {
270 
271  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
272  << " is not defined"
273  << G4endl;
274  }
275 }
276 
277 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......