Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 
181  particleIterator->reset();
182  while( (*particleIterator)() ){
183  G4ParticleDefinition* particle = particleIterator->value();
184  G4ProcessManager* pmanager = particle->GetProcessManager();
185 
186  if (fDecayProcess->IsApplicable(*particle) && !particle->IsShortLived()) {
187 
188  pmanager ->AddProcess(fDecayProcess);
189 
190  // set ordering for PostStepDoIt and AtRestDoIt
191  pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
192  pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
193 
194  }
195  }
196 }
197 
198 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
199 
201 {
202  // Step limitation seen as a process
203  XrayFluoStepMax* stepMaxProcess = new XrayFluoStepMax();
204 
206  particleIterator->reset();
207  while ((*particleIterator)()){
208  G4ParticleDefinition* particle = particleIterator->value();
209  G4ProcessManager* pmanager = particle->GetProcessManager();
210 
211  if (stepMaxProcess->IsApplicable(*particle) && !particle->IsShortLived())
212  {
213  pmanager ->AddDiscreteProcess(stepMaxProcess);
214  }
215  }
216 }
217 
218 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
219 
221 {
222  if (verboseLevel>-1) {
223  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
224  }
225 
226  if (name == emName) return;
227 
228  if (name == "emlivermore") {
229 
230  emName = name;
231  delete emPhysicsList;
232  emPhysicsList = new G4EmLivermorePhysics;
233 
234  } else if (name == "emstandard") {
235  emName = name;
236  delete emPhysicsList;
237  emPhysicsList = new G4EmStandardPhysics();
238 
239  } else if (name == "emstandard_opt1") {
240 
241  emName = name;
242  delete emPhysicsList;
243  emPhysicsList = new G4EmStandardPhysics_option1();
244 
245  } else if (name == "emstandard_opt2") {
246 
247  emName = name;
248  delete emPhysicsList;
249  emPhysicsList = new G4EmStandardPhysics_option2();
250 
251  } else if (name == "emstandard_opt3") {
252 
253  emName = name;
254  delete emPhysicsList;
255  emPhysicsList = new G4EmStandardPhysics_option3();
256 
257  } else if (name == "empenelope"){
258  emName = name;
259  delete emPhysicsList;
260  emPhysicsList = new G4EmPenelopePhysics();
261 
262  } else {
263 
264  G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
265  << " is not defined"
266  << G4endl;
267  }
268 }
269 
270 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
271 
273 {
274  if (verboseLevel >0){
275  G4cout << "PhysicsList::SetCuts:";
276  G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
277  }
278 
279  // set cut values for gamma at first and for e- second and next for e+,
280  // because some processes for e+/e- need cut values for gamma
281  SetCutValue(cutForGamma, "gamma");
282  SetCutValue(cutForElectron, "e-");
283  SetCutValue(cutForPositron, "e+");
284 
286 }
287 
288 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
289 
291 {
292  cutForGamma = cut;
293  SetParticleCuts(cutForGamma, G4Gamma::Gamma());
294 }
295 
296 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
297 
299 {
300  cutForElectron = cut;
301  SetParticleCuts(cutForElectron, G4Electron::Electron());
302 }
303 
304 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
305 
307 {
308  cutForPositron = cut;
309  SetParticleCuts(cutForPositron, G4Positron::Positron());
310 }
311 
312 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
313 
315 {
316  cutForProton = cut;
317  SetParticleCuts(cutForProton, G4Proton::Proton());
318 }
319 
320 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
321 
322 //void XrayFluoPhysicsList::SetFluorescence(G4bool value)
323 //{
324 // G4VAtomDeexcitation* de = G4LossTableManager::Instance()->AtomDeexcitation();
325 // if(de) { de->SetFluo(value); }
326 //}
327 
328 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
329 
330 //void XrayFluoPhysicsList::SetPIXE(G4bool value)
331 //{
332 // G4VAtomDeexcitation* de = G4LossTableManager::Instance()->AtomDeexcitation();
333 // if(de) { de->SetPIXE(value); }
334 //}
335 
336 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
const XML_Char * name
Definition: expat.h:151
static G4MuonPlus * MuonPlusDefinition()
Definition: G4MuonPlus.cc:94
static G4LossTableManager * Instance()
void SetPIXE(G4bool val)
static constexpr double mm
Definition: G4SIunits.hh:115
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)
#define G4BestUnit(a, b)
#define G4_USE_G4BESTUNIT_FOR_VERBOSE 1
static void ConstructParticle()
void SetDEDXBinningForCSDARange(G4int val)
static void ConstructParticle()
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
G4ProcessManager * GetProcessManager() const
static G4MuonMinus * MuonMinusDefinition()
Definition: G4MuonMinus.cc:95
virtual void ConstructProcess()=0
void SetBuildCSDARange(G4bool val)
void SetVerbose(G4int val)
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
static G4ChargedGeantino * ChargedGeantinoDefinition()
static G4Electron * Electron()
Definition: G4Electron.cc:94
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
#define G4endl
Definition: G4ios.hh:61
static G4AntiNeutrinoE * AntiNeutrinoEDefinition()
double G4double
Definition: G4Types.hh:76
static G4NeutrinoMu * NeutrinoMuDefinition()
Definition: G4NeutrinoMu.cc:80
G4bool IsApplicable(const G4ParticleDefinition &)
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81