LDMX Software
|
Generates a Geant4 event from particle gun, but can have many particles. More...
#include <MultiParticleGunPrimaryGenerator.h>
Public Member Functions | |
MultiParticleGunPrimaryGenerator (const std::string &name, const framework::config::Parameters ¶meters) | |
Constructor. | |
virtual | ~MultiParticleGunPrimaryGenerator () |
Destructor. | |
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. | |
Public Member Functions inherited from simcore::PrimaryGenerator | |
PrimaryGenerator (const std::string &name, const framework::config::Parameters ¶meters) | |
Constructor. | |
virtual | ~PrimaryGenerator ()=default |
Destructor. | |
Private Attributes | |
TRandom * | random_ |
Random number generator. | |
G4ThreeVector | mpgVertex_ |
The vertex position from which to fire the particles. | |
G4ThreeVector | mpgMomentum_ |
The initial momentum of the particles. | |
double | mpgNParticles_ {1.} |
Number of particles that will be fired by the gun per event. | |
int | mpgPdgID_ {99999} |
PDG ID of the particle used by the gun. | |
bool | mpgEnablePoisson_ {false} |
Flag denoting whether the number of incident particles should be Poisson distributed. | |
Additional Inherited Members | |
Public Types inherited from simcore::PrimaryGenerator | |
using | Factory = ::simcore::Factory< PrimaryGenerator, std::shared_ptr< PrimaryGenerator >, const std::string &, const framework::config::Parameters & > |
Factory for primary generators. | |
Protected Attributes inherited from simcore::PrimaryGenerator | |
std::string | name_ {""} |
Name of the PrimaryGenerator. | |
Generates a Geant4 event from particle gun, but can have many particles.
Definition at line 52 of file MultiParticleGunPrimaryGenerator.h.
simcore::generators::MultiParticleGunPrimaryGenerator::MultiParticleGunPrimaryGenerator | ( | const std::string & | name, |
const framework::config::Parameters & | parameters | ||
) |
Constructor.
name | the name of this generator |
parameters | the configuration parameters |
Parameters: vertex : Position to shoot from (mm) momentum : 3-vector mometum of particles (MeV) nParticles : number of particles to shoot (mean if Poisson enabled) pdgID : pdgID of particle to shoot enablePoisson : whether to poisson distribute the number of particles
Definition at line 13 of file MultiParticleGunPrimaryGenerator.cxx.
References framework::config::Parameters::getParameter(), mpgEnablePoisson_, mpgMomentum_, mpgNParticles_, mpgPdgID_, mpgVertex_, and simcore::PrimaryGenerator::name_.
|
virtual |
|
overridevirtual |
Generate vertices in the Geant4 event.
anEvent | The Geant4 event. |
Implements simcore::PrimaryGenerator.
Definition at line 37 of file MultiParticleGunPrimaryGenerator.cxx.
References mpgEnablePoisson_, mpgMomentum_, mpgNParticles_, mpgPdgID_, mpgVertex_, random_, and simcore::UserPrimaryParticleInformation::setHepEvtStatus().
|
overridevirtual |
Record the configuration of the primary generator into the run header.
Implements simcore::PrimaryGenerator.
Definition at line 76 of file MultiParticleGunPrimaryGenerator.cxx.
References mpgEnablePoisson_, mpgMomentum_, mpgNParticles_, mpgPdgID_, mpgVertex_, ldmx::RunHeader::setFloatParameter(), ldmx::RunHeader::setIntParameter(), and ldmx::RunHeader::setStringParameter().
|
private |
Flag denoting whether the number of incident particles should be Poisson distributed.
Definition at line 101 of file MultiParticleGunPrimaryGenerator.h.
Referenced by GeneratePrimaryVertex(), MultiParticleGunPrimaryGenerator(), and RecordConfig().
|
private |
The initial momentum of the particles.
Definition at line 89 of file MultiParticleGunPrimaryGenerator.h.
Referenced by GeneratePrimaryVertex(), MultiParticleGunPrimaryGenerator(), and RecordConfig().
|
private |
Number of particles that will be fired by the gun per event.
Definition at line 92 of file MultiParticleGunPrimaryGenerator.h.
Referenced by GeneratePrimaryVertex(), MultiParticleGunPrimaryGenerator(), and RecordConfig().
|
private |
PDG ID of the particle used by the gun.
Definition at line 95 of file MultiParticleGunPrimaryGenerator.h.
Referenced by GeneratePrimaryVertex(), MultiParticleGunPrimaryGenerator(), and RecordConfig().
|
private |
The vertex position from which to fire the particles.
Definition at line 86 of file MultiParticleGunPrimaryGenerator.h.
Referenced by GeneratePrimaryVertex(), MultiParticleGunPrimaryGenerator(), and RecordConfig().
|
private |
Random number generator.
Definition at line 83 of file MultiParticleGunPrimaryGenerator.h.
Referenced by GeneratePrimaryVertex(), and ~MultiParticleGunPrimaryGenerator().