|
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 | prepEvent (const framework::Event &event) |
| Prepare to generate a new primary vertex given the input event context. | |
| 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 40 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::FromScoringPlane, simcore::generators::GeneralParticleSource, simcore::generators::GenieGenerator, simcore::generators::HepMCPrimaryGenerator, simcore::generators::LHEPrimaryGenerator, simcore::generators::MultiParticleGunPrimaryGenerator, and simcore::generators::ParticleGun.
|
inline |
Definition at line 89 of file PrimaryGenerator.h.
|
inlinevirtual |
Prepare to generate a new primary vertex given the input event context.
This is helpful in the case where the primary vertices are being read from the input LDMX Event file or if the primary generator just wants to use some information from the EventHeader to help guide generation of primary vertices.
| [in] | event | a const reference to the event that is about to be generated It is const because objects should only be added to the event by the Simulator (or ReSimulator) after an event is confirmed to not have been aborted during the simulation. |
Reimplemented in simcore::generators::FromScoringPlane.
Definition at line 71 of file PrimaryGenerator.h.
|
pure virtual |
Record the configuration of the primary generator into the run header.
Implemented in simcore::generators::FromScoringPlane, simcore::generators::GeneralParticleSource, simcore::generators::GenieGenerator, simcore::generators::HepMCPrimaryGenerator, 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::HepMCPrimaryGenerator::GeneratePrimaryVertex(), simcore::generators::LHEPrimaryGenerator::GeneratePrimaryVertex(), and simcore::generators::MultiParticleGunPrimaryGenerator::GeneratePrimaryVertex().
|
inline |
Check if beam spot smearing is enabled for this generator.
Definition at line 106 of file PrimaryGenerator.h.
References use_beamspot_.
Referenced by simcore::generators::GeneralParticleSource::GeneratePrimaryVertex(), simcore::generators::GenieGenerator::GeneratePrimaryVertex(), simcore::generators::HepMCPrimaryGenerator::GeneratePrimaryVertex(), simcore::generators::LHEPrimaryGenerator::GeneratePrimaryVertex(), and simcore::generators::MultiParticleGunPrimaryGenerator::GeneratePrimaryVertex().
|
protected |
Extent of the beamspot in x [mm].
Definition at line 116 of file PrimaryGenerator.h.
Referenced by smearBeamspot().
|
protected |
Extent of the beamspot in y [mm].
Definition at line 119 of file PrimaryGenerator.h.
Referenced by smearBeamspot().
|
protected |
Extent of the beamspot in z [mm].
Definition at line 122 of file PrimaryGenerator.h.
Referenced by smearBeamspot().
|
protected |
Name of the PrimaryGenerator.
Definition at line 110 of file PrimaryGenerator.h.
Referenced by RecordConfig().
|
protected |
Flag denoting whether beam spot smearing is enabled for this generator.
Definition at line 113 of file PrimaryGenerator.h.
Referenced by smearBeamspot(), and useBeamspot().