Geant4  10.03.p03
 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 100289 2016-10-17 08:46:50Z 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";
70  fEmPhysicsList = new G4EmStandardPhysics();
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 {
90  fEmPhysicsList->ConstructParticle();
91  fDecay->ConstructParticle();
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  //
107  fEmPhysicsList->ConstructProcess();
108 
109  // decay process
110  //
111  fDecay->ConstructProcess();
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;
132  fEmPhysicsList = new PhysListEmStandard(name);
133 
134  } else if (name == "emstandard_opt0") {
135 
136  fEmName = name;
137  delete fEmPhysicsList;
138  fEmPhysicsList = new G4EmStandardPhysics();
139 
140  } else if (name == "emstandard_opt1") {
141 
142  fEmName = name;
143  delete fEmPhysicsList;
144  fEmPhysicsList = new G4EmStandardPhysics_option1();
145 
146  } else if (name == "emstandard_opt2") {
147 
148  fEmName = name;
149  delete fEmPhysicsList;
150  fEmPhysicsList = new G4EmStandardPhysics_option2();
151 
152  } else if (name == "emstandard_opt3") {
153 
154  fEmName = name;
155  delete fEmPhysicsList;
156  fEmPhysicsList = new G4EmStandardPhysics_option3();
157 
158  } else if (name == "emstandard_opt4") {
159 
160  fEmName = name;
161  delete fEmPhysicsList;
162  fEmPhysicsList = new G4EmStandardPhysics_option4();
163 
164  } else if (name == "emstandardWVI") {
165 
166  fEmName = name;
167  delete fEmPhysicsList;
168  fEmPhysicsList = new G4EmStandardPhysicsWVI();
169 
170  } else if (name == "emstandardGS") {
171 
172  fEmName = name;
173  delete fEmPhysicsList;
174  fEmPhysicsList = new G4EmStandardPhysicsGS();
175 
176  } else if (name == "emstandardSS") {
177 
178  fEmName = name;
179  delete fEmPhysicsList;
180  fEmPhysicsList = new G4EmStandardPhysicsSS();
181 
182  } else if (name == "empenelope"){
183  fEmName = name;
184  delete fEmPhysicsList;
185  fEmPhysicsList = new G4EmPenelopePhysics();
186 
187  } else if (name == "emlivermore"){
188  fEmName = name;
189  delete fEmPhysicsList;
190  fEmPhysicsList = new G4EmLivermorePhysics();
191 
192  } else if (name == "emlowenergy"){
193  fEmName = name;
194  delete fEmPhysicsList;
195  fEmPhysicsList = new G4EmLowEPPhysics();
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 
213  particleIterator->reset();
214  while ((*particleIterator)()){
215  G4ParticleDefinition* particle = particleIterator->value();
216  G4ProcessManager* pmanager = particle->GetProcessManager();
217 
218  if (stepMaxProcess->IsApplicable(*particle))
219  {
220  pmanager ->AddDiscreteProcess(stepMaxProcess);
221  }
222  }
223 }
224 
225 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void SetDefaultCutValue(G4double newCutValue)
const XML_Char * name
Definition: expat.h:151
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4LossTableManager * Instance()
static constexpr double mm
Definition: G4SIunits.hh:115
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
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
G4ProcessManager * GetProcessManager() const
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: StepMax.cc:51
virtual void ConstructProcess()=0
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
#define G4endl
Definition: G4ios.hh:61
void ConstructProcess()
Definition: PhysicsList.cc:170