Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
examples/extended/electromagnetic/TestEm18/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/TestEm18/src/PhysicsList.cc
27 /// \brief Implementation of the PhysicsList class
28 //
29 // $Id: PhysicsList.cc 67268 2013-02-13 11:38:40Z ihrivnac $
30 //
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 #include "PhysicsList.hh"
35 #include "PhysicsListMessenger.hh"
36 
37 #include "PhysListEmStandard.hh"
38 #include "PhysListEmLivermore.hh"
39 #include "PhysListEmPenelope.hh"
40 
41 #include "G4LossTableManager.hh"
42 #include "G4UnitsTable.hh"
43 #include "G4SystemOfUnits.hh"
44 
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
48  fMessenger(0),
49  fEmPhysicsList(0)
50 {
52  fMessenger = new PhysicsListMessenger(this);
53 
54  // EM physics
55  fEmName = G4String("standard");
56  fEmPhysicsList = new PhysListEmStandard(fEmName);
57 
58  defaultCutValue = 1.*mm;
59  fCutForGamma = defaultCutValue;
60  fCutForElectron = defaultCutValue;
61 
62  SetVerboseLevel(1);
63 }
64 
65 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
66 
68 {
69  delete fEmPhysicsList;
70  delete fMessenger;
71 }
72 
73 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
74 
76 {
77  if (verboseLevel>1) {
78  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
79  }
80 
81  if (name == fEmName) return;
82 
83  if (name == "standard") {
84 
85  fEmName = name;
86  delete fEmPhysicsList;
87  fEmPhysicsList = new PhysListEmStandard(name);
88 
89  } else if (name == "livermore") {
90 
91  fEmName = name;
92  delete fEmPhysicsList;
93  fEmPhysicsList = new PhysListEmLivermore(name);
94 
95  } else if (name == "penelope") {
96 
97  fEmName = name;
98  delete fEmPhysicsList;
99  fEmPhysicsList = new PhysListEmPenelope(name);
100 
101  } else {
102 
103  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
104  << " is not defined"
105  << G4endl;
106  }
107 }
108 
109 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
110 
111 // Bosons
112 #include "G4ChargedGeantino.hh"
113 #include "G4Geantino.hh"
114 #include "G4Gamma.hh"
115 
116 // leptons
117 #include "G4Electron.hh"
118 #include "G4Positron.hh"
119 
120 #include "G4MuonPlus.hh"
121 #include "G4MuonMinus.hh"
122 
123 // Mesons
124 #include "G4PionPlus.hh"
125 #include "G4PionMinus.hh"
126 
127 #include "G4KaonPlus.hh"
128 #include "G4KaonMinus.hh"
129 
130 // Baryons
131 #include "G4Proton.hh"
132 #include "G4AntiProton.hh"
133 #include "G4Neutron.hh"
134 #include "G4AntiNeutron.hh"
135 
136 // Nuclei
137 #include "G4Deuteron.hh"
138 #include "G4Triton.hh"
139 #include "G4Alpha.hh"
140 #include "G4GenericIon.hh"
141 
143 {
144 // pseudo-particles
147 
148 // gamma
150 
151 // leptons
156 
157 // mesons
162 
163 // baryons
168 
169 // ions
174 }
175 
176 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
177 
178 #include "G4EmProcessOptions.hh"
179 
181 {
183  fEmPhysicsList->ConstructProcess();
184  AddStepMax();
185 
186  // Em options
187  //
188  G4EmProcessOptions emOptions;
189 
190  //physics tables
191  //
192  emOptions.SetMinEnergy(10*eV); //default 100 eV
193  emOptions.SetMaxEnergy(10*TeV); //default 100 TeV
194  emOptions.SetDEDXBinning(12*20); //default=12*7
195  emOptions.SetLambdaBinning(12*20); //default=12*7
196 
197  //build CSDA range
198  //
199  emOptions.SetBuildCSDARange(true);
200  emOptions.SetMaxEnergyForCSDARange(10*TeV);
201  emOptions.SetDEDXBinningForCSDARange(12*20);
202 
203  //ionization
204  //
205  emOptions.SetSubCutoff(false); //default
206 }
207 
208 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
209 
210 #include "G4ProcessManager.hh"
211 #include "StepMax.hh"
212 
214 {
215  // Step limitation seen as a process
216  StepMax* stepMaxProcess = new StepMax();
217 
218  theParticleIterator->reset();
219  while ((*theParticleIterator)()){
220  G4ParticleDefinition* particle = theParticleIterator->value();
221  G4ProcessManager* pmanager = particle->GetProcessManager();
222 
223  if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
224  {
225  pmanager ->AddDiscreteProcess(stepMaxProcess);
226  }
227  }
228 }
229 
230 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
231 
233 {
234  if (verboseLevel >0){
235  G4cout << "PhysicsList::SetCuts:";
236  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
237  }
238 
239  // set cut values for gamma at first and for e- second and next for e+,
240  // because some processes for e+/e- need cut values for gamma
241  SetCutValue(fCutForGamma, "gamma");
242  SetCutValue(fCutForElectron, "e-");
243  SetCutValue(fCutForElectron, "e+");
244 
246 }
247 
248 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
249 
251 {
252  fCutForGamma = cut;
253  SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
254 }
255 
256 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
257 
259 {
260  fCutForElectron = cut;
261  SetParticleCuts(fCutForElectron, G4Electron::Electron());
262  SetParticleCuts(fCutForElectron, G4Positron::Positron());
263 }
264 
265 //....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
void SetMinEnergy(G4double val)
static G4Proton * ProtonDefinition()
Definition: G4Proton.cc:88
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
const XML_Char * name
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
void SetDEDXBinningForCSDARange(G4int val)
static G4AntiProton * AntiProtonDefinition()
Definition: G4AntiProton.cc:88
G4ProcessManager * GetProcessManager() const
static G4AntiNeutron * AntiNeutronDefinition()
void SetMaxEnergyForCSDARange(G4double val)
void SetDEDXBinning(G4int val)
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
void SetLambdaBinning(G4int val)
static G4PionMinus * PionMinusDefinition()
Definition: G4PionMinus.cc:93
static G4PionPlus * PionPlusDefinition()
Definition: G4PionPlus.cc:93
void SetVerboseLevel(G4int value)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
void SetMaxEnergy(G4double val)
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
static G4Positron * Positron()
Definition: G4Positron.cc:94
virtual G4bool IsApplicable(const G4ParticleDefinition &)
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
virtual void ConstructProcess()=0
void SetBuildCSDARange(G4bool val)
static G4ChargedGeantino * ChargedGeantinoDefinition()
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
void SetSubCutoff(G4bool val, const G4Region *r=0)
static G4Deuteron * DeuteronDefinition()
Definition: G4Deuteron.cc:89
static G4Alpha * AlphaDefinition()
Definition: G4Alpha.cc:84
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:99
#define theParticleIterator
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81