Geant4  10.02
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 // This example is provided by the Geant4-DNA collaboration
27 // Any report or published results obtained using the Geant4-DNA software
28 // shall cite the following Geant4-DNA collaboration publication:
29 // Med. Phys. 37 (2010) 4692-4708
30 // The Geant4-DNA web site is available at http://geant4-dna.org
31 //
32 // If you use this example, please cite the following publication:
33 // Rad. Prot. Dos. 133 (2009) 2-11
34 
35 #include "PhysicsList.hh"
36 #include "PhysicsListMessenger.hh"
37 
38 #include "G4SystemOfUnits.hh"
39 #include "G4StepLimiter.hh"
40 
41 #include "G4EmStandardPhysics.hh"
46 #include "G4EmLivermorePhysics.hh"
47 #include "G4EmPenelopePhysics.hh"
48 #include "G4DecayPhysics.hh"
49 #include "G4LossTableManager.hh"
50 
51 #include "G4ProcessManager.hh"
52 
53 #include "G4Gamma.hh"
54 #include "G4Electron.hh"
55 #include "G4Positron.hh"
56 
57 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
58 
60 {
66 
67  fMessenger = new PhysicsListMessenger(this);
68 
69  SetVerboseLevel(1);
70 
71  // EM physics
72  fEmName = G4String("emlivermore");
73 
75 
76  // Deacy physics and all particles
78 }
79 
80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
81 
83 {
84  delete fMessenger;
85  delete fEmPhysicsList;
86  delete fDecPhysicsList;
87 }
88 
89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
90 
92 {
94 }
95 
96 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
97 
99 {
100  // transportation
102 
103  // electromagnetic physics list
105 
106  // decay physics list
108 
109  // step limitation (as a full process)
110  AddStepMax();
111 
112 }
113 
114 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
115 
117 {
118  if (verboseLevel>1) {
119  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
120  }
121 
122  if (name == fEmName) return;
123 
124  if (name == "emstandard_opt0") {
125 
126  fEmName = name;
127  delete fEmPhysicsList;
129 
130  } else if (name == "emstandard_opt1") {
131 
132  fEmName = name;
133  delete fEmPhysicsList;
135 
136  } else if (name == "emstandard_opt2") {
137 
138  fEmName = name;
139  delete fEmPhysicsList;
141 
142  } else if (name == "emstandard_opt3") {
143 
144  fEmName = name;
145  delete fEmPhysicsList;
147 
148  } else if (name == "emstandard_opt4") {
149 
150  fEmName = name;
151  delete fEmPhysicsList;
153 
154  } else if (name == "emlivermore") {
155 
156  fEmName = name;
157  delete fEmPhysicsList;
159 
160  } else if (name == "empenelope") {
161 
162  fEmName = name;
163  delete fEmPhysicsList;
165 
166  }
167 }
168 
169 
170 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
171 
173 {
174  // Step limitation seen as a process
175 
177 
178  theParticleIterator->reset();
179  while ((*theParticleIterator)()){
180  G4ParticleDefinition* particle = theParticleIterator->value();
181  G4ProcessManager* pmanager = particle->GetProcessManager();
182 
183  if (fStepMaxProcess->IsApplicable(*particle) && pmanager)
184  {
186  }
187  }
188 }
189 
190 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
191 
193 {
194 
195  if (verboseLevel >0){
196  G4cout << "PhysicsList::SetCuts:";
197  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
198  }
199 
200  SetCutValue(fCutForGamma, "gamma");
203 
205 }
206 
207 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
208 
210 {
211  fCutForGamma = cut;
213 }
214 
215 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
216 
218 {
219  fCutForElectron = cut;
221 }
222 
223 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
224 
226 {
227  fCutForPositron = cut;
229 }
230 
231 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
232 
void ConstructParticle()
Definition: PhysicsList.cc:117
static G4LossTableManager * Instance()
void SetCutValue(G4double aCut, const G4String &pname)
void SetCutForGamma(G4double)
Definition: PhysicsList.cc:231
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
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
G4ProcessManager * GetProcessManager() const
void SetCutForElectron(G4double)
Definition: PhysicsList.cc:239
PhysicsListMessenger * fMessenger
Definition: PhysicsList.hh:78
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
void SetVerboseLevel(G4int value)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
void SetCuts()
Definition: PhysicsList.cc:219
void AddStepMax()
Definition: PhysicsList.cc:172
static const double micrometer
Definition: G4SIunits.hh:99
static G4Positron * Positron()
Definition: G4Positron.cc:94
G4VPhysicsConstructor * fEmPhysicsList
Definition: PhysicsList.hh:73
virtual void ConstructProcess()=0
G4StepLimiter * fStepMaxProcess
Definition: PhysicsList.hh:76
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
G4VPhysicsConstructor * fDecPhysicsList
Definition: PhysicsList.hh:74
double G4double
Definition: G4Types.hh:76
G4String fEmName
Definition: PhysicsList.hh:72
void ConstructProcess()
Definition: PhysicsList.cc:170
#define theParticleIterator
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4VProcess.hh:205