Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MicrobeamPhysicsList.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 // $Id$
27 //
28 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
30 
31 #include "MicrobeamPhysicsList.hh"
33 
34 #include "G4PhysicalConstants.hh"
35 #include "G4SystemOfUnits.hh"
36 #include "G4UnitsTable.hh"
37 #include "G4StepLimiter.hh"
38 
39 #include "G4EmStandardPhysics.hh"
44 #include "G4EmLivermorePhysics.hh"
45 #include "G4EmPenelopePhysics.hh"
46 
47 #include "G4DecayPhysics.hh"
48 
49 #include "G4LossTableManager.hh"
50 
51 //#include "G4EmConfigurator.hh"
52 
53 #include "G4ProcessManager.hh"
54 #include "G4Decay.hh"
55 
56 #include "G4Gamma.hh"
57 #include "G4Electron.hh"
58 #include "G4Positron.hh"
59 
60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
61 
63 {
66  cutForGamma = defaultCutValue;
67  cutForElectron = defaultCutValue;
68  cutForPositron = defaultCutValue;
69 
70  pMessenger = new MicrobeamPhysicsListMessenger(this);
71 
72  SetVerboseLevel(1);
73 
74  // EM physics
75  emName = G4String("emstandard_opt0");
76 
77  emPhysicsList = new G4EmStandardPhysics(1);
78 
79  // Deacy physics and all particles
80  decPhysicsList = new G4DecayPhysics();
81 }
82 
83 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84 
86 {
87  delete pMessenger;
88  delete emPhysicsList;
89  delete decPhysicsList;
90 }
91 
92 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
93 
95 {
96  decPhysicsList->ConstructParticle();
97 }
98 
99 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
100 
102 {
103  // transportation
104  //
106 
107  // electromagnetic physics list
108  //
109  emPhysicsList->ConstructProcess();
110 
111  // decay physics list
112  //
113  decPhysicsList->ConstructProcess();
114 
115  // step limitation (as a full process)
116  //
117  AddStepMax();
118 
119 }
120 
121 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
122 
124 {
125  if (verboseLevel>1) {
126  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
127  }
128 
129  if (name == emName) return;
130 
131  if (name == "emstandard_opt0") {
132 
133  emName = name;
134  delete emPhysicsList;
135  emPhysicsList = new G4EmStandardPhysics(1);
136 
137  } else if (name == "emstandard_opt1") {
138 
139  emName = name;
140  delete emPhysicsList;
141  emPhysicsList = new G4EmStandardPhysics_option1();
142 
143  } else if (name == "emstandard_opt2") {
144 
145  emName = name;
146  delete emPhysicsList;
147  emPhysicsList = new G4EmStandardPhysics_option2();
148 
149  } else if (name == "emstandard_opt3") {
150 
151  emName = name;
152  delete emPhysicsList;
153  emPhysicsList = new G4EmStandardPhysics_option3();
154 
155  } else if (name == "emstandard_opt4") {
156 
157  emName = name;
158  delete emPhysicsList;
159  emPhysicsList = new G4EmStandardPhysics_option4();
160 
161  } else if (name == "emlivermore") {
162  emName = name;
163  delete emPhysicsList;
164  emPhysicsList = new G4EmLivermorePhysics();
165 
166  } else if (name == "empenelope") {
167  emName = name;
168  delete emPhysicsList;
169  emPhysicsList = new G4EmPenelopePhysics();
170 
171  }
172 }
173 
174 
175 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
176 
178 {
179  // Step limitation seen as a process
180  stepMaxProcess = new G4StepLimiter();
181 
183  while ((*theParticleIterator)()){
185  G4ProcessManager* pmanager = particle->GetProcessManager();
186 
187  if (stepMaxProcess->IsApplicable(*particle) && pmanager)
188  {
189  pmanager ->AddDiscreteProcess(stepMaxProcess);
190  }
191  }
192 }
193 
194 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
195 
197 {
198 
199  if (verboseLevel >0){
200  G4cout << "PhysicsList::SetCuts:";
201  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
202  }
203 
204  // set cut values for gamma at first and for e- second and next for e+,
205  // because some processes for e+/e- need cut values for gamma
206  SetCutValue(cutForGamma, "gamma");
207  SetCutValue(cutForElectron, "e-");
208  SetCutValue(cutForPositron, "e+");
209 
211 }
212 
213 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
214 
216 {
217  cutForGamma = cut;
218  SetParticleCuts(cutForGamma, G4Gamma::Gamma());
219 }
220 
221 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
222 
224 {
225  cutForElectron = cut;
226  SetParticleCuts(cutForElectron, G4Electron::Electron());
227 }
228 
229 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
230 
232 {
233  cutForPositron = cut;
234  SetParticleCuts(cutForPositron, G4Positron::Positron());
235 }
236 
237 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
238