53 NumberOfParticlesToBeGenerated = numberofparticles;
54 SetParticleDefinition( particleDef );
104 if(!aParticleDefinition)
106 G4Exception(
"G4ParticleGun::SetParticleDefinition()",
"Event0101",
114 ED <<
"G4ParticleGun does not support shooting a short-lived particle without a valid decay table." <<
G4endl;
115 ED <<
"G4ParticleGun::SetParticleDefinition for "
117 G4Exception(
"G4ParticleGun::SetParticleDefinition()",
"Event0102",
122 particle_definition = aParticleDefinition;
124 if(particle_momentum>0.0)
126 G4double mass = particle_definition->GetPDGMass();
128 std::sqrt(particle_momentum*particle_momentum+mass*mass)-mass;
142 G4cout <<
" was defined in terms of Momentum: "
144 G4cout <<
" is now defined in terms of KineticEnergy: "
159 G4cout <<
" was defined in terms of KineticEnergy: "
161 G4cout <<
" is now defined in terms Momentum: "
166 G4cout <<
"Particle Definition not defined yet for G4ParticleGun"<<
G4endl;
189 G4cout <<
" was defined in terms of KineticEnergy: "
191 G4cout <<
" is now defined in terms Momentum: "
196 G4cout <<
"Particle Definition not defined yet for G4ParticleGun"<<
G4endl;
217 ED <<
"Particle definition is not defined." <<
G4endl;
218 ED <<
"G4ParticleGun::SetParticleDefinition() has to be invoked beforehand." <<
G4endl;
219 G4Exception(
"G4ParticleGun::GeneratePrimaryVertex()",
"Event0109",
G4ThreeVector G4ParticleMomentum
std::ostringstream G4ExceptionDescription
G4DecayTable * GetDecayTable() const
virtual void SetInitialValues()
const G4String & GetParticleName() const
G4double GetPDGCharge() const
void SetKineticEnergy(G4double eKin)
G4double GetPDGMass() const
G4ParticleDefinition * particle_definition
G4ParticleGunMessenger * theMessenger
G4int NumberOfParticlesToBeGenerated
G4ParticleMomentum particle_momentum_direction
G4double particle_momentum
G4ThreeVector particle_position
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)
void SetPolarization(const G4ThreeVector &pol)
void SetPrimary(G4PrimaryParticle *pp)
void SetCharge(G4double chg)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
void SetMomentumDirection(const G4ThreeVector &p)
virtual void GeneratePrimaryVertex(G4Event *evt)
G4GLOB_DLL std::ostream G4cout
void SetParticleEnergy(G4double aKineticEnergy)
G4bool IsShortLived() const
void SetParticleMomentum(G4double aMomentum)
void AddPrimaryVertex(G4PrimaryVertex *aPrimaryVertex)
G4ThreeVector particle_polarization
static constexpr double GeV
void SetMass(G4double mas)