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 90969 2015-06-12 08:12:57Z 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 "G4EmStandardPhysicsGS.hh"
46 #include "G4EmStandardPhysicsSS.hh"
47 
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 
66 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67 
69  fEmPhysicsList(0), fStepMaxProcess(0), fMessenger(0)
70 {
73 
74  fMessenger = new PhysicsListMessenger(this);
75  SetVerboseLevel(1);
76 
77  // EM physics
78  fEmName = G4String("local");
80 
81 }
82 
83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84 
86 {
87  delete fMessenger;
88 }
89 
90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
91 
93 {
94  G4BosonConstructor pBosonConstructor;
95  pBosonConstructor.ConstructParticle();
96 
97  G4LeptonConstructor pLeptonConstructor;
98  pLeptonConstructor.ConstructParticle();
99 
100  G4MesonConstructor pMesonConstructor;
101  pMesonConstructor.ConstructParticle();
102 
103  G4BaryonConstructor pBaryonConstructor;
104  pBaryonConstructor.ConstructParticle();
105 
106  G4IonConstructor pIonConstructor;
107  pIonConstructor.ConstructParticle();
108 
109  G4ShortLivedConstructor pShortLivedConstructor;
110  pShortLivedConstructor.ConstructParticle();
111 }
112 
113 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
114 
115 #include "G4ProcessManager.hh"
116 #include "G4Decay.hh"
117 
119 {
121 
122  // electromagnetic Physics List
123  //
125 
126  // Add Decay Process
127  //
128  G4Decay* fDecayProcess = new G4Decay();
129 
130  theParticleIterator->reset();
131  while( (*theParticleIterator)() ){
132  G4ParticleDefinition* particle = theParticleIterator->value();
133  G4ProcessManager* pmanager = particle->GetProcessManager();
134 
135  if (fDecayProcess->IsApplicable(*particle)) {
136 
137  pmanager ->AddProcess(fDecayProcess);
138 
139  // set ordering for PostStepDoIt and AtRestDoIt
140  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
141  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
142 
143  }
144  }
145 
146  // stepLimitation (as a full process)
147  //
148  AddStepMax();
149 }
150 
151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
152 
154 {
155  if (verboseLevel>1) {
156  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
157  }
158 
159  if (name == fEmName) return;
160 
161  if (name == "local") {
162 
163  fEmName = name;
164  delete fEmPhysicsList;
166 
167  } else if (name == "emstandard_opt0") {
168 
169  fEmName = name;
170  delete fEmPhysicsList;
172 
173  } else if (name == "emstandard_opt1") {
174 
175  fEmName = name;
176  delete fEmPhysicsList;
178 
179  } else if (name == "emstandard_opt2") {
180 
181  fEmName = name;
182  delete fEmPhysicsList;
184 
185  } else if (name == "emstandard_opt3") {
186 
187  fEmName = name;
188  delete fEmPhysicsList;
190 
191  } else if (name == "emstandard_opt4") {
192 
193  fEmName = name;
194  delete fEmPhysicsList;
196 
197  } else if (name == "emstandardWVI") {
198 
199  fEmName = name;
200  delete fEmPhysicsList;
202 
203  } else if (name == "emstandardGS") {
204 
205  fEmName = name;
206  delete fEmPhysicsList;
208 
209  } else if (name == "emstandardSS") {
210 
211  fEmName = name;
212  delete fEmPhysicsList;
214 
215  } else if (name == "emlivermore") {
216 
217  fEmName = name;
218  delete fEmPhysicsList;
220 
221  } else if (name == "empenelope") {
222 
223  fEmName = name;
224  delete fEmPhysicsList;
226 
227  } else if (name == "emlowenergy") {
228 
229  fEmName = name;
230  delete fEmPhysicsList;
232 
233  } else {
234 
235  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
236  << " is not defined"
237  << G4endl;
238  }
239 }
240 
241 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
242 
243 #include "StepMax.hh"
244 
246 {
247  // Step limitation seen as a process
248  fStepMaxProcess = new StepMax();
249 
250  theParticleIterator->reset();
251  while ((*theParticleIterator)()){
252  G4ParticleDefinition* particle = theParticleIterator->value();
253  G4ProcessManager* pmanager = particle->GetProcessManager();
254 
255  if (fStepMaxProcess->IsApplicable(*particle))
256  {
258  }
259  }
260 }
261 
262 //....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:114
#define theParticleIterator
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:205