#include <G4ParticleGun.hh>
Definition at line 64 of file G4ParticleGun.hh.
◆ G4ParticleGun() [1/4]
G4ParticleGun::G4ParticleGun |
( |
| ) |
|
◆ G4ParticleGun() [2/4]
G4ParticleGun::G4ParticleGun |
( |
G4int | numberofparticles | ) |
|
|
explicit |
Definition at line 43 of file G4ParticleGun.cc.
44{
47}
G4int NumberOfParticlesToBeGenerated
◆ G4ParticleGun() [3/4]
Definition at line 49 of file G4ParticleGun.cc.
51{
55}
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)
◆ ~G4ParticleGun()
G4ParticleGun::~G4ParticleGun |
( |
| ) |
|
|
override |
◆ G4ParticleGun() [4/4]
◆ GeneratePrimaryVertex()
void G4ParticleGun::GeneratePrimaryVertex |
( |
G4Event * | evt | ) |
|
|
overridevirtual |
Implements G4VPrimaryGenerator.
Definition at line 203 of file G4ParticleGun.cc.
204{
206 {
208 ED <<
"Particle definition is not defined." <<
G4endl;
209 ED << "G4ParticleGun::SetParticleDefinition() has to be invoked beforehand."
211 G4Exception(
"G4ParticleGun::GeneratePrimaryVertex()",
"Event0109",
213 return;
214 }
215
216
217
218 auto* vertex =
220
221
222
225 {
226 auto* particle =
229 particle->SetMass( mass );
236 vertex->SetPrimary( particle );
237 }
239}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
void AddPrimaryVertex(G4PrimaryVertex *aPrimaryVertex)
G4double GetPDGMass() const
G4ThreeVector particle_polarization
G4ParticleMomentum particle_momentum_direction
G4ParticleDefinition * particle_definition
G4ThreeVector particle_position
◆ GetNumberOfParticles()
G4int G4ParticleGun::GetNumberOfParticles |
( |
| ) |
const |
|
inline |
◆ GetParticleCharge()
G4double G4ParticleGun::GetParticleCharge |
( |
| ) |
const |
|
inline |
◆ GetParticleDefinition()
◆ GetParticleEnergy()
G4double G4ParticleGun::GetParticleEnergy |
( |
| ) |
const |
|
inline |
◆ GetParticleMomentum()
G4double G4ParticleGun::GetParticleMomentum |
( |
| ) |
const |
|
inline |
◆ GetParticleMomentumDirection()
◆ GetParticlePolarization()
◆ GetParticleWeight()
G4double G4ParticleGun::GetParticleWeight |
( |
| ) |
const |
|
inline |
◆ operator!=()
◆ operator=()
◆ operator==()
◆ SetInitialValues()
void G4ParticleGun::SetInitialValues |
( |
| ) |
|
|
protectedvirtual |
◆ SetNumberOfParticles()
void G4ParticleGun::SetNumberOfParticles |
( |
G4int | i | ) |
|
|
inline |
◆ SetParticleCharge()
void G4ParticleGun::SetParticleCharge |
( |
G4double | aCharge | ) |
|
|
inline |
◆ SetParticleDefinition()
◆ SetParticleEnergy()
void G4ParticleGun::SetParticleEnergy |
( |
G4double | aKineticEnergy | ) |
|
◆ SetParticleMomentum() [1/2]
void G4ParticleGun::SetParticleMomentum |
( |
G4double | aMomentum | ) |
|
Definition at line 131 of file G4ParticleGun.cc.
132{
134 {
136 {
139 }
140 else
141 {
143 }
144 G4cout <<
" was defined in terms of KineticEnergy: "
146 G4cout <<
" is now defined in terms Momentum: "
147 << aMomentum/GeV <<
"GeV/c" <<
G4endl;
148 }
150 {
151 G4cout <<
"Particle Definition not defined yet for G4ParticleGun"
156 }
157 else
158 {
163 }
164}
Referenced by G4ParticleGunMessenger::SetNewValue().
◆ SetParticleMomentum() [2/2]
Definition at line 166 of file G4ParticleGun.cc.
167{
169 {
171 {
174 }
175 else
176 {
178 }
179 G4cout <<
" was defined in terms of KineticEnergy: "
181 G4cout <<
" is now defined in terms Momentum: "
182 << aMomentum.
mag()/GeV <<
"GeV/c" <<
G4endl;
183 }
185 {
186 G4cout <<
"Particle Definition not defined yet for G4ParticleGun"
192 }
193 else
194 {
200 }
201}
◆ SetParticleMomentumDirection()
◆ SetParticlePolarization()
void G4ParticleGun::SetParticlePolarization |
( |
G4ThreeVector | aVal | ) |
|
|
inline |
◆ SetParticleWeight()
void G4ParticleGun::SetParticleWeight |
( |
G4double | w | ) |
|
|
inline |
◆ NumberOfParticlesToBeGenerated
G4int G4ParticleGun::NumberOfParticlesToBeGenerated = 0 |
|
protected |
◆ particle_charge
G4double G4ParticleGun::particle_charge = 0.0 |
|
protected |
◆ particle_definition
◆ particle_energy
G4double G4ParticleGun::particle_energy = 0.0 |
|
protected |
◆ particle_momentum
G4double G4ParticleGun::particle_momentum = 0.0 |
|
protected |
◆ particle_momentum_direction
◆ particle_polarization
◆ particle_weight
G4double G4ParticleGun::particle_weight = 1.0 |
|
protected |
The documentation for this class was generated from the following files: