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 90968 2015-06-12 08:11:52Z 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 #include "G4EmLivermorePhysics.hh"
48 #include "G4EmPenelopePhysics.hh"
49 #include "G4EmLowEPPhysics.hh"
50 
51 #include "G4DecayPhysics.hh"
52 #include "StepMax.hh"
53 
54 #include "G4LossTableManager.hh"
55 #include "G4ProcessManager.hh"
56 
57 #include "G4UnitsTable.hh"
58 #include "G4SystemOfUnits.hh"
59 
60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
61 
63  : G4VModularPhysicsList(),fEmPhysicsList(0),fDecay(0),fMessenger(0)
64 {
65  SetVerboseLevel(1);
66  fMessenger = new PhysicsListMessenger(this);
67 
68  // EM physics
69  fEmName = "emstandard_opt0";
71  fDecay = new G4DecayPhysics();
72 
75 }
76 
77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78 
80 {
81  delete fMessenger;
82  delete fEmPhysicsList;
83  delete fDecay;
84 }
85 
86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
87 
89 {
92 }
93 
94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
95 
97 {
98  if (verboseLevel > -1) {
99  G4cout << "PhysicsList::ConstructProcess start" << G4endl;
100  }
101  // transportation
102  //
104 
105  // electromagnetic physics list
106  //
108 
109  // decay process
110  //
112 
113  // step limitation (as a full process)
114  //
115  AddStepMax();
116 }
117 
118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
119 
121 {
122  if (verboseLevel>0) {
123  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
124  }
125 
126  if (name == fEmName) return;
127 
128  if (name == "local") {
129 
130  fEmName = name;
131  delete fEmPhysicsList;
133 
134  } else if (name == "emstandard_opt0") {
135 
136  fEmName = name;
137  delete fEmPhysicsList;
139 
140  } else if (name == "emstandard_opt1") {
141 
142  fEmName = name;
143  delete fEmPhysicsList;
145 
146  } else if (name == "emstandard_opt2") {
147 
148  fEmName = name;
149  delete fEmPhysicsList;
151 
152  } else if (name == "emstandard_opt3") {
153 
154  fEmName = name;
155  delete fEmPhysicsList;
157 
158  } else if (name == "emstandard_opt4") {
159 
160  fEmName = name;
161  delete fEmPhysicsList;
163 
164  } else if (name == "emstandardWVI") {
165 
166  fEmName = name;
167  delete fEmPhysicsList;
169 
170  } else if (name == "emstandardGS") {
171 
172  fEmName = name;
173  delete fEmPhysicsList;
175 
176  } else if (name == "emstandardSS") {
177 
178  fEmName = name;
179  delete fEmPhysicsList;
181 
182  } else if (name == "empenelope"){
183  fEmName = name;
184  delete fEmPhysicsList;
186 
187  } else if (name == "emlivermore"){
188  fEmName = name;
189  delete fEmPhysicsList;
191 
192  } else if (name == "emlowenergy"){
193  fEmName = name;
194  delete fEmPhysicsList;
196 
197  } else {
198 
199  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
200  << " is not defined"
201  << G4endl;
202  }
203 }
204 
205 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
206 
208 {
209  // Step limitation seen as a process
210  StepMax* stepMaxProcess = new StepMax();
211 
212  theParticleIterator->reset();
213  while ((*theParticleIterator)()){
214  G4ParticleDefinition* particle = theParticleIterator->value();
215  G4ProcessManager* pmanager = particle->GetProcessManager();
216 
217  if (stepMaxProcess->IsApplicable(*particle))
218  {
219  pmanager ->AddDiscreteProcess(stepMaxProcess);
220  }
221  }
222 }
223 
224 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SetDefaultCutValue(G4double newCutValue)
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4LossTableManager * Instance()
G4String name
Definition: TRTMaterials.hh:40
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4VPhysicsConstructor * fDecay
Definition: PhysicsList.hh:66
G4ProcessManager * GetProcessManager() const
PhysicsListMessenger * fMessenger
Definition: PhysicsList.hh:78
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
virtual void ConstructParticle()=0
G4GLOB_DLL std::ostream G4cout
void SetVerboseLevel(G4int value)
void AddStepMax()
Definition: PhysicsList.cc:172
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