LDMX Software
|
Class that extends the functionality of G4ParticleGun. More...
#include <ParticleGun.h>
Public Member Functions | |
ParticleGun (const std::string &name, const framework::config::Parameters ¶meters) | |
Constructor. | |
virtual | ~ParticleGun ()=default |
Destructor. | |
void | GeneratePrimaryVertex (G4Event *event) override |
Generate the primary 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 | |
G4ParticleGun | theGun_ |
The actual Geant4 implementation of the ParticleGun. | |
int | verbosity_ |
LDMX Verbosity for this generator. | |
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. | |
Class that extends the functionality of G4ParticleGun.
Definition at line 30 of file ParticleGun.h.
simcore::generators::ParticleGun::ParticleGun | ( | const std::string & | name, |
const framework::config::Parameters & | parameters | ||
) |
Constructor.
parameters | Parameters used to configure the particle gun. |
Parameters: verbosity: > 1 means print configuration particle : name of particle to shoot (Geant4 naming) energy : energy of particle (GeV) position : position to shoot from (mm three-vector) time : time to shoot at (ns) direction: direction to shoot in (unitless three-vector)
Definition at line 31 of file ParticleGun.cxx.
References framework::config::Parameters::getParameter(), theGun_, and verbosity_.
|
overridevirtual |
Generate the primary vertices in the Geant4 event.
event | The Geant4 event. |
Implements simcore::PrimaryGenerator.
Definition at line 82 of file ParticleGun.cxx.
References theGun_.
|
overridevirtual |
Record the configuration of the primary generator into the run header.
Implements simcore::PrimaryGenerator.
Definition at line 87 of file ParticleGun.cxx.
References ldmx::RunHeader::setFloatParameter(), ldmx::RunHeader::setStringParameter(), and theGun_.
|
private |
The actual Geant4 implementation of the ParticleGun.
Definition at line 64 of file ParticleGun.h.
Referenced by GeneratePrimaryVertex(), ParticleGun(), and RecordConfig().
|
private |
LDMX Verbosity for this generator.
Definition at line 69 of file ParticleGun.h.
Referenced by ParticleGun().