Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4UserParticlesPhysics.cxx
Go to the documentation of this file.
1//------------------------------------------------
2// The Geant4 Virtual Monte Carlo package
3// Copyright (C) 2007 - 2014 Ivana Hrivnacova
4// All rights reserved.
5//
6// For the licensing terms see geant4_vmc/LICENSE.
7// Contact: root-vmc@cern.ch
8//-------------------------------------------------
9
14
16#include "TG4Globals.h"
17#include "TG4ParticlesManager.h"
18#include "TG4StateManager.h"
19#include "TG4UserParticle.h"
20#include "TGeant4.h"
21
22#include <G4ProcessManager.hh>
23
24#include "G4ComptonScattering.hh"
25#include "G4GammaConversion.hh"
26#include "G4PhotoElectricEffect.hh"
27
28#include "G4eBremsstrahlung.hh"
29#include "G4eIonisation.hh"
30#include "G4eMultipleScattering.hh"
31#include "G4eplusAnnihilation.hh"
32
33#include "G4MuBremsstrahlung.hh"
34#include "G4MuIonisation.hh"
35#include "G4MuPairProduction.hh"
36
37#include "G4hIonisation.hh"
38#include "G4hMultipleScattering.hh"
39#include <G4ionIonisation.hh>
40
41#include <G4OpAbsorption.hh>
42#include <G4OpBoundaryProcess.hh>
43#include <G4OpRayleigh.hh>
44
45#include <TVirtualMCApplication.h>
46
47//_____________________________________________________________________________
53
54//_____________________________________________________________________________
56 G4int theVerboseLevel, const G4String& name)
57 : TG4VPhysicsConstructor(name, theVerboseLevel)
58{
60}
61
62//_____________________________________________________________________________
67
68//
69// protected methods
70//
71
72//_____________________________________________________________________________
74{
76
78 TVirtualMCApplication::Instance()->AddParticles();
80}
81
82//_____________________________________________________________________________
84{
87
89
90 for (G4int i = 0; i < particlesManager->GetNofUserParticles(); ++i) {
91
92 TG4UserParticle* userParticle = particlesManager->GetUserParticle(i);
93 G4ProcessManager* processManager = userParticle->GetProcessManager();
94
95 switch (userParticle->GetMCType()) {
96
97 case kPTGamma:
98 // From G4EmStandardPhysics
99 processManager->AddDiscreteProcess(new G4PhotoElectricEffect);
100 processManager->AddDiscreteProcess(new G4ComptonScattering);
101 processManager->AddDiscreteProcess(new G4GammaConversion);
102 break;
103
104 case kPTElectron:
105 // From G4EmStandardPhysics
106 processManager->AddProcess(new G4eMultipleScattering, -1, 1, 1);
107 processManager->AddProcess(new G4eIonisation, -1, 2, 2);
108 processManager->AddProcess(new G4eBremsstrahlung(), -1, 3, 3);
109 break;
110
111 case kPTNeutron:
112 TG4Globals::Warning("TG4UserParticlesPhysics", "ConstructProcess",
113 "No hadronic processes are built for user defined particles.");
114 break;
115
116 case kPTHadron:
117 // From G4EmStandardPhysics
118 processManager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
119 processManager->AddProcess(new G4hIonisation, -1, 2, 2);
120 TG4Globals::Warning("TG4UserParticlesPhysics", "ConstructProcess",
121 "No hadronic processes are built for user defined particles.");
122 break;
123
124 case kPTMuon:
125 // From G4EmStandardPhysics
126 processManager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
127 processManager->AddProcess(new G4MuIonisation, -1, 2, 2);
128 processManager->AddProcess(new G4MuBremsstrahlung, -1, 3, 3);
129 processManager->AddProcess(new G4MuPairProduction, -1, 4, 4);
130 break;
131
132 case kPTGeantino:
133 break;
134
135 case kPTChargedGeantino:
136 break;
137
138 case kPTOpticalPhoton:
139 // From TG4OpticalPhysics
140 processManager->AddDiscreteProcess(new G4OpAbsorption());
141 processManager->AddDiscreteProcess(new G4OpRayleigh());
142 processManager->AddDiscreteProcess(new G4OpBoundaryProcess());
143 break;
144
145 case kPTIon:
146 // From G4EmStandardPhysics
147 processManager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
148 processManager->AddProcess(new G4ionIonisation, -1, 2, 2);
149 TG4Globals::Warning("TG4UserParticlesPhysics", "ConstructProcess",
150 "No hadronic processes are built for user defined particles.");
151 break;
152
153 case kPTUndefined:
154 break;
155 }
156 }
157
158 if (VerboseLevel() > 0)
159 G4cout << "### User particles physics constructed. " << G4endl;
160}
Definition of the TG4Globals class and basic container types.
Definition of the TG4ParticlesManager class.
Definition of the TG4StateManager class.
Definition of the TG4UserParticle class.
Definition of the TG4UserParticlesPhysics class.
Definition of the TGeant4 class.
static void Warning(const TString &className, const TString &methodName, const TString &text)
Provides mapping between TDatabasePDG and Geant4 particles.
TG4UserParticle * GetUserParticle(G4int index) const
static TG4ParticlesManager * Instance()
void SetNewState(TG4ApplicationState state)
static TG4StateManager * Instance()
The class for user particle definition.
TMCParticleType GetMCType() const
Return the particle MC type.
TG4UserParticlesPhysics(const G4String &name="UserParticles")
virtual void ConstructProcess()
Construct physics processes.
virtual void ConstructParticle()
Construct particles.
Abstract base class for physics constructors with verbose.
virtual G4int VerboseLevel() const
@ kAddParticles
in AddParticles
@ kPreInit
in PreInit