source: trunk/examples/novice/gemc/src/EMPhysics.cc@ 1214

Last change on this file since 1214 was 807, checked in by garnier, 17 years ago

update

File size: 5.5 KB
Line 
1// %%%%%%%%%%
2// G4 headers
3// %%%%%%%%%%
4#include "G4BaryonConstructor.hh"
5#include "G4LeptonConstructor.hh"
6#include "G4MesonConstructor.hh"
7#include "G4IonConstructor.hh"
8
9#include "G4PhotoElectricEffect.hh"
10#include "G4ComptonScattering.hh"
11#include "G4GammaConversion.hh"
12
13#include "G4MultipleScattering.hh"
14#include "G4eIonisation.hh"
15#include "G4eBremsstrahlung.hh"
16#include "G4eplusAnnihilation.hh"
17
18#include "G4MuIonisation.hh"
19#include "G4MuBremsstrahlung.hh"
20#include "G4MuPairProduction.hh"
21#include "G4MuonMinusCaptureAtRest.hh"
22
23#include "G4SynchrotronRadiation.hh"
24
25#include "G4hIonisation.hh"
26#include "G4ProcessManager.hh"
27#include "G4StepLimiter.hh"
28
29// %%%%%%%%%%%%
30// gemc headers
31// %%%%%%%%%%%%
32#include "EMPhysics.h"
33
34
35EMPhysics::EMPhysics(gemc_opts Opt) : G4VPhysicsConstructor("EM Physics")
36{
37 gemcOpt = Opt;
38}
39
40EMPhysics::~EMPhysics(){}
41
42void EMPhysics::ConstructParticle()
43{
44 G4Gamma::GammaDefinition();
45
46 // Construct all mesons
47 G4MesonConstructor pMesonConstructor;
48 pMesonConstructor.ConstructParticle();
49
50 // Construct all leptons
51 G4LeptonConstructor pLeptonConstructor;
52 pLeptonConstructor.ConstructParticle();
53
54 // Construct all baryons
55 G4BaryonConstructor pBaryonConstructor;
56 pBaryonConstructor.ConstructParticle();
57
58 // Construct light ions (d, t, 3He, alpha, and generic ion)
59 G4IonConstructor ionConstruct;
60 ionConstruct.ConstructParticle();
61}
62
63
64// see cosmicray_charging/src/LISAPhysicsList.cc for possible switch to low energy EM.
65
66void EMPhysics::ConstructProcess()
67{
68 string hd_msg = gemcOpt.args["LOG_MSG"].args + " EM / mu- Capture Physics List: <<< ";
69 double VERB = gemcOpt.args["PHY_VERBOSITY"].arg ;
70 cout << hd_msg << " Building ElectroMagnetic and Capture Processes " << endl;
71
72 theParticleIterator->reset();
73 while( (*theParticleIterator)() )
74 {
75 G4ParticleDefinition* particle = theParticleIterator->value();
76 G4ProcessManager* pmanager = particle->GetProcessManager();
77 string pname = particle->GetParticleName();
78
79 // Gamma Physics
80 if (pname == "gamma")
81 {
82 if(VERB > 2) cout << hd_msg << " Gamma: Photoelectric Effect" << endl;
83 pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
84 if(VERB > 2) cout << hd_msg << " Gamma: Compton Scattering" << endl;
85 pmanager->AddDiscreteProcess(new G4ComptonScattering);
86 if(VERB > 2) cout << hd_msg << " Gamma: Pair Production" << endl;
87 pmanager->AddDiscreteProcess(new G4GammaConversion);
88 }
89
90 // Electron Physics
91 else if (pname == "e-")
92 {
93 if(VERB > 2) cout << hd_msg << " Electron: Multiple Scattering" << endl;
94 pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1);
95 if(VERB > 2) cout << hd_msg << " Electron: Ionisation" << endl;
96 pmanager->AddProcess(new G4eIonisation, -1, 2, 2);
97 if(VERB > 2) cout << hd_msg << " Electron: Bremsstrahlung" << endl;
98 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3);
99// if(VERB > 2) cout << hd_msg << " Electron: synchrotron radiation" << endl;
100// pmanager->AddDiscreteProcess(new G4SynchrotronRadiation);
101
102 }
103 // Positron Physics
104 else if (pname == "e+")
105 {
106 if(VERB > 2) cout << hd_msg << " Positron: Multiple Scattering" << endl;
107 pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1);
108 if(VERB > 2) cout << hd_msg << " Positron: Ionisation" << endl;
109 pmanager->AddProcess(new G4eIonisation, -1, 2, 2);
110 if(VERB > 2) cout << hd_msg << " Positron: Bremsstrahlung" << endl;
111 pmanager->AddProcess(new G4eBremsstrahlung, -1, 3, 3);
112 if(VERB > 2) cout << hd_msg << " Positron: e+ Annihilation" << endl;
113 pmanager->AddProcess(new G4eplusAnnihilation, 0, -1, 4);
114// if(VERB > 2) cout << hd_msg << " Positron: synchrotron radiation" << endl;
115// pmanager->AddDiscreteProcess(new G4SynchrotronRadiation);
116
117 }
118 // Muons Physics
119 else if(pname == "mu+" || pname == "mu-")
120 {
121 if(VERB > 2) cout << hd_msg << " " << pname << ": Multiple Scattering" << endl;
122 pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1);
123 if(VERB > 2) cout << hd_msg << " " << pname << ": Ionisation" << endl;
124 pmanager->AddProcess(new G4MuIonisation, -1, 2, 2);
125 if(VERB > 2) cout << hd_msg << " " << pname << ": Bremsstrahlung" << endl;
126 pmanager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3);
127 if(VERB > 2) cout << hd_msg << " " << pname << ": Pair Production" << endl;
128 pmanager->AddProcess(new G4MuPairProduction, -1, 4, 4);
129 if(pname == "mu-")
130 {
131 if(VERB > 2) cout << hd_msg << " " << pname << ": Capture Process" << endl;
132 pmanager->AddProcess(new G4MuonMinusCaptureAtRest(),0,-1,-1);
133 }
134 }
135 // All other charged particles except geantino
136 else if ((!particle->IsShortLived()) && (particle->GetPDGCharge() != 0.0) && (pname != "chargedgeantino"))
137 {
138 if(VERB > 2) cout << hd_msg << " Adding Multiple Scattering for " << pname << endl;
139 pmanager->AddProcess(new G4MultipleScattering, -1, 1, 1);
140 if(VERB > 2) cout << hd_msg << " Adding Ionisation for " << pname << endl;
141 pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
142 }
143
144 // Adding Step Limiter
145// if ((!particle->IsShortLived()) && (pname != "chargedgeantino"))
146 if ((!particle->IsShortLived()) && (particle->GetPDGCharge() != 0.0) && (pname != "chargedgeantino"))
147 {
148 if(VERB > 2) cout << hd_msg << " Adding Step Limiter for " << pname << endl;
149 pmanager->AddProcess(new G4StepLimiter, -1,-1,3);
150 }
151
152
153 }
154
155}
156
157
158
Note: See TracBrowser for help on using the repository browser.