Geant4  10.02
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 90967 2015-06-12 08:10:54Z 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 
70 
71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
72 
74  fEmPhysicsList(0), fMessenger(0)
75 {
76  fMessenger = new PhysicsListMessenger(this);
77 
78  SetVerboseLevel(1);
79 
80  // EM physics
81  fEmPhysicsList = new PhysListEmStandard(fEmName = "local");
82 
85 
86  fStepMaxProcess = 0;
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 #include "G4EmProcessOptions.hh"
132 
134 {
135  // transportation
136  //
138 
139  // electromagnetic physics list
140  //
142 
143  // Em options
144  //
145  G4EmProcessOptions emOptions;
146  emOptions.SetBuildCSDARange(true);
147  emOptions.SetDEDXBinningForCSDARange(8*10);
148 
149  // decay process
150  //
151  AddDecay();
152 
153  // step limitation (as a full process)
154  //
155  AddStepMax();
156 }
157 
158 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
159 
161 {
162  if (verboseLevel>-1) {
163  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
164  }
165 
166  if (name == fEmName) return;
167 
168  if (name == "local") {
169 
170  fEmName = name;
171  delete fEmPhysicsList;
173 
174  } else if (name == "emstandard_opt0") {
175 
176  fEmName = name;
177  delete fEmPhysicsList;
179 
180  } else if (name == "emstandard_opt1") {
181 
182  fEmName = name;
183  delete fEmPhysicsList;
185 
186  } else if (name == "emstandard_opt2") {
187 
188  fEmName = name;
189  delete fEmPhysicsList;
191 
192  } else if (name == "emstandard_opt3") {
193 
194  fEmName = name;
195  delete fEmPhysicsList;
197 
198  } else if (name == "emstandard_opt4") {
199 
200  fEmName = name;
201  delete fEmPhysicsList;
203 
204  } else if (name == "emstandardSS") {
205 
206  fEmName = name;
207  delete fEmPhysicsList;
209 
210  } else if (name == "standardSSM") {
211 
212  fEmName = name;
213  delete fEmPhysicsList;
215 
216  } else if (name == "emstandardWVI") {
217 
218  fEmName = name;
219  delete fEmPhysicsList;
221 
222  } else if (name == "standardGS") {
223 
224  fEmName = name;
225  delete fEmPhysicsList;
227 
228  } else if (name == "emlivermore") {
229  fEmName = name;
230  delete fEmPhysicsList;
232 
233  } else if (name == "empenelope") {
234  fEmName = name;
235  delete fEmPhysicsList;
237 
238  } else if (name == "emlowenergy") {
239  fEmName = name;
240  delete fEmPhysicsList;
242 
243  } else if (name == "dna") {
244  fEmName = name;
245  delete fEmPhysicsList;
247 
248  } else if (name == "dna_opt1") {
249  fEmName = name;
250  delete fEmPhysicsList;
252 
253  } else {
254 
255  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
256  << " is not defined"
257  << G4endl;
258  }
259 }
260 
261 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
262 
263 #include "G4Decay.hh"
264 
266 {
267  // decay process
268  //
269  G4Decay* fDecayProcess = new G4Decay();
270 
271  theParticleIterator->reset();
272  while( (*theParticleIterator)() ){
273  G4ParticleDefinition* particle = theParticleIterator->value();
274  G4ProcessManager* pmanager = particle->GetProcessManager();
275 
276  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
277 
278  pmanager ->AddProcess(fDecayProcess);
279 
280  // set ordering for PostStepDoIt and AtRestDoIt
281  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
282  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
283 
284  }
285  }
286 }
287 
288 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
289 
290 #include "StepMax.hh"
291 
293 {
294  // Step limitation seen as a process
295  fStepMaxProcess = new StepMax();
296 
297  theParticleIterator->reset();
298  while ((*theParticleIterator)()){
299  G4ParticleDefinition* particle = theParticleIterator->value();
300  G4ProcessManager* pmanager = particle->GetProcessManager();
301 
302  if (fStepMaxProcess->IsApplicable(*particle))
303  {
305  }
306  }
307 }
308 
309 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SetDefaultCutValue(G4double newCutValue)
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4LossTableManager * Instance()
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
G4String name
Definition: TRTMaterials.hh:40
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static void ConstructParticle()
void SetDEDXBinningForCSDARange(G4int val)
#define G4ThreadLocal
Definition: tls.hh:89
static void ConstructParticle()
G4ProcessManager * GetProcessManager() const
PhysicsListMessenger * fMessenger
Definition: PhysicsList.hh:78
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 AddDecay()
Definition: PhysicsList.cc:231
G4VPhysicsConstructor * fEmPhysicsList
Definition: PhysicsList.hh:73
virtual void ConstructProcess()=0
void SetBuildCSDARange(G4bool val)
G4StepLimiter * fStepMaxProcess
Definition: PhysicsList.hh:76
#define G4endl
Definition: G4ios.hh:61
G4String fEmName
Definition: PhysicsList.hh:72
void ConstructProcess()
Definition: PhysicsList.cc:170
static const double mm
Definition: G4SIunits.hh:114
#define theParticleIterator
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:205
G4ParticleDefinition * GetIon(const G4String &name)