Geant4  10.01.p02
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 //
26 
28 
29 #include "G4SystemOfUnits.hh"
30 #include "G4ParticleDefinition.hh"
31 #include "G4LossTableManager.hh"
32 #include "G4EmProcessOptions.hh"
33 
34 #include "G4ComptonScattering.hh"
35 #include "G4GammaConversion.hh"
36 #include "G4PhotoElectricEffect.hh"
37 #include "G4RayleighScattering.hh"
38 #include "G4PEEffectFluoModel.hh"
39 #include "G4KleinNishinaModel.hh"
40 #include "G4LowEPComptonModel.hh"
43 
44 #include "G4eMultipleScattering.hh"
46 #include "G4hMultipleScattering.hh"
47 #include "G4CoulombScattering.hh"
50 
51 #include "G4eIonisation.hh"
52 #include "G4eBremsstrahlung.hh"
53 #include "G4Generator2BS.hh"
54 #include "G4SeltzerBergerModel.hh"
57 
58 #include "G4eplusAnnihilation.hh"
59 #include "G4UAtomicDeexcitation.hh"
60 
61 #include "G4MuIonisation.hh"
62 #include "G4MuBremsstrahlung.hh"
63 #include "G4MuPairProduction.hh"
64 
65 #include "G4hIonisation.hh"
66 #include "G4ionIonisation.hh"
68 
69 #include "G4PhysicsListHelper.hh"
70 #include "G4BuilderType.hh"
71 #include "G4ProcessManager.hh"
72 
73 // Wrapper
76 
77 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
78 
80  const G4String& name)
82 }
83 
84 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
85 
87 {}
88 
89 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
90 
92 {
93  aParticleIterator->reset();
94  while( (*aParticleIterator)() ){
95  G4ParticleDefinition* particle = aParticleIterator->value();
96  G4ProcessManager* pmanager = particle->GetProcessManager();
97  G4String particleName = particle->GetParticleName();
98 
99  if (particleName == "gamma") {
100 
101  // Compton scattering
103  cs->SetEmModel(new G4KleinNishinaModel(),1);
104  G4VEmModel* theLowEPComptonModel = new G4LowEPComptonModel();
105  theLowEPComptonModel->SetHighEnergyLimit(20*MeV);
106  cs->AddEmModel(0, theLowEPComptonModel);
107  pmanager->AddDiscreteProcess(cs);
108 
109  // Photoelectric
111  G4VEmModel* theLivermorePEModel =
113  theLivermorePEModel->SetHighEnergyLimit(10*GeV);
114  pe->SetEmModel(theLivermorePEModel,1);
115  pmanager->AddDiscreteProcess(pe);
116 
117  // Gamma conversion
119  G4VEmModel* thePenelopeGCModel =
121  thePenelopeGCModel->SetHighEnergyLimit(1*GeV);
122  gc->SetEmModel(thePenelopeGCModel,1);
123 
124  pmanager->AddDiscreteProcess(gc);
125 
126  // Rayleigh scattering
127  pmanager->AddDiscreteProcess(new G4RayleighScattering());
128 
129  } else if (particleName == "e-") {
130 
131  // ionisation
132  G4eIonisation* eIoni = new G4eIonisation();
133  eIoni->SetStepFunction(0.2, 100*um);
134  G4VEmModel* theIoniPenelope = new G4PenelopeIonisationModel();
135  theIoniPenelope->SetHighEnergyLimit(0.1*MeV);
136  eIoni->AddEmModel(0, theIoniPenelope, new G4UniversalFluctuation());
137 
138  XWrapperContinuousDiscreteProcess *eIoni_wrapper =
140  eIoni_wrapper->RegisterProcess(eIoni,-1);
141  pmanager->AddProcess(eIoni_wrapper,-1, 1, 1);
142 
143  // bremsstrahlung
144  G4eBremsstrahlung* eBrem = new G4eBremsstrahlung();
145  XWrapperContinuousDiscreteProcess *eBrem_wrapper =
147  eBrem_wrapper->RegisterProcess(eBrem,-1);
148  pmanager->AddProcess(eBrem_wrapper,-1, 2, 2);
149 
150  // coulomb scattering
152  ecs->SetBuildTableFlag(false);
155  ecsmodel->SetPolarAngleLimit(0.0);
156  ecs->AddEmModel(0, ecsmodel);
157  XWrapperDiscreteProcess *ecs_wrapper =
159  ecs_wrapper->RegisterProcess(ecs,0);
160  pmanager->AddDiscreteProcess(ecs_wrapper);
161 
162  } else if (particleName == "e+") {
163  // ionisation
164  G4eIonisation* eIoni = new G4eIonisation();
165  eIoni->SetStepFunction(0.2, 100*um);
166  G4VEmModel* theIoniPenelope = new G4PenelopeIonisationModel();
167  theIoniPenelope->SetHighEnergyLimit(0.1*MeV);
168  eIoni->AddEmModel(0, theIoniPenelope, new G4UniversalFluctuation());
169 
170  XWrapperContinuousDiscreteProcess *eIoni_wrapper =
172  eIoni_wrapper->RegisterProcess(eIoni,-1);
173  pmanager->AddProcess(eIoni_wrapper,-1, 1, 1);
174 
175  // bremsstrahlung
176  G4eBremsstrahlung* eBrem = new G4eBremsstrahlung();
177  XWrapperContinuousDiscreteProcess *eBrem_wrapper =
179  eBrem_wrapper->RegisterProcess(eBrem,-1);
180  pmanager->AddProcess(eBrem_wrapper,-1, 2, 2);
181 
182  // annihilation at rest and in flight
183  G4eplusAnnihilation* eplusAnn = new G4eplusAnnihilation();
184  XWrapperDiscreteProcess *eplusAnn_wrapper =
186  eplusAnn_wrapper->RegisterProcess(eplusAnn,-1);
187  pmanager->AddProcess(eplusAnn_wrapper);
188 
189  // coulomb scattering
191  ecs->SetBuildTableFlag(false);
194  ecsmodel->SetPolarAngleLimit(0.0);
195  ecs->AddEmModel(0, ecsmodel);
196  XWrapperDiscreteProcess *ecs_wrapper =
198  ecs_wrapper->RegisterProcess(ecs,0);
199  pmanager->AddDiscreteProcess(ecs_wrapper,1);
200 
201  } else if ((particleName == "mu+" ||
202  particleName == "mu-")) {
203  // ionisation
204  G4MuIonisation* muIoni = new G4MuIonisation();
205  muIoni->SetStepFunction(0.2, 50*um);
206  XWrapperContinuousDiscreteProcess *muIoni_wrapper =
208  muIoni_wrapper->RegisterProcess(muIoni,-1);
209  pmanager->AddProcess(muIoni_wrapper,-1, 1, 1);
210 
211  // bremsstrahlung
212  G4MuBremsstrahlung* muBrem = new G4MuBremsstrahlung();
213  XWrapperContinuousDiscreteProcess *muBrem_wrapper =
215  muBrem_wrapper->RegisterProcess(muBrem,-1);
216  pmanager->AddProcess(muBrem_wrapper,-1, 2, 2);
217 
218  // pair production
219  G4MuPairProduction* muPair = new G4MuPairProduction();
220  XWrapperContinuousDiscreteProcess* muPair_wrapper =
222  muPair_wrapper->RegisterProcess(muPair,-1);
223  pmanager->AddProcess(muPair_wrapper,-1, 3, 3);
224 
225  // coulomb scattering
227  ecs->SetBuildTableFlag(false);
228  G4eCoulombScatteringModel* ecsmodel =
230  ecsmodel->SetPolarAngleLimit(0.0);
231  ecs->AddEmModel(0, ecsmodel);
232  XWrapperDiscreteProcess *ecs_wrapper =
234  ecs_wrapper->RegisterProcess(ecs,0);
235  pmanager->AddDiscreteProcess(ecs_wrapper);
236 
237  } else if ((particleName == "alpha" || particleName == "He3") ) {
238  // ionisation
239  G4ionIonisation* ionIoni = new G4ionIonisation();
240  ionIoni->SetStepFunction(0.1, 10*um);
241  XWrapperContinuousDiscreteProcess *ionIoni_wrapper =
243  ionIoni_wrapper->RegisterProcess(ionIoni,-1);
244  pmanager->AddProcess(ionIoni_wrapper,-1, 1, 1);
245 
246  // coulomb scattering
248  ecs->SetBuildTableFlag(false);
249  XWrapperDiscreteProcess *ecs_wrapper =
251  ecs_wrapper->RegisterProcess(ecs,0);
252  pmanager->AddDiscreteProcess(ecs_wrapper);
253 
254  } else if (particleName == "GenericIon" ) {
255  // ionisation
256  G4ionIonisation* ionIoni = new G4ionIonisation();
257  ionIoni->SetStepFunction(0.1, 1*um);
258  XWrapperContinuousDiscreteProcess *ionIoni_wrapper =
260  ionIoni_wrapper->RegisterProcess(ionIoni,-1);
261  pmanager->AddProcess(ionIoni_wrapper,-1, 1, 1);
262 
263  // coulomb scattering
265  ecs->SetBuildTableFlag(false);
266  XWrapperDiscreteProcess *ecs_wrapper =
268  ecs_wrapper->RegisterProcess(ecs,0);
269  pmanager->AddDiscreteProcess(ecs_wrapper);
270 
271  } else if ((!particle->IsShortLived()) &&
272  (particle->GetPDGCharge() != 0.0) &&
273  (particle->GetParticleName() != "chargedgeantino") ) {
274  //all others charged particles except geantino
275 
276  // ionisation
277  G4hIonisation* hIoni = new G4hIonisation();
278  XWrapperContinuousDiscreteProcess *hIoni_wrapper =
280  hIoni_wrapper->RegisterProcess(hIoni,-1);
281  pmanager->AddProcess(hIoni_wrapper,-1, 1, 1);
282 
283  // coulomb scattering
285  ecs->SetBuildTableFlag(false);
286  XWrapperDiscreteProcess *ecs_wrapper =
288  ecs_wrapper->RegisterProcess(ecs,0);
289  pmanager->AddDiscreteProcess(ecs_wrapper);
290 
291  }
292  }
293 
294  // Em options
295  //
296  // Main options and setting parameters are shown here.
297  // Several of them have default values.
298  //
299  G4EmProcessOptions emOptions;
300 
301  //physics tables
302  //
303  emOptions.SetMinEnergy(10*eV);
304  emOptions.SetMaxEnergy(10*TeV);
305  emOptions.SetDEDXBinning(12*20);
306  emOptions.SetLambdaBinning(12*20);
307 
308  // scattering
309  emOptions.SetPolarAngleLimit(0.0);
310 
311  // Deexcitation
314  de->SetFluo(true);
315 }
316 
317 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
318 
ExExChPhysListEmStandardSS(const G4String &name="standardSS")
void RegisterProcess(G4VContinuousDiscreteProcess *)
static const double MeV
Definition: G4SIunits.hh:193
static G4LossTableManager * Instance()
void SetBuildTableFlag(G4bool val)
G4String name
Definition: TRTMaterials.hh:40
void SetMinEnergy(G4double val)
void SetStepFunction(G4double v1, G4double v2)
G4int AddDiscreteProcess(G4VProcess *aProcess, G4int ord=ordDefault)
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleName() const
void SetHighEnergyLimit(G4double)
Definition: G4VEmModel.hh:707
void SetDEDXBinning(G4int val)
void SetEmModel(G4VEmModel *, G4int index=1)
void SetLambdaBinning(G4int val)
#define aParticleIterator
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
static const double GeV
Definition: G4SIunits.hh:196
void AddEmModel(G4int, G4VEmModel *, G4VEmFluctuationModel *fluc=0, const G4Region *region=0)
void SetMaxEnergy(G4double val)
static const double eV
Definition: G4SIunits.hh:194
void AddEmModel(G4int, G4VEmModel *, const G4Region *region=0)
static const double TeV
Definition: G4SIunits.hh:197
void RegisterProcess(G4VDiscreteProcess *)
G4double GetPDGCharge() const
void SetAtomDeexcitation(G4VAtomDeexcitation *)
void SetPolarAngleLimit(G4double)
Definition: G4VEmModel.hh:742
void SetPolarAngleLimit(G4double val)