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 94269 2015-11-10 07:55:24Z 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 "PhysListEmStandardMP.hh"
39 
40 #include "G4EmStandardPhysics.hh"
45 #include "G4EmStandardPhysicsSS.hh"
46 #include "G4EmStandardPhysicsGS.hh"
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 
67 
68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
69 
71 {
72  fMessenger = new PhysicsListMessenger(this);
73 
74  SetVerboseLevel(1);
75 
76  // EM physics
77  fEmPhysicsList = new PhysListEmStandard(fEmName = "local");
78 
81 }
82 
83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84 
86 {
87  delete fMessenger;
88  delete fEmPhysicsList;
89 }
90 
91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
92 
94 {
95  G4BosonConstructor pBosonConstructor;
96  pBosonConstructor.ConstructParticle();
97 
98  G4LeptonConstructor pLeptonConstructor;
99  pLeptonConstructor.ConstructParticle();
100 
101  G4MesonConstructor pMesonConstructor;
102  pMesonConstructor.ConstructParticle();
103 
104  G4BaryonConstructor pBaryonConstructor;
105  pBaryonConstructor.ConstructParticle();
106 
107  G4IonConstructor pIonConstructor;
108  pIonConstructor.ConstructParticle();
109 
110  G4ShortLivedConstructor pShortLivedConstructor;
111  pShortLivedConstructor.ConstructParticle();
112 }
113 
114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
115 
116 #include "G4ProcessManager.hh"
117 #include "G4EmProcessOptions.hh"
118 
120 {
121  // transportation
122  //
124 
125  // electromagnetic physics list
126  //
128 
129  // Em options
130  //
131  G4EmProcessOptions emOptions;
132  emOptions.SetBuildCSDARange(true);
133  emOptions.SetDEDXBinningForCSDARange(8*10);
134 
135  // decay process
136  //
137  AddDecay();
138 
139  // step limitation (as a full process)
140  //
141  AddStepMax();
142 }
143 
144 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
145 
147 {
148  if (verboseLevel>-1) {
149  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
150  }
151 
152  if (name == fEmName) return;
153 
154  if (name == "local") {
155  fEmName = name;
156  delete fEmPhysicsList;
158 
159  } else if (name == "emstandard_opt0") {
160  fEmName = name;
161  delete fEmPhysicsList;
163 
164  } else if (name == "emstandard_opt1") {
165  fEmName = name;
166  delete fEmPhysicsList;
168 
169  } else if (name == "emstandard_opt2") {
170  fEmName = name;
171  delete fEmPhysicsList;
173 
174  } else if (name == "emstandard_opt3") {
175  fEmName = name;
176  delete fEmPhysicsList;
178 
179  } else if (name == "emstandard_opt4") {
180  fEmName = name;
181  delete fEmPhysicsList;
183 
184  } else if (name == "emstandardSS") {
185  fEmName = name;
186  delete fEmPhysicsList;
188 
189  } else if (name == "emstandardGS") {
190  fEmName = name;
191  delete fEmPhysicsList;
193 
194  } else if (name == "emstandardWVI") {
195  fEmName = name;
196  delete fEmPhysicsList;
198 
199  } else if (name == "emlowenergy") {
200  fEmName = name;
201  delete fEmPhysicsList;
203 
204  } else if (name == "emlivermore") {
205  fEmName = name;
206  delete fEmPhysicsList;
208 
209  } else if (name == "empenelope") {
210  fEmName = name;
211  delete fEmPhysicsList;
213 
214  } else if (name == "emstandardMP") {
215  fEmName = name;
216  delete fEmPhysicsList;
218 
219  } else {
220 
221  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
222  << " is not defined"
223  << G4endl;
224  }
225 }
226 
227 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
228 
229 #include "G4Decay.hh"
230 
232 {
233  // decay process
234  //
235  G4Decay* fDecayProcess = new G4Decay();
236 
237  theParticleIterator->reset();
238  while( (*theParticleIterator)() ){
239  G4ParticleDefinition* particle = theParticleIterator->value();
240  G4ProcessManager* pmanager = particle->GetProcessManager();
241 
242  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
243 
244  pmanager ->AddProcess(fDecayProcess);
245 
246  // set ordering for PostStepDoIt and AtRestDoIt
247  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
248  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
249 
250  }
251  }
252 }
253 
254 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
255 
256 #include "StepMax.hh"
257 
259 {
260  // Step limitation seen as a process
261  fStepMaxProcess = new StepMax();
262 
263  theParticleIterator->reset();
264  while ((*theParticleIterator)()){
265  G4ParticleDefinition* particle = theParticleIterator->value();
266  G4ProcessManager* pmanager = particle->GetProcessManager();
267 
268  if (fStepMaxProcess->IsApplicable(*particle))
269  {
271  }
272  }
273 }
274 
275 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SetDefaultCutValue(G4double newCutValue)
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4LossTableManager * Instance()
G4int fNumAngles
Definition: PhysicsList.hh:71
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)
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
void SetVerboseLevel(G4int value)
Definition of the PhysListEmStandardMP class.
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