LDMX Software
simcore::PrimaryGenerator Class Referenceabstract

Interface that defines a simulation primary generator. More...

#include <PrimaryGenerator.h>

Public Member Functions

 PrimaryGenerator (const std::string &name, const framework::config::Parameters &parameters)
 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 ()
 

Protected Attributes

std::string name_ {""}
 Name of the PrimaryGenerator.
 

Detailed Description

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 38 of file PrimaryGenerator.h.

Constructor & Destructor Documentation

◆ PrimaryGenerator()

simcore::PrimaryGenerator::PrimaryGenerator ( const std::string & name,
const framework::config::Parameters & parameters )

Constructor.

Parameters
nameName given the to class instance.

Definition at line 12 of file PrimaryGenerator.cxx.

14 : name_(name) {}
std::string name_
Name of the PrimaryGenerator.

Member Function Documentation

◆ GeneratePrimaryVertex()

virtual void simcore::PrimaryGenerator::GeneratePrimaryVertex ( G4Event * )
pure virtual

◆ name()

std::string simcore::PrimaryGenerator::name ( )
inline

Definition at line 71 of file PrimaryGenerator.h.

71{ return name_; }

◆ RecordConfig()

virtual void simcore::PrimaryGenerator::RecordConfig ( const std::string & id,
ldmx::RunHeader & rh )
pure virtual

Record the configuration of the primary generator into the run header.

Note
you must include the id number in each entry into the run header just in case there are other generators

Implemented in simcore::generators::GeneralParticleSource, simcore::generators::GenieGenerator, simcore::generators::LHEPrimaryGenerator, simcore::generators::MultiParticleGunPrimaryGenerator, and simcore::generators::ParticleGun.

References name_.

Member Data Documentation

◆ name_

std::string simcore::PrimaryGenerator::name_ {""}
protected

Name of the PrimaryGenerator.

Definition at line 75 of file PrimaryGenerator.h.

75{""};

Referenced by RecordConfig().


The documentation for this class was generated from the following files: