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 //---------------------------------------------------------------------------
31 //
32 // ClassName: PhysicsList
33 //
34 // Author: V.Ivanchenko 14.10.2002
35 //
36 // Modified:
37 // 17.11.06 Use components from physics_lists subdirectory (V.Ivanchenko)
38 // 24.10.12 Migrated to new stopping and ion physics (A.Ribon)
39 //
40 //----------------------------------------------------------------------------
41 //
42 
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 
46 #include "PhysicsList.hh"
47 #include "PhysicsListMessenger.hh"
48 
49 #include "PhysListEmStandard.hh"
50 #include "G4EmStandardPhysics.hh"
55 #include "G4EmLivermorePhysics.hh"
56 #include "G4EmPenelopePhysics.hh"
57 #include "G4EmLowEPPhysics.hh"
58 #include "G4EmStandardPhysicsGS.hh"
59 #include "G4EmStandardPhysicsSS.hh"
61 #include "G4DecayPhysics.hh"
63 #include "G4HadronInelasticQBBC.hh"
64 #include "G4IonPhysics.hh"
65 #include "G4EmExtraPhysics.hh"
66 #include "G4StoppingPhysics.hh"
67 
68 #include "G4RegionStore.hh"
69 #include "G4ProcessManager.hh"
70 #include "G4ParticleTypes.hh"
71 #include "G4ParticleTable.hh"
72 
73 #include "G4Gamma.hh"
74 #include "G4Electron.hh"
75 #include "G4Positron.hh"
76 #include "G4Proton.hh"
77 
78 #include "G4UnitsTable.hh"
79 #include "G4SystemOfUnits.hh"
80 #include "G4LossTableManager.hh"
81 #include "StepMax.hh"
82 
83 #include "G4EmProcessOptions.hh"
84 
85 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
86 
88  fEmPhysicsList(0),
89  fDecayPhysicsList(0),
90  fStepMaxProcess(0),
91  fMessenger(0)
92 {
95 
96  fMessenger = new PhysicsListMessenger(this);
97  fStepMaxProcess = new StepMax();
98 
99  // Initilise flags
100 
101  SetVerboseLevel(1);
102 
103  fHelIsRegisted = false;
104  fBicIsRegisted = false;
105  fGnucIsRegisted = false;
106  fStopIsRegisted = false;
107 
108  // EM physics
109  fEmName = G4String("emstandard");
111 
112  // Decay Physics is always defined
114 }
115 
116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
117 
119 {
120  delete fMessenger;
121  delete fDecayPhysicsList;
122  delete fEmPhysicsList;
123  delete fStepMaxProcess;
124  for(size_t i=0; i<fHadronPhys.size(); i++) {
125  delete fHadronPhys[i];
126  }
127 }
128 
129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
130 
132 {
134 }
135 
136 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
137 
139 {
143  for(size_t i=0; i<fHadronPhys.size(); ++i) {
144  fHadronPhys[i]->ConstructProcess();
145  }
146  AddStepMax();
147 }
148 
149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
150 
152 {
153  if (verboseLevel > 1)
154  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
155 
156  if (name == fEmName) return;
157 
158  if (name == "emstandard") {
159  fEmName = name;
160  delete fEmPhysicsList;
162  if (verboseLevel > 0)
163  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
164 
165  } else if (name == "emstandard_opt1") {
166  fEmName = name;
167  delete fEmPhysicsList;
169  if (verboseLevel > 0)
170  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
171 
172  } else if (name == "emstandard_opt2") {
173  fEmName = name;
174  delete fEmPhysicsList;
176  if (verboseLevel > 0)
177  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
178 
179  } else if (name == "emstandard_opt3") {
180  fEmName = name;
181  delete fEmPhysicsList;
183  if (verboseLevel > 0)
184  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
185 
186  } else if (name == "emstandard_opt4") {
187  fEmName = name;
188  delete fEmPhysicsList;
190  if (verboseLevel > 0)
191  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
192 
193  } else if (name == "emstandard_local") {
194  fEmName = name;
195  delete fEmPhysicsList;
197  if (verboseLevel > 0)
198  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
199 
200  } else if (name == "emlivermore") {
201  fEmName = name;
202  delete fEmPhysicsList;
204 
205  } else if (name == "empenelope") {
206  fEmName = name;
207  delete fEmPhysicsList;
209 
210  } else if (name == "emlowenergy") {
211  fEmName = name;
212  delete fEmPhysicsList;
214 
215  } else if (name == "emstandardGS") {
216  fEmName = name;
217  delete fEmPhysicsList;
219 
220  } else if (name == "emstandardSS") {
221  fEmName = name;
222  delete fEmPhysicsList;
224 
225  } else if (name == "emstandardWVI") {
226  fEmName = name;
227  delete fEmPhysicsList;
229 
230  } else if (name == "elastic" && !fHelIsRegisted) {
231  fHadronPhys.push_back( new G4HadronElasticPhysics());
232  fHelIsRegisted = true;
233  if (verboseLevel > 0)
234  G4cout << "PhysicsList::Add hadron elastic physics" << G4endl;
235 
236  } else if (name == "binary" && !fBicIsRegisted) {
237  fHadronPhys.push_back(new G4HadronInelasticQBBC());
238  fHadronPhys.push_back(new G4IonPhysics());
239  fBicIsRegisted = true;
240  if (verboseLevel > 0)
241  G4cout << "PhysicsList::Add hadron inelastic physics from <QBBC>"
242  << G4endl;
243 
244  } else if (name == "gamma_nuc" && !fGnucIsRegisted) {
245  fHadronPhys.push_back(new G4EmExtraPhysics());
246  fGnucIsRegisted = true;
247  if (verboseLevel > 0)
248  G4cout << "PhysicsList::Add gamma- and electro-nuclear physics"
249  << G4endl;
250 
251  } else if (name == "stopping" && !fStopIsRegisted) {
252  fHadronPhys.push_back(new G4StoppingPhysics());
253  fStopIsRegisted = true;
254  if (verboseLevel > 0)
255  G4cout << "PhysicsList::Add stopping physics" << G4endl;
256 
257  } else {
258  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
259  << " is not defined"
260  << G4endl;
261  }
262 }
263 
264 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
265 
267 {
268  // Step limitation seen as a process
269 
271  particleIterator->reset();
272  while ((*particleIterator)()){
274  G4ProcessManager* pmanager = particle->GetProcessManager();
275 
276  if (fStepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
277  {
279  }
280  }
281 }
282 
283 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
284