Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
examples/extended/medical/GammaTherapy/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 medical/GammaTherapy/src/PhysicsList.cc
27 /// \brief Implementation of the PhysicsList class
28 //
29 // $Id: PhysicsList.cc 67994 2013-03-13 11:05:39Z gcosmo $
30 //
31 //---------------------------------------------------------------------------
32 //
33 // ClassName: PhysicsList
34 //
35 // Author: V.Ivanchenko 03.05.2004
36 //
37 // Modified:
38 // 16.11.06 Use components from physics_lists subdirectory (V.Ivanchenko)
39 // 16.05.07 Use renamed EM components from physics_lists (V.Ivanchenko)
40 //
41 //----------------------------------------------------------------------------
42 //
43 
44 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
46 
47 #include "PhysicsList.hh"
48 #include "PhysicsListMessenger.hh"
49 
50 #include "G4EmStandardPhysics.hh"
54 #include "G4EmLivermorePhysics.hh"
55 #include "G4EmPenelopePhysics.hh"
56 #include "StepLimiterBuilder.hh"
57 #include "G4DecayPhysics.hh"
59 #include "G4HadronInelasticQBBC.hh"
61 #include "G4EmExtraPhysics.hh"
62 #include "G4StoppingPhysics.hh"
63 
64 #include "G4UnitsTable.hh"
65 #include "G4LossTableManager.hh"
66 #include "G4EmProcessOptions.hh"
67 
68 #include "G4PhysicalConstants.hh"
69 #include "G4SystemOfUnits.hh"
70 
71 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
72 
74 {
75  fEmBuilderIsRegisted = false;
76  fHelIsRegisted = false;
77  fBicIsRegisted = false;
78  fIonIsRegisted = false;
79  fGnucIsRegisted = false;
80  fStopIsRegisted = false;
81  fVerbose = 1;
83  defaultCutValue = 1.*mm;
84  fCutForGamma = defaultCutValue;
85  fCutForElectron = defaultCutValue;
86  fCutForPositron = defaultCutValue;
87 
88  fMessenger = new PhysicsListMessenger(this);
89 
90  // Add Physics builders
92 }
93 
94 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
95 
97 {
98  delete fMessenger;
99 }
100 
101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
102 
104 {
105  if(fVerbose > 0) {
106  G4cout << "### PhysicsList Construte Particles" << G4endl;
107  }
109 }
110 
111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
112 
114 {
115  if(fVerbose > 0) {
116  G4cout << "### PhysicsList Construte Processes" << G4endl;
117  }
118  if(!fEmBuilderIsRegisted) { AddPhysicsList("emstandard"); }
121 
122  // Define energy interval for loss processes
123  // from 10 eV to 10 GeV
124  G4EmProcessOptions emOptions;
125  emOptions.SetMinEnergy(0.01*keV);
126  emOptions.SetMaxEnergy(10.*GeV);
127  emOptions.SetDEDXBinning(90);
128  emOptions.SetLambdaBinning(90);
129 }
130 
131 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
132 
134 {
135  if(fVerbose > 0) {
136  G4cout << "### PhysicsList Add Physics <" << name
137  << "> " << G4endl;
138  }
139  if ((name == "emstandard") && !fEmBuilderIsRegisted) {
141  fEmBuilderIsRegisted = true;
142 
143  } else if (name == "emstandard_opt1" && !fEmBuilderIsRegisted) {
145  fEmBuilderIsRegisted = true;
146 
147  } else if (name == "emstandard_opt2" && !fEmBuilderIsRegisted) {
149  fEmBuilderIsRegisted = true;
150 
151  } else if (name == "emstandard_opt3" && !fEmBuilderIsRegisted) {
153  fEmBuilderIsRegisted = true;
154 
155  } else if (name == "emlivermore" && !fEmBuilderIsRegisted) {
157  fEmBuilderIsRegisted = true;
158 
159  } else if (name == "empenelope" && !fEmBuilderIsRegisted) {
161  fEmBuilderIsRegisted = true;
162 
163  } else if (name == "elastic" && !fHelIsRegisted && fEmBuilderIsRegisted) {
165  fHelIsRegisted = true;
166 
167  } else if (name == "binary" && !fBicIsRegisted && fEmBuilderIsRegisted) {
169  fBicIsRegisted = true;
170 
171  } else if (name == "binary_ion" && !fIonIsRegisted && fEmBuilderIsRegisted) {
173  fIonIsRegisted = true;
174 
175  } else if (name == "gamma_nuc" && !fGnucIsRegisted && fEmBuilderIsRegisted) {
177  fGnucIsRegisted = true;
178 
179  } else if (name == "stopping" && !fStopIsRegisted && fEmBuilderIsRegisted) {
181  fStopIsRegisted = true;
182 
183  } else if(!fEmBuilderIsRegisted) {
184  G4cout << "PhysicsList::AddPhysicsList <" << name << ">"
185  << " fail - EM physics should be registered first " << G4endl;
186  } else {
187  G4cout << "PhysicsList::AddPhysicsList <" << name << ">"
188  << " fail - module is already regitered or is unknown " << G4endl;
189  }
190 }
191 
192 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
193 
195 {
196  SetCutValue(fCutForGamma, "gamma");
197  SetCutValue(fCutForElectron, "e-");
198  SetCutValue(fCutForPositron, "e+");
199 
200  if (fVerbose>0) DumpCutValuesTable();
201 }
202 
203 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
204 
206 {
207  fCutForGamma = cut;
208  SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
209 }
210 
211 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
212 
214 {
215  fCutForElectron = cut;
216  SetParticleCuts(fCutForElectron, G4Electron::Electron());
217 }
218 
219 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
220 
222 {
223  fCutForPositron = cut;
224  SetParticleCuts(fCutForPositron, G4Positron::Positron());
225 }
226 
227 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RegisterPhysics(G4VPhysicsConstructor *)
static G4LossTableManager * Instance()
void SetCutValue(G4double aCut, const G4String &pname)
void SetMinEnergy(G4double val)
const XML_Char * name
Definition of the StepLimiterBuilder class.
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 G4Gamma * Gamma()
Definition: G4Gamma.cc:86
void SetMaxEnergy(G4double val)
static G4Positron * Positron()
Definition: G4Positron.cc:94
void SetVerbose(G4int val)
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76