Geant4  10.02.p01
ExExChPhysListEmStandardSS.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 //
27 
28 #include "G4SystemOfUnits.hh"
29 #include "G4ParticleDefinition.hh"
30 #include "G4LossTableManager.hh"
31 #include "G4EmProcessOptions.hh"
32 
33 #include "G4ComptonScattering.hh"
34 #include "G4GammaConversion.hh"
35 #include "G4PhotoElectricEffect.hh"
36 #include "G4RayleighScattering.hh"
37 #include "G4PEEffectFluoModel.hh"
38 #include "G4KleinNishinaModel.hh"
39 #include "G4LowEPComptonModel.hh"
42 
43 #include "G4eMultipleScattering.hh"
45 #include "G4hMultipleScattering.hh"
46 #include "G4CoulombScattering.hh"
49 
50 #include "G4eIonisation.hh"
51 #include "G4eBremsstrahlung.hh"
52 #include "G4Generator2BS.hh"
53 #include "G4SeltzerBergerModel.hh"
56 
57 #include "G4eplusAnnihilation.hh"
58 #include "G4UAtomicDeexcitation.hh"
59 
60 
61 #include "G4MuIonisation.hh"
62 #include "G4MuBremsstrahlung.hh"
63 #include "G4MuPairProduction.hh"
64 
65 #include "G4hBremsstrahlung.hh"
66 #include "G4hPairProduction.hh"
67 #include "G4hIonisation.hh"
68 #include "G4ionIonisation.hh"
70 
71 #include "G4PhysicsListHelper.hh"
72 #include "G4BuilderType.hh"
73 #include "G4ProcessManager.hh"
74 
75 // Wrapper
78 
79 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
80 
82  const G4String& name)
84 }
85 
86 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
87 
89 {}
90 
91 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
92 
94 {
96 
97  // Add standard EM Processes
98  //
99  aParticleIterator->reset();
100  while( (*aParticleIterator)() ){
101  G4ParticleDefinition* particle = aParticleIterator->value();
102  G4String particleName = particle->GetParticleName();
103 
104  if (particleName == "gamma") {
105  //G4cout << particleName << G4endl;
106  // Compton scattering
108  cs->SetEmModel(new G4KleinNishinaModel(),1);
109  G4VEmModel* theLowEPComptonModel = new G4LowEPComptonModel();
110  theLowEPComptonModel->SetHighEnergyLimit(20*MeV);
111  cs->AddEmModel(0, theLowEPComptonModel);
112  ph->RegisterProcess(cs, particle);
113 
114  // Photoelectric
116  G4VEmModel* theLivermorePEModel =
118  theLivermorePEModel->SetHighEnergyLimit(10*GeV);
119  pe->SetEmModel(theLivermorePEModel,1);
120  ph->RegisterProcess(pe, particle);
121 
122  // Gamma conversion
124  G4VEmModel* thePenelopeGCModel =
126  thePenelopeGCModel->SetHighEnergyLimit(1*GeV);
127  gc->SetEmModel(thePenelopeGCModel,1);
128  ph->RegisterProcess(gc, particle);
129 
130  // Rayleigh scattering
131  ph->RegisterProcess(new G4RayleighScattering(), particle);
132  } else if (particleName == "e-") {
133 
134  //G4cout << particleName << G4endl;
135  // ionisation
136  G4eIonisation* eIoni = new G4eIonisation();
137  eIoni->SetStepFunction(0.1, 100*um);
138  G4VEmModel* theIoniPenelope = new G4PenelopeIonisationModel();
139  theIoniPenelope->SetHighEnergyLimit(0.1*MeV);
140  eIoni->AddEmModel(0, theIoniPenelope, new G4UniversalFluctuation());
141 
142  XWrapperContinuousDiscreteProcess *eIoni_wrapper =
144  eIoni_wrapper->RegisterProcess(eIoni,-1);
145  ph->RegisterProcess(eIoni_wrapper, particle);
146 
147  // bremsstrahlung
148  G4eBremsstrahlung* eBrem = new G4eBremsstrahlung();
149  XWrapperContinuousDiscreteProcess *eBrem_wrapper =
151  eBrem_wrapper->RegisterProcess(eBrem,-1);
152  ph->RegisterProcess(eBrem_wrapper, particle);
153 
154  // coulomb scattering
156  ecs->SetBuildTableFlag(false);
159  ecsmodel->SetPolarAngleLimit(0.0);
160  ecs->AddEmModel(0, ecsmodel);
161  XWrapperDiscreteProcess *ecs_wrapper =
163  ecs_wrapper->RegisterProcess(ecs,1,1);
164  ph->RegisterProcess(ecs_wrapper, particle);
165 
166 
167  // multiple scattering
169  XWrapperContinuousDiscreteProcess *ems_wrapper =
171  ems_wrapper->RegisterProcess(ems,0,2);
172  ph->RegisterProcess(ems_wrapper, particle);
173 
174  } else if (particleName == "e+") {
175  //G4cout << particleName << G4endl;
176  // ionisation
177  G4eIonisation* eIoni = new G4eIonisation();
178  eIoni->SetStepFunction(0.2, 100*um);
179  G4VEmModel* theIoniPenelope = new G4PenelopeIonisationModel();
180  theIoniPenelope->SetHighEnergyLimit(0.1*MeV);
181  eIoni->AddEmModel(0, theIoniPenelope, new G4UniversalFluctuation());
182 
183  XWrapperContinuousDiscreteProcess *eIoni_wrapper =
185  eIoni_wrapper->RegisterProcess(eIoni,-1);
186  ph->RegisterProcess(eIoni_wrapper, particle);
187 
188  // bremsstrahlung
189  G4eBremsstrahlung* eBrem = new G4eBremsstrahlung();
190  XWrapperContinuousDiscreteProcess *eBrem_wrapper =
192  eBrem_wrapper->RegisterProcess(eBrem,-1);
193  ph->RegisterProcess(eBrem_wrapper, particle);
194 
195  // annihilation at rest and in flight
196  G4eplusAnnihilation* eplusAnn = new G4eplusAnnihilation();
197  XWrapperDiscreteProcess *eplusAnn_wrapper =
199  eplusAnn_wrapper->RegisterProcess(eplusAnn,-1);
200  ph->RegisterProcess(eplusAnn_wrapper, particle);
201 
202  // coulomb scattering
204  ecs->SetBuildTableFlag(false);
207  ecsmodel->SetPolarAngleLimit(0.0);
208  ecs->AddEmModel(0, ecsmodel);
209  XWrapperDiscreteProcess *ecs_wrapper =
211  ecs_wrapper->RegisterProcess(ecs,1,1);
212  ph->RegisterProcess(ecs_wrapper, particle);
213 
214  // multiple scattering
216  XWrapperContinuousDiscreteProcess *ems_wrapper =
218  ems_wrapper->RegisterProcess(ems,0,2);
219  ph->RegisterProcess(ems_wrapper, particle);
220 
221  } else if ((particleName == "mu+" ||
222  particleName == "mu-")) {
223  //G4cout << particleName << G4endl;
224  // ionisation
225  G4MuIonisation* muIoni = new G4MuIonisation();
226  muIoni->SetStepFunction(0.2, 50*um);
227  XWrapperContinuousDiscreteProcess *muIoni_wrapper =
229  muIoni_wrapper->RegisterProcess(muIoni,-1);
230  ph->RegisterProcess(muIoni_wrapper, particle);
231 
232  // bremsstrahlung
233  G4MuBremsstrahlung* muBrem = new G4MuBremsstrahlung();
234  XWrapperContinuousDiscreteProcess *muBrem_wrapper =
236  muBrem_wrapper->RegisterProcess(muBrem,-1);
237  ph->RegisterProcess(muBrem_wrapper, particle);
238 
239  // pair production
240  G4MuPairProduction* muPair = new G4MuPairProduction();
241  XWrapperContinuousDiscreteProcess* muPair_wrapper =
243  muPair_wrapper->RegisterProcess(muPair,-1);
244  ph->RegisterProcess(muPair_wrapper, particle);
245 
246  // coulomb scattering
248  ecs->SetBuildTableFlag(false);
249  G4eCoulombScatteringModel* ecsmodel =
251  ecsmodel->SetPolarAngleLimit(0.0);
252  ecs->AddEmModel(0, ecsmodel);
253  XWrapperDiscreteProcess *ecs_wrapper =
255  ecs_wrapper->RegisterProcess(ecs,1,1);
256  ph->RegisterProcess(ecs_wrapper, particle);
257 
258  // multiple scattering
259  XWrapperContinuousDiscreteProcess *mums_wrapper =
261  mums_wrapper->RegisterProcess(new G4MuMultipleScattering(),0,2);
262  ph->RegisterProcess(mums_wrapper, particle);
263 
264  } else if ((particleName == "alpha" || particleName == "He3") ) {
265  //G4cout << particleName << G4endl;
266  // ionisation
267  G4ionIonisation* ionIoni = new G4ionIonisation();
268  ionIoni->SetStepFunction(0.1, 10*um);
269  XWrapperContinuousDiscreteProcess *ionIoni_wrapper =
271  ionIoni_wrapper->RegisterProcess(ionIoni,-1);
272  ph->RegisterProcess(ionIoni_wrapper, particle);
273 
274  // coulomb scattering
276  ecs->SetBuildTableFlag(false);
277  XWrapperDiscreteProcess *ecs_wrapper =
279  ecs_wrapper->RegisterProcess(ecs,1,1);
280  ph->RegisterProcess(ecs_wrapper, particle);
281 
282 
283  // multiple scattering
284  XWrapperContinuousDiscreteProcess *hms_wrapper =
286  hms_wrapper->RegisterProcess(new G4hMultipleScattering(),0,2);
287  ph->RegisterProcess(hms_wrapper, particle);
288 
289  } else if( particleName == "proton" ||
290  particleName == "pi-" ||
291  particleName == "pi+" ) {
292 
293  //G4cout << particleName << G4endl;
294  // ionisation
295  G4hIonisation* hIoni = new G4hIonisation();
296  hIoni->SetStepFunction(0.1, 20*um);
297  XWrapperContinuousDiscreteProcess *hIoni_wrapper =
299  hIoni_wrapper->RegisterProcess(hIoni,-1);
300  ph->RegisterProcess(hIoni_wrapper, particle);
301 
302  // bremsstrahlung
303  G4hBremsstrahlung* hBrem = new G4hBremsstrahlung();
304  XWrapperContinuousDiscreteProcess *hBrem_wrapper =
306  hBrem_wrapper->RegisterProcess(hBrem,-1);
307  ph->RegisterProcess(hBrem_wrapper, particle);
308 
309  // pair production
310  G4hPairProduction* hPair = new G4hPairProduction();
311  XWrapperContinuousDiscreteProcess* hPair_wrapper =
313  hPair_wrapper->RegisterProcess(hPair,-1);
314  ph->RegisterProcess(hPair_wrapper, particle);
315 
316  // coulomb scattering
318  ecs->SetBuildTableFlag(false);
319  XWrapperDiscreteProcess *ecs_wrapper =
321  ecs_wrapper->RegisterProcess(ecs,1,1);
322  ph->RegisterProcess(ecs_wrapper, particle);
323 
324  // multiple scattering
325  XWrapperContinuousDiscreteProcess *hms_wrapper =
327  hms_wrapper->RegisterProcess(new G4hMultipleScattering(),0,2);
328  ph->RegisterProcess(hms_wrapper, particle);
329 
330  } else if (particleName == "GenericIon" ) {
331  //G4cout << particleName << G4endl;
332  // ionisation
333  G4ionIonisation* ionIoni = new G4ionIonisation();
334  ionIoni->SetStepFunction(0.1, 1*um);
335  XWrapperContinuousDiscreteProcess *ionIoni_wrapper =
337  ionIoni_wrapper->RegisterProcess(ionIoni,-1);
338  ph->RegisterProcess(ionIoni_wrapper, particle);
339 
340  // coulomb scattering
342  ecs->SetBuildTableFlag(false);
343  XWrapperDiscreteProcess *ecs_wrapper =
345  ecs_wrapper->RegisterProcess(ecs,1,1);
346  ph->RegisterProcess(ecs_wrapper, particle);
347 
348  // multiple scattering
349  XWrapperContinuousDiscreteProcess *hms_wrapper =
351  hms_wrapper->RegisterProcess(new G4hMultipleScattering(),0,2);
352  ph->RegisterProcess(hms_wrapper, particle);
353 
354  } else if ((!particle->IsShortLived()) &&
355  (particle->GetPDGCharge() != 0.0) &&
356  (particle->GetParticleName() != "chargedgeantino") ) {
357  //G4cout << particleName << G4endl;
358  //all others charged particles except geantino
359 
360  // ionisation
361  G4hIonisation* hIoni = new G4hIonisation();
362  XWrapperContinuousDiscreteProcess *hIoni_wrapper =
364  hIoni_wrapper->RegisterProcess(hIoni,-1);
365  ph->RegisterProcess(hIoni_wrapper, particle);
366 
367  // coulomb scattering
369  ecs->SetBuildTableFlag(false);
370  XWrapperDiscreteProcess *ecs_wrapper =
372  ecs_wrapper->RegisterProcess(ecs,1,1);
373  ph->RegisterProcess(ecs_wrapper, particle);
374 
375  // multiple scattering
376  XWrapperContinuousDiscreteProcess *hms_wrapper =
378  hms_wrapper->RegisterProcess(new G4hMultipleScattering(),0,2);
379  ph->RegisterProcess(hms_wrapper, particle);
380 
381  }
382  }
383 
384  // Em options
385  //
386  // Main options and setting parameters are shown here.
387  // Several of them have default values.
388  //
389  G4EmProcessOptions emOptions;
390 
391  //physics tables
392  //
393  emOptions.SetMinEnergy(10*eV);
394  emOptions.SetMaxEnergy(10*TeV);
395  emOptions.SetDEDXBinning(12*20);
396  emOptions.SetLambdaBinning(12*20);
397 
398  // scattering
399  emOptions.SetPolarAngleLimit(0.0);
400 
401  // Deexcitation
404  de->SetFluo(true);
405 }
406 
407 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
408 
ExExChPhysListEmStandardSS(const G4String &name="standardSS")
void RegisterProcess(G4VContinuousDiscreteProcess *)
static const double MeV
Definition: G4SIunits.hh:211
static G4LossTableManager * Instance()
void SetBuildTableFlag(G4bool val)
G4String name
Definition: TRTMaterials.hh:40
void SetMinEnergy(G4double val)
void SetStepFunction(G4double v1, G4double v2)
const G4String & GetParticleName() const
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:725
void SetDEDXBinning(G4int val)
void SetEmModel(G4VEmModel *, G4int index=1)
void SetLambdaBinning(G4int val)
#define aParticleIterator
G4bool RegisterProcess(G4VProcess *process, G4ParticleDefinition *particle)
static const double GeV
Definition: G4SIunits.hh:214
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *fluc=0, const G4Region *region=0)
void SetMaxEnergy(G4double val)
static const double eV
Definition: G4SIunits.hh:212
void AddEmModel(G4int, G4VEmModel *, const G4Region *region=0)
static G4PhysicsListHelper * GetPhysicsListHelper()
static const double um
Definition: G4SIunits.hh:112
static const double TeV
Definition: G4SIunits.hh:215
void RegisterProcess(G4VDiscreteProcess *)
G4double GetPDGCharge() const
void SetAtomDeexcitation(G4VAtomDeexcitation *)
void SetPolarAngleLimit(G4double)
Definition: G4VEmModel.hh:760
void SetPolarAngleLimit(G4double val)