LDMX Software
Public Types | Public Member Functions | Protected Attributes | List of all members
simcore::PrimaryGenerator Class Referenceabstract

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

#include <PrimaryGenerator.h>

Public Types

using Factory = ::simcore::Factory< PrimaryGenerator, std::shared_ptr< PrimaryGenerator >, const std::string &, const framework::config::Parameters & >
 Factory for primary generators.
 

Public Member Functions

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

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.

Member Typedef Documentation

◆ Factory

Factory for primary generators.

Definition at line 49 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

Generate a Primary Vertex.

This function must be defined by any other LDMX generators.

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

◆ 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::LHEPrimaryGenerator, simcore::generators::MultiParticleGunPrimaryGenerator, and simcore::generators::ParticleGun.

Member Data Documentation

◆ name_

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

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