Geant4  10.01.p02
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 90770 2015-06-09 12:12:47Z gcosmo $
30 //
31 //---------------------------------------------------------------------------
32 //
33 // ClassName: PhysicsList
34 //
35 // Description: EM physics with a possibility to add PAI model
36 //
37 // Author: V.Ivanchenko 01.09.2010
38 //
39 //----------------------------------------------------------------------------
40 //
41 
42 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
44 
45 #include "PhysicsList.hh"
46 #include "PhysicsListMessenger.hh"
47 
48 #include "G4EmStandardPhysics.hh"
53 #include "G4EmLivermorePhysics.hh"
54 #include "G4EmPenelopePhysics.hh"
55 #include "G4EmLowEPPhysics.hh"
56 #include "G4DecayPhysics.hh"
57 
58 #include "G4PAIModel.hh"
59 #include "G4PAIPhotModel.hh"
60 
61 #include "G4Gamma.hh"
62 #include "G4Electron.hh"
63 #include "G4Positron.hh"
64 #include "G4Proton.hh"
65 
66 #include "G4UnitsTable.hh"
67 #include "G4SystemOfUnits.hh"
68 #include "G4LossTableManager.hh"
69 #include "G4ProductionCutsTable.hh"
70 #include "G4EmConfigurator.hh"
71 #include "G4EmParameters.hh"
72 
73 #include "StepMax.hh"
74 
75 #include "G4ProcessManager.hh"
76 #include "G4ParticleTypes.hh"
77 #include "G4ParticleTable.hh"
78 
79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
80 
82  fEmPhysicsList(0),
83  fDecayPhysicsList(0),
84  fStepMaxProcess(0),
85  fMessenger(0),
86  fPAI(false)
87 {
89 
91 
92  fMessenger = new PhysicsListMessenger(this);
93 
94  fStepMaxProcess = new StepMax();
95 
96  // Decay Physics is always defined
98 
99  // EM physics
100  fEmName = G4String("emstandard");
102 
103  SetVerboseLevel(1);
104 }
105 
106 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
107 
109 {
110  delete fMessenger;
111  delete fDecayPhysicsList;
112  delete fEmPhysicsList;
113  for(size_t i=0; i<fHadronPhys.size(); ++i) { delete fHadronPhys[i]; }
114  delete fStepMaxProcess;
115 }
116 
117 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
118 
120 {
122 }
123 
124 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
125 
127 {
130  if(fPAI) { AddPAIModel(fEmName); }
132  for(size_t i=0; i<fHadronPhys.size(); ++i) {
133  fHadronPhys[i]->ConstructProcess();
134  }
135  AddStepMax();
136 }
137 
138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
139 
141 {
142  if (verboseLevel>1) {
143  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
144  }
145 
146  if (name == fEmName) {
147  return;
148 
149  } else if (name == "emstandard_opt1") {
150 
151  fEmName = name;
152  delete fEmPhysicsList;
154 
155  } else if (name == "emstandard_opt2") {
156 
157  fEmName = name;
158  delete fEmPhysicsList;
160 
161  } else if (name == "emstandard_opt3") {
162 
163  fEmName = name;
164  delete fEmPhysicsList;
166 
167  } else if (name == "emstandard_opt4") {
168 
169  fEmName = name;
170  delete fEmPhysicsList;
172 
173  } else if (name == "emlivermore") {
174 
175  fEmName = name;
176  delete fEmPhysicsList;
178 
179  } else if (name == "empenelope") {
180 
181  fEmName = name;
182  delete fEmPhysicsList;
184 
185  } else if (name == "emlowenergy") {
186 
187  fEmName = name;
188  delete fEmPhysicsList;
190 
191  } else if (name == "pai") {
192 
193  fEmName = name;
194  fPAI = true;
195 
196  } else if (name == "pai_photon") {
197 
198  fEmName = name;
199  fPAI = true;
200 
201  } else {
202 
203  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
204  << " is not defined"
205  << G4endl;
206  }
207 }
208 
209 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
210 
212 {
213  // Step limitation seen as a process
214 
215  theParticleIterator->reset();
216  while ((*theParticleIterator)())
217  {
218  G4ParticleDefinition* particle = theParticleIterator->value();
219  G4ProcessManager* pmanager = particle->GetProcessManager();
220 
221  if (fStepMaxProcess->IsApplicable(*particle))
222  {
224  }
225  }
226 }
227 
228 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
229 
231 {
233  if ( verboseLevel > 0 ) { DumpCutValuesTable(); }
234 }
235 
236 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
237 
238 void PhysicsList::AddPAIModel(const G4String& modname)
239 {
240  theParticleIterator->reset();
241  while ((*theParticleIterator)())
242  {
243  G4ParticleDefinition* particle = theParticleIterator->value();
244  G4String partname = particle->GetParticleName();
245  if(partname == "e-" || partname == "e+") {
246  NewPAIModel(particle, modname, "eIoni");
247 
248  } else if(partname == "mu-" || partname == "mu+") {
249  NewPAIModel(particle, modname, "muIoni");
250 
251  } else if(partname == "proton" ||
252  partname == "pi+" ||
253  partname == "pi-"
254  ) {
255  NewPAIModel(particle, modname, "hIoni");
256  }
257  }
258 }
259 
260 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
261 
263  const G4String& modname,
264  const G4String& procname)
265 {
267  G4String partname = part->GetParticleName();
268  if(modname == "pai") {
269  G4PAIModel* pai = new G4PAIModel(part,"PAIModel");
270  config->SetExtraEmModel(partname,procname,pai,"GasDetector",
271  0.0,100.*TeV,pai);
272  } else if(modname == "pai_photon") {
273  G4PAIPhotModel* pai = new G4PAIPhotModel(part,"PAIPhotModel");
274  config->SetExtraEmModel(partname,procname,pai,"GasDetector",
275  0.0,100.*TeV,pai);
276  }
277 }
278 
279 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
280 
void SetDefaultCutValue(G4double newCutValue)
G4EmConfigurator * EmConfigurator()
void ConstructParticle()
Definition: PhysicsList.cc:117
void SetVerbose(G4int val)
static G4LossTableManager * Instance()
void AddPAIModel(const G4String &)
Definition: PhysicsList.cc:238
void SetEnergyRange(G4double lowedge, G4double highedge)
G4String name
Definition: TRTMaterials.hh:40
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
std::vector< G4VPhysicsConstructor * > fHadronPhys
Definition: PhysicsList.hh:76
G4ProcessManager * GetProcessManager() const
PhysicsListMessenger * fMessenger
Definition: PhysicsList.hh:78
const G4String & GetParticleName() const
void NewPAIModel(const G4ParticleDefinition *, const G4String &modname, const G4String &procname)
Definition: PhysicsList.cc:262
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
G4bool fPAI
Definition: PhysicsList.hh:84
virtual void ConstructParticle()=0
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
void SetVerboseLevel(G4int value)
void SetCuts()
Definition: PhysicsList.cc:219
void AddStepMax()
Definition: PhysicsList.cc:172
G4VPhysicsConstructor * fDecayPhysicsList
Definition: PhysicsList.hh:75
static G4ProductionCutsTable * GetProductionCutsTable()
static const double eV
Definition: G4SIunits.hh:194
static G4EmParameters * Instance()
G4VPhysicsConstructor * fEmPhysicsList
Definition: PhysicsList.hh:73
virtual void ConstructProcess()=0
G4StepLimiter * fStepMaxProcess
Definition: PhysicsList.hh:76
#define G4endl
Definition: G4ios.hh:61
static const double TeV
Definition: G4SIunits.hh:197
G4String fEmName
Definition: PhysicsList.hh:72
void ConstructProcess()
Definition: PhysicsList.cc:170
static const double mm
Definition: G4SIunits.hh:102
void SetExtraEmModel(const G4String &particleName, const G4String &processName, G4VEmModel *, const G4String &regionName="", G4double emin=0.0, G4double emax=DBL_MAX, G4VEmFluctuationModel *fm=0)
#define theParticleIterator
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:205