Belle II Software development
ExtPhysicsConstructor Class Reference

Define geant4e-specific physics. More...

#include <ExtPhysicsConstructor.h>

Inheritance diagram for ExtPhysicsConstructor:

Public Member Functions

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

Private Attributes

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

Detailed Description

Define geant4e-specific physics.

Definition at line 30 of file ExtPhysicsConstructor.h.

Constructor & Destructor Documentation

◆ ExtPhysicsConstructor()

The ExtPhysicsConstructor constructor.

Definition at line 31 of file ExtPhysicsConstructor.cc.

31 : G4VPhysicsConstructor("ExtPhysicsConstructor"),
33{
34}
ExtStepLengthLimitProcess * m_StepLengthLimitProcess
Process that limits the geant4e step length.
ExtMagFieldLimitProcess * m_MagFieldLimitProcess
Process that limits the geant4e step length in magnetic field.
ExtMessenger * m_Messenger
Pointer to the ExtMessenger that is used to control geant4e.
ExtEnergyLoss * m_ELossProcess
Process that limits the geant4e step length due to energy loss.

◆ ~ExtPhysicsConstructor()

~ExtPhysicsConstructor ( )
virtual

The ExtPhysicsConstructor destructor.

Definition at line 36 of file ExtPhysicsConstructor.cc.

Member Function Documentation

◆ ConstructParticle()

void ConstructParticle ( )

ConstructParticle() defines the geant4e-specific particles.

Definition at line 44 of file ExtPhysicsConstructor.cc.

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

◆ ConstructProcess()

void ConstructProcess ( )

ConstructProcess() defines the geant4e-specific processes.

Definition at line 192 of file ExtPhysicsConstructor.cc.

193{
194 // Define the limited set of processes that will be suffered by the
195 // geant4e-specific particles
196 m_StepLengthLimitProcess = new ExtStepLengthLimitProcess;
197 m_MagFieldLimitProcess = new ExtMagFieldLimitProcess;
198 m_ELossProcess = new ExtEnergyLoss;
200 G4ParticleTable* myParticleTable = G4ParticleTable::GetParticleTable();
201 // theParticleIterator is a Geant4 macro since version 10.
202 G4ParticleTable::G4PTblDicIterator* myParticleIterator = myParticleTable->GetIterator();
203 myParticleIterator->reset();
204 while ((*myParticleIterator)()) {
205 G4ParticleDefinition* particle = myParticleIterator->value();
206 G4ProcessManager* pmanager = particle->GetProcessManager();
207 G4String particleName = particle->GetParticleName();
208 if (particleName.compare(0, 4, "g4e_") == 0) {
209 if (particleName == "g4e_gamma") {
210 pmanager->AddDiscreteProcess(new G4GammaConversion());
211 pmanager->AddDiscreteProcess(new G4ComptonScattering());
212 pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
213 } else {
214 pmanager->AddContinuousProcess(m_ELossProcess, 1);
215 pmanager->AddDiscreteProcess(m_StepLengthLimitProcess, 2);
216 pmanager->AddDiscreteProcess(m_MagFieldLimitProcess, 3);
217 }
218 }
219 }
220}
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
private

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

Definition at line 55 of file ExtPhysicsConstructor.h.

◆ m_MagFieldLimitProcess

ExtMagFieldLimitProcess* m_MagFieldLimitProcess
private

Process that limits the geant4e step length in magnetic field.

Definition at line 52 of file ExtPhysicsConstructor.h.

◆ m_Messenger

ExtMessenger* m_Messenger
private

Pointer to the ExtMessenger that is used to control geant4e.

Definition at line 58 of file ExtPhysicsConstructor.h.

◆ m_StepLengthLimitProcess

ExtStepLengthLimitProcess* m_StepLengthLimitProcess
private

Process that limits the geant4e step length.

Definition at line 49 of file ExtPhysicsConstructor.h.


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