Belle II Software development
Geant4ePhysics Class Reference

Define geant4e-specific physics. More...

#include <Geant4ePhysics.h>

Inheritance diagram for Geant4ePhysics:

Public Member Functions

 Geant4ePhysics ()
 The Geant4ePhysics constructor.
 
virtual ~Geant4ePhysics ()
 The Geant4ePhysics destructor.
 
virtual void ConstructParticle () override
 ConstructParticle() defines the geant4e-specific particles.
 
virtual void ConstructProcess () override
 ConstructProcess() defines the geant4e-specific processes.
 

Private Attributes

ExtStepLengthLimitProcessm_StepLengthLimitProcess = nullptr
 Process that limits the geant4e step length.
 
ExtMagFieldLimitProcessm_MagFieldLimitProcess = nullptr
 Process that limits the geant4e step length in magnetic field.
 
ExtEnergyLossm_ELossProcess = nullptr
 Process that limits the geant4e step length due to energy loss.
 
ExtMessengerm_Messenger = nullptr
 Pointer to the ExtMessenger that is used to control geant4e.
 

Detailed Description

Define geant4e-specific physics.

Definition at line 30 of file Geant4ePhysics.h.

Constructor & Destructor Documentation

◆ Geant4ePhysics()

The Geant4ePhysics constructor.

Definition at line 29 of file Geant4ePhysics.cc.

30{
31}

◆ ~Geant4ePhysics()

~Geant4ePhysics ( )
virtual

The Geant4ePhysics destructor.

Definition at line 33 of file Geant4ePhysics.cc.

34{
35 if (m_StepLengthLimitProcess) delete m_StepLengthLimitProcess;
36 if (m_MagFieldLimitProcess) delete m_MagFieldLimitProcess;
37 if (m_ELossProcess) delete m_ELossProcess;
38 if (m_Messenger) delete m_Messenger;
39}

Member Function Documentation

◆ ConstructParticle()

void ConstructParticle ( )
overridevirtual

ConstructParticle() defines the geant4e-specific particles.

Definition at line 42 of file Geant4ePhysics.cc.

