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 100280 2016-10-17 08:36:57Z gcosmo $
30 //
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 #include "PhysicsList.hh"
35 #include "PhysicsListMessenger.hh"
36 
37 #include "PhysListEmStandard.hh"
38 
39 #include "G4EmStandardPhysics.hh"
44 #include "G4EmStandardPhysicsSS.hh"
45 #include "G4EmStandardPhysicsGS.hh"
47 #include "G4EmLivermorePhysics.hh"
48 #include "G4EmPenelopePhysics.hh"
49 #include "G4EmLowEPPhysics.hh"
50 
51 #include "G4LossTableManager.hh"
52 #include "G4UnitsTable.hh"
53 #include "G4SystemOfUnits.hh"
54 
55 // particles
56 
57 #include "G4BosonConstructor.hh"
58 #include "G4LeptonConstructor.hh"
59 #include "G4MesonConstructor.hh"
60 #include "G4BosonConstructor.hh"
61 #include "G4BaryonConstructor.hh"
62 #include "G4IonConstructor.hh"
64 
65 G4ThreadLocal StepMax* PhysicsList::fStepMaxProcess = 0;
66 
67 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
68 
70 {
71  fMessenger = new PhysicsListMessenger(this);
72 
73  SetVerboseLevel(1);
74 
75  // EM physics
76  fEmPhysicsList = new PhysListEmStandard(fEmName = "local");
77 
80 }
81 
82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
83 
85 {
86  delete fMessenger;
87  delete fEmPhysicsList;
88 }
89 
90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
91 
93 {
94  G4BosonConstructor pBosonConstructor;
95  pBosonConstructor.ConstructParticle();
96 
97  G4LeptonConstructor pLeptonConstructor;
98  pLeptonConstructor.ConstructParticle();
99 
100  G4MesonConstructor pMesonConstructor;
101  pMesonConstructor.ConstructParticle();
102 
103  G4BaryonConstructor pBaryonConstructor;
104  pBaryonConstructor.ConstructParticle();
105 
106  G4IonConstructor pIonConstructor;
107  pIonConstructor.ConstructParticle();
108 
109  G4ShortLivedConstructor pShortLivedConstructor;
110  pShortLivedConstructor.ConstructParticle();
111 }
112 
113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
114 
115 #include "G4ProcessManager.hh"
116 
118 {
119  // transportation
120  //
122 
123  // electromagnetic physics list
124  //
125  fEmPhysicsList->ConstructProcess();
126 
127  // Em options
128  //
130  param->SetBuildCSDARange(true);
131 
132  // decay process
133  //
134  AddDecay();
135 
136  // radioactive decay Process
137  //
139 
140  // step limitation (as a full process)
141  //
142  AddStepMax();
143 }
144 
145 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
146 
148 {
149  if (verboseLevel>-1) {
150  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
151  }
152 
153  if (name == fEmName) return;
154 
155  if (name == "local") {
156  fEmName = name;
157  delete fEmPhysicsList;
158  fEmPhysicsList = new PhysListEmStandard(name);
159 
160  } else if (name == "emstandard_opt0") {
161  fEmName = name;
162  delete fEmPhysicsList;
163  fEmPhysicsList = new G4EmStandardPhysics();
164 
165  } else if (name == "emstandard_opt1") {
166  fEmName = name;
167  delete fEmPhysicsList;
168  fEmPhysicsList = new G4EmStandardPhysics_option1();
169 
170  } else if (name == "emstandard_opt2") {
171  fEmName = name;
172  delete fEmPhysicsList;
173  fEmPhysicsList = new G4EmStandardPhysics_option2();
174 
175  } else if (name == "emstandard_opt3") {
176  fEmName = name;
177  delete fEmPhysicsList;
178  fEmPhysicsList = new G4EmStandardPhysics_option3();
179 
180  } else if (name == "emstandard_opt4") {
181  fEmName = name;
182  delete fEmPhysicsList;
183  fEmPhysicsList = new G4EmStandardPhysics_option4();
184 
185  } else if (name == "emstandardSS") {
186  fEmName = name;
187  delete fEmPhysicsList;
188  fEmPhysicsList = new G4EmStandardPhysicsSS();
189 
190  } else if (name == "emstandardGS") {
191  fEmName = name;
192  delete fEmPhysicsList;
193  fEmPhysicsList = new G4EmStandardPhysicsGS();
194 
195  } else if (name == "emstandardWVI") {
196  fEmName = name;
197  delete fEmPhysicsList;
198  fEmPhysicsList = new G4EmStandardPhysicsWVI();
199 
200  } else if (name == "emlowenergy") {
201  fEmName = name;
202  delete fEmPhysicsList;
203  fEmPhysicsList = new G4EmLowEPPhysics();
204 
205  } else if (name == "emlivermore") {
206  fEmName = name;
207  delete fEmPhysicsList;
208  fEmPhysicsList = new G4EmLivermorePhysics();
209 
210  } else if (name == "empenelope") {
211  fEmName = name;
212  delete fEmPhysicsList;
213  fEmPhysicsList = new G4EmPenelopePhysics();
214 
215  } else {
216 
217  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
218  << " is not defined"
219  << G4endl;
220  }
221 }
222 
223 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
224 
225 #include "G4Decay.hh"
226 
228 {
229  // decay process
230  //
231  G4Decay* fDecayProcess = new G4Decay();
232 
234  particleIterator->reset();
235  while( (*particleIterator)() ){
236  G4ParticleDefinition* particle = particleIterator->value();
237  G4ProcessManager* pmanager = particle->GetProcessManager();
238 
239  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
240 
241  pmanager ->AddProcess(fDecayProcess);
242 
243  // set ordering for PostStepDoIt and AtRestDoIt
244  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
245  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
246 
247  }
248  }
249 }
250 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
251 
252 #include "G4PhysicsListHelper.hh"
253 #include "G4RadioactiveDecay.hh"
254 #include "G4GenericIon.hh"
255 #include "G4NuclideTable.hh"
256 
258 {
259  G4RadioactiveDecay* radioactiveDecay = new G4RadioactiveDecay();
260 
261  radioactiveDecay->SetARM(true); //Atomic Rearangement
262 
264  ph->RegisterProcess(radioactiveDecay, G4GenericIon::GenericIon());
265 
266  // mandatory for G4NuclideTable
267  //
269 }
270 
271 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
272 
273 #include "StepMax.hh"
274 
276 {
277  // Step limitation seen as a process
278  fStepMaxProcess = new StepMax();
279 
281  particleIterator->reset();
282  while ((*particleIterator)()){
283  G4ParticleDefinition* particle = particleIterator->value();
284  G4ProcessManager* pmanager = particle->GetProcessManager();
285 
286  if (fStepMaxProcess->IsApplicable(*particle))
287  {
288  pmanager ->AddDiscreteProcess(fStepMaxProcess);
289  }
290  }
291 }
292 
293 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SetThresholdOfHalfLife(G4double)
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
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static void ConstructParticle()
#define G4ThreadLocal
Definition: tls.hh:89
static void ConstructParticle()
static constexpr double picosecond
Definition: G4SIunits.hh:161
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
static void ConstructParticle()
G4GLOB_DLL std::ostream G4cout
static void ConstructParticle()
G4bool RegisterProcess(G4VProcess *process, G4ParticleDefinition *particle)
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
void SetARM(G4bool arm)
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
void SetVerboseLevel(G4int value)
static void ConstructParticle()
void AddStepMax()
Definition: PhysicsList.cc:172
void SetBuildCSDARange(G4bool val)
static G4GenericIon * GenericIon()
Definition: G4GenericIon.cc:93
G4ProcessManager * GetProcessManager() const
void AddDecay()
Definition: PhysicsList.cc:222
static G4PhysicsListHelper * GetPhysicsListHelper()
static G4EmParameters * Instance()
virtual void ConstructProcess()=0
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
#define G4endl
Definition: G4ios.hh:61
static G4NuclideTable * GetInstance()
void ConstructProcess()
Definition: PhysicsList.cc:170
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:205
void AddRadioactiveDecay()
Definition: PhysicsList.cc:246