|
LDMX Software
|
Interface that defines a simulation primary generator. More...
#include <PrimaryGenerator.h>
Public Member Functions | |
| 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. | |
| virtual void | GeneratePrimaryVertex (G4Event *)=0 |
| Generate a Primary Vertex. | |
| virtual void | RecordConfig (const std::string &id, ldmx::RunHeader &rh)=0 |
| Record the configuration of the primary generator into the run header. | |
| std::string | name () |
| void | smearBeamspot (G4PrimaryVertex *primary_vertex) |
| Apply beam spot smearing to a primary vertex. | |
| bool | useBeamspot () const |
| Check if beam spot smearing is enabled for this generator. | |
Protected Attributes | |
| std::string | name_ {""} |
| Name of the PrimaryGenerator. | |
| bool | use_beamspot_ {false} |
| Flag denoting whether beam spot smearing is enabled for this generator. | |
| double | beamspot_x_size_ {0} |
| Extent of the beamspot in x [mm]. | |
| double | beamspot_y_size_ {0} |
| Extent of the beamspot in y [mm]. | |
| double | beamspot_z_size_ {0} |
| Extent of the beamspot in z [mm]. | |
Interface that defines a simulation primary generator.
This class inherits from the Geant4 Primary Genertor template, and is used as a common reference for all of the other PrimaryGenerators.
Definition at line 39 of file PrimaryGenerator.h.
| simcore::PrimaryGenerator::PrimaryGenerator | ( | const std::string & | name, |
| const framework::config::Parameters & | parameters ) |
Constructor.
| name | Name given the to class instance. |
Definition at line 19 of file PrimaryGenerator.cxx.
References framework::config::Parameters::get().
|
pure virtual |
Generate a Primary Vertex.
This function must be defined by any other LDMX generators.
Implemented in simcore::generators::GeneralParticleSource, simcore::generators::GenieGenerator, simcore::generators::LHEPrimaryGenerator, simcore::generators::MultiParticleGunPrimaryGenerator, and simcore::generators::ParticleGun.
|
inline |
Definition at line 73 of file PrimaryGenerator.h.
|
pure virtual |
Record the configuration of the primary generator into the run header.
Implemented in simcore::generators::GeneralParticleSource, simcore::generators::GenieGenerator, simcore::generators::LHEPrimaryGenerator, simcore::generators::MultiParticleGunPrimaryGenerator, and simcore::generators::ParticleGun.
References name_.
| void simcore::PrimaryGenerator::smearBeamspot | ( | G4PrimaryVertex * | primary_vertex | ) |
Apply beam spot smearing to a primary vertex.
This method should be called by derived classes after generating a vertex if beam spot smearing is enabled for this generator.
| primary_vertex | The vertex to smear |
Definition at line 32 of file PrimaryGenerator.cxx.
References beamspot_x_size_, beamspot_y_size_, beamspot_z_size_, and use_beamspot_.
Referenced by simcore::generators::GeneralParticleSource::GeneratePrimaryVertex(), simcore::generators::GenieGenerator::GeneratePrimaryVertex(), simcore::generators::LHEPrimaryGenerator::GeneratePrimaryVertex(), and simcore::generators::MultiParticleGunPrimaryGenerator::GeneratePrimaryVertex().
|
inline |
Check if beam spot smearing is enabled for this generator.
Definition at line 90 of file PrimaryGenerator.h.
References use_beamspot_.
Referenced by simcore::generators::GeneralParticleSource::GeneratePrimaryVertex(), simcore::generators::GenieGenerator::GeneratePrimaryVertex(), simcore::generators::LHEPrimaryGenerator::GeneratePrimaryVertex(), and simcore::generators::MultiParticleGunPrimaryGenerator::GeneratePrimaryVertex().
|
protected |
Extent of the beamspot in x [mm].
Definition at line 100 of file PrimaryGenerator.h.
Referenced by smearBeamspot().
|
protected |
Extent of the beamspot in y [mm].
Definition at line 103 of file PrimaryGenerator.h.
Referenced by smearBeamspot().
|
protected |
Extent of the beamspot in z [mm].
Definition at line 106 of file PrimaryGenerator.h.
Referenced by smearBeamspot().
|
protected |
Name of the PrimaryGenerator.
Definition at line 94 of file PrimaryGenerator.h.
Referenced by RecordConfig().
|
protected |
Flag denoting whether beam spot smearing is enabled for this generator.
Definition at line 97 of file PrimaryGenerator.h.
Referenced by smearBeamspot(), and useBeamspot().