Geant4  10.02
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 {
184  theParticleIterator->reset();
185 
186  while( (*theParticleIterator)() )
187  {
188  G4ParticleDefinition* particle = theParticleIterator->value();
189  G4ProcessManager* pmanager = particle->GetProcessManager();
190  G4String particleName = particle->GetParticleName();
191 
192  if (particleName == "gamma")
193  {
194  //gamma
195  pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
196  pmanager->AddDiscreteProcess(new G4ComptonScattering());
197  pmanager->AddDiscreteProcess(new G4GammaConversion());
198  }
199  else if (particleName == "e-")
200  {
201  //electron
202  pmanager->AddProcess(new G4eMultipleScattering(),-1, 1,1);
203  pmanager->AddProcess(new G4eIonisation(), -1, 2,2);
204  pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3,3);
205 
206  } else if (particleName == "e+") {
207 
208  //positron
209  pmanager->AddProcess(new G4eMultipleScattering(),-1, 1,1);
210  pmanager->AddProcess(new G4eIonisation(), -1, 2,2);
211  pmanager->AddProcess(new G4eBremsstrahlung(), -1, 3,3);
212  pmanager->AddProcess(new G4eplusAnnihilation(), 0,-1,4);
213 
214  } else if( particleName == "mu-" ||
215  particleName == "mu+" ) {
216 
217  //muon
218  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
219  pmanager->AddProcess(new G4MuIonisation, -1, 2, 2);
220  pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3);
221  pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4);
222 
223  } else if( particleName == "pi-" ||
224  particleName == "pi+" ) {
225 
226  //pions
227  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
228  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
229  pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3);
230  pmanager->AddProcess(new G4hPairProduction, -1, 4, 4);
231 
232  } else if( particleName == "proton" ) {
233 
234  //proton
235  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
236  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
237  pmanager->AddProcess(new G4hBremsstrahlung, -1, 3, 3);
238  pmanager->AddProcess(new G4hPairProduction, -1, 4, 4);
239 
240  } else if( particleName == "alpha" ||
241  particleName == "He3" ||
242  particleName == "GenericIon" ) {
243 
244  //Ions
245  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
246  pmanager->AddProcess(new G4ionIonisation, -1, 2, 2);
247 
248  } else if ((!particle->IsShortLived()) &&
249  (particle->GetPDGCharge() != 0.0) &&
250  (particle->GetParticleName() != "chargedgeantino")) {
251 
252  //all others charged particles except geantino
253  pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
254  pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
255 
256  }
257  }
258 }
259 
260 #include "G4Decay.hh"
261 
263 {
264  G4Decay* theDecayProcess = new G4Decay();
265  theParticleIterator->reset();
266  while( (*theParticleIterator)() ){
267  G4ParticleDefinition* particle = theParticleIterator->value();
268  G4ProcessManager* pmanager = particle->GetProcessManager();
269  if (theDecayProcess->IsApplicable(*particle)) {
270  pmanager ->AddProcess(theDecayProcess);
271  pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
272  pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
273  }
274  }
275 }
276 
278 {
279  // defaultCutValue you have typed in is used
280 
281  if (verboseLevel >1){
282  G4cout << "XrayTelPhysicsList::SetCuts:" << G4endl;
283  }
284 
285  // set cut values for gamma at first and for e- second
286  SetCutValue(cutForGamma, "gamma");
289 
290  // SetCutValueForOthers(defaultCutValue);
291 
292  if (verboseLevel >1) {
294  }
295 }
296 
298 {
299  ResetCuts();
300  cutForGamma = cut;
301 }
302 
304 {
305  ResetCuts();
306  cutForElectron = cut;
307 }
308 
310 {
311  return cutForGamma;
312 }
313 
315 {
316  return cutForElectron;
317 }
318 
319 
320 
321 
322 
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:82
static G4Electron * ElectronDefinition()
Definition: G4Electron.cc:89
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()
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleName() const
void SetCutForGamma(G4double)
static void ConstructParticle()
void DumpCutValuesTable(G4int flag=1)
G4GLOB_DLL std::ostream G4cout
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
static G4ChargedGeantino * ChargedGeantinoDefinition()
void ResetCuts()
obsolete methods
#define G4endl
Definition: G4ios.hh:61
static const double m
Definition: G4SIunits.hh:128
static G4AntiNeutrinoE * AntiNeutrinoEDefinition()
static G4OpticalPhoton * OpticalPhotonDefinition()
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const
static G4NeutrinoMu * NeutrinoMuDefinition()
Definition: G4NeutrinoMu.cc:80
static const double mm
Definition: G4SIunits.hh:114
#define theParticleIterator
void SetCutForElectron(G4double)
static G4Gamma * GammaDefinition()
Definition: G4Gamma.cc:81