43{
44 /*
45 // Create ext-specific copies of useful particles, in case we are
46 // running the geant4e extrapolator. These particles will have a
47 // limited process list and can coexist with geant4 particles: they
48 // are distinguished by their name having the prefix "g4e_" and their
49 // "PDG code" always being the reserved value of 0 (which means that
50 // the user must use FindParticle(name) rather than FindParticle(#)
51 // to look up these special particles.
52 // Arguments for G4ParticleDefinition() are as follows:
53 // name mass width charge
54 // 2*spin parity C-conjugation
55 // 2*Isospin 2*Isospin3 G-parity
56 // type lepton number baryon number PDG encoding
57 // stable lifetime decay table
58 // shortlived subType anti_encoding
59 // Values copied verbatim from geant4, except our particles don't decay
60 // and the names/PDGcodes are unique.
61
62 static G4ParticleDefinition* g4eParticle = NULL;
63
64 if (g4eParticle == NULL) {
65 // Bohr Magneton for positron and positive muon
66 G4double muBpositron = 0.5 * CLHEP::eplus * CLHEP::hbar_Planck / (0.51099906 * CLHEP::MeV / CLHEP::c_squared);
67 G4double muBmuon = 0.5 * CLHEP::eplus * CLHEP::hbar_Planck / (0.1056584 * CLHEP::GeV / CLHEP::c_squared);
68 G4double muNucleon = CLHEP::eplus * CLHEP::hbar_Planck / 2. / (CLHEP::proton_mass_c2 / CLHEP::c_squared);
69 // Copied from G4Gamma.cc
70 g4eParticle = new G4ParticleDefinition(
71 "g4e_gamma", 0.0 * CLHEP::MeV, 0.0 * CLHEP::MeV, 0.0,
72 2, -1, -1,
73 0, 0, 0,
74 "gamma", 0, 0, g4ePDGcode,
75 true, 0.0, NULL,
76 false, "photon", g4ePDGcode
77 );
78 // Copied from G4Electron.cc
79 new G4ParticleDefinition(
80 "g4e_e-", 0.51099906 * CLHEP::MeV, 0.0 * CLHEP::MeV, -1.0 * CLHEP::eplus,
81 1, 0, 0,
82 0, 0, 0,
83 "lepton", 1, 0, g4ePDGcode,
84 true, -1.0, NULL,
85 false, "e", g4ePDGcode, -1.0011596521859 * muBpositron
86 );
87 // Copied from G4Positron.cc
88 new G4ParticleDefinition(
89 "g4e_e+", 0.51099906 * CLHEP::MeV, 0.0 * CLHEP::MeV, +1.0 * CLHEP::eplus,
90 1, 0, 0,
91 0, 0, 0,
92 "lepton", -1, 0, g4ePDGcode,
93 true, -1.0, NULL,
94 false, "e", g4ePDGcode, 1.0011596521859 * muBpositron
95 );
96 // Copied from G4MuonPlus.cc
97 new G4ParticleDefinition(
98 "g4e_mu+", 0.1056584 * CLHEP::GeV, 2.99591e-16 * CLHEP::MeV, +1.0 * CLHEP::eplus,
99 1, 0, 0,
100 0, 0, 0,
101 "lepton", -1, 0, g4ePDGcode,
102 true, -1.0, NULL,
103 false, "mu", g4ePDGcode, 1.0011659208 * muBmuon
104 );
105 // Copied from G4MuonMinus.cc
106 new G4ParticleDefinition(
107 "g4e_mu-", 0.1056584 * CLHEP::GeV, 2.99591e-16 * CLHEP::MeV, -1.0 * CLHEP::eplus,
108 1, 0, 0,
109 0, 0, 0,
110 "lepton", 1, 0, g4ePDGcode,
111 true, -1.0, NULL,
112 false, "mu", g4ePDGcode, -1.0011659208 * muBmuon
113 );
114 // Copied from G4PionPlus.cc
115 new G4ParticleDefinition(
116 "g4e_pi+", 0.1395700 * CLHEP::GeV, 2.5284e-14 * CLHEP::MeV, +1.0 * CLHEP::eplus,
117 0, -1, 0,
118 2, +2, -1,
119 "meson", 0, 0, g4ePDGcode,
120 true, -1.0, NULL,
121 false, "pi", g4ePDGcode
122 );
123 // Copied from G4PionMinus.cc
124 new G4ParticleDefinition(
125 "g4e_pi-", 0.1395700 * CLHEP::GeV, 2.5284e-14 * CLHEP::MeV, -1.0 * CLHEP::eplus,
126 0, -1, 0,
127 2, -2, -1,
128 "meson", 0, 0, g4ePDGcode,
129 true, -1.0, NULL,
130 false, "pi", g4ePDGcode
131 );
132 // Copied from G4KaonPlus.cc
133 new G4ParticleDefinition(
134 "g4e_kaon+", 0.493677 * CLHEP::GeV, 5.315e-14 * CLHEP::MeV, +1.0 * CLHEP::eplus,
135 0, -1, 0,
136 1, +1, 0,
137 "meson", 0, 0, g4ePDGcode,
138 true, -1.0, NULL,
139 false, "kaon", g4ePDGcode
140 );
141 // Copied from G4KaonMinus.cc
142 new G4ParticleDefinition(
143 "g4e_kaon-", 0.493677 * CLHEP::GeV, 5.315e-14 * CLHEP::MeV, -1.0 * CLHEP::eplus,
144 0, -1, 0,
145 1, -1, 0,
146 "meson", 0, 0, g4ePDGcode,
147 true, -1.0, NULL,
148 false, "kaon", g4ePDGcode
149 );
150 // Copied from G4Proton.cc except use G4ParticleDefinition instead of G4Ions
151 new G4ParticleDefinition(
152 "g4e_proton", 0.9382723 * CLHEP::GeV, 0.0 * CLHEP::MeV, +1.0 * CLHEP::eplus,
153 1, +1, 0,
154 1, +1, 0,
155 "baryon", 0, +1, g4ePDGcode,
156 true, -1.0, NULL,
157 false, "nucleon", g4ePDGcode, 2.792847351 * muNucleon
158 );
159 // Copied from G4AntiProton.cc except use G4ParticleDefinition instead of G4Ions
160 new G4ParticleDefinition(
161 "g4e_anti_proton", 0.9382723 * CLHEP::GeV, 0.0 * CLHEP::MeV, -1.0 * CLHEP::eplus,
162 1, +1, 0,
163 1, -1, 0,
164 "baryon", 0, -1, g4ePDGcode,
165 true, -1.0, NULL,
166 false, "nucleon", g4ePDGcode, -2.792847351 * muNucleon
167 );
168 // copied from G4Deuteron.hh except use G4ParticleDefinition instead of G4Ions
169 new G4ParticleDefinition(
170 "g4e_deuteron", 1.875613 * CLHEP::GeV, 0.0 * CLHEP::MeV, +1.0 * CLHEP::eplus,
171 2, +1, 0,
172 0, 0, 0,
173 "nucleus", 0, +2, g4ePDGcode,
174 true, -1.0, NULL,
175 false, "static", g4ePDGcode, 0.857438230 * muNucleon
176
177 );
178 // copied from G4AntiDeuteron.hh except use G4ParticleDefinition instead of G4Ions
179 new G4ParticleDefinition(
180 "g4e_anti_deuteron", 1.875613 * CLHEP::GeV, 0.0 * CLHEP::MeV, -1.0 * CLHEP::eplus,
181 2, +1, 0,
182 0, 0, 0,
183 "anti_nucleus", 0, -2, g4ePDGcode,
184 true, -1.0, NULL,
185 false, "static", g4ePDGcode, -0.857438230 * muNucleon
186 );
187
188 }
189 */
190}

◆ ConstructProcess()

void ConstructProcess ( )
overridevirtual

ConstructProcess() defines the geant4e-specific processes.

Definition at line 193 of file Geant4ePhysics.cc.

194{
195 // Define the limited set of processes that will be suffered by the
196 // geant4e-specific particles
197 m_StepLengthLimitProcess = new ExtStepLengthLimitProcess;
198 m_MagFieldLimitProcess = new ExtMagFieldLimitProcess;
199 m_ELossProcess = new ExtEnergyLoss;
200 m_Messenger = new ExtMessenger(m_StepLengthLimitProcess, m_MagFieldLimitProcess, m_ELossProcess);
201 G4ParticleTable* myParticleTable = G4ParticleTable::GetParticleTable();
202 // theParticleIterator is a Geant4 macro since version 10.
203 G4ParticleTable::G4PTblDicIterator* myParticleIterator = myParticleTable->GetIterator();
204 myParticleIterator->reset();
205 while ((*myParticleIterator)()) {
206 G4ParticleDefinition* particle = myParticleIterator->value();
207 G4ProcessManager* pmanager = particle->GetProcessManager();
208 G4String particleName = particle->GetParticleName();
209 if (particleName.compare(0, 4, "g4e_") == 0) {
210 if (particleName == "g4e_gamma") {
211 pmanager->AddDiscreteProcess(new G4GammaConversion());
212 pmanager->AddDiscreteProcess(new G4ComptonScattering());
213 pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
214 } else {
215 pmanager->AddContinuousProcess(m_ELossProcess, 1);
216 pmanager->AddDiscreteProcess(m_StepLengthLimitProcess, 2);
217 pmanager->AddDiscreteProcess(m_MagFieldLimitProcess, 3);
218 }
219 }
220 }
221}
std::string particleName(int pdgCode)
Returns the name of a particle with given pdg code.
Definition EvtPDLUtil.cc:20

Member Data Documentation

◆ m_ELossProcess

ExtEnergyLoss* m_ELossProcess = nullptr
private

Process that limits the geant4e step length due to energy loss.

Definition at line 55 of file Geant4ePhysics.h.

◆ m_MagFieldLimitProcess

ExtMagFieldLimitProcess* m_MagFieldLimitProcess = nullptr
private

Process that limits the geant4e step length in magnetic field.

Definition at line 52 of file Geant4ePhysics.h.

◆ m_Messenger

ExtMessenger* m_Messenger = nullptr
private

Pointer to the ExtMessenger that is used to control geant4e.

Definition at line 58 of file Geant4ePhysics.h.

◆ m_StepLengthLimitProcess

ExtStepLengthLimitProcess* m_StepLengthLimitProcess = nullptr
private

Process that limits the geant4e step length.

Definition at line 49 of file Geant4ePhysics.h.


The documentation for this class was generated from the following files: