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 101250 2016-11-10 08:54:02Z 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 "PhysListEmStandardNR.hh"
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 "G4DecayPhysics.hh"
53 
57 #include "G4HadronInelasticQBBC.hh"
58 #include "G4IonPhysics.hh"
59 
60 #include "G4LossTableManager.hh"
61 #include "G4EmConfigurator.hh"
62 #include "G4UnitsTable.hh"
63 
64 #include "G4ProcessManager.hh"
65 #include "G4Decay.hh"
66 
67 #include "StepMax.hh"
68 
69 #include "G4IonFluctuations.hh"
72 
73 #include "G4BraggIonGasModel.hh"
75 
76 #include "G4PhysicalConstants.hh"
77 #include "G4SystemOfUnits.hh"
78 
79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
80 
82  fStepMaxProcess(nullptr)
83 {
84  fHelIsRegisted = false;
85  fBicIsRegisted = false;
86  fBiciIsRegisted = false;
87 
88  // protected member of the base class
89  verboseLevel = 1;
90 
91  fMessenger = new PhysicsListMessenger(this);
92 
93  // EM physics
94  fEmName = G4String("emstandard_opt0");
95  fEmPhysicsList = new G4EmStandardPhysics(verboseLevel);
96 
97  // Deacy physics and all particles
98  fDecPhysicsList = new G4DecayPhysics(verboseLevel);
99 }
100 
101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
102 
104 {
105  delete fMessenger;
106  delete fEmPhysicsList;
107  delete fDecPhysicsList;
108  for(size_t i=0; i<fHadronPhys.size(); i++) {delete fHadronPhys[i];}
109 }
110 
111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
112 
114 {
115  fDecPhysicsList->ConstructParticle();
116 }
117 
118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
119 
121 {
122  // transportation
123  //
125 
126  // electromagnetic physics list
127  //
128  fEmPhysicsList->ConstructProcess();
129 
130  // decay physics list
131  //
132  fDecPhysicsList->ConstructProcess();
133 
134  // hadronic physics lists
135  for(size_t i=0; i<fHadronPhys.size(); i++) {
136  fHadronPhys[i]->ConstructProcess();
137  }
138 
139  // step limitation (as a full process)
140  //
141  AddStepMax();
142 }
143 
144 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
145 
147 {
148  if (verboseLevel>1) {
149  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
150  }
151 
152  if (name == fEmName) return;
153 
154  if (name == "local") {
155 
156  fEmName = name;
157  delete fEmPhysicsList;
158  fEmPhysicsList = new PhysListEmStandard(name);
159 
160  } else if (name == "emstandard_opt0") {
161 
162  fEmName = name;
163  delete fEmPhysicsList;
164  fEmPhysicsList = new G4EmStandardPhysics(verboseLevel);
165 
166  } else if (name == "emstandard_opt1") {
167 
168  fEmName = name;
169  delete fEmPhysicsList;
170  fEmPhysicsList = new G4EmStandardPhysics_option1(verboseLevel);
171 
172  } else if (name == "emstandard_opt2") {
173 
174  fEmName = name;
175  delete fEmPhysicsList;
176  fEmPhysicsList = new G4EmStandardPhysics_option2(verboseLevel);
177 
178  } else if (name == "emstandard_opt3") {
179 
180  fEmName = name;
181  delete fEmPhysicsList;
182  fEmPhysicsList = new G4EmStandardPhysics_option3(verboseLevel);
183 
184  } else if (name == "emstandard_opt4") {
185 
186  fEmName = name;
187  delete fEmPhysicsList;
188  fEmPhysicsList = new G4EmStandardPhysics_option4(verboseLevel);
189 
190  } else if (name == "ionGasModels") {
191 
192  AddPhysicsList("emstandard_opt0");
193  fEmName = name;
194  AddIonGasModels();
195 
196  } else if (name == "standardNR") {
197 
198  fEmName = name;
199  delete fEmPhysicsList;
200  fEmPhysicsList = new PhysListEmStandardNR(name);
201 
202  } else if (name == "emlivermore") {
203  fEmName = name;
204  delete fEmPhysicsList;
205  fEmPhysicsList = new G4EmLivermorePhysics(verboseLevel);
206 
207  } else if (name == "empenelope") {
208  fEmName = name;
209  delete fEmPhysicsList;
210  fEmPhysicsList = new G4EmPenelopePhysics(verboseLevel);
211 
212  } else if (name == "emlowenergy") {
213  fEmName = name;
214  delete fEmPhysicsList;
215  fEmPhysicsList = new G4EmLowEPPhysics(verboseLevel);
216 
217  } else if (name == "emstandardSS") {
218 
219  fEmName = name;
220  delete fEmPhysicsList;
221  fEmPhysicsList = new G4EmStandardPhysicsSS(verboseLevel);
222 
223  } else if (name == "emstandardWVI") {
224 
225  fEmName = name;
226  delete fEmPhysicsList;
227  fEmPhysicsList = new G4EmStandardPhysicsWVI(verboseLevel);
228 
229  } else if (name == "emstandardGS") {
230 
231  fEmName = name;
232  delete fEmPhysicsList;
233  fEmPhysicsList = new G4EmStandardPhysicsGS(verboseLevel);
234 
235  } else if (name == "elastic" && !fHelIsRegisted) {
236  fHadronPhys.push_back( new G4HadronElasticPhysics(verboseLevel));
237  fHelIsRegisted = true;
238 
239  } else if (name == "DElastic" && !fHelIsRegisted) {
240  fHadronPhys.push_back( new G4HadronDElasticPhysics(verboseLevel));
241  fHelIsRegisted = true;
242 
243  } else if (name == "HElastic" && !fHelIsRegisted) {
244  fHadronPhys.push_back( new G4HadronHElasticPhysics(verboseLevel));
245  fHelIsRegisted = true;
246 
247  } else if (name == "binary" && !fBicIsRegisted) {
248  fHadronPhys.push_back(new G4HadronInelasticQBBC(verboseLevel));
249  fBicIsRegisted = true;
250 
251  } else if (name == "binary_ion" && !fBiciIsRegisted) {
252  fHadronPhys.push_back(new G4IonPhysics(verboseLevel));
253  fBiciIsRegisted = true;
254 
255  } else {
256 
257  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
258  << " is not defined"
259  << G4endl;
260  }
261 }
262 
263 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
264 
266 {
267  // Step limitation seen as a process
268  fStepMaxProcess = new StepMax();
269 
271  particleIterator->reset();
272  while ((*particleIterator)()){
273  G4ParticleDefinition* particle = particleIterator->value();
274  G4ProcessManager* pmanager = particle->GetProcessManager();
275 
276  if (fStepMaxProcess->IsApplicable(*particle) && pmanager)
277  {
278  pmanager ->AddDiscreteProcess(fStepMaxProcess);
279  }
280  }
281 }
282 
283 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
284 
285 void PhysicsList::AddIonGasModels()
286 {
287  G4EmConfigurator* em_config =
290  particleIterator->reset();
291  while ((*particleIterator)())
292  {
293  G4ParticleDefinition* particle = particleIterator->value();
294  G4String partname = particle->GetParticleName();
295  if(partname == "alpha" || partname == "He3" || partname == "GenericIon") {
298  G4double eth = 2.*MeV*particle->GetPDGMass()/proton_mass_c2;
299  em_config->SetExtraEmModel(partname,"ionIoni",mod1,"",0.0,eth,
300  new G4IonFluctuations());
301  em_config->SetExtraEmModel(partname,"ionIoni",mod2,"",eth,100*TeV,
302  new G4UniversalFluctuation());
303 
304  }
305  }
306 }
307 
308 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
309 
G4EmConfigurator * EmConfigurator()
const XML_Char * name
Definition: expat.h:151
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4LossTableManager * Instance()
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
void SetExtraEmModel(const G4String &particleName, const G4String &processName, G4VEmModel *, const G4String &regionName="", G4double emin=0.0, G4double emax=DBL_MAX, G4VEmFluctuationModel *fm=nullptr)
const G4String & GetParticleName() const
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
static constexpr double TeV
Definition: G4SIunits.hh:218
virtual void ConstructParticle()=0
G4GLOB_DLL std::ostream G4cout
float proton_mass_c2
Definition: hepunit.py:275
void AddStepMax()
Definition: PhysicsList.cc:172
G4double GetPDGMass() const
G4ProcessManager * GetProcessManager() const
virtual void ConstructProcess()=0
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
Definition of the PhysListEmStandardNR class.
double G4double
Definition: G4Types.hh:76
void ConstructProcess()
Definition: PhysicsList.cc:170
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:205