Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
examples/extended/electromagnetic/TestEm15/src/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 //
26 /// \file electromagnetic/TestEm15/src/PhysicsList.cc
27 /// \brief Implementation of the PhysicsList class
28 //
29 //
30 // $Id: PhysicsList.cc 68585 2013-04-01 23:35:07Z adotti $
31 //
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
34 
35 #include "PhysicsList.hh"
36 #include "PhysicsListMessenger.hh"
37 
38 #include "PhysListEmStandard.hh"
39 
40 #include "G4LossTableManager.hh"
41 #include "G4UnitsTable.hh"
42 #include "G4SystemOfUnits.hh"
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 
48  fEmPhysicsList(0),
49  fMessenger(0)
50 {
52 
53  fCurrentDefaultCut = 1.0*mm;
54  fCutForGamma = fCurrentDefaultCut;
55  fCutForElectron = fCurrentDefaultCut;
56  fCutForPositron = fCurrentDefaultCut;
57 
58  fMessenger = new PhysicsListMessenger(this);
59 
60  SetVerboseLevel(1);
61 
62  // EM physics
63  fEmName = G4String("standard");
64  fEmPhysicsList = new PhysListEmStandard(fEmName);
65 
66 }
67 
68 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
69 
71 {
72  delete fMessenger;
73 }
74 
75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
76 
77 // Bosons
78 #include "G4ChargedGeantino.hh"
79 #include "G4Geantino.hh"
80 #include "G4Gamma.hh"
81 #include "G4OpticalPhoton.hh"
82 
83 // leptons
84 #include "G4MuonPlus.hh"
85 #include "G4MuonMinus.hh"
86 #include "G4NeutrinoMu.hh"
87 #include "G4AntiNeutrinoMu.hh"
88 
89 #include "G4Electron.hh"
90 #include "G4Positron.hh"
91 #include "G4NeutrinoE.hh"
92 #include "G4AntiNeutrinoE.hh"
93 
94 // Mesons
95 #include "G4PionPlus.hh"
96 #include "G4PionMinus.hh"
97 #include "G4PionZero.hh"
98 #include "G4Eta.hh"
99 #include "G4EtaPrime.hh"
100 
101 #include "G4KaonPlus.hh"
102 #include "G4KaonMinus.hh"
103 #include "G4KaonZero.hh"
104 #include "G4AntiKaonZero.hh"
105 #include "G4KaonZeroLong.hh"
106 #include "G4KaonZeroShort.hh"
107 
108 // Baryons
109 #include "G4Proton.hh"
110 #include "G4AntiProton.hh"
111 #include "G4Neutron.hh"
112 #include "G4AntiNeutron.hh"
113 
114 // Nuclei
115 #include "G4Deuteron.hh"
116 #include "G4Triton.hh"
117 #include "G4Alpha.hh"
118 #include "G4GenericIon.hh"
119 
120 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
121 
123 {
124 // pseudo-particles
127 
128 // gamma
130 
131 // optical photon
133 
134 // leptons
139 
144 
145 // mesons
157 
158 // barions
163 
164 // ions
169 }
170 
171 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
172 
173 #include "G4EmProcessOptions.hh"
174 
176 {
177  // Transportation
178  //
180 
181  // Electromagnetic physics list
182  //
183  fEmPhysicsList->ConstructProcess();
184 
185  // Em options
186  //
187  G4EmProcessOptions emOptions;
188  emOptions.SetStepFunction(1., 1*mm);
189  emOptions.SetIntegral(false);
190  emOptions.SetLossFluctuations(false);
191 
192  // step limitation (as a full process)
193  //
194  AddStepMax();
195 }
196 
197 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
198 
200 
202 {
203  if (verboseLevel>0) {
204  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
205  }
206 
207  if (name == fEmName) return;
208 
209  if (name == "standard") {
210 
211  fEmName = name;
212  delete fEmPhysicsList;
213  fEmPhysicsList = new PhysListEmStandard(name);
214 
215  } else if (name == "emstandard_opt3") {
216 
217  fEmName = name;
218  delete fEmPhysicsList;
219  fEmPhysicsList = new G4EmStandardPhysics_option3();
220 
221  } else {
222  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
223  << " is not defined"
224  << G4endl;
225  }
226 }
227 
228 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
229 
230 #include "G4ProcessManager.hh"
231 #include "StepMax.hh"
232 
234 {
235  // Step limitation seen as a process
236  StepMax* stepMaxProcess = new StepMax();
237 
238  theParticleIterator->reset();
239  while ((*theParticleIterator)()){
240  G4ParticleDefinition* particle = theParticleIterator->value();
241  G4ProcessManager* pmanager = particle->GetProcessManager();
242 
243  if (stepMaxProcess->IsApplicable(*particle) && pmanager)
244  {
245  pmanager ->AddDiscreteProcess(stepMaxProcess);
246  }
247  }
248 }
249 
250 
251 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
252 
253 #include "G4Gamma.hh"
254 #include "G4Electron.hh"
255 #include "G4Positron.hh"
256 
258 {
259  // set cut values for gamma at first and for e- second and next for e+,
260  // because some processes for e+/e- need cut values for gamma
261  SetCutValue(fCutForGamma, "gamma");
262  SetCutValue(fCutForElectron, "e-");
263  SetCutValue(fCutForPositron, "e+");
264 }
265 
266 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
267 
269 {
270  fCutForGamma = cut;
271  SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
272 }
273 
274 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
275 
277 {
278  fCutForElectron = cut;
279  SetParticleCuts(fCutForElectron, G4Electron::Electron());
280 }
281 
282 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
283 
285 {
286  fCutForPositron = cut;
287  SetParticleCuts(fCutForPositron, G4Positron::Positron());
288 }
289 
290 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
static G4Triton * TritonDefinition()
Definition: G4Triton.cc:90
static G4KaonPlus * KaonPlusDefinition()
Definition: G4KaonPlus.cc:108
static G4GenericIon * GenericIonDefinition()
Definition: G4GenericIon.cc:88
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:94
static G4LossTableManager * Instance()
void SetCutValue(G4double aCut, const G4String &pname)
static G4KaonMinus * KaonMinusDefinition()
Definition: G4KaonMinus.cc:108
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
const XML_Char * name
void SetStepFunction(G4double v1, G4double v2)
static G4KaonZero * KaonZeroDefinition()
Definition: G4KaonZero.cc:99
static G4AntiKaonZero * AntiKaonZeroDefinition()
static G4KaonZeroShort * KaonZeroShortDefinition()
static G4AntiProton * AntiProtonDefinition()
Definition: G4AntiProton.cc:88
G4ProcessManager * GetProcessManager() const
static G4AntiNeutron * AntiNeutronDefinition()
static G4PionZero * PionZeroDefinition()
Definition: G4PionZero.cc:99
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
G4GLOB_DLL std::ostream G4cout
static G4PionMinus * PionMinusDefinition()
Definition: G4PionMinus.cc:93
static G4KaonZeroLong * KaonZeroLongDefinition()
static G4NeutrinoE * NeutrinoEDefinition()
Definition: G4NeutrinoE.cc:80
void SetLossFluctuations(G4bool val)
static G4AntiNeutrinoMu * AntiNeutrinoMuDefinition()
static G4PionPlus * PionPlusDefinition()
Definition: G4PionPlus.cc:93
void SetVerboseLevel(G4int value)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
static G4EtaPrime * EtaPrimeDefinition()
Definition: G4EtaPrime.cc:100
static G4Positron * Positron()
Definition: G4Positron.cc:94
virtual G4bool IsApplicable(const G4ParticleDefinition &)
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
virtual void ConstructProcess()=0
void SetIntegral(G4bool val)
static G4ChargedGeantino * ChargedGeantinoDefinition()
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
static G4AntiNeutrinoE * AntiNeutrinoEDefinition()
static G4OpticalPhoton * OpticalPhotonDefinition()
double G4double
Definition: G4Types.hh:76
static G4NeutrinoMu * NeutrinoMuDefinition()
Definition: G4NeutrinoMu.cc:80
static G4Deuteron * DeuteronDefinition()
Definition: G4Deuteron.cc:89
static G4Alpha * AlphaDefinition()
Definition: G4Alpha.cc:84
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:99
#define theParticleIterator
static G4Eta * EtaDefinition()
Definition: G4Eta.cc:104
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81