|
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. | |
| DECLARE_FACTORY_WITH_WAREHOUSE (PrimaryGenerator, std::shared_ptr< PrimaryGenerator >, const std::string &, const framework::config::Parameters &) | |
| virtual | ~PrimaryGenerator ()=default |
| Destructor. | |
| std::string | name () |
Private Attributes | |
| TRandom * | random_ |
| Random number generator. | |
| G4ThreeVector | mpg_vertex_ |
| The vertex position from which to fire the particles. | |
| G4ThreeVector | mpg_momentum_ |
| The initial momentum of the particles. | |
| double | mpg_n_particles_ {1.} |
| Number of particles that will be fired by the gun per event. | |
| int | mpg_pdg_id_ {99999} |
| PDG ID of the particle used by the gun. | |
| bool | mpg_enable_poisson_ {false} |
| Flag denoting whether the number of incident particles should be Poisson distributed. | |
Additional Inherited Members | |
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::get(), mpg_enable_poisson_, mpg_momentum_, mpg_n_particles_, mpg_pdg_id_, and mpg_vertex_.
|
virtual |
|
overridevirtual |
Generate vertices in the Geant4 event.
| anEvent | The Geant4 event. |
Implements simcore::PrimaryGenerator.
Definition at line 39 of file MultiParticleGunPrimaryGenerator.cxx.
References mpg_enable_poisson_, mpg_momentum_, mpg_n_particles_, mpg_pdg_id_, mpg_vertex_, random_, and simcore::UserPrimaryParticleInformation::setHepEvtStatus().
|
overridevirtual |
Record the configuration of the primary generator into the run header.
Implements simcore::PrimaryGenerator.
Definition at line 78 of file MultiParticleGunPrimaryGenerator.cxx.
References mpg_enable_poisson_, mpg_momentum_, mpg_n_particles_, mpg_pdg_id_, mpg_vertex_, 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().