Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 100262 2016-10-17 08:08:04Z 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 "PhysListEmStandardSS.hh"
39 #include "PhysListEmStandardGS.hh"
40 #include "PhysListEmStandardWVI.hh"
41 
42 #include "G4EmStandardPhysics.hh"
46 
47 #include "G4UnitsTable.hh"
48 
49 #include "G4ParticleDefinition.hh"
50 #include "G4ProcessManager.hh"
51 
52 // Bosons
53 #include "G4ChargedGeantino.hh"
54 #include "G4Geantino.hh"
55 #include "G4Gamma.hh"
56 #include "G4OpticalPhoton.hh"
57 
58 // leptons
59 #include "G4MuonPlus.hh"
60 #include "G4MuonMinus.hh"
61 #include "G4NeutrinoMu.hh"
62 #include "G4AntiNeutrinoMu.hh"
63 
64 #include "G4Electron.hh"
65 #include "G4Positron.hh"
66 #include "G4NeutrinoE.hh"
67 #include "G4AntiNeutrinoE.hh"
68 
69 // Hadrons
70 #include "G4MesonConstructor.hh"
71 #include "G4BaryonConstructor.hh"
72 #include "G4IonConstructor.hh"
73 
74 #include "G4SystemOfUnits.hh"
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77 
79  fMessenger(0), fEmName("local"), fEmPhysicsList(0)
80 {
81  fMessenger = new PhysicsListMessenger(this);
82 
83  // EM physics
84  fEmName = G4String("local");
85  fEmPhysicsList = new PhysListEmStandard(fEmName);
86 
88  SetVerboseLevel(1);
89 }
90 
91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
92 
94 {
95  delete fEmPhysicsList;
96  delete fMessenger;
97 }
98 
99 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
100 
102 {
103 // pseudo-particles
106 
107 // gamma
109 
110 // optical photon
112 
113 // leptons
118 
123 
124 // mesons
125  G4MesonConstructor mConstructor;
126  mConstructor.ConstructParticle();
127 
128 // barions
129  G4BaryonConstructor bConstructor;
130  bConstructor.ConstructParticle();
131 
132 // ions
133  G4IonConstructor iConstructor;
134  iConstructor.ConstructParticle();
135 }
136 
137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
138 
140 {
142  fEmPhysicsList->ConstructProcess();
143  AddDecay();
144  AddStepMax();
145 }
146 
147 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
148 
149 #include "G4Decay.hh"
150 
152 {
153  // Add Decay Process
154 
155  G4Decay* fDecayProcess = new G4Decay();
156 
158  particleIterator->reset();
159  while( (*particleIterator)() ){
160  G4ParticleDefinition* particle = particleIterator->value();
161  G4ProcessManager* pmanager = particle->GetProcessManager();
162 
163  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
164 
165  pmanager ->AddProcess(fDecayProcess);
166 
167  // set ordering for PostStepDoIt and AtRestDoIt
168  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
169  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
170 
171  }
172  }
173 }
174 
175 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
176 
177 #include "StepMax.hh"
178 
180 {
181  // Step limitation seen as a process
182  StepMax* stepMaxProcess = new StepMax();
183 
185  particleIterator->reset();
186  while ((*particleIterator)()){
187  G4ParticleDefinition* particle = particleIterator->value();
188  G4ProcessManager* pmanager = particle->GetProcessManager();
189 
190  if (stepMaxProcess->IsApplicable(*particle))
191  {
192  pmanager ->AddDiscreteProcess(stepMaxProcess);
193  }
194  }
195 }
196 
197 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
198 
200 {
201  if (verboseLevel>-1) {
202  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
203  }
204 
205  if (name == fEmName) return;
206 
207  if (name == "local") {
208 
209  fEmName = name;
210  delete fEmPhysicsList;
211  fEmPhysicsList = new PhysListEmStandard(name);
212 
213  } else if (name == "emstandard_opt0") {
214 
215  fEmName = name;
216  delete fEmPhysicsList;
217  fEmPhysicsList = new G4EmStandardPhysics();
218 
219  } else if (name == "emstandard_opt1") {
220 
221  fEmName = name;
222  delete fEmPhysicsList;
223  fEmPhysicsList = new G4EmStandardPhysics_option1();
224 
225  } else if (name == "emstandard_opt2") {
226 
227  fEmName = name;
228  delete fEmPhysicsList;
229  fEmPhysicsList = new G4EmStandardPhysics_option2();
230 
231  } else if (name == "emstandard_opt3") {
232 
233  fEmName = name;
234  delete fEmPhysicsList;
235  fEmPhysicsList = new G4EmStandardPhysics_option3();
236 
237  } else if (name == "standardSS") {
238 
239  fEmName = name;
240  delete fEmPhysicsList;
241  fEmPhysicsList = new PhysListEmStandardSS(name);
242 
243  } else if (name == "standardGS") {
244 
245  fEmName = name;
246  delete fEmPhysicsList;
247  fEmPhysicsList = new PhysListEmStandardGS(name);
248 
249  } else if (name == "standardWVI") {
250 
251  fEmName = name;
252  delete fEmPhysicsList;
253  fEmPhysicsList = new PhysListEmStandardWVI(name);
254 
255  } else {
256 
257  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
258  << " is not defined"
259  << G4endl;
260  }
261 }
262 
263 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
void SetDefaultCutValue(G4double newCutValue)
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
const XML_Char * name
Definition: expat.h:151
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:94
static constexpr double mm
Definition: G4SIunits.hh:115
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static void ConstructParticle()
static void ConstructParticle()
Definition of the PhysListEmStandardSS class.
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
static void ConstructParticle()
G4GLOB_DLL std::ostream G4cout
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
static G4NeutrinoE * NeutrinoEDefinition()
Definition: G4NeutrinoE.cc:80
static G4AntiNeutrinoMu * AntiNeutrinoMuDefinition()
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
void SetVerboseLevel(G4int value)
void AddStepMax()
Definition: PhysicsList.cc:172
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
G4ProcessManager * GetProcessManager() const
void AddDecay()
Definition: PhysicsList.cc:222
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: StepMax.cc:51
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
virtual void ConstructProcess()=0
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
static G4ChargedGeantino * ChargedGeantinoDefinition()
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
#define G4endl
Definition: G4ios.hh:61
Definition of the PhysListEmStandardGS class.
static G4AntiNeutrinoE * AntiNeutrinoEDefinition()
static G4OpticalPhoton * OpticalPhotonDefinition()
void ConstructProcess()
Definition: PhysicsList.cc:170
Definition of the PhysListEmStandardWVI class.
static G4NeutrinoMu * NeutrinoMuDefinition()
Definition: G4NeutrinoMu.cc:80
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81