Generates a Geant4 event from particle gun, but can have many particles.
void GeneratePrimaryVertex(G4Event *anEvent) override
Generate vertices in the Geant4 event.
void RecordConfig(const std::string &id, ldmx::RunHeader &rh) override
Record the configuration of the primary generator into the run header.
MultiParticleGunPrimaryGenerator(const std::string &name, const framework::config::Parameters ¶meters)
Constructor.
int mpg_pdg_id_
PDG ID of the particle used by the gun.
double mpg_n_particles_
Number of particles that will be fired by the gun per event.
G4ThreeVector mpg_vertex_
The vertex position from which to fire the particles.
G4ThreeVector mpg_momentum_
The initial momentum of the particles.
bool mpg_enable_poisson_
Flag denoting whether the number of incident particles should be Poisson distributed.
virtual ~MultiParticleGunPrimaryGenerator()
Destructor.