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 84857 2014-10-21 16:06:58Z 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"
45 #include "G4EmStandardPhysicsSS.hh"
46 
47 #include "G4EmLivermorePhysics.hh"
48 #include "G4EmPenelopePhysics.hh"
49 #include "G4EmLowEPPhysics.hh"
50 
51 #include "G4LossTableManager.hh"
52 #include "G4UnitsTable.hh"
53 #include "G4SystemOfUnits.hh"
54 
55 // particles
56 
57 #include "G4BosonConstructor.hh"
58 #include "G4LeptonConstructor.hh"
59 #include "G4MesonConstructor.hh"
60 #include "G4BosonConstructor.hh"
61 #include "G4BaryonConstructor.hh"
62 #include "G4IonConstructor.hh"
64 
65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
66 
68  fEmPhysicsList(0), fStepMaxProcess(0), fMessenger(0)
69 {
72 
73  fMessenger = new PhysicsListMessenger(this);
74  SetVerboseLevel(1);
75 
76  // EM physics
77  fEmName = G4String("local");
79 
80 }
81 
82 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
83 
85 {
86  delete fMessenger;
87 }
88 
89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
90 
92 {
93  G4BosonConstructor pBosonConstructor;
94  pBosonConstructor.ConstructParticle();
95 
96  G4LeptonConstructor pLeptonConstructor;
97  pLeptonConstructor.ConstructParticle();
98 
99  G4MesonConstructor pMesonConstructor;
100  pMesonConstructor.ConstructParticle();
101 
102  G4BaryonConstructor pBaryonConstructor;
103  pBaryonConstructor.ConstructParticle();
104 
105  G4IonConstructor pIonConstructor;
106  pIonConstructor.ConstructParticle();
107 
108  G4ShortLivedConstructor pShortLivedConstructor;
109  pShortLivedConstructor.ConstructParticle();
110 }
111 
112 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
113 
114 #include "G4ProcessManager.hh"
115 #include "G4Decay.hh"
116 
118 {
120 
121  // electromagnetic Physics List
122  //
124 
125  // Add Decay Process
126  //
127  G4Decay* fDecayProcess = new G4Decay();
128 
129  theParticleIterator->reset();
130  while( (*theParticleIterator)() ){
131  G4ParticleDefinition* particle = theParticleIterator->value();
132  G4ProcessManager* pmanager = particle->GetProcessManager();
133 
134  if (fDecayProcess->IsApplicable(*particle)) {
135 
136  pmanager ->AddProcess(fDecayProcess);
137 
138  // set ordering for PostStepDoIt and AtRestDoIt
139  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
140  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
141 
142  }
143  }
144 
145  // stepLimitation (as a full process)
146  //
147  AddStepMax();
148 }
149 
150 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
151 
153 {
154  if (verboseLevel>1) {
155  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
156  }
157 
158  if (name == fEmName) return;
159 
160  if (name == "local") {
161 
162  fEmName = name;
163  delete fEmPhysicsList;
165 
166  } else if (name == "emstandard_opt0") {
167 
168  fEmName = name;
169  delete fEmPhysicsList;
171 
172  } else if (name == "emstandard_opt1") {
173 
174  fEmName = name;
175  delete fEmPhysicsList;
177 
178  } else if (name == "emstandard_opt2") {
179 
180  fEmName = name;
181  delete fEmPhysicsList;
183 
184  } else if (name == "emstandard_opt3") {
185 
186  fEmName = name;
187  delete fEmPhysicsList;
189 
190  } else if (name == "emstandard_opt4") {
191 
192  fEmName = name;
193  delete fEmPhysicsList;
195 
196  } else if (name == "emstandardWVI") {
197 
198  fEmName = name;
199  delete fEmPhysicsList;
201 
202  } else if (name == "emstandardSS") {
203 
204  fEmName = name;
205  delete fEmPhysicsList;
207 
208  } else if (name == "emlivermore") {
209 
210  fEmName = name;
211  delete fEmPhysicsList;
213 
214  } else if (name == "empenelope") {
215 
216  fEmName = name;
217  delete fEmPhysicsList;
219 
220  } else if (name == "emlowenergy") {
221 
222  fEmName = name;
223  delete fEmPhysicsList;
225 
226  } else {
227 
228  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
229  << " is not defined"
230  << G4endl;
231  }
232 }
233 
234 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
235 
236 #include "StepMax.hh"
237 
239 {
240  // Step limitation seen as a process
241  fStepMaxProcess = new StepMax();
242 
243  theParticleIterator->reset();
244  while ((*theParticleIterator)()){
245  G4ParticleDefinition* particle = theParticleIterator->value();
246  G4ProcessManager* pmanager = particle->GetProcessManager();
247 
248  if (fStepMaxProcess->IsApplicable(*particle))
249  {
251  }
252  }
253 }
254 
255 //....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
G4VPhysicsConstructor * fEmPhysicsList
Definition: PhysicsList.hh:73
virtual void ConstructProcess()=0
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