DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Public Member Functions | Protected Attributes | List of all members
dd4hep::sim::HEPMC3FileReader Class Reference

Base class to read hepmc3 event files. More...

Inheritance diagram for dd4hep::sim::HEPMC3FileReader:
dd4hep::sim::HEPMC3EventReader dd4hep::sim::Geant4EventReader

Public Member Functions

 HEPMC3FileReader (const std::string &nam)
 Initializing constructor. More...
 
virtual ~HEPMC3FileReader ()=default
 Default destructor. More...
 
virtual EventReaderStatus readGenEvent (int event_number, HepMC3::GenEvent &genEvent)
 Read an event and fill a vector of MCParticles. More...
 
virtual EventReaderStatus moveToEvent (int event_number)
 skip to event with event_number More...
 
virtual EventReaderStatus setParameters (std::map< std::string, std::string > &parameters)
 Set the parameters for the class. More...
 
virtual void registerRunParameters ()
 register the run parameters into an extension for the run context More...
 
- Public Member Functions inherited from dd4hep::sim::HEPMC3EventReader
 HEPMC3EventReader (const std::string &fileName)
 Initializing constructor. More...
 
virtual ~HEPMC3EventReader ()=default
 Default destructor. More...
 
virtual EventReaderStatus readParticles (int event_number, Vertices &vertices, Particles &particles)
 Read an event and fill a vector of Particles and vertices. More...
 
- Public Member Functions inherited from dd4hep::sim::Geant4EventReader
 Geant4EventReader (const std::string &nam)
 Initializing constructor. More...
 
virtual ~Geant4EventReader ()
 Default destructor. More...
 
Geant4Contextcontext () const
 Get the context (from the input action) More...
 
void setInputAction (Geant4InputAction *action)
 Set the input action. More...
 
const std::string & name () const
 File name. More...
 
bool hasDirectAccess () const
 Flag if direct event access (by event sequence number) is supported (Default: false) More...
 
int currentEventNumber () const
 return current Event Number More...
 
virtual EventReaderStatus skipEvent ()
 Skip event. To be implemented for sequential sources. More...
 
virtual void checkParameters (std::map< std::string, std::string > &)
 make sure that all parameters have been processed, otherwise throw exceptions More...
 

Protected Attributes

std::shared_ptr< HepMC3::Reader > m_reader
 Reference to reader object. More...
 
- Protected Attributes inherited from dd4hep::sim::HEPMC3EventReader
std::string m_flow1 = "flow1"
 name of the GenEvent Attribute storing the color flow1 More...
 
std::string m_flow2 = "flow2"
 name of the GenEvent Attribute storing the color flow2 More...
 
- Protected Attributes inherited from dd4hep::sim::Geant4EventReader
std::string m_name
 File name to be opened and read. More...
 
bool m_directAccess { false }
 Flag if direct event access is supported. To be explicitly set by subclass constructors. More...
 
int m_currEvent { 0 }
 Current event number. More...
 
Geant4InputActionm_inputAction { nullptr }
 The input action context. More...
 

Additional Inherited Members

- Public Types inherited from dd4hep::sim::Geant4EventReader
enum  EventReaderStatus {
  EVENT_READER_ERROR =0, EVENT_READER_OK =1, EVENT_READER_NO_DIRECT =2, EVENT_READER_NO_PRIMARIES =4,
  EVENT_READER_NO_FACTORY =6, EVENT_READER_IO_ERROR =8, EVENT_READER_EOF =10
}
 Status codes of the event reader object. Anything with NOT low-bit set is an error. More...
 
typedef Geant4Vertex Vertex
 
typedef Geant4Particle Particle
 
typedef std::vector< Particle * > Particles
 
typedef std::vector< Vertex * > Vertices
 
- Protected Member Functions inherited from dd4hep::sim::Geant4EventReader
template<typename T >
void _getParameterValue (std::map< std::string, std::string > &parameters, std::string const &parameterName, T &parameter, T defaultValue)
 transform the string parameter value into the type of parameter More...
 

Detailed Description

Base class to read hepmc3 event files.

Version
1.0

Definition at line 93 of file HepMC3FileReader.cpp.

Constructor & Destructor Documentation

◆ HEPMC3FileReader()

HEPMC3FileReader::HEPMC3FileReader ( const std::string &  nam)

Initializing constructor.

Definition at line 126 of file HepMC3FileReader.cpp.

◆ ~HEPMC3FileReader()

virtual dd4hep::sim::HEPMC3FileReader::~HEPMC3FileReader ( )
virtualdefault

Default destructor.

Member Function Documentation

◆ moveToEvent()

Geant4EventReader::EventReaderStatus HEPMC3FileReader::moveToEvent ( int  event_number)
virtual

skip to event with event_number

moveToSpecifiedEvent, a.k.a. skipNEvents

Reimplemented from dd4hep::sim::Geant4EventReader.

Definition at line 159 of file HepMC3FileReader.cpp.

◆ readGenEvent()

Geant4EventReader::EventReaderStatus HEPMC3FileReader::readGenEvent ( int  event_number,
HepMC3::GenEvent &  genEvent 
)
virtual

Read an event and fill a vector of MCParticles.

Implements dd4hep::sim::HEPMC3EventReader.

Definition at line 176 of file HepMC3FileReader.cpp.

◆ registerRunParameters()

void HEPMC3FileReader::registerRunParameters ( )
virtual

register the run parameters into an extension for the run context

Reimplemented from dd4hep::sim::Geant4EventReader.

Definition at line 147 of file HepMC3FileReader.cpp.

◆ setParameters()

Geant4EventReader::EventReaderStatus HEPMC3FileReader::setParameters ( std::map< std::string, std::string > &  parameters)
virtual

Set the parameters for the class.

Reimplemented from dd4hep::sim::Geant4EventReader.

Definition at line 202 of file HepMC3FileReader.cpp.

Member Data Documentation

◆ m_reader

std::shared_ptr<HepMC3::Reader> dd4hep::sim::HEPMC3FileReader::m_reader
protected

Reference to reader object.

Definition at line 96 of file HepMC3FileReader.cpp.


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