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 100288 2016-10-17 08:45:43Z 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"
45 #include "G4EmStandardPhysicsGS.hh"
46 #include "G4EmStandardPhysicsSS.hh"
47 
48 #include "G4EmLivermorePhysics.hh"
49 #include "G4EmPenelopePhysics.hh"
50 #include "G4EmLowEPPhysics.hh"
51 
52 #include "G4LossTableManager.hh"
53 #include "G4UnitsTable.hh"
54 #include "G4SystemOfUnits.hh"
55 
56 // particles
57 
58 #include "G4BosonConstructor.hh"
59 #include "G4LeptonConstructor.hh"
60 #include "G4MesonConstructor.hh"
61 #include "G4BosonConstructor.hh"
62 #include "G4BaryonConstructor.hh"
63 #include "G4IonConstructor.hh"
65 
66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67 
69  fEmPhysicsList(0), fStepMaxProcess(0), fMessenger(0)
70 {
73 
74  fMessenger = new PhysicsListMessenger(this);
75  SetVerboseLevel(1);
76 
77  // EM physics
78  fEmName = G4String("local");
79  fEmPhysicsList = new PhysListEmStandard(fEmName);
80 
81 }
82 
83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84 
86 {
87  delete fMessenger;
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  // decay Process
128  //
129  AddDecay();
130 
131  // radioactive decay Process
132  //
134 
135  // stepLimitation (as a full process)
136  //
137  AddStepMax();
138 }
139 
140 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
141 
143 {
144  if (verboseLevel>1) {
145  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
146  }
147 
148  if (name == fEmName) return;
149 
150  if (name == "local") {
151 
152  fEmName = name;
153  delete fEmPhysicsList;
154  fEmPhysicsList = new PhysListEmStandard(name);
155 
156  } else if (name == "emstandard_opt0") {
157 
158  fEmName = name;
159  delete fEmPhysicsList;
160  fEmPhysicsList = new G4EmStandardPhysics();
161 
162  } else if (name == "emstandard_opt1") {
163 
164  fEmName = name;
165  delete fEmPhysicsList;
166  fEmPhysicsList = new G4EmStandardPhysics_option1();
167 
168  } else if (name == "emstandard_opt2") {
169 
170  fEmName = name;
171  delete fEmPhysicsList;
172  fEmPhysicsList = new G4EmStandardPhysics_option2();
173 
174  } else if (name == "emstandard_opt3") {
175 
176  fEmName = name;
177  delete fEmPhysicsList;
178  fEmPhysicsList = new G4EmStandardPhysics_option3();
179 
180  } else if (name == "emstandard_opt4") {
181 
182  fEmName = name;
183  delete fEmPhysicsList;
184  fEmPhysicsList = new G4EmStandardPhysics_option4();
185 
186  } else if (name == "emstandardWVI") {
187 
188  fEmName = name;
189  delete fEmPhysicsList;
190  fEmPhysicsList = new G4EmStandardPhysicsWVI();
191 
192  } else if (name == "emstandardGS") {
193 
194  fEmName = name;
195  delete fEmPhysicsList;
196  fEmPhysicsList = new G4EmStandardPhysicsGS();
197 
198  } else if (name == "emstandardSS") {
199 
200  fEmName = name;
201  delete fEmPhysicsList;
202  fEmPhysicsList = new G4EmStandardPhysicsSS();
203 
204  } else if (name == "emlivermore") {
205 
206  fEmName = name;
207  delete fEmPhysicsList;
208  fEmPhysicsList = new G4EmLivermorePhysics();
209 
210  } else if (name == "empenelope") {
211 
212  fEmName = name;
213  delete fEmPhysicsList;
214  fEmPhysicsList = new G4EmPenelopePhysics();
215 
216  } else if (name == "emlowenergy") {
217 
218  fEmName = name;
219  delete fEmPhysicsList;
220  fEmPhysicsList = new G4EmLowEPPhysics();
221 
222  } else {
223 
224  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
225  << " is not defined"
226  << G4endl;
227  }
228 }
229 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
230 
231 #include "G4PhysicsListHelper.hh"
232 #include "G4Decay.hh"
233 
235 {
237 
238  // Decay Process
239  //
240  G4Decay* fDecayProcess = new G4Decay();
241 
243  particleIterator->reset();
244  while( (*particleIterator)() ){
245  G4ParticleDefinition* particle = particleIterator->value();
246  if (fDecayProcess->IsApplicable(*particle))
247  ph->RegisterProcess(fDecayProcess, particle);
248  }
249 }
250 
251 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
252 
253 #include "G4PhysicsListHelper.hh"
254 #include "G4RadioactiveDecay.hh"
255 #include "G4GenericIon.hh"
256 #include "G4NuclideTable.hh"
257 
259 {
260  G4RadioactiveDecay* radioactiveDecay = new G4RadioactiveDecay();
261 
262  radioactiveDecay->SetARM(true); //Atomic Rearangement
263 
265  ph->RegisterProcess(radioactiveDecay, G4GenericIon::GenericIon());
266 
267  // mandatory for G4NuclideTable
268  //
270 }
271 
272 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
273 
274 #include "StepMax.hh"
275 
277 {
278  // Step limitation seen as a process
279  fStepMaxProcess = new StepMax();
280 
282  particleIterator->reset();
283  while ((*particleIterator)()){
284  G4ParticleDefinition* particle = particleIterator->value();
285  G4ProcessManager* pmanager = particle->GetProcessManager();
286 
287  if (fStepMaxProcess->IsApplicable(*particle))
288  {
289  pmanager ->AddDiscreteProcess(fStepMaxProcess);
290  }
291  }
292 }
293 
294 //....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()
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)
void SetARM(G4bool arm)
void SetVerboseLevel(G4int value)
static void ConstructParticle()
void AddStepMax()
Definition: PhysicsList.cc:172
static G4GenericIon * GenericIon()
Definition: G4GenericIon.cc:93
G4ProcessManager * GetProcessManager() const
void AddDecay()
Definition: PhysicsList.cc:222
static G4PhysicsListHelper * GetPhysicsListHelper()
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