GEMC  1.8
Geant4 Monte-Carlo Framework
EMPhysics.cc
Go to the documentation of this file.
1 // %%%%%%%%%%
2 // G4 headers
3 // %%%%%%%%%%
4 
5 #include "G4PhysicsListHelper.hh"
6 
7 #include "G4BaryonConstructor.hh"
8 #include "G4LeptonConstructor.hh"
9 #include "G4MesonConstructor.hh"
10 #include "G4IonConstructor.hh"
11 
12 
13 
14 // gamma
15 #include "G4PhotoElectricEffect.hh"
16 #include "G4LivermorePhotoElectricModel.hh"
17 #include "G4ComptonScattering.hh"
18 #include "G4LivermoreComptonModel.hh"
19 #include "G4GammaConversion.hh"
20 #include "G4LivermoreGammaConversionModel.hh"
21 #include "G4RayleighScattering.hh"
22 #include "G4LivermoreRayleighModel.hh"
23 
24 // e-, e+
25 #include "G4eMultipleScattering.hh"
26 #include "G4UniversalFluctuation.hh"
27 #include "G4eIonisation.hh"
28 #include "G4LivermoreIonisationModel.hh"
29 #include "G4eBremsstrahlung.hh"
30 #include "G4LivermoreBremsstrahlungModel.hh"
31 #include "G4eplusAnnihilation.hh"
32 
33 // mu
34 #include "G4MuMultipleScattering.hh"
35 #include "G4MuIonisation.hh"
36 #include "G4MuBremsstrahlung.hh"
37 #include "G4MuPairProduction.hh"
38 #include "G4MuonMinusCaptureAtRest.hh"
39 
40 // hadrons
41 #include "G4hMultipleScattering.hh"
42 #include "G4hIonisation.hh"
43 #include "G4hBremsstrahlung.hh"
44 #include "G4hPairProduction.hh"
45 
46 
47 // other
48 #include "G4ionIonisation.hh"
49 #include "G4SynchrotronRadiation.hh"
50 #include "G4ProcessManager.hh"
51 #include "G4StepLimiter.hh"
52 
53 // %%%%%%%%%%%%
54 // gemc headers
55 // %%%%%%%%%%%%
56 #include "EMPhysics.h"
57 
58 
60 {
61  gemcOpt = Opt;
62 }
63 
65 
67 {
68  G4Gamma::GammaDefinition();
69 
70  // Construct all mesons
71  G4MesonConstructor pMesonConstructor;
72  pMesonConstructor.ConstructParticle();
73 
74  // Construct all leptons
75  G4LeptonConstructor pLeptonConstructor;
76  pLeptonConstructor.ConstructParticle();
77 
78  // Construct all baryons
79  G4BaryonConstructor pBaryonConstructor;
80  pBaryonConstructor.ConstructParticle();
81 
82  // Construct light ions (d, t, 3He, alpha, and generic ion)
83  G4IonConstructor ionConstruct;
84  ionConstruct.ConstructParticle();
85 }
86 
87 
88 // see cosmicray_charging/src/LISAPhysicsList.cc for possible switch to low energy EM.
89 
91 {
92  string hd_msg = gemcOpt.args["LOG_MSG"].args + " EM / mu- Capture Physics List: <<< ";
93  double LOW_EM_PHYS = gemcOpt.args["LOW_EM_PHYS"].arg ;
94  double VERB = gemcOpt.args["PHY_VERBOSITY"].arg ;
95  cout << hd_msg << " Building ElectroMagnetic and Capture Processes " << endl;
96 
97 
98  G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
99  theParticleIterator->reset();
100 
101  while( (*theParticleIterator)() )
102  {
103  G4ParticleDefinition* particle = theParticleIterator->value();
104  G4ProcessManager* pmanager = particle->GetProcessManager();
105  string pname = particle->GetParticleName();
106 
107  // Gammas
108  if (pname == "gamma")
109  {
110  if(LOW_EM_PHYS>0)
111  {
112  G4PhotoElectricEffect* thePhotoElectricEffect = new G4PhotoElectricEffect();
113  thePhotoElectricEffect->SetModel(new G4LivermorePhotoElectricModel());
114  ph->RegisterProcess(thePhotoElectricEffect, particle);
115 
116  G4ComptonScattering* theComptonScattering = new G4ComptonScattering();
117  theComptonScattering->SetModel(new G4LivermoreComptonModel());
118  ph->RegisterProcess(theComptonScattering, particle);
119 
120  G4GammaConversion* theGammaConversion = new G4GammaConversion();
121  theGammaConversion->SetModel(new G4LivermoreGammaConversionModel());
122  ph->RegisterProcess(theGammaConversion, particle);
123 
124  G4RayleighScattering* theRayleigh = new G4RayleighScattering();
125  theRayleigh->SetModel(new G4LivermoreRayleighModel());
126  ph->RegisterProcess(theRayleigh, particle);
127  }
128  else
129  {
130  ph->RegisterProcess(new G4PhotoElectricEffect, particle);
131  ph->RegisterProcess(new G4ComptonScattering, particle);
132  ph->RegisterProcess(new G4GammaConversion, particle);
133  ph->RegisterProcess(new G4RayleighScattering, particle);
134  }
135 
136  if(VERB>2)
137  cout << hd_msg << " Gamma: Photoelectric Effect, Compton Scattering, Gamma Conversion, Rayleigh Scattering" << endl;
138 
139  }
140 
141  // Electrons
142  else if (pname == "e-")
143  {
144 
145  if(LOW_EM_PHYS>0)
146  {
147  // Multiple Scattering
148  G4eMultipleScattering* msc = new G4eMultipleScattering();
149  ph->RegisterProcess(msc, particle);
150 
151  // Ionisation
152  G4eIonisation* eIoni = new G4eIonisation();
153  eIoni->SetEmModel(new G4LivermoreIonisationModel());
154  eIoni->SetFluctModel(new G4UniversalFluctuation() );
155  ph->RegisterProcess(eIoni, particle);
156 
157  // Bremsstrahlung
158  G4eBremsstrahlung* eBrem = new G4eBremsstrahlung();
159  eBrem->SetEmModel(new G4LivermoreBremsstrahlungModel());
160  ph->RegisterProcess(eBrem, particle);
161  }
162  else
163  {
164  ph->RegisterProcess(new G4eMultipleScattering, particle);
165  ph->RegisterProcess(new G4eIonisation, particle);
166  ph->RegisterProcess(new G4eBremsstrahlung, particle);
167 
168  }
169  cout << hd_msg << " electrons: Multiple Scattering, Ionisation, Bremsstrahlung" << endl;
170  }
171 
172  // Positrons
173  else if (pname == "e+")
174  {
175 
176  ph->RegisterProcess(new G4eMultipleScattering, particle);
177  ph->RegisterProcess(new G4eIonisation, particle);
178  ph->RegisterProcess(new G4eBremsstrahlung, particle);
179  ph->RegisterProcess(new G4eplusAnnihilation, particle);
180 
181  cout << hd_msg << " positrons: Multiple Scattering, Ionisation, Bremsstrahlung, Annihilation" << endl;
182  }
183 
184  // Muonss
185  else if(pname == "mu+" || pname == "mu-")
186  {
187 
188  ph->RegisterProcess(new G4MuMultipleScattering, particle);
189  ph->RegisterProcess(new G4MuIonisation, particle);
190  ph->RegisterProcess(new G4MuBremsstrahlung, particle);
191  ph->RegisterProcess(new G4MuPairProduction, particle);
192 
193  cout << hd_msg << " muons: Multiple Scattering, Ionisation, Bremsstrahlung, Pair Production" << endl;
194  }
195 
196  // proton, pions
197  else if( pname == "proton" ||
198  pname == "pi-" ||
199  pname == "pi+" )
200  {
201  ph->RegisterProcess(new G4hMultipleScattering, particle);
202  ph->RegisterProcess(new G4hIonisation, particle);
203  ph->RegisterProcess(new G4hBremsstrahlung, particle);
204  ph->RegisterProcess(new G4hPairProduction, particle);
205 
206  }
207 
208  // alpha, helium3
209  else if( pname == "alpha" ||
210  pname == "He3" )
211  {
212  ph->RegisterProcess(new G4hMultipleScattering, particle);
213  ph->RegisterProcess(new G4ionIonisation, particle);
214 
215  }
216 
217  // ions
218  else if( pname == "GenericIon" )
219  {
220  ph->RegisterProcess(new G4hMultipleScattering, particle);
221  ph->RegisterProcess(new G4ionIonisation, particle);
222 
223  }
224 
225  // everything else
226  else if ((!particle->IsShortLived()) &&
227  (particle->GetPDGCharge() != 0.0) &&
228  (particle->GetParticleName() != "chargedgeantino"))
229  {
230  ph->RegisterProcess(new G4hMultipleScattering, particle);
231  ph->RegisterProcess(new G4hIonisation, particle);
232  }
233 
234 
235  // Adding Step Limiter
236  if ((!particle->IsShortLived()) && (particle->GetPDGCharge() != 0.0) && (pname != "chargedgeantino"))
237  {
238  if(VERB > 2) cout << hd_msg << " Adding Step Limiter for " << pname << endl;
239  pmanager->AddProcess(new G4StepLimiter, -1,-1,3);
240  }
241 
242 
243  }
244 
245 }
246 
247 
248 
virtual ~EMPhysics()
Definition: EMPhysics.cc:64
gemc_opts gemcOpt
Definition: EMPhysics.h:16
virtual void ConstructProcess()
Definition: EMPhysics.cc:90
virtual void ConstructParticle()
Definition: EMPhysics.cc:66
EMPhysics(gemc_opts)
Definition: EMPhysics.cc:59
map< string, opts > args
Options map.
Definition: usage.h:68