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

Vertex generator that reads positions sequentially from an ntuple file. More...

#include <RMGVertexFromFile.hh>

Inheritance diagram for RMGVertexFromFile:
Collaboration diagram for RMGVertexFromFile:

Public Member Functions

 RMGVertexFromFile (RMGVertexFromFile const &)=delete
 
RMGVertexFromFileoperator= (RMGVertexFromFile const &)=delete
 
 RMGVertexFromFile (RMGVertexFromFile &&)=delete
 
RMGVertexFromFileoperator= (RMGVertexFromFile &&)=delete
 
bool GenerateVertex (G4ThreeVector &) override
 Read the next position row from the file.
 
void BeginOfRunAction (const G4Run *) override
 Open the input file and bind the position 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 RMGVVertexGenerator
 RMGVVertexGenerator (std::string name)
 
 RMGVVertexGenerator (RMGVVertexGenerator const &)=delete
 
RMGVVertexGeneratoroperator= (RMGVVertexGenerator const &)=delete
 
 RMGVVertexGenerator (RMGVVertexGenerator &&)=delete
 
RMGVVertexGeneratoroperator= (RMGVVertexGenerator &&)=delete
 
void SetMaxAttempts (int val)
 Set the maximum number of attempts for vertex generation.
 
int GetMaxAttempts () const
 Get the maximum number of attempts for vertex generation.
 

Additional Inherited Members

- Protected Attributes inherited from RMGVVertexGenerator
std::string fGeneratorName
 
int fMaxAttempts = 100
 
const G4ThreeVector kDummyPrimaryPosition = G4ThreeVector(0, 0, 0)
 
std::unique_ptr< G4UImessengerfMessenger
 

Detailed Description

Vertex generator that reads positions sequentially from an ntuple file.

Each row of the ntuple supplies one (x, y, z) triplet. Used to replay vertices produced by an external sampler (e.g. an MC truth file) into a remage run.

Member Function Documentation

◆ BeginOfRunAction()

void RMGVertexFromFile::BeginOfRunAction ( const G4Run * )
overridevirtual

Open the input file and bind the position columns.

Reimplemented from RMGVVertexGenerator.

◆ EndOfRunAction()

void RMGVertexFromFile::EndOfRunAction ( const G4Run * )
overridevirtual

Close the input file.

Reimplemented from RMGVVertexGenerator.

◆ GenerateVertex()

bool RMGVertexFromFile::GenerateVertex ( G4ThreeVector & vertex)
overridevirtual

Read the next position row from the file.

Returns
False if the input has been exhausted (which aborts the run gracefully).

Reimplemented from RMGVVertexGenerator.


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