Geant4  10.02.p01
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 90970 2015-06-12 08:14:00Z 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 
49 #include "G4EmLivermorePhysics.hh"
50 #include "G4EmPenelopePhysics.hh"
51 #include "G4EmLowEPPhysics.hh"
52 
53 #include "G4Decay.hh"
54 #include "StepMax.hh"
55 
56 #include "G4LossTableManager.hh"
57 
58 #include "G4UnitsTable.hh"
59 #include "G4SystemOfUnits.hh"
60 
61 #include "G4ParticleDefinition.hh"
62 #include "G4ProcessManager.hh"
63 
64 // particles
65 
66 #include "G4BosonConstructor.hh"
67 #include "G4LeptonConstructor.hh"
68 #include "G4MesonConstructor.hh"
69 #include "G4BosonConstructor.hh"
70 #include "G4BaryonConstructor.hh"
71 #include "G4IonConstructor.hh"
73 
74 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
75 
77  fMessenger(0),fEmPhysicsList(0)
78 {
79  fMessenger = new PhysicsListMessenger(this);
80  SetVerboseLevel(1);
81 
82  // EM physics
83  fEmName = G4String("local");
85 
88 }
89 
90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
91 
93 {
94  delete fEmPhysicsList;
95  delete fMessenger;
96 }
97 
98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
99 
101 {
102  G4BosonConstructor pBosonConstructor;
103  pBosonConstructor.ConstructParticle();
104 
105  G4LeptonConstructor pLeptonConstructor;
106  pLeptonConstructor.ConstructParticle();
107 
108  G4MesonConstructor pMesonConstructor;
109  pMesonConstructor.ConstructParticle();
110 
111  G4BaryonConstructor pBaryonConstructor;
112  pBaryonConstructor.ConstructParticle();
113 
114  G4IonConstructor pIonConstructor;
115  pIonConstructor.ConstructParticle();
116 
117  G4ShortLivedConstructor pShortLivedConstructor;
118  pShortLivedConstructor.ConstructParticle();
119 }
120 
121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
122 
124 {
127  AddDecay();
128  AddStepMax();
129 }
130 
131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
132 
134 {
135  // Add Decay Process
136 
137  G4Decay* fDecayProcess = new G4Decay();
138 
139  theParticleIterator->reset();
140  while( (*theParticleIterator)() ){
141  G4ParticleDefinition* particle = theParticleIterator->value();
142  G4ProcessManager* pmanager = particle->GetProcessManager();
143 
144  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
145 
146  pmanager ->AddProcess(fDecayProcess);
147 
148  // set ordering for PostStepDoIt and AtRestDoIt
149  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
150  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
151 
152  }
153  }
154 }
155 
156 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
157 
159 {
160  // Step limitation seen as a process
161  StepMax* stepMaxProcess = new StepMax();
162 
163  theParticleIterator->reset();
164  while ((*theParticleIterator)()){
165  G4ParticleDefinition* particle = theParticleIterator->value();
166  G4ProcessManager* pmanager = particle->GetProcessManager();
167 
168  if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
169  {
170  pmanager ->AddDiscreteProcess(stepMaxProcess);
171  }
172  }
173 }
174 
175 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
176 
178 {
179  if (verboseLevel>-1) {
180  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
181  }
182 
183  if (name == fEmName) return;
184 
185  if (name == "local") {
186 
187  fEmName = name;
188  delete fEmPhysicsList;
190 
191  } else if (name == "emstandard_opt0") {
192 
193  fEmName = name;
194  delete fEmPhysicsList;
196 
197  } else if (name == "emstandard_opt1") {
198 
199  fEmName = name;
200  delete fEmPhysicsList;
202 
203  } else if (name == "emstandard_opt2") {
204 
205  fEmName = name;
206  delete fEmPhysicsList;
208 
209  } else if (name == "emstandard_opt3") {
210 
211  fEmName = name;
212  delete fEmPhysicsList;
214 
215  } else if (name == "emstandard_opt4") {
216 
217  fEmName = name;
218  delete fEmPhysicsList;
220 
221  } else if (name == "emstandardSS") {
222 
223  fEmName = name;
224  delete fEmPhysicsList;
226 
227  } else if (name == "standardSSM") {
228 
229  fEmName = name;
230  delete fEmPhysicsList;
232 
233  } else if (name == "emstandardWVI") {
234 
235  fEmName = name;
236  delete fEmPhysicsList;
238 
239  } else if (name == "standardGS") {
240 
241  fEmName = name;
242  delete fEmPhysicsList;
244 
245  } else if (name == "empenelope"){
246  fEmName = name;
247  delete fEmPhysicsList;
249 
250  } else if (name == "emlowenergy"){
251  fEmName = name;
252  delete fEmPhysicsList;
254 
255  } else if (name == "emlivermore"){
256  fEmName = name;
257  delete fEmPhysicsList;
259 
260  } else {
261 
262  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
263  << " is not defined"
264  << G4endl;
265  }
266 }
267 
268 //....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()
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:231
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: StepMax.cc:51
G4VPhysicsConstructor * fEmPhysicsList
Definition: PhysicsList.hh:73
virtual void ConstructProcess()=0
#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