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 83428 2014-08-21 15:46:01Z 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 "G4EmLivermorePhysics.hh"
43 #include "G4EmPenelopePhysics.hh"
44 #include "G4EmLowEPPhysics.hh"
45 #include "G4DecayPhysics.hh"
46 
47 #include "G4ParticleDefinition.hh"
48 #include "G4ProcessManager.hh"
49 #include "G4ParticleTable.hh"
50 #include "G4ProcessTable.hh"
51 
52 #include "G4Gamma.hh"
53 #include "G4Electron.hh"
54 #include "G4Positron.hh"
55 
57 
58 #include "G4AnnihiToMuPair.hh"
59 #include "G4eeToHadrons.hh"
60 
61 #include "G4SystemOfUnits.hh"
62 #include "G4UnitsTable.hh"
63 #include "G4LossTableManager.hh"
64 
65 #include "StepMax.hh"
66 
67 
68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
69 
71  fEmPhysicsList(0),
72  fDecayPhysicsList(0),
73  fStepMaxProcess(0),
74  fMes(0)
75 {
77 
78  defaultCutValue = 1.*km;
79  fMes = new PhysicsListMessenger(this);
80 
81  fStepMaxProcess = new StepMax();
82 
84 
85  SetVerboseLevel(2);
86 }
87 
88 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
89 
91 {
92  delete fMes;
93  delete fDecayPhysicsList;
94  delete fEmPhysicsList;
95  delete fStepMaxProcess;
96 }
97 
98 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
99 
101 {
103 }
104 
105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
106 
108 {
110 
113 
114  AddStepMax();
115 
117 }
118 
119 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
120 
122 {
123  const G4ParticleDefinition* particle = G4Gamma::Gamma();
124  G4ProcessManager* pmanager = particle->GetProcessManager();
125 
127 
128  particle = G4Positron::Positron();
129  pmanager = particle->GetProcessManager();
130 
131  pmanager->AddDiscreteProcess(new G4AnnihiToMuPair);
132  pmanager->AddDiscreteProcess(new G4eeToHadrons);
133 }
134 
135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
136 
138 {
139  G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable();
140  G4GammaConversionToMuons* gammaToMuPairProcess = (G4GammaConversionToMuons*)
141  theProcessTable->FindProcess("GammaToMuPair","gamma");
142  if(gammaToMuPairProcess) gammaToMuPairProcess->SetCrossSecFactor(fac);
143  else G4cout
144  << "Warning. No process GammaToMuPair found, SetGammaToMuPairFac was ignored"
145  << G4endl;
146 }
147 
148 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
149 
151 {
152  G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable();
153  G4AnnihiToMuPair* annihiToMuPairProcess = (G4AnnihiToMuPair*)
154  theProcessTable->FindProcess("AnnihiToMuPair","e+");
155  if(annihiToMuPairProcess) annihiToMuPairProcess->SetCrossSecFactor(fac);
156  else G4cout
157  << "Warning. No process AnnihiToMuPair found, SetAnnihiToMuPairFac ignored"
158  << G4endl;
159 }
160 
161 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
162 
164 {
165  G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable();
166  G4eeToHadrons* eehadProcess = (G4eeToHadrons*)
167  theProcessTable->FindProcess("ee2hadr","e+");
168  if(eehadProcess) eehadProcess->SetCrossSecFactor(fac);
169  else G4cout
170  << "Warning. No process ee2hadr found, SetAnnihiToHadronFac was ignored"
171  << G4endl;
172 }
173 
174 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
175 
177 {
178  if (verboseLevel>1) {
179  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
180  }
181 
182  if (name == fEmName) {
183  return;
184 
185  } else if (name == "emstandard_opt0") {
186 
187  fEmName = name;
188  delete fEmPhysicsList;
190 
191  } else if (name == "emstandard_opt1") {
192 
193  fEmName = name;
194  delete fEmPhysicsList;
196 
197  } else if (name == "emstandard_opt2") {
198 
199  fEmName = name;
200  delete fEmPhysicsList;
202 
203  } else if (name == "emstandard_opt3") {
204 
205  fEmName = name;
206  delete fEmPhysicsList;
208 
209  } else if (name == "emstandard_opt4") {
210 
211  fEmName = name;
212  delete fEmPhysicsList;
214 
215  } else if (name == "emlivermore") {
216 
217  fEmName = name;
218  delete fEmPhysicsList;
220 
221  } else if (name == "empenelope") {
222 
223  fEmName = name;
224  delete fEmPhysicsList;
226 
227  } else if (name == "emlowenergy") {
228 
229  fEmName = name;
230  delete fEmPhysicsList;
232 
233  } else {
234 
235  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
236  << " is not defined"
237  << G4endl;
238  }
239 }
240 
241 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
242 
244 {
245  //Step limitation seen as a process
246 
247  theParticleIterator->reset();
248  while ((*theParticleIterator)())
249  {
250  G4ParticleDefinition* particle = theParticleIterator->value();
251  G4ProcessManager* pmanager = particle->GetProcessManager();
252 
253  if (fStepMaxProcess->IsApplicable(*particle))
254  {
256  }
257  }
258 }
259 
260 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
261 
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:137
virtual void ConstructParticle()=0
G4GLOB_DLL std::ostream G4cout
void SetAnnihiToHadronFac(G4double)
Definition: PhysicsList.cc:163
void SetAnnihiToMuPairFac(G4double)
Definition: PhysicsList.cc:150
void ConstructHighEnergy()
Definition: PhysicsList.cc:121
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:114
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