Geant4  10.01
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 85029 2014-10-23 10:00:33Z 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 "G4EmLivermorePhysics.hh"
46 #include "G4EmPenelopePhysics.hh"
47 
48 #include "G4LossTableManager.hh"
49 #include "G4UnitsTable.hh"
50 #include "G4SystemOfUnits.hh"
51 
52 // particles
53 
54 #include "G4BosonConstructor.hh"
55 #include "G4LeptonConstructor.hh"
56 #include "G4MesonConstructor.hh"
57 #include "G4BosonConstructor.hh"
58 #include "G4BaryonConstructor.hh"
59 #include "G4IonConstructor.hh"
61 
63 
64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
65 
67  fEmPhysicsList(0), fMessenger(0)
68 {
69  fMessenger = new PhysicsListMessenger(this);
70 
71  SetVerboseLevel(1);
72 
73  // EM physics
74  fEmPhysicsList = new PhysListEmStandard(fEmName = "local");
75 
78 }
79 
80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
81 
83 {
84  delete fMessenger;
85  delete fEmPhysicsList;
86 }
87 
88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
89 
91 {
92  G4BosonConstructor pBosonConstructor;
93  pBosonConstructor.ConstructParticle();
94 
95  G4LeptonConstructor pLeptonConstructor;
96  pLeptonConstructor.ConstructParticle();
97 
98  G4MesonConstructor pMesonConstructor;
99  pMesonConstructor.ConstructParticle();
100 
101  G4BaryonConstructor pBaryonConstructor;
102  pBaryonConstructor.ConstructParticle();
103 
104  G4IonConstructor pIonConstructor;
105  pIonConstructor.ConstructParticle();
106 
107  G4ShortLivedConstructor pShortLivedConstructor;
108  pShortLivedConstructor.ConstructParticle();
109 }
110 
111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
112 
113 #include "G4ProcessManager.hh"
114 #include "G4EmProcessOptions.hh"
115 
117 {
118  // transportation
119  //
121 
122  // electromagnetic physics list
123  //
125 
126  // Em options
127  //
128  G4EmProcessOptions emOptions;
129  emOptions.SetBuildCSDARange(true);
130  emOptions.SetDEDXBinningForCSDARange(8*10);
131 
132  // decay process
133  //
134  AddDecay();
135 
136  // step limitation (as a full process)
137  //
138  AddStepMax();
139 }
140 
141 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
142 
144 {
145  if (verboseLevel>-1) {
146  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
147  }
148 
149  if (name == fEmName) return;
150 
151  if (name == "local") {
152 
153  fEmName = name;
154  delete fEmPhysicsList;
156 
157  } else if (name == "emstandard_opt0") {
158 
159  fEmName = name;
160  delete fEmPhysicsList;
162 
163  } else if (name == "emstandard_opt1") {
164 
165  fEmName = name;
166  delete fEmPhysicsList;
168 
169  } else if (name == "emstandard_opt2") {
170 
171  fEmName = name;
172  delete fEmPhysicsList;
174 
175  } else if (name == "emstandard_opt3") {
176 
177  fEmName = name;
178  delete fEmPhysicsList;
180 
181  } else if (name == "emstandard_opt4") {
182 
183  fEmName = name;
184  delete fEmPhysicsList;
186 
187  } else if (name == "emstandardSS") {
188 
189  fEmName = name;
190  delete fEmPhysicsList;
192 
193  } else if (name == "emlivermore") {
194  fEmName = name;
195  delete fEmPhysicsList;
197 
198  } else if (name == "empenelope") {
199  fEmName = name;
200  delete fEmPhysicsList;
202 
203  } else {
204 
205  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
206  << " is not defined"
207  << G4endl;
208  }
209 }
210 
211 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
212 
213 #include "G4Decay.hh"
214 
216 {
217  // decay process
218  //
219  G4Decay* fDecayProcess = new G4Decay();
220 
221  theParticleIterator->reset();
222  while( (*theParticleIterator)() ){
223  G4ParticleDefinition* particle = theParticleIterator->value();
224  G4ProcessManager* pmanager = particle->GetProcessManager();
225 
226  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
227 
228  pmanager ->AddProcess(fDecayProcess);
229 
230  // set ordering for PostStepDoIt and AtRestDoIt
231  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
232  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
233 
234  }
235  }
236 }
237 
238 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
239 
240 #include "StepMax.hh"
241 
243 {
244  // Step limitation seen as a process
245  fStepMaxProcess = new StepMax();
246 
247  theParticleIterator->reset();
248  while ((*theParticleIterator)()){
249  G4ParticleDefinition* particle = theParticleIterator->value();
250  G4ProcessManager* pmanager = particle->GetProcessManager();
251 
252  if (fStepMaxProcess->IsApplicable(*particle))
253  {
255  }
256  }
257 }
258 
259 //....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:84
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)
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:226
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:102
#define theParticleIterator
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:205