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 "PhysListEm5DStandard.hh"
38 
39 #include "G4EmStandardPhysics.hh"
45 #include "G4EmStandardPhysicsGS.hh"
46 #include "G4EmStandardPhysicsSS.hh"
47 
48 #include "G4EmLivermorePhysics.hh"
49 #include "G4EmPenelopePhysics.hh"
50 #include "G4EmLowEPPhysics.hh"
51 
52 #include "G4EmDNAPhysics.hh"
56 
58 
59 #include "G4DecayPhysics.hh"
60 #include "StepMax.hh"
61 
62 #include "G4UnitsTable.hh"
63 #include "G4SystemOfUnits.hh"
64 
65 #include "G4ParticleDefinition.hh"
66 #include "G4ProcessManager.hh"
67 
68 // particles
69 
70 #include "G4BosonConstructor.hh"
71 #include "G4LeptonConstructor.hh"
72 #include "G4MesonConstructor.hh"
73 #include "G4BosonConstructor.hh"
74 #include "G4BaryonConstructor.hh"
75 #include "G4IonConstructor.hh"
78 
79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
80 
82  fHadPhysicsList(nullptr)
83 {
84  fMessenger = new PhysicsListMessenger(this);
85  SetVerboseLevel(1);
86 
87  // EM physics
88  fEmName = G4String("emstandard_opt4");
90 
91  // Decay physics
93 
95 }
96 
97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
98 
100 {
101  delete fEmPhysicsList;
102  delete fMessenger;
103 }
104 
105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
106 
108 {
109  G4BosonConstructor pBosonConstructor;
110  pBosonConstructor.ConstructParticle();
111 
112  G4LeptonConstructor pLeptonConstructor;
113  pLeptonConstructor.ConstructParticle();
114 
115  G4MesonConstructor pMesonConstructor;
116  pMesonConstructor.ConstructParticle();
117 
118  G4BaryonConstructor pBaryonConstructor;
119  pBaryonConstructor.ConstructParticle();
120 
121  G4IonConstructor pIonConstructor;
122  pIonConstructor.ConstructParticle();
123 
124  G4ShortLivedConstructor sLivedConstructor;
125  sLivedConstructor.ConstructParticle();
126 
127  // Geant4-DNA
128 
129  G4DNAGenericIonsManager* genericIonsManager;
130  genericIonsManager=G4DNAGenericIonsManager::Instance();
131  genericIonsManager->GetIon("alpha++");
132  genericIonsManager->GetIon("alpha+");
133  genericIonsManager->GetIon("helium");
134  genericIonsManager->GetIon("hydrogen");
135 }
136 
137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
138 
140 {
145  AddStepMax();
146 }
147 
148 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
149 
151 {
152  // Step limitation seen as a process
153  StepMax* stepMaxProcess = new StepMax(fMessenger);
154 
156  particleIterator->reset();
157  while ((*particleIterator)()){
159  G4ProcessManager* pmanager = particle->GetProcessManager();
160 
161  if (stepMaxProcess->IsApplicable(*particle))
162  {
163  pmanager->AddDiscreteProcess(stepMaxProcess);
164  }
165  }
166 }
167 
168 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
169 
171 {
172  if (verboseLevel>1) {
173  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
174  }
175 
176  if (name == fEmName) return;
177 
178  if (name == "local") {
179 
180  fEmName = name;
181  delete fEmPhysicsList;
183 
184  } else if (name == "emstandard_opt0") {
185 
186  fEmName = name;
187  delete fEmPhysicsList;
189 
190  } else if (name == "emstandard_opt1") {
191 
192  fEmName = name;
193  delete fEmPhysicsList;
195 
196  } else if (name == "emstandard_opt2") {
197 
198  fEmName = name;
199  delete fEmPhysicsList;
201 
202  } else if (name == "emstandard_opt3") {
203 
204  fEmName = name;
205  delete fEmPhysicsList;
207 
208  } else if (name == "emstandard_opt4") {
209 
210  fEmName = name;
211  delete fEmPhysicsList;
213 
214  } else if (name == "emstandardSS") {
215 
216  fEmName = name;
217  delete fEmPhysicsList;
219 
220  } else if (name == "emstandard5D") {
221 
222  fEmName = name;
223  delete fEmPhysicsList;
225 
226  } else if (name == "emstandardWVI") {
227 
228  fEmName = name;
229  delete fEmPhysicsList;
231 
232  } else if (name == "emstandardGS") {
233 
234  fEmName = name;
235  delete fEmPhysicsList;
237 
238  } else if (name == "empenelope") {
239  fEmName = name;
240  delete fEmPhysicsList;
242 
243  } else if (name == "emlowenergy") {
244  fEmName = name;
245  delete fEmPhysicsList;
247 
248  } else if (name == "emlivermore") {
249  fEmName = name;
250  delete fEmPhysicsList;
252 
253  } else if (name == "dna") {
254  fEmName = name;
255  delete fEmPhysicsList;
257 
258  } else if (name == "dna_opt2") {
259  fEmName = name;
260  delete fEmPhysicsList;
262 
263  } else if (name == "dna_opt4") {
264  fEmName = name;
265  delete fEmPhysicsList;
267 
268  } else if (name == "dna_opt6") {
269  fEmName = name;
270  delete fEmPhysicsList;
272 
273  } else if (name == "had_elastic" && !fHadPhysicsList) {
275 
276  } else {
277 
278  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
279  << " is not defined"
280  << G4endl;
281  }
282 }
283 
284 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......