Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4EmBuilder.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//
27// Geant4 class G4EmBuilder
28//
29// Author V.Ivanchenko 22.05.2020
30//
31
32#include "G4EmBuilder.hh"
33
34#include "G4SystemOfUnits.hh"
36#include "G4PhysListUtil.hh"
37#include "G4EmParameters.hh"
39
44#include "G4WentzelVIModel.hh"
45
46#include "G4ProcessManager.hh"
49
54
55#include "G4MuIonisation.hh"
56#include "G4MuBremsstrahlung.hh"
57#include "G4MuPairProduction.hh"
58#include "G4hBremsstrahlung.hh"
59#include "G4hPairProduction.hh"
60
61#include "G4hIonisation.hh"
62#include "G4ionIonisation.hh"
63#include "G4NuclearStopping.hh"
64
68
69#include "G4ParticleTable.hh"
70#include "G4Gamma.hh"
71#include "G4Electron.hh"
72#include "G4Positron.hh"
73
74#include "G4ChargedGeantino.hh"
75#include "G4Geantino.hh"
76#include "G4NeutrinoMu.hh"
77#include "G4AntiNeutrinoMu.hh"
78#include "G4NeutrinoE.hh"
79#include "G4AntiNeutrinoE.hh"
80
81#include "G4MuonPlus.hh"
82#include "G4MuonMinus.hh"
83#include "G4PionPlus.hh"
84#include "G4PionMinus.hh"
85#include "G4PionZero.hh"
86#include "G4KaonPlus.hh"
87#include "G4KaonMinus.hh"
88#include "G4Proton.hh"
89#include "G4AntiProton.hh"
90#include "G4Lambda.hh"
91#include "G4AntiLambda.hh"
92
93#include "G4Deuteron.hh"
94#include "G4Triton.hh"
95#include "G4He3.hh"
96#include "G4Alpha.hh"
97#include "G4GenericIon.hh"
98
100#include "G4HadParticles.hh"
102#include "G4LossTableManager.hh"
104
106 const std::vector<G4int>& partList)
107{
110
111 for( auto & pdg : partList ) {
112 auto part = table->FindParticle( pdg );
113 if ( part == nullptr || part->GetPDGCharge() == 0.0 ) { continue; }
114 ph->RegisterProcess(hmsc, part);
115 ph->RegisterProcess(new G4hIonisation(), part);
116 }
117}
118
120 G4NuclearStopping* nucStopping)
121{
123
125 ph->RegisterProcess(hmsc, part);
126 ph->RegisterProcess(new G4hIonisation(), part);
127
128 part = G4Triton::Triton();
129 ph->RegisterProcess(hmsc, part);
130 ph->RegisterProcess(new G4hIonisation(), part);
131
132 part = G4Alpha::Alpha();
133 ph->RegisterProcess(new G4hMultipleScattering(), part);
134 ph->RegisterProcess(new G4ionIonisation(), part);
135 if( nucStopping != nullptr ) {
136 ph->RegisterProcess(nucStopping, part);
137 }
138
139 part = G4He3::He3();
140 ph->RegisterProcess(new G4hMultipleScattering(), part);
141 ph->RegisterProcess(new G4ionIonisation(), part);
142 if( nucStopping != nullptr ) {
143 ph->RegisterProcess(nucStopping, part);
144 }
145}
146
148{
150
152 ph->RegisterProcess(new G4hIonisation(), part);
153 ph->RegisterProcess(new G4CoulombScattering(), part);
154
155 part = G4Triton::Triton();
156 ph->RegisterProcess(new G4hIonisation(), part);
157 ph->RegisterProcess(new G4CoulombScattering(), part);
158
159 part = G4Alpha::Alpha();
160 ph->RegisterProcess(new G4ionIonisation(), part);
161 ph->RegisterProcess(new G4CoulombScattering(), part);
162
163 part = G4He3::He3();
164 ph->RegisterProcess(new G4ionIonisation(), part);
165 ph->RegisterProcess(new G4CoulombScattering(), part);
166}
167
170 G4bool isHEP, G4bool isProton,
171 G4bool isWVI)
172{
174
176 if(isWVI) { msc->SetEmModel(new G4WentzelVIModel()); }
177 G4CoulombScattering* ss = ( isWVI ) ? new G4CoulombScattering() : nullptr;
178
179 ph->RegisterProcess(msc, part1);
180 ph->RegisterProcess(new G4hIonisation(), part1);
181
182 G4hBremsstrahlung* brem = ( isHEP ) ? new G4hBremsstrahlung() : nullptr;
183 G4hPairProduction* pair = ( isHEP ) ? new G4hPairProduction() : nullptr;
184
185 if( isHEP ) {
186 ph->RegisterProcess(brem, part1);
187 ph->RegisterProcess(pair, part1);
188 }
189 if( isWVI ) { ph->RegisterProcess(ss, part1); }
190
191 if( isProton ) {
192 msc = new G4hMultipleScattering();
193 if(isWVI) {
194 msc->SetEmModel(new G4WentzelVIModel());
195 ss = new G4CoulombScattering();
196 }
197 }
198 ph->RegisterProcess(msc, part2);
199 ph->RegisterProcess(new G4hIonisation(), part2);
200 if( isHEP ) {
201 ph->RegisterProcess(brem, part2);
202 ph->RegisterProcess(pair, part2);
203 }
204 if( isWVI ) { ph->RegisterProcess(ss, part2); }
205}
206
209 G4bool isHEP)
210{
212
213 ph->RegisterProcess(new G4hIonisation(), part1);
214
215 G4hBremsstrahlung* brem = ( isHEP ) ? new G4hBremsstrahlung() : nullptr;
216 G4hPairProduction* pair = ( isHEP ) ? new G4hPairProduction() : nullptr;
217
218 if( isHEP ) {
219 ph->RegisterProcess(brem, part1);
220 ph->RegisterProcess(pair, part1);
221 }
222 ph->RegisterProcess(new G4CoulombScattering(), part1);
223
224 ph->RegisterProcess(new G4hIonisation(), part2);
225 if( isHEP ) {
226 ph->RegisterProcess(brem, part2);
227 ph->RegisterProcess(pair, part2);
228 }
229 ph->RegisterProcess(new G4CoulombScattering(), part2);
230}
231
233 G4NuclearStopping* nucStopping,
234 G4bool isWVI)
235{
239 G4bool isHEP = ( param->MaxKinEnergy() > hpar->EnergyThresholdForHeavyHadrons() );
240
241 // muon multiple and single scattering
243 if(isWVI) { mumsc->SetEmModel(new G4WentzelVIModel()); }
244 G4CoulombScattering* muss = ( isWVI ) ? new G4CoulombScattering() : nullptr;
245
246 // Add standard EM Processes
247 // mu+-
249 ph->RegisterProcess(mumsc, part);
250 ph->RegisterProcess(new G4MuIonisation(), part);
251
252 // muon bremsstrahlung and pair production
253 G4MuBremsstrahlung* mub = ( isHEP ) ? new G4MuBremsstrahlung() : nullptr;
254 G4MuPairProduction* mup = ( isHEP ) ? new G4MuPairProduction() : nullptr;
255
256 if( isHEP ) {
257 ph->RegisterProcess(mub, part);
258 ph->RegisterProcess(mup, part);
259 }
260 if( isWVI ) { ph->RegisterProcess(muss, part); }
261
262 part = G4MuonMinus::MuonMinus();
263 ph->RegisterProcess(mumsc, part);
264 ph->RegisterProcess(new G4MuIonisation(), part);
265 if( isHEP ) {
266 ph->RegisterProcess(mub, part);
267 ph->RegisterProcess(mup, part);
268 }
269 if( isWVI ) { ph->RegisterProcess(muss, part); }
270
271 // pi+-
273
274 // K+-
276
277 // p, pbar
279 if( nucStopping != nullptr ) {
280 ph->RegisterProcess(nucStopping, G4Proton::Proton());
281 }
282
283 // ions
284 ConstructIonEmPhysics(hmsc, nucStopping);
285
286 // hyperons and anti particles
287 if( isHEP ) {
289
290 // b- and c- charged particles
291 if( hpar->EnableBCParticles() ) {
293 }
294 // light hyper-nuclei
295 if( hpar->EnableHyperNuclei() ) {
297 }
298 }
299}
300
302{
306 G4bool isHEP = ( param->MaxKinEnergy() > hpar->EnergyThresholdForHeavyHadrons() );
307
308 // muon multiple and single scattering
310
311 // Add standard EM Processes
312 // mu+-
314 ph->RegisterProcess(new G4MuIonisation(), part);
315
316 // muon bremsstrahlung and pair production
317 G4MuBremsstrahlung* mub = ( isHEP ) ? new G4MuBremsstrahlung() : nullptr;
318 G4MuPairProduction* mup = ( isHEP ) ? new G4MuPairProduction() : nullptr;
319
320 if( isHEP ) {
321 ph->RegisterProcess(mub, part);
322 ph->RegisterProcess(mup, part);
323 }
324 ph->RegisterProcess(muss, part);
325
326 part = G4MuonMinus::MuonMinus();
327 ph->RegisterProcess(new G4MuIonisation(), part);
328 if( isHEP ) {
329 ph->RegisterProcess(mub, part);
330 ph->RegisterProcess(mup, part);
331 }
332 ph->RegisterProcess(muss, part);
333
334 // pi+-
336
337 // K+-
339
340 // p, pbar
342 // ions
344
345 // hyperons and anti particles
346 if( isHEP ) {
348
349 // b- and c- charged particles
350 if( hpar->EnableBCParticles() ) {
352 }
353 // light hyper-nuclei
354 if( hpar->EnableHyperNuclei() ) {
356 }
357 }
358}
359
361{
362 // instantiate singletones for physics
364 // pseudo-particles
371 // gamma
373 // leptons
378 // mesons
384 // barions
391 // ions
394 G4He3::He3();
397}
398
400{
403 if(nullptr == ad) {
404 ad = new G4UAtomicDeexcitation();
405 man->SetAtomDeexcitation(ad);
406 }
407}
408
410 G4ParticleDefinition* particle)
411{
414 G4ProcessManager* procManager = particle->GetProcessManager();
415 auto plist = procManager->GetProcessList();
416 G4int ptype = (0 < plist->size()) ? (*plist)[0]->GetProcessSubType() : 0;
417 if(type != G4TransportationWithMscType::fDisabled && ptype == TRANSPORTATION) {
418 // Remove default G4Transportation and replace with G4TransportationWithMsc.
419 procManager->RemoveProcess(0);
420 G4TransportationWithMsc* transportWithMsc = new G4TransportationWithMsc(
422 if(type == G4TransportationWithMscType::fMultipleSteps) {
423 transportWithMsc->SetMultipleSteps(true);
424 }
425 transportWithMsc->AddMscModel(msc1);
426 if(msc2 != nullptr) {
427 transportWithMsc->AddMscModel(msc2);
428 }
429 procManager->AddProcess(transportWithMsc, -1, 0, 0);
430 } else {
431 // Register as a separate process.
433 msc->SetEmModel(msc1);
434 if(msc2 != nullptr) {
435 msc->SetEmModel(msc2);
436 }
438 ph->RegisterProcess(msc, particle);
439 }
440}
G4TransportationWithMscType
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
static G4Alpha * Alpha()
Definition: G4Alpha.cc:88
static G4AntiLambda * AntiLambda()
static G4AntiNeutrinoE * AntiNeutrinoE()
static G4AntiNeutrinoMu * AntiNeutrinoMu()
static G4AntiNeutron * AntiNeutron()
static G4AntiProton * AntiProton()
Definition: G4AntiProton.cc:92
static G4ChargedGeantino * ChargedGeantinoDefinition()
static G4Deuteron * Deuteron()
Definition: G4Deuteron.cc:93
static G4Electron * Electron()
Definition: G4Electron.cc:93
static void ConstructCharged(G4hMultipleScattering *hmsc, G4NuclearStopping *nucStopping, G4bool isWVI=true)
Definition: G4EmBuilder.cc:232
static void ConstructChargedSS(G4hMultipleScattering *hmsc)
Definition: G4EmBuilder.cc:301
static void ConstructMinimalEmSet()
Definition: G4EmBuilder.cc:360
static void ConstructLightHadrons(G4ParticleDefinition *part1, G4ParticleDefinition *part2, G4bool isHEP, G4bool isProton, G4bool isWVI)
Definition: G4EmBuilder.cc:168
static void ConstructIonEmPhysics(G4hMultipleScattering *hmsc, G4NuclearStopping *nucStopping)
Definition: G4EmBuilder.cc:119
static void ConstructElectronMscProcess(G4VMscModel *msc1, G4VMscModel *msc2, G4ParticleDefinition *particle)
Definition: G4EmBuilder.cc:409
static void ConstructIonEmPhysicsSS()
Definition: G4EmBuilder.cc:147
static void PrepareEMPhysics()
Definition: G4EmBuilder.cc:399
static void ConstructLightHadronsSS(G4ParticleDefinition *part1, G4ParticleDefinition *part2, G4bool isHEP)
Definition: G4EmBuilder.cc:207
static void ConstructBasicEmPhysics(G4hMultipleScattering *hmsc, const std::vector< G4int > &listHadrons)
Definition: G4EmBuilder.cc:105
static G4EmParameters * Instance()
G4TransportationWithMscType TransportationWithMsc() const
G4double MaxKinEnergy() const
static G4Gamma * Gamma()
Definition: G4Gamma.cc:85
static G4Geantino * GeantinoDefinition()
Definition: G4Geantino.cc:81
static G4GenericIon * GenericIon()
Definition: G4GenericIon.cc:92
static const std::vector< G4int > & GetBCChargedHadrons()
static const std::vector< G4int > & GetHeavyChargedParticles()
static const std::vector< G4int > & GetChargedHyperNuclei()
static G4HadronicParameters * Instance()
G4bool EnableHyperNuclei() const
G4bool EnableBCParticles() const
G4double EnergyThresholdForHeavyHadrons() const
static G4He3 * He3()
Definition: G4He3.cc:93
static G4KaonMinus * KaonMinus()
Definition: G4KaonMinus.cc:112
static G4KaonPlus * KaonPlus()
Definition: G4KaonPlus.cc:112
static G4Lambda * Lambda()
Definition: G4Lambda.cc:107
void SetAtomDeexcitation(G4VAtomDeexcitation *)
static G4LossTableManager * Instance()
G4VAtomDeexcitation * AtomDeexcitation()
static G4MuonMinus * MuonMinus()
Definition: G4MuonMinus.cc:99
static G4MuonPlus * MuonPlus()
Definition: G4MuonPlus.cc:98
static G4NeutrinoE * NeutrinoE()
Definition: G4NeutrinoE.cc:84
static G4NeutrinoMu * NeutrinoMu()
Definition: G4NeutrinoMu.cc:84
static G4Neutron * Neutron()
Definition: G4Neutron.cc:103
G4ProcessManager * GetProcessManager() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
static void InitialiseParameters()
G4bool RegisterProcess(G4VProcess *process, G4ParticleDefinition *particle)
static G4PhysicsListHelper * GetPhysicsListHelper()
static G4PionMinus * PionMinus()
Definition: G4PionMinus.cc:97
static G4PionPlus * PionPlus()
Definition: G4PionPlus.cc:97
static G4PionZero * PionZero()
Definition: G4PionZero.cc:107
static G4Positron * Positron()
Definition: G4Positron.cc:93
G4ProcessVector * GetProcessList() const
G4VProcess * RemoveProcess(G4VProcess *aProcess)
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
static G4Proton * Proton()
Definition: G4Proton.cc:92
void AddMscModel(G4VMscModel *mscModel, G4int order=0, const G4Region *region=nullptr)
static G4Triton * Triton()
Definition: G4Triton.cc:93
void SetEmModel(G4VMscModel *, G4int idx=0)