Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
XrayTelPhysicsList.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 // **********************************************************************
28 // * *
29 // * GEANT 4 xray_telescope advanced example *
30 // * *
31 // * MODULE: XrayTelPhysicsList.cc *
32 // * ------- *
33 // * *
34 // * Version: 0.4 *
35 // * Date: 06/11/00 *
36 // * Author: R Nartallo *
37 // * Organisation: ESA/ESTEC, Noordwijk, THe Netherlands *
38 // * *
39 // **********************************************************************
40 //
41 // CHANGE HISTORY
42 // --------------
43 //
44 // 06.11.2000 R.Nartallo
45 // - First implementation of xray_telescope Physics list
46 // - Based on Chandra and XMM models
47 //
48 //
49 // **********************************************************************
50 
51 #include "XrayTelPhysicsList.hh"
52 
53 #include "globals.hh"
54 #include "G4SystemOfUnits.hh"
55 #include "G4ParticleDefinition.hh"
56 #include "G4ParticleWithCuts.hh"
57 #include "G4ProcessManager.hh"
58 #include "G4ProcessVector.hh"
59 #include "G4ParticleTypes.hh"
60 #include "G4ParticleTable.hh"
62 #include "G4Material.hh"
63 #include "G4MaterialTable.hh"
64 #include "G4ios.hh"
65 // Hadrons
66 #include "G4MesonConstructor.hh"
67 #include "G4BaryonConstructor.hh"
68 #include "G4IonConstructor.hh"
69 
71 {
72  // Default cut values
73  defaultCutValue = 2.0*mm;
74  cutForGamma = 1.0*m;
75  cutForElectron = 1.0*m;
76 
77  SetVerboseLevel(1);
78 }
79 
81 {}
82 
84 {
85  // Here are constructed all particles
90  ConstructIons();
92 }
93 
94 // In this method, static member functions should be called for ALL particles to be used.
95 
97 {
98  // pseudo-particles
101 
102  // gamma
104 
105  // optical photon
107 }
109 {
110  // leptons
113 
118 
121 }
123 {
124  // mesons
125  G4MesonConstructor mConstructor;
126  mConstructor.ConstructParticle();
127 }
128 
130 {
131  // barions
132  G4BaryonConstructor bConstructor;
133  bConstructor.ConstructParticle();
134 }
135 
137 {
138  // ions
139  G4IonConstructor iConstructor;
140  iConstructor.ConstructParticle();
141 }
142 
144 {
145  //Short-lived
146  G4ShortLivedConstructor slConstructor;
147  slConstructor.ConstructParticle();
148 }
149 
150 
152 {
153  // Transportation, electromagnetic and general processes
155  ConstructEM();
157 }
158 
159 // Here are respective header files for chosen processes
160 
161 #include "G4ComptonScattering.hh"
162 #include "G4GammaConversion.hh"
163 #include "G4PhotoElectricEffect.hh"
164 
165 #include "G4eMultipleScattering.hh"
166 #include "G4hMultipleScattering.hh"
167 
168 #include "G4eIonisation.hh"
169 #include "G4eBremsstrahlung.hh"
170 #include "G4eplusAnnihilation.hh"
171 
172 #include "G4MuIonisation.hh"
173 #include "G4MuBremsstrahlung.hh"
174 #include "G4MuPairProduction.hh"
175 
176 #include "G4hIonisation.hh"
177 #include "G4hBremsstrahlung.hh"
178 #include "G4hPairProduction.hh"
179 
180 #include "G4ionIonisation.hh"
181 
183 {
185  particleIterator->reset();
186 
187  while( (*particleIterator)() )
188  {
189  G4ParticleDefinition* particle = particleIterator->value();
190  G4ProcessManager* pmanager = particle->GetProcessManager();
191  G4String particleName = particle->GetParticleName();
192 
193  if (particleName == "gamma")
194  {
195  //gamma
196  pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
197  pmanager->AddDiscreteProcess(new G4ComptonScattering());
198  pmanager->AddDiscreteProcess(new G4GammaConversion());
199  }
200  else if (particleName == "e-")
201  {
202  //electron
203  pmanager->AddProcess(new G4eMultipleScattering(),-1, 1,1);
204  pmanager->AddProcess(new G4eIonisation(), -1, 2,2);
205  pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3,3);
206 
207  } else if (particleName == "e+") {
208 
209  //positron
210  pmanager->AddProcess(new G4eMultipleScattering(),-1, 1,1);
211  pmanager->AddProcess(new G4eIonisation(), -1, 2,2);
212  pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3,3);
213  pmanager->AddProcess(new G4eplusAnnihilation(), 0,-1,4);
214 
215  } else if( particleName == "mu-" ||
216  particleName == "mu+" ) {
217 
218  //muon
219  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
220  pmanager->AddProcess(new G4MuIonisation, -1, 2, 2);
221  pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3);
222  pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4);
223 
224  } else if( particleName == "pi-" ||
225  particleName == "pi+" ) {
226 
227  //pions
228  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
229  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
230  pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3);
231  pmanager->AddProcess(new G4hPairProduction, -1, 4, 4);
232 
233  } else if( particleName == "proton" ) {
234 
235  //proton
236  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
237  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
238  pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3);
239  pmanager->AddProcess(new G4hPairProduction, -1, 4, 4);
240 
241  } else if( particleName == "alpha" ||
242  particleName == "He3" ||
243  particleName == "GenericIon" ) {
244 
245  //Ions
246  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
247  pmanager->AddProcess(new G4ionIonisation, -1, 2, 2);
248 
249  } else if ((!particle->IsShortLived()) &&
250  (particle->GetPDGCharge() != 0.0) &&
251  (particle->GetParticleName() != "chargedgeantino")) {
252 
253  //all others charged particles except geantino
254  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
255  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
256 
257  }
258  }
259 }
260 
261 #include "G4Decay.hh"
262 
264 {
265  G4Decay* theDecayProcess = new G4Decay();
267  particleIterator->reset();
268  while( (*particleIterator)() ){
269  G4ParticleDefinition* particle = particleIterator->value();
270  G4ProcessManager* pmanager = particle->GetProcessManager();
271  if (theDecayProcess->IsApplicable(*particle)) {
272  pmanager ->AddProcess(theDecayProcess);
273  pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
274  pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
275  }
276  }
277 }
278 
280 {
281  // defaultCutValue you have typed in is used
282 
283  if (verboseLevel >1){
284  G4cout << "XrayTelPhysicsList::SetCuts:" << G4endl;
285  }
286 
287  // set cut values for gamma at first and for e- second
288  SetCutValue(cutForGamma, "gamma");
289  SetCutValue(cutForElectron, "e-");
290  SetCutValue(cutForElectron, "e+");
291 
292  // SetCutValueForOthers(defaultCutValue);
293 
294  if (verboseLevel >1) {
296  }
297 }
298 
300 {
301  ResetCuts();
302  cutForGamma = cut;
303 }
304 
306 {
307  ResetCuts();
308  cutForElectron = cut;
309 }
310 
312 {
313  return cutForGamma;
314 }
315 
317 {
318  return cutForElectron;
319 }
320 
321 
322 
323 
324 
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
static constexpr double mm
Definition: G4SIunits.hh:115
void SetCutValue(G4double aCut, const G4String &pname)
G4double GetCutForGamma() const
virtual G4bool IsApplicable(const G4ParticleDefinition &)
Definition: G4Decay.cc:89
static G4MuonMinus * Definition()
Definition: G4MuonMinus.cc:52
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
static void ConstructParticle()
static void ConstructParticle()
const G4String & GetParticleName() const
void SetCutForGamma(G4double)
static void ConstructParticle()
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
static constexpr double m
Definition: G4SIunits.hh:129
void SetVerboseLevel(G4int value)
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
static G4NeutrinoE * NeutrinoEDefinition()
Definition: G4NeutrinoE.cc:80
static G4MuonPlus * Definition()
Definition: G4MuonPlus.cc:52
static G4AntiNeutrinoMu * AntiNeutrinoMuDefinition()
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
static G4Positron * PositronDefinition()
Definition: G4Positron.cc:89
G4double GetCutForElectron() const
G4ProcessManager * GetProcessManager() const
std::vector< G4InuclElementaryParticle >::iterator particleIterator
Definition: G4BigBanger.cc:65
static G4ChargedGeantino * ChargedGeantinoDefinition()
void ResetCuts()
obsolete methods
G4ParticleTable::G4PTblDicIterator * GetParticleIterator() const
#define G4endl
Definition: G4ios.hh:61
static G4AntiNeutrinoE * AntiNeutrinoEDefinition()
static G4OpticalPhoton * OpticalPhotonDefinition()
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const
static G4NeutrinoMu * NeutrinoMuDefinition()
Definition: G4NeutrinoMu.cc:80
void SetCutForElectron(G4double)
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81