Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PhysicsList.cc
Go to the documentation of this file.
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 // $Id: PhysicsList.cc 100282 2016-10-17 08:39:00Z gcosmo $
30 //
31 //---------------------------------------------------------------------------
32 //
33 // ClassName: PhysicsList
34 //
35 // Author: V.Ivanchenko 14.10.2002
36 //
37 // Modified:
38 // 17.11.06 Use components from physics_lists subdirectory (V.Ivanchenko)
39 // 24.10.12 Migrated to new stopping and ion physics (A.Ribon)
40 //
41 //----------------------------------------------------------------------------
42 //
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
47 #include "PhysicsList.hh"
48 #include "PhysicsListMessenger.hh"
49 
50 #include "PhysListEmStandard.hh"
51 #include "G4EmStandardPhysics.hh"
56 #include "G4EmLivermorePhysics.hh"
57 #include "G4EmPenelopePhysics.hh"
58 #include "G4EmLowEPPhysics.hh"
59 #include "G4EmStandardPhysicsGS.hh"
60 #include "G4EmStandardPhysicsSS.hh"
62 #include "G4DecayPhysics.hh"
64 #include "G4HadronInelasticQBBC.hh"
65 #include "G4IonPhysics.hh"
66 #include "G4EmExtraPhysics.hh"
67 #include "G4StoppingPhysics.hh"
68 
69 #include "G4RegionStore.hh"
70 #include "G4ProcessManager.hh"
71 #include "G4ParticleTypes.hh"
72 #include "G4ParticleTable.hh"
73 
74 #include "G4Gamma.hh"
75 #include "G4Electron.hh"
76 #include "G4Positron.hh"
77 #include "G4Proton.hh"
78 
79 #include "G4UnitsTable.hh"
80 #include "G4SystemOfUnits.hh"
81 #include "G4LossTableManager.hh"
82 #include "StepMax.hh"
83 
84 #include "G4EmProcessOptions.hh"
85 
86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
87 
89  fEmPhysicsList(0),
90  fDecayPhysicsList(0),
91  fStepMaxProcess(0),
92  fMessenger(0)
93 {
96 
97  fMessenger = new PhysicsListMessenger(this);
98  fStepMaxProcess = new StepMax();
99 
100  // Initilise flags
101 
102  SetVerboseLevel(1);
103 
104  fHelIsRegisted = false;
105  fBicIsRegisted = false;
106  fGnucIsRegisted = false;
107  fStopIsRegisted = false;
108 
109  // EM physics
110  fEmName = G4String("emstandard");
111  fEmPhysicsList = new G4EmStandardPhysics();
112 
113  // Decay Physics is always defined
114  fDecayPhysicsList = new G4DecayPhysics();
115 }
116 
117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
118 
120 {
121  delete fMessenger;
122  delete fDecayPhysicsList;
123  delete fEmPhysicsList;
124  delete fStepMaxProcess;
125  for(size_t i=0; i<fHadronPhys.size(); i++) {
126  delete fHadronPhys[i];
127  }
128 }
129 
130 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
131 
133 {
134  fDecayPhysicsList->ConstructParticle();
135 }
136 
137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
138 
140 {
142  fEmPhysicsList->ConstructProcess();
143  fDecayPhysicsList->ConstructProcess();
144  for(size_t i=0; i<fHadronPhys.size(); ++i) {
145  fHadronPhys[i]->ConstructProcess();
146  }
147  AddStepMax();
148 }
149 
150 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
151 
153 {
154  if (verboseLevel > 1)
155  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
156 
157  if (name == fEmName) return;
158 
159  if (name == "emstandard") {
160  fEmName = name;
161  delete fEmPhysicsList;
162  fEmPhysicsList = new G4EmStandardPhysics();
163  if (verboseLevel > 0)
164  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
165 
166  } else if (name == "emstandard_opt1") {
167  fEmName = name;
168  delete fEmPhysicsList;
169  fEmPhysicsList = new G4EmStandardPhysics_option1();
170  if (verboseLevel > 0)
171  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
172 
173  } else if (name == "emstandard_opt2") {
174  fEmName = name;
175  delete fEmPhysicsList;
176  fEmPhysicsList = new G4EmStandardPhysics_option2();
177  if (verboseLevel > 0)
178  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
179 
180  } else if (name == "emstandard_opt3") {
181  fEmName = name;
182  delete fEmPhysicsList;
183  fEmPhysicsList = new G4EmStandardPhysics_option3();
184  if (verboseLevel > 0)
185  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
186 
187  } else if (name == "emstandard_opt4") {
188  fEmName = name;
189  delete fEmPhysicsList;
190  fEmPhysicsList = new G4EmStandardPhysics_option4();
191  if (verboseLevel > 0)
192  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
193 
194  } else if (name == "emstandard_local") {
195  fEmName = name;
196  delete fEmPhysicsList;
197  fEmPhysicsList = new PhysListEmStandard();
198  if (verboseLevel > 0)
199  G4cout << "PhysicsList::Set " << name << " EM physics" << G4endl;
200 
201  } else if (name == "emlivermore") {
202  fEmName = name;
203  delete fEmPhysicsList;
204  fEmPhysicsList = new G4EmLivermorePhysics();
205 
206  } else if (name == "empenelope") {
207  fEmName = name;
208  delete fEmPhysicsList;
209  fEmPhysicsList = new G4EmPenelopePhysics();
210 
211  } else if (name == "emlowenergy") {
212  fEmName = name;
213  delete fEmPhysicsList;
214  fEmPhysicsList = new G4EmLowEPPhysics();
215 
216  } else if (name == "emstandardGS") {
217  fEmName = name;
218  delete fEmPhysicsList;
219  fEmPhysicsList = new G4EmStandardPhysicsGS();
220 
221  } else if (name == "emstandardSS") {
222  fEmName = name;
223  delete fEmPhysicsList;
224  fEmPhysicsList = new G4EmStandardPhysicsSS();
225 
226  } else if (name == "emstandardWVI") {
227  fEmName = name;
228  delete fEmPhysicsList;
229  fEmPhysicsList = new G4EmStandardPhysicsWVI();
230 
231  } else if (name == "elastic" && !fHelIsRegisted) {
232  fHadronPhys.push_back( new G4HadronElasticPhysics());
233  fHelIsRegisted = true;
234  if (verboseLevel > 0)
235  G4cout << "PhysicsList::Add hadron elastic physics" << G4endl;
236 
237  } else if (name == "binary" && !fBicIsRegisted) {
238  fHadronPhys.push_back(new G4HadronInelasticQBBC());
239  fHadronPhys.push_back(new G4IonPhysics());
240  fBicIsRegisted = true;
241  if (verboseLevel > 0)
242  G4cout << "PhysicsList::Add hadron inelastic physics from <QBBC>"
243  << G4endl;
244 
245  } else if (name == "gamma_nuc" && !fGnucIsRegisted) {
246  fHadronPhys.push_back(new G4EmExtraPhysics());
247  fGnucIsRegisted = true;
248  if (verboseLevel > 0)
249  G4cout << "PhysicsList::Add gamma- and electro-nuclear physics"
250  << G4endl;
251 
252  } else if (name == "stopping" && !fStopIsRegisted) {
253  fHadronPhys.push_back(new G4StoppingPhysics());
254  fStopIsRegisted = true;
255  if (verboseLevel > 0)
256  G4cout << "PhysicsList::Add stopping physics" << G4endl;
257 
258  } else {
259  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
260  << " is not defined"
261  << G4endl;
262  }
263 }
264 
265 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
266 
268 {
269  // Step limitation seen as a process
270 
272  particleIterator->reset();
273  while ((*particleIterator)()){
274  G4ParticleDefinition* particle = particleIterator->value();
275  G4ProcessManager* pmanager = particle->GetProcessManager();
276 
277  if (fStepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
278  {
279  pmanager ->AddDiscreteProcess(fStepMaxProcess);
280  }
281  }
282 }
283 
284 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
285 
void SetDefaultCutValue(G4double newCutValue)
const XML_Char * name
Definition: expat.h:151
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4LossTableManager * Instance()
static constexpr double mm
Definition: G4SIunits.hh:115
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
virtual void ConstructParticle()=0
G4GLOB_DLL std::ostream G4cout
void SetVerboseLevel(G4int value)
void AddStepMax()
Definition: PhysicsList.cc:172
G4ProcessManager * GetProcessManager() const
virtual void ConstructProcess()=0
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
#define G4endl
Definition: G4ios.hh:61
void ConstructProcess()
Definition: PhysicsList.cc:170
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:205