Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GammaRayTelPhysicsList.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 // Authors: Susanna Guatelli, susanna@uow.edu.au,
27 // Authors: Jeremy Davis, jad028@uowmail.edu.au
28 //
29 // Code based on the hadrontherapy && radioprotection advanced example
30 
33 #include "G4PhysListFactory.hh"
34 #include "G4VPhysicsConstructor.hh"
35 
36 // Physic lists (contained inside the Geant4 distribution)
38 #include "G4EmLivermorePhysics.hh"
39 #include "G4EmPenelopePhysics.hh"
40 #include "G4EmLivermorePolarizedPhysics.hh" // TBC
41 
42 #include "G4DecayPhysics.hh"
47 #include "G4Decay.hh"
48 #include "G4StepLimiter.hh"
49 #include "G4LossTableManager.hh"
50 #include "G4UnitsTable.hh"
51 #include "G4SystemOfUnits.hh"
52 #include "G4ProcessManager.hh"
53 
54 #include "G4IonFluctuations.hh"
56 #include "G4EmProcessOptions.hh"
59 
62 {
65  cutForGamma = defaultCutValue;
66  cutForElectron = defaultCutValue;
67  cutForPositron = defaultCutValue;
68 
69  helIsRegisted = false;
70  bicIsRegisted = false;
71  biciIsRegisted = false;
72  locIonIonInelasticIsRegistered = false;
73  radioactiveDecayIsRegisted = false;
74 
75  pMessenger = new GammaRayTelPhysicsListMessenger(this);
76 
77  SetVerboseLevel(1);
78 
79  // EM physics
80  emPhysicsList = new G4EmStandardPhysics_option3(1);
81  emName = G4String("emstandard_opt3");
82 
83  // Decay physics and all particles
84  decPhysicsList = new G4DecayPhysics();
85 }
86 
89 {
90  delete pMessenger;
91  delete emPhysicsList;
92  delete decPhysicsList;
93  for(size_t i=0; i<hadronPhys.size(); i++) {delete hadronPhys[i];}
94 }
95 
98 {
99  G4PhysListFactory factory;
100  G4VModularPhysicsList* phys =factory.GetReferencePhysList(name);
101  G4int i=0;
102  const G4VPhysicsConstructor* elem= phys->GetPhysics(i);
103  G4VPhysicsConstructor* tmp = const_cast<G4VPhysicsConstructor*> (elem);
104  while (elem !=0)
105  {
106  RegisterPhysics(tmp);
107  elem= phys->GetPhysics(++i) ;
108  tmp = const_cast<G4VPhysicsConstructor*> (elem);
109  }
110 }
111 
114 {
115  decPhysicsList->ConstructParticle();
116 }
117 
120 {
121  // transportation
122  //
124 
125  // electromagnetic physics list
126  //
127  emPhysicsList->ConstructProcess();
128  em_config.AddModels();
129 
130  // decay physics list
131  //
132  decPhysicsList->ConstructProcess();
133 
134  // hadronic physics lists
135  for(size_t i=0; i<hadronPhys.size(); i++) {
136  hadronPhys[i]->ConstructProcess();
137  }
138 
139  // step limitation (as a full process)
140  //
141  // AddStepMax();
142 }
143 
146 {
147 
148  if (verboseLevel>1) {
149  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
150  }
151  if (name == emName) return;
152 
154  // ELECTROMAGNETIC MODELS
156 
157  if (name == "standard_opt3") {
158  emName = name;
159  delete emPhysicsList;
160  emPhysicsList = new G4EmStandardPhysics_option3();
161  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmStandardPhysics_option3" << G4endl;
162 
163  } else if (name == "LowE_Livermore") {
164  emName = name;
165  delete emPhysicsList;
166  emPhysicsList = new G4EmLivermorePhysics();
167  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
168  } else if (name == "LowE_Penelope") {
169  emName = name;
170  delete emPhysicsList;
171  emPhysicsList = new G4EmPenelopePhysics();
172  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
173  } else if (name == "LowE_Polarized") {
174  emName = name;
175  delete emPhysicsList;
176  emPhysicsList = new G4EmLivermorePolarizedPhysics();
177  G4cout << "THE FOLLOWING ELECTROMAGNETIC PHYSICS LIST HAS BEEN ACTIVATED: G4EmLivermorePhysics" << G4endl;
178 
180  // HADRONIC MODELS
182  } else if (name == "elastic" && !helIsRegisted) {
183  G4cout << "THE FOLLOWING HADRONIC ELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4HadronElasticPhysics()" << G4endl;
184  hadronPhys.push_back( new G4HadronElasticPhysics());
185  helIsRegisted = true;
186 
187  } else if (name == "DElastic" && !helIsRegisted) {
188  hadronPhys.push_back( new G4HadronDElasticPhysics());
189  helIsRegisted = true;
190 
191  } else if (name == "HPElastic" && !helIsRegisted) {
192  hadronPhys.push_back( new G4HadronElasticPhysicsHP());
193  helIsRegisted = true;
194 
195  } else if (name == "binary" && !bicIsRegisted) {
196  hadronPhys.push_back(new G4HadronPhysicsQGSP_BIC_HP());
197  bicIsRegisted = true;
198  G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: HadronPhysicsQGSP_BIC_HP()" << G4endl;
199 
200  } else if (name == "binary_ion" && !biciIsRegisted) {
201  hadronPhys.push_back(new G4IonBinaryCascadePhysics());
202  biciIsRegisted = true;
203  G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4IonBinaryCascadePhysics()" << G4endl;
204  } else if (name == "radioactive_decay" && !radioactiveDecayIsRegisted ) {
205  hadronPhys.push_back(new G4RadioactiveDecayPhysics());
206  radioactiveDecayIsRegisted = true;
207  G4cout << "THE FOLLOWING HADRONIC INELASTIC PHYSICS LIST HAS BEEN ACTIVATED: G4RadioactiveDecayPhysics()" << G4endl;
208  } else {
209 
210  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
211  << " is not defined"
212  << G4endl;
213  }
214 }
215 
218 {
219 
220  if (verboseLevel >0){
221  G4cout << "PhysicsList::SetCuts:";
222  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
223  }
224 
225  G4double lowLimit = 250. * eV;
226  G4double highLimit = 100. * GeV;
228 
229  // set cut values for gamma at first and for e- second and next for e+,
230  // because some processes for e+/e- need cut values for gamma
231  SetCutValue(cutForGamma, "gamma");
232  SetCutValue(cutForElectron, "e-");
233  SetCutValue(cutForPositron, "e+");
234 
236 }
237 
239 {
240  cutForGamma = cut;
241  SetParticleCuts(cutForGamma, G4Gamma::Gamma());
242 }
243 
245 {
246  cutForElectron = cut;
247  SetParticleCuts(cutForElectron, G4Electron::Electron());
248 }
249 
251 {
252  cutForPositron = cut;
253  SetParticleCuts(cutForPositron, G4Positron::Positron());
254 }
255 
const XML_Char * name
Definition: expat.h:151
void RegisterPhysics(G4VPhysicsConstructor *)
static G4LossTableManager * Instance()
void SetCutValue(G4double aCut, const G4String &pname)
void SetEnergyRange(G4double lowedge, G4double highedge)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
int G4int
Definition: G4Types.hh:78
void AddPhysicsList(const G4String &name)
virtual void ConstructParticle()=0
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
const G4VPhysicsConstructor * GetPhysics(G4int index) const
G4VModularPhysicsList * GetReferencePhysList(const G4String &)
static constexpr double eV
Definition: G4SIunits.hh:215
void SetVerboseLevel(G4int value)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
static G4ProductionCutsTable * GetProductionCutsTable()
static G4Positron * Positron()
Definition: G4Positron.cc:94
static constexpr double GeV
Definition: G4SIunits.hh:217
virtual void ConstructProcess()=0
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
void AddPackage(const G4String &name)
double G4double
Definition: G4Types.hh:76
static constexpr double micrometer
Definition: G4SIunits.hh:100