Geant4  10.01.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 82219 2014-06-12 09:38:27Z 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 
71 #include "StepMax.hh"
72 
73 #include "G4ProcessManager.hh"
74 #include "G4ParticleTypes.hh"
75 #include "G4ParticleTable.hh"
76 
77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78 
80  fConfig(0),
81  fEmPhysicsList(0),
82  fDecayPhysicsList(0),
83  fStepMaxProcess(0),
84  fMessenger(0)
85 {
88 
90 
91  fMessenger = new PhysicsListMessenger(this);
92 
93  fStepMaxProcess = new StepMax();
94 
95  // Decay Physics is always defined
97 
98  // EM physics
99  fEmName = G4String("emstandard");
101 
102  SetVerboseLevel(1);
103 }
104 
105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
106 
108 {
109  delete fMessenger;
110  delete fDecayPhysicsList;
111  delete fEmPhysicsList;
112  for(size_t i=0; i<fHadronPhys.size(); ++i) { delete fHadronPhys[i]; }
113  delete fStepMaxProcess;
114 }
115 
116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
117 
119 {
121 }
122 
123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
124 
126 {
130  for(size_t i=0; i<fHadronPhys.size(); ++i) {
131  fHadronPhys[i]->ConstructProcess(); }
132  AddStepMax();
133 }
134 
135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
136 
138 {
139  if (verboseLevel>1) {
140  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
141  }
142 
143  if (name == fEmName) {
144  return;
145 
146  } else if (name == "emstandard_opt1") {
147 
148  fEmName = name;
149  delete fEmPhysicsList;
151 
152  } else if (name == "emstandard_opt2") {
153 
154  fEmName = name;
155  delete fEmPhysicsList;
157 
158  } else if (name == "emstandard_opt3") {
159 
160  fEmName = name;
161  delete fEmPhysicsList;
163 
164  } else if (name == "emstandard_opt4") {
165 
166  fEmName = name;
167  delete fEmPhysicsList;
169 
170  } else if (name == "emlivermore") {
171 
172  fEmName = name;
173  delete fEmPhysicsList;
175 
176  } else if (name == "empenelope") {
177 
178  fEmName = name;
179  delete fEmPhysicsList;
181 
182  } else if (name == "emlowenergy") {
183 
184  fEmName = name;
185  delete fEmPhysicsList;
187 
188  } else if (name == "pai") {
189 
190  fEmName = name;
191  AddPAIModel(name);
192 
193  } else if (name == "pai_photon") {
194 
195  fEmName = name;
196  AddPAIModel(name);
197 
198  } else {
199 
200  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
201  << " is not defined"
202  << G4endl;
203  }
204 }
205 
206 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
207 
209 {
210  // Step limitation seen as a process
211 
212  theParticleIterator->reset();
213  while ((*theParticleIterator)())
214  {
215  G4ParticleDefinition* particle = theParticleIterator->value();
216  G4ProcessManager* pmanager = particle->GetProcessManager();
217 
218  if (fStepMaxProcess->IsApplicable(*particle))
219  {
221  }
222  }
223 }
224 
225 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
226 
228 {
230  if ( verboseLevel > 0 ) { DumpCutValuesTable(); }
231 }
232 
233 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
234 
235 void PhysicsList::AddPAIModel(const G4String& modname)
236 {
237  theParticleIterator->reset();
238  while ((*theParticleIterator)())
239  {
240  G4ParticleDefinition* particle = theParticleIterator->value();
241  G4String partname = particle->GetParticleName();
242  if(partname == "e-" || partname == "e+") {
243  NewPAIModel(particle, modname, "eIoni");
244 
245  } else if(partname == "mu-" || partname == "mu+") {
246  NewPAIModel(particle, modname, "muIoni");
247 
248  } else if(partname == "proton" ||
249  partname == "pi+" ||
250  partname == "pi-"
251  ) {
252  NewPAIModel(particle, modname, "hIoni");
253  }
254  }
255 }
256 
257 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
258 
260  const G4String& modname,
261  const G4String& procname)
262 {
263  G4String partname = part->GetParticleName();
264  if(modname == "pai") {
265  G4PAIModel* pai = new G4PAIModel(part,"PAIModel");
266  fConfig->SetExtraEmModel(partname,procname,pai,"GasDetector",
267  0.0,100.*TeV,pai);
268  } else if(modname == "pai_photon") {
269  G4PAIPhotModel* pai = new G4PAIPhotModel(part,"PAIPhotModel");
270  fConfig->SetExtraEmModel(partname,procname,pai,"GasDetector",
271  0.0,100.*TeV,pai);
272  }
273 }
274 
275 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
276 
void SetDefaultCutValue(G4double newCutValue)
G4EmConfigurator * EmConfigurator()
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4LossTableManager * Instance()
void AddPAIModel(const G4String &)
Definition: PhysicsList.cc:235
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:259
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
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
G4VPhysicsConstructor * fEmPhysicsList
Definition: PhysicsList.hh:73
virtual void ConstructProcess()=0
G4StepLimiter * fStepMaxProcess
Definition: PhysicsList.hh:76
void SetVerbose(G4int val)
#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
G4EmConfigurator * fConfig
Definition: PhysicsList.hh:77
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:205