remage
Simulation framework for HPGe-based experiments
 
Loading...
Searching...
No Matches
RMGGeneratorFromFile Class Reference

Primary generator reading particle kinematics row-by-row from an ntuple file. More...

#include <RMGGeneratorFromFile.hh>

Inheritance diagram for RMGGeneratorFromFile:
Collaboration diagram for RMGGeneratorFromFile:

Public Member Functions

 RMGGeneratorFromFile (RMGGeneratorFromFile const &)=delete
 
RMGGeneratorFromFileoperator= (RMGGeneratorFromFile const &)=delete
 
 RMGGeneratorFromFile (RMGGeneratorFromFile &&)=delete
 
RMGGeneratorFromFileoperator= (RMGGeneratorFromFile &&)=delete
 
void GeneratePrimaries (G4Event *) override
 Read the next row(s) from the input ntuple and create the primary vertex.
 
void SetParticlePosition (G4ThreeVector pos) override
 Set the vertex position for the next call to GeneratePrimaries.
 
void BeginOfRunAction (const G4Run *) override
 Open the input file and bind the row reader to the configured ntuple columns.
 
void EndOfRunAction (const G4Run *) override
 Close the input file.
 
void OpenFile (std::string &name)
 Set the path of the input ntuple file.
 
- Public Member Functions inherited from RMGVGenerator
 RMGVGenerator (std::string name)
 
 RMGVGenerator (RMGVGenerator const &)=delete
 
RMGVGeneratoroperator= (RMGVGenerator const &)=delete
 
 RMGVGenerator (RMGVGenerator &&)=delete
 
RMGVGeneratoroperator= (RMGVGenerator &&)=delete
 
void SetReportingFrequency (int freq)
 
std::string GetGeneratorName ()
 

Additional Inherited Members

- Protected Attributes inherited from RMGVGenerator
std::string fGeneratorName
 
std::unique_ptr< G4UImessengerfMessenger
 
int fReportingFrequency = 1000
 

Detailed Description

Primary generator reading particle kinematics row-by-row from an ntuple file.

Each row of the input ntuple (LH5/HDF5/ROOT, opened through RMGAnalysisReader) specifies a Geant4 PDG id, kinetic energy, momentum direction and global time. The vertex position is supplied externally by the configured vertex generator via SetParticlePosition. The fNpart column allows several consecutive rows to be combined into a single multi-particle primary vertex.

Member Function Documentation

◆ BeginOfRunAction()

void RMGGeneratorFromFile::BeginOfRunAction ( const G4Run * )
overridevirtual

Open the input file and bind the row reader to the configured ntuple columns.

Reimplemented from RMGVGenerator.

◆ EndOfRunAction()

void RMGGeneratorFromFile::EndOfRunAction ( const G4Run * )
overridevirtual

Close the input file.

Reimplemented from RMGVGenerator.

◆ GeneratePrimaries()

void RMGGeneratorFromFile::GeneratePrimaries ( G4Event * event)
overridevirtual

Read the next row(s) from the input ntuple and create the primary vertex.

Implements RMGVGenerator.

◆ SetParticlePosition()

void RMGGeneratorFromFile::SetParticlePosition ( G4ThreeVector pos)
inlineoverridevirtual

Set the vertex position for the next call to GeneratePrimaries.

Implements RMGVGenerator.


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