Geant4  10.02.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 93739 2015-10-30 11:04:09Z gcosmo $
30 //
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 #include "PhysicsList.hh"
35 #include "PhysicsListMessenger.hh"
36 
37 #include "G4EmStandardPhysics.hh"
42 #include "G4EmStandardPhysicsGS.hh"
44 #include "G4EmStandardPhysicsSS.hh"
45 #include "G4EmLivermorePhysics.hh"
46 #include "G4EmPenelopePhysics.hh"
47 #include "G4EmLowEPPhysics.hh"
48 
49 #include "G4DecayPhysics.hh"
50 
51 #include "G4ParticleDefinition.hh"
52 #include "G4ProcessManager.hh"
53 #include "G4ParticleTable.hh"
54 #include "G4ProcessTable.hh"
55 
56 #include "G4Gamma.hh"
57 #include "G4Electron.hh"
58 #include "G4Positron.hh"
59 
61 
62 #include "G4AnnihiToMuPair.hh"
63 #include "G4eeToHadrons.hh"
64 
65 #include "G4SystemOfUnits.hh"
66 #include "G4UnitsTable.hh"
67 #include "G4LossTableManager.hh"
68 
69 #include "StepMax.hh"
70 
71 
72 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
73 
75  fEmPhysicsList(0),
76  fDecayPhysicsList(0),
77  fStepMaxProcess(0),
78  fMes(0)
79 {
81 
82  defaultCutValue = 1.*km;
83  fMes = new PhysicsListMessenger(this);
84 
85  fStepMaxProcess = new StepMax();
86 
88 
89  SetVerboseLevel(2);
90 }
91 
92 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
93 
95 {
96  delete fMes;
97  delete fDecayPhysicsList;
98  delete fEmPhysicsList;
99  delete fStepMaxProcess;
100 }
101 
102 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
103 
105 {
107 }
108 
109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
110 
112 {
114 
117 
118  AddStepMax();
119 
121 }
122 
123 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
124 
126 {
127  const G4ParticleDefinition* particle = G4Gamma::Gamma();
128  G4ProcessManager* pmanager = particle->GetProcessManager();
129 
131 
132  particle = G4Positron::Positron();
133  pmanager = particle->GetProcessManager();
134 
135  pmanager->AddDiscreteProcess(new G4AnnihiToMuPair);
136  pmanager->AddDiscreteProcess(new G4eeToHadrons);
137 }
138 
139 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
140 
142 {
143  G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable();
144  G4GammaConversionToMuons* gammaToMuPairProcess = (G4GammaConversionToMuons*)
145  theProcessTable->FindProcess("GammaToMuPair","gamma");
146  if(gammaToMuPairProcess) gammaToMuPairProcess->SetCrossSecFactor(fac);
147  else G4cout
148  << "Warning. No process GammaToMuPair found, SetGammaToMuPairFac was ignored"
149  << G4endl;
150 }
151 
152 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
153 
155 {
156  G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable();
157  G4AnnihiToMuPair* annihiToMuPairProcess = (G4AnnihiToMuPair*)
158  theProcessTable->FindProcess("AnnihiToMuPair","e+");
159  if(annihiToMuPairProcess) annihiToMuPairProcess->SetCrossSecFactor(fac);
160  else G4cout
161  << "Warning. No process AnnihiToMuPair found, SetAnnihiToMuPairFac ignored"
162  << G4endl;
163 }
164 
165 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
166 
168 {
169  G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable();
170  G4eeToHadrons* eehadProcess = (G4eeToHadrons*)
171  theProcessTable->FindProcess("ee2hadr","e+");
172  if(eehadProcess) eehadProcess->SetCrossSecFactor(fac);
173  else G4cout
174  << "Warning. No process ee2hadr found, SetAnnihiToHadronFac was ignored"
175  << G4endl;
176 }
177 
178 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
179 
181 {
182  if (verboseLevel>1) {
183  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
184  }
185 
186  if (name == fEmName) {
187  return;
188 
189  } else if (name == "emstandard_opt0") {
190 
191  fEmName = name;
192  delete fEmPhysicsList;
194 
195  } else if (name == "emstandard_opt1") {
196 
197  fEmName = name;
198  delete fEmPhysicsList;
200 
201  } else if (name == "emstandard_opt2") {
202 
203  fEmName = name;
204  delete fEmPhysicsList;
206 
207  } else if (name == "emstandard_opt3") {
208 
209  fEmName = name;
210  delete fEmPhysicsList;
212 
213  } else if (name == "emstandard_opt4") {
214 
215  fEmName = name;
216  delete fEmPhysicsList;
218 
219  } else if (name == "emlivermore") {
220 
221  fEmName = name;
222  delete fEmPhysicsList;
224 
225  } else if (name == "empenelope") {
226 
227  fEmName = name;
228  delete fEmPhysicsList;
230 
231  } else if (name == "emlowenergy") {
232 
233  fEmName = name;
234  delete fEmPhysicsList;
236 
237  } else if (name == "emstandardGS") {
238 
239  fEmName = name;
240  delete fEmPhysicsList;
242 
243  } else if (name == "emstandardSS") {
244 
245  fEmName = name;
246  delete fEmPhysicsList;
248 
249  } else if (name == "emstandardWVI") {
250 
251  fEmName = name;
252  delete fEmPhysicsList;
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 
269  theParticleIterator->reset();
270  while ((*theParticleIterator)())
271  {
272  G4ParticleDefinition* particle = theParticleIterator->value();
273  G4ProcessManager* pmanager = particle->GetProcessManager();
274 
275  if (fStepMaxProcess->IsApplicable(*particle))
276  {
278  }
279  }
280 }
281 
282 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
283 
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4LossTableManager * Instance()
G4String name
Definition: TRTMaterials.hh:40
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4ProcessManager * GetProcessManager() const
void AddPhysicsList(const G4String &name)
Definition: PhysicsList.cc:191
void SetGammaToMuPairFac(G4double)
Definition: PhysicsList.cc:141
virtual void ConstructParticle()=0
G4GLOB_DLL std::ostream G4cout
void SetAnnihiToHadronFac(G4double)
Definition: PhysicsList.cc:167
void SetAnnihiToMuPairFac(G4double)
Definition: PhysicsList.cc:154
void ConstructHighEnergy()
Definition: PhysicsList.cc:125
void SetCrossSecFactor(G4double fac)
void SetVerboseLevel(G4int value)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
void AddStepMax()
Definition: PhysicsList.cc:172
G4VPhysicsConstructor * fDecayPhysicsList
Definition: PhysicsList.hh:75
static G4Positron * Positron()
Definition: G4Positron.cc:94
static const double km
Definition: G4SIunits.hh:132
G4VPhysicsConstructor * fEmPhysicsList
Definition: PhysicsList.hh:73
virtual void ConstructProcess()=0
G4StepLimiter * fStepMaxProcess
Definition: PhysicsList.hh:76
void SetVerbose(G4int val)
static const G4double fac
#define G4endl
Definition: G4ios.hh:61
void SetCrossSecFactor(G4double fac)
double G4double
Definition: G4Types.hh:76
G4String fEmName
Definition: PhysicsList.hh:72
void ConstructProcess()
Definition: PhysicsList.cc:170
static G4ProcessTable * GetProcessTable()
G4VProcess * FindProcess(const G4String &processName, const G4String &particleName) const
#define theParticleIterator
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:205
PhysicsListMessenger * fMes
Definition: PhysicsList.hh:80