Geant4  10.00.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 77094 2013-11-21 10:51:54Z 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 "G4DecayPhysics.hh"
56 
57 #include "G4PAIModel.hh"
58 #include "G4PAIPhotModel.hh"
59 
60 #include "G4Gamma.hh"
61 #include "G4Electron.hh"
62 #include "G4Positron.hh"
63 #include "G4Proton.hh"
64 
65 #include "G4UnitsTable.hh"
66 #include "G4SystemOfUnits.hh"
67 #include "G4LossTableManager.hh"
68 #include "G4ProductionCutsTable.hh"
69 
70 #include "StepMax.hh"
71 
72 #include "G4ProcessManager.hh"
73 #include "G4ParticleTypes.hh"
74 #include "G4ParticleTable.hh"
75 
76 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
77 
79  fConfig(0),
80  fEmPhysicsList(0),
81  fDecayPhysicsList(0),
82  fStepMaxProcess(0),
83  fMessenger(0)
84 {
87  defaultCutValue = 1.*mm;
92 
93  fMessenger = new PhysicsListMessenger(this);
94 
95  fStepMaxProcess = new StepMax();
96 
97  // Decay Physics is always defined
99 
100  // EM physics
101  fEmName = G4String("emstandard");
103 
104  SetVerboseLevel(1);
105 }
106 
107 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
108 
110 {
111  delete fMessenger;
112  delete fDecayPhysicsList;
113  delete fEmPhysicsList;
114  for(size_t i=0; i<fHadronPhys.size(); ++i) { delete fHadronPhys[i]; }
115  delete fStepMaxProcess;
116 }
117 
118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
119 
121 {
123 }
124 
125 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
126 
128 {
132  for(size_t i=0; i<fHadronPhys.size(); ++i) {
133  fHadronPhys[i]->ConstructProcess(); }
134  AddStepMax();
135 }
136 
137 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
138 
140 {
141  if (verboseLevel>1) {
142  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
143  }
144 
145  if (name == fEmName) {
146  return;
147 
148  } else if (name == "emstandard_opt1") {
149 
150  fEmName = name;
151  delete fEmPhysicsList;
153 
154  } else if (name == "emstandard_opt2") {
155 
156  fEmName = name;
157  delete fEmPhysicsList;
159 
160  } else if (name == "emstandard_opt3") {
161 
162  fEmName = name;
163  delete fEmPhysicsList;
165 
166  } else if (name == "emstandard_opt4") {
167 
168  fEmName = name;
169  delete fEmPhysicsList;
171 
172  } else if (name == "emlivermore") {
173 
174  fEmName = name;
175  delete fEmPhysicsList;
177 
178  } else if (name == "empenelope") {
179 
180  fEmName = name;
181  delete fEmPhysicsList;
183 
184  } else if (name == "pai") {
185 
186  fEmName = name;
187  AddPAIModel(name);
188 
189  } else if (name == "pai_photon") {
190 
191  fEmName = name;
192  AddPAIModel(name);
193 
194  } else {
195 
196  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
197  << " is not defined"
198  << G4endl;
199  }
200 }
201 
202 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
203 
205 {
206  // Step limitation seen as a process
207 
208  theParticleIterator->reset();
209  while ((*theParticleIterator)())
210  {
211  G4ParticleDefinition* particle = theParticleIterator->value();
212  G4ProcessManager* pmanager = particle->GetProcessManager();
213 
214  if (fStepMaxProcess->IsApplicable(*particle))
215  {
217  }
218  }
219 }
220 
221 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
222 
224 {
226  if ( verboseLevel > 0 )
227  {
228  G4cout << "PhysicsList::SetCuts:";
229  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
230  }
231 
232  // set cut values for gamma at first and for e- second and next for e+,
233  // because some processes for e+/e- need cut values for gamma
234 
235  SetCutValue(fCutForGamma, "gamma");
238  SetCutValue(fCutForProton, "proton");
239 
240  if ( verboseLevel > 0 ) { DumpCutValuesTable(); }
241 }
242 
243 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
244 
246 {
247  fCutForGamma = cut;
249 }
250 
251 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
252 
254 {
255  fCutForElectron = cut;
257 }
258 
259 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
260 
262 {
263  fCutForPositron = cut;
265 }
266 
267 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
268 
270 {
271  fCutForProton = cut;
273 }
274 
275 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
276 
277 void PhysicsList::AddPAIModel(const G4String& modname)
278 {
279  theParticleIterator->reset();
280  while ((*theParticleIterator)())
281  {
282  G4ParticleDefinition* particle = theParticleIterator->value();
283  G4String partname = particle->GetParticleName();
284  if(partname == "e-" || partname == "e+") {
285  NewPAIModel(particle, modname, "eIoni");
286 
287  } else if(partname == "mu-" || partname == "mu+") {
288  NewPAIModel(particle, modname, "muIoni");
289 
290  } else if(partname == "proton" ||
291  partname == "pi+" ||
292  partname == "pi-"
293  ) {
294  NewPAIModel(particle, modname, "hIoni");
295  }
296  }
297 }
298 
299 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
300 
302  const G4String& modname,
303  const G4String& procname)
304 {
305  G4String partname = part->GetParticleName();
306  if(modname == "pai") {
307  G4PAIModel* pai = new G4PAIModel(part,"PAIModel");
308  fConfig->SetExtraEmModel(partname,procname,pai,"GasDetector",
309  0.0,100.*TeV,pai);
310  } else if(modname == "pai_photon") {
311  G4PAIPhotModel* pai = new G4PAIPhotModel(part,"PAIPhotModel");
312  fConfig->SetExtraEmModel(partname,procname,pai,"GasDetector",
313  0.0,100.*TeV,pai);
314  }
315 }
316 
317 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
318 
G4EmConfigurator * EmConfigurator()
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4LossTableManager * Instance()
void AddPAIModel(const G4String &)
Definition: PhysicsList.cc:277
void SetCutValue(G4double aCut, const G4String &pname)
void SetCutForGamma(G4double)
Definition: PhysicsList.cc:231
void SetEnergyRange(G4double lowedge, G4double highedge)
G4String name
Definition: TRTMaterials.hh:40
G4double fCutForPositron
Definition: PhysicsList.hh:70
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
void SetCutForPositron(G4double)
Definition: PhysicsList.cc:247
G4double fCutForElectron
Definition: PhysicsList.hh:69
void SetCutForProton(G4double)
Definition: PhysicsList.cc:269
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
std::vector< G4VPhysicsConstructor * > fHadronPhys
Definition: PhysicsList.hh:85
G4ProcessManager * GetProcessManager() const
void SetCutForElectron(G4double)
Definition: PhysicsList.cc:239
PhysicsListMessenger * fMessenger
Definition: PhysicsList.hh:78
const G4String & GetParticleName() const
void NewPAIModel(const G4ParticleDefinition *, const G4String &modname, const G4String &procname)
Definition: PhysicsList.cc:301
G4double fCutForProton
Definition: PhysicsList.hh:68
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
virtual void ConstructParticle()=0
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
G4double fCutForGamma
Definition: PhysicsList.hh:64
static G4Proton * Proton()
Definition: G4Proton.cc:93
void SetVerboseLevel(G4int value)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
void SetCuts()
Definition: PhysicsList.cc:219
void AddStepMax()
Definition: PhysicsList.cc:172
G4VPhysicsConstructor * fDecayPhysicsList
Definition: PhysicsList.hh:89
static G4ProductionCutsTable * GetProductionCutsTable()
static const double eV
Definition: G4SIunits.hh:194
static G4Positron * Positron()
Definition: G4Positron.cc:94
G4VPhysicsConstructor * fEmPhysicsList
Definition: PhysicsList.hh:73
virtual void ConstructProcess()=0
G4StepLimiter * fStepMaxProcess
Definition: PhysicsList.hh:76
void SetVerbose(G4int val)
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
static const double TeV
Definition: G4SIunits.hh:197
double G4double
Definition: G4Types.hh:76
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:81
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:205