Geant4_10
XrayFluoPhysicsList.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 //
27 // History
28 // 14/01/11 Alf re-adapt this file from Physiclist of testEm18
29 //
30 //
31 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 #include "XrayFluoPhysicsList.hh"
36 
37 #include "G4SystemOfUnits.hh"
38 #include "G4LossTableManager.hh"
39 #include "G4EmProcessOptions.hh"
40 #include "G4ProcessManager.hh"
41 
42 //#include "PhysListEmStandard.hh"
43 
44 #include "G4EmStandardPhysics.hh"
48 //#include "XrayFluoPhysListEmStandardFLUO.hh"
49 #include "G4EmLivermorePhysics.hh"
50 #include "G4EmPenelopePhysics.hh"
51 //#include "G4UAtomicDeexcitation.hh"
52 
53 #include "G4Decay.hh"
54 #include "XrayFluoStepMax.hh"
55 
56 #include "G4UnitsTable.hh"
57 
58 #include "G4ParticleDefinition.hh"
59 #include "G4ProcessManager.hh"
60 
61 // Bosons
62 #include "G4ChargedGeantino.hh"
63 #include "G4Geantino.hh"
64 #include "G4Gamma.hh"
65 #include "G4OpticalPhoton.hh"
66 
67 // leptons
68 #include "G4MuonPlus.hh"
69 #include "G4MuonMinus.hh"
70 #include "G4NeutrinoMu.hh"
71 #include "G4AntiNeutrinoMu.hh"
72 
73 #include "G4Electron.hh"
74 #include "G4Positron.hh"
75 #include "G4NeutrinoE.hh"
76 #include "G4AntiNeutrinoE.hh"
77 
78 // Hadrons
79 #include "G4Proton.hh"
80 #include "G4MesonConstructor.hh"
81 #include "G4BaryonConstructor.hh"
82 #include "G4IonConstructor.hh"
83 
84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
85 
87 {
88  pMessenger = new XrayFluoPhysicsListMessenger(this);
89 
90  // EM physics
92 
93  defaultCutValue = 1.*mm;
94 
95  cutForGamma = defaultCutValue;
96  cutForElectron = defaultCutValue;
97  cutForPositron = defaultCutValue;
98  cutForProton = defaultCutValue;
99 
100  SetVerboseLevel(1);
101 
102  // EM physics
103  emName = G4String("emlivermore");
104  emPhysicsList = new G4EmLivermorePhysics;
105 
106 }
107 
108 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
109 
111 {
112  delete emPhysicsList;
113  delete pMessenger;
114 }
115 
116 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
117 
119 {
120  // pseudo-particles
123 
124  // gamma
126 
127  // leptons
132 
137 
138  // mesons
139  G4MesonConstructor mConstructor;
140  mConstructor.ConstructParticle();
141 
142  // barions
143  G4BaryonConstructor bConstructor;
144  bConstructor.ConstructParticle();
145 
146  // ions
147  G4IonConstructor iConstructor;
148  iConstructor.ConstructParticle();
149 }
150 
151 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
152 
154 {
156  emPhysicsList->ConstructProcess();
157  AddDecay();
158  AddStepMax();
159 
160  // Em options
161  //
162  G4EmProcessOptions emOptions;
163  emOptions.SetBuildCSDARange(true);
164  emOptions.SetDEDXBinningForCSDARange(10*10);
165  //emOptions.SetDeexcitationActiveRegion(true); //TBC
166  emOptions.SetFluo(true);
167  emOptions.SetAuger(true);
168  emOptions.SetPIXE(true);
169 
170 }
171 
172 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
173 
175 {
176  // Add Decay Process
177 
178  G4Decay* fDecayProcess = new G4Decay();
179 
180  theParticleIterator->reset();
181  while( (*theParticleIterator)() ){
182  G4ParticleDefinition* particle = theParticleIterator->value();
183  G4ProcessManager* pmanager = particle->GetProcessManager();
184 
185  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
186 
187  pmanager ->AddProcess(fDecayProcess);
188 
189  // set ordering for PostStepDoIt and AtRestDoIt
190  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
191  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
192 
193  }
194  }
195 }
196 
197 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
198 
200 {
201  // Step limitation seen as a process
202  XrayFluoStepMax* stepMaxProcess = new XrayFluoStepMax();
203 
204  theParticleIterator->reset();
205  while ((*theParticleIterator)()){
206  G4ParticleDefinition* particle = theParticleIterator->value();
207  G4ProcessManager* pmanager = particle->GetProcessManager();
208 
209  if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
210  {
211  pmanager ->AddDiscreteProcess(stepMaxProcess);
212  }
213  }
214 }
215 
216 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
217 
219 {
220  if (verboseLevel>-1) {
221  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
222  }
223 
224  if (name == emName) return;
225 
226  if (name == "emlivermore") {
227 
228  emName = name;
229  delete emPhysicsList;
230  emPhysicsList = new G4EmLivermorePhysics;
231 
232  } else if (name == "emstandard") {
233  emName = name;
234  delete emPhysicsList;
235  emPhysicsList = new G4EmStandardPhysics();
236 
237  } else if (name == "emstandard_opt1") {
238 
239  emName = name;
240  delete emPhysicsList;
241  emPhysicsList = new G4EmStandardPhysics_option1();
242 
243  } else if (name == "emstandard_opt2") {
244 
245  emName = name;
246  delete emPhysicsList;
247  emPhysicsList = new G4EmStandardPhysics_option2();
248 
249  } else if (name == "emstandard_opt3") {
250 
251  emName = name;
252  delete emPhysicsList;
253  emPhysicsList = new G4EmStandardPhysics_option3();
254 
255  } else if (name == "empenelope"){
256  emName = name;
257  delete emPhysicsList;
258  emPhysicsList = new G4EmPenelopePhysics();
259 
260  } else {
261 
262  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
263  << " is not defined"
264  << G4endl;
265  }
266 }
267 
268 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
269 
271 {
272  if (verboseLevel >0){
273  G4cout << "PhysicsList::SetCuts:";
274  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
275  }
276 
277  // set cut values for gamma at first and for e- second and next for e+,
278  // because some processes for e+/e- need cut values for gamma
279  SetCutValue(cutForGamma, "gamma");
280  SetCutValue(cutForElectron, "e-");
281  SetCutValue(cutForPositron, "e+");
282 
284 }
285 
286 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
287 
289 {
290  cutForGamma = cut;
291  SetParticleCuts(cutForGamma, G4Gamma::Gamma());
292 }
293 
294 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
295 
297 {
298  cutForElectron = cut;
299  SetParticleCuts(cutForElectron, G4Electron::Electron());
300 }
301 
302 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
303 
305 {
306  cutForPositron = cut;
307  SetParticleCuts(cutForPositron, G4Positron::Positron());
308 }
309 
310 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
311 
313 {
314  cutForProton = cut;
315  SetParticleCuts(cutForProton, G4Proton::Proton());
316 }
317 
318 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
319 
320 //void XrayFluoPhysicsList::SetFluorescence(G4bool value)
321 //{
322 // G4VAtomDeexcitation* de = G4LossTableManager::Instance()->AtomDeexcitation();
323 // if(de) { de->SetFluo(value); }
324 //}
325 
326 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
327 
328 //void XrayFluoPhysicsList::SetPIXE(G4bool value)
329 //{
330 // G4VAtomDeexcitation* de = G4LossTableManager::Instance()->AtomDeexcitation();
331 // if(de) { de->SetPIXE(value); }
332 //}
333 
334 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:94
static G4LossTableManager * Instance()
void SetPIXE(G4bool val)
void SetCutValue(G4double aCut, const G4String &pname)
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
void SetCutForProton(G4double)
const XML_Char * name
Definition: expat.h:151
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static void ConstructParticle()
void SetDEDXBinningForCSDARange(G4int val)
static void ConstructParticle()
G4ProcessManager * GetProcessManager() const
void SetCutForElectron(G4double)
void SetCutForGamma(G4double)
void SetFluo(G4bool val)
static void ConstructParticle()
void SetAuger(G4bool val)
void SetParticleCuts(G4double cut, G4ParticleDefinition *particle, G4Region *region=0)
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
static G4NeutrinoE * NeutrinoEDefinition()
Definition: G4NeutrinoE.cc:80
static G4AntiNeutrinoMu * AntiNeutrinoMuDefinition()
static G4Proton * Proton()
Definition: G4Proton.cc:93
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
void SetVerboseLevel(G4int value)
static G4Gamma * Gamma()
Definition: G4Gamma.cc:86
void AddPhysicsList(const G4String &name)
void SetCutForPositron(G4double)
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
static G4Positron * Positron()
Definition: G4Positron.cc:94
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
virtual void ConstructProcess()=0
void SetBuildCSDARange(G4bool val)
void SetVerbose(G4int val)
static G4ChargedGeantino * ChargedGeantinoDefinition()
static G4Electron * Electron()
Definition: G4Electron.cc:94
#define G4endl
Definition: G4ios.hh:61
static G4AntiNeutrinoE * AntiNeutrinoEDefinition()
double G4double
Definition: G4Types.hh:76
static G4NeutrinoMu * NeutrinoMuDefinition()
Definition: G4NeutrinoMu.cc:80
#define theParticleIterator
G4bool IsApplicable(const G4ParticleDefinition &)
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81