45 fParticleGun(0), fMessenger(0),
46 fPositron(0), fMuon(0), fPion(0), fKaon(0), fProton(0),
48 fSigmaMomentum(50.*
MeV),
50 fRandomizePrimary(true)
115 G4double Ekin = std::sqrt(pp*pp+mass*mass)-mass;
133 "Primary generator control");
138 "Mean momentum of primaries.");
151 sigmaMomentumCmd.
SetRange(
"sp>=0.");
157 "Sigma angle divergence of primaries.");
166 =
"Boolean flag for randomizing primary particle types.\n";
168 +=
"In case this flag is false, you can select the primary particle\n";
169 guidance +=
" with /gun/particle command.";
B5PrimaryGeneratorAction()
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
CLHEP::Hep3Vector G4ThreeVector
This class is generic messenger.
Command & DeclareProperty(const G4String &name, const G4AnyType &variable, const G4String &doc="")
Declare Methods.
G4ParticleGun * fParticleGun
virtual void GeneratePrimaries(G4Event *)
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
virtual void GeneratePrimaryVertex(G4Event *evt)
G4ParticleDefinition * fKaon
Command & SetDefaultValue(const G4String &)
void SetParticlePosition(G4ThreeVector aPosition)
Command & SetGuidance(const G4String &s0)
G4ParticleDefinition * fPositron
G4GenericMessenger * fMessenger
Command & SetRange(const G4String &range)
G4ParticleDefinition * fPion
void SetParticleEnergy(G4double aKineticEnergy)
G4double GetPDGMass() const
static G4ParticleTable * GetParticleTable()
Definition of the B5PrimaryGeneratorAction class.
G4ParticleDefinition * GetParticleDefinition() const
G4ParticleDefinition * fProton
Command & SetParameterName(const G4String &, G4bool, G4bool=false)
virtual ~B5PrimaryGeneratorAction()
G4ParticleDefinition * fMuon
Command & DeclarePropertyWithUnit(const G4String &name, const G4String &defaultUnit, const G4AnyType &variable, const G4String &doc="")
void SetParticleDefinition(G4ParticleDefinition *aParticleDefinition)