Geant4  10.03.p02
 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 100335 2016-10-18 07:37:53Z 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 #include "PhysListEmStandardSSM.hh"
39 
40 #include "G4EmStandardPhysics.hh"
46 #include "G4EmStandardPhysicsGS.hh"
47 #include "G4EmStandardPhysicsSS.hh"
48 #include "G4EmLivermorePhysics.hh"
49 #include "G4EmPenelopePhysics.hh"
50 #include "G4EmLowEPPhysics.hh"
51 #include "G4EmDNAPhysics.hh"
53 
54 #include "G4LossTableManager.hh"
55 #include "G4UnitsTable.hh"
56 #include "G4SystemOfUnits.hh"
57 
58 // particles
59 
60 #include "G4BosonConstructor.hh"
61 #include "G4LeptonConstructor.hh"
62 #include "G4MesonConstructor.hh"
63 #include "G4BosonConstructor.hh"
64 #include "G4BaryonConstructor.hh"
65 #include "G4IonConstructor.hh"
68 
69 G4ThreadLocal StepMax* PhysicsList::fStepMaxProcess = nullptr;
70 
71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
72 
74 {
75  fMessenger = new PhysicsListMessenger(this);
76 
77  SetVerboseLevel(1);
78 
79  // EM physics
80  fEmPhysicsList = new PhysListEmStandard(fEmName = "local");
81 
82  // Em options
83  //
85 
87 }
88 
89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
90 
92 {
93  delete fMessenger;
94  delete fEmPhysicsList;
95 }
96 
97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
98 
100 {
101  G4BosonConstructor pBosonConstructor;
102  pBosonConstructor.ConstructParticle();
103 
104  G4LeptonConstructor pLeptonConstructor;
105  pLeptonConstructor.ConstructParticle();
106 
107  G4MesonConstructor pMesonConstructor;
108  pMesonConstructor.ConstructParticle();
109 
110  G4BaryonConstructor pBaryonConstructor;
111  pBaryonConstructor.ConstructParticle();
112 
113  G4IonConstructor pIonConstructor;
114  pIonConstructor.ConstructParticle();
115 
116  G4ShortLivedConstructor pShortLivedConstructor;
117  pShortLivedConstructor.ConstructParticle();
118 
119 // DNA
120  G4DNAGenericIonsManager* genericIonsManager;
121  genericIonsManager=G4DNAGenericIonsManager::Instance();
122  genericIonsManager->GetIon("alpha++");
123  genericIonsManager->GetIon("alpha+");
124  genericIonsManager->GetIon("helium");
125  genericIonsManager->GetIon("hydrogen");
126 }
127 
128 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
129 
130 #include "G4ProcessManager.hh"
131 
133 {
134  // transportation
135  //
137 
138  // electromagnetic physics list
139  //
140  fEmPhysicsList->ConstructProcess();
141 
142  // decay process
143  //
144  AddDecay();
145 
146  // step limitation (as a full process)
147  //
148  AddStepMax();
149 }
150 
151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
152 
154 {
155  if (verboseLevel>-1) {
156  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
157  }
158 
159  if (name == fEmName) return;
160 
161  if (name == "local") {
162 
163  fEmName = name;
164  delete fEmPhysicsList;
165  fEmPhysicsList = new PhysListEmStandard(name);
166 
167  } else if (name == "emstandard_opt0") {
168 
169  fEmName = name;
170  delete fEmPhysicsList;
171  fEmPhysicsList = new G4EmStandardPhysics();
172 
173  } else if (name == "emstandard_opt1") {
174 
175  fEmName = name;
176  delete fEmPhysicsList;
177  fEmPhysicsList = new G4EmStandardPhysics_option1();
178 
179  } else if (name == "emstandard_opt2") {
180 
181  fEmName = name;
182  delete fEmPhysicsList;
183  fEmPhysicsList = new G4EmStandardPhysics_option2();
184 
185  } else if (name == "emstandard_opt3") {
186 
187  fEmName = name;
188  delete fEmPhysicsList;
189  fEmPhysicsList = new G4EmStandardPhysics_option3();
190 
191  } else if (name == "emstandard_opt4") {
192 
193  fEmName = name;
194  delete fEmPhysicsList;
195  fEmPhysicsList = new G4EmStandardPhysics_option4();
196 
197  } else if (name == "emstandardSS") {
198 
199  fEmName = name;
200  delete fEmPhysicsList;
201  fEmPhysicsList = new G4EmStandardPhysicsSS();
202 
203  } else if (name == "standardSSM") {
204 
205  fEmName = name;
206  delete fEmPhysicsList;
207  fEmPhysicsList = new PhysListEmStandardSSM(name);
208 
209  } else if (name == "emstandardWVI") {
210 
211  fEmName = name;
212  delete fEmPhysicsList;
213  fEmPhysicsList = new G4EmStandardPhysicsWVI();
214 
215  } else if (name == "standardGS") {
216 
217  fEmName = name;
218  delete fEmPhysicsList;
219  fEmPhysicsList = new G4EmStandardPhysicsGS();
220 
221  } else if (name == "emlivermore") {
222  fEmName = name;
223  delete fEmPhysicsList;
224  fEmPhysicsList = new G4EmLivermorePhysics();
225 
226  } else if (name == "empenelope") {
227  fEmName = name;
228  delete fEmPhysicsList;
229  fEmPhysicsList = new G4EmPenelopePhysics();
230 
231  } else if (name == "emlowenergy") {
232  fEmName = name;
233  delete fEmPhysicsList;
234  fEmPhysicsList = new G4EmLowEPPhysics();
235 
236  } else if (name == "dna") {
237  fEmName = name;
238  delete fEmPhysicsList;
239  fEmPhysicsList = new G4EmDNAPhysics();
240 
241  } else if (name == "dna_opt1") {
242  fEmName = name;
243  delete fEmPhysicsList;
244  fEmPhysicsList = new G4EmDNAPhysics_option1();
245 
246  } else {
247 
248  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
249  << " is not defined"
250  << G4endl;
251  }
253 }
254 
255 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
256 
257 #include "G4Decay.hh"
258 
260 {
261  // decay process
262  //
263  G4Decay* fDecayProcess = new G4Decay();
264 
266  particleIterator->reset();
267  while( (*particleIterator)() ){
268  G4ParticleDefinition* particle = particleIterator->value();
269  G4ProcessManager* pmanager = particle->GetProcessManager();
270 
271  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
272 
273  pmanager ->AddProcess(fDecayProcess);
274 
275  // set ordering for PostStepDoIt and AtRestDoIt
276  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
277  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
278 
279  }
280  }
281 }
282 
283 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
284 
285 #include "StepMax.hh"
286 
288 {
289  // Step limitation seen as a process
290  fStepMaxProcess = new StepMax();
291 
293  particleIterator->reset();
294  while ((*particleIterator)()){
295  G4ParticleDefinition* particle = particleIterator->value();
296  G4ProcessManager* pmanager = particle->GetProcessManager();
297 
298  if (fStepMaxProcess->IsApplicable(*particle))
299  {
300  pmanager ->AddDiscreteProcess(fStepMaxProcess);
301  }
302  }
303 }
304 
305 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SetDefaultCutValue(G4double newCutValue)
const XML_Char * name
Definition: expat.h:151
void ConstructParticle()
Definition: PhysicsList.cc:117
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()
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
static void ConstructParticle()
G4GLOB_DLL std::ostream G4cout
static void ConstructParticle()
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
static G4DNAGenericIonsManager * Instance(void)
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)
G4ProcessManager * GetProcessManager() const
void AddDecay()
Definition: PhysicsList.cc:222
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
void ConstructProcess()
Definition: PhysicsList.cc:170
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:205
G4ParticleDefinition * GetIon(const G4String &name)