Celeritas  0.5.0-56+6b053cd
Public Member Functions | List of all members
celeritas::HepMC3PrimaryGenerator Class Referencefinal

HepMC3 reader class for sharing across threads. More...

#include <HepMC3PrimaryGenerator.hh>

Inheritance diagram for celeritas::HepMC3PrimaryGenerator:
Inheritance graph
[legend]

Public Member Functions

 HepMC3PrimaryGenerator (std::string const &filename)
 Construct with a path to a HepMC3-compatible input file.
 
 CELER_DELETE_COPY_MOVE (HepMC3PrimaryGenerator)
 
void GeneratePrimaryVertex (G4Event *g4_event) final
 Add primaries to Geant4 event. More...
 
int NumEvents ()
 Get total number of events.
 

Detailed Description

HepMC3 reader class for sharing across threads.

This singleton is shared among threads so that events can be correctly split up between them, being constructed the first time instance() is invoked. As this is a derived G4VPrimaryGenerator class, the HepMC3PrimaryGenerator must be used by a concrete implementation of the G4VUserPrimaryGeneratorAction class:

void PrimaryGeneratorAction::GeneratePrimaries(G4Event* event)
{
HepMC3PrimaryGenerator::Instance()->GeneratePrimaryVertex(event);
}

Member Function Documentation

◆ GeneratePrimaryVertex()

void celeritas::HepMC3PrimaryGenerator::GeneratePrimaryVertex ( G4Event *  g4_event)
inlinefinal

Add primaries to Geant4 event.

Add HepMC3 primaries to a Geant4 event.

This function should be called by G4VUserPrimaryGeneratorAction::GeneratePrimaries .


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