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

Class to read EDM4hep files. More...

Inheritance diagram for dd4hep::sim::EDM4hepFileReader:
dd4hep::sim::Geant4EventReader

Public Member Functions

 EDM4hepFileReader (const std::string &nam)
 Initializing constructor. More...
 
virtual EventReaderStatus setParameters (std::map< std::string, std::string > &parameters)
 Read parameters set for this action. More...
 
virtual EventReaderStatus readParticles (int event_number, Vertices &vertices, std::vector< Particle * > &particles)
 Read an event and fill a vector of MCParticles. More...
 
void registerRunParameters ()
 Call to register the run parameters. 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 moveToEvent (int event_number)
 Move to the indicated event number. More...
 
virtual EventReaderStatus skipEvent ()
 Skip event. To be implemented for sequential sources. More...
 
virtual EventReaderStatus readParticles (int event_number, Vertices &vertices, Particles &particles)=0
 Read an event and fill a vector of MCParticles. More...
 
virtual void checkParameters (std::map< std::string, std::string > &)
 make sure that all parameters have been processed, otherwise throw exceptions More...
 

Protected Attributes

podio::Reader m_reader
 Reference to reader object. More...
 
std::string m_collectionName
 Name of the MCParticle collection to read. More...
 
std::string m_eventHeaderCollectionName
 Name of the EventHeader collection to read. 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

Class to read EDM4hep files.

Version
1.0

Definition at line 101 of file EDM4hepFileReader.cpp.

Constructor & Destructor Documentation

◆ EDM4hepFileReader()

dd4hep::sim::EDM4hepFileReader::EDM4hepFileReader ( const std::string &  nam)

Initializing constructor.

Definition at line 125 of file EDM4hepFileReader.cpp.

Member Function Documentation

◆ readParticles()

EDM4hepFileReader::EventReaderStatus dd4hep::sim::EDM4hepFileReader::readParticles ( int  event_number,
Vertices vertices,
std::vector< Particle * > &  particles 
)
virtual

Read an event and fill a vector of MCParticles.

Definition at line 180 of file EDM4hepFileReader.cpp.

◆ registerRunParameters()

void dd4hep::sim::EDM4hepFileReader::registerRunParameters ( )
virtual

Call to register the run parameters.

Reimplemented from dd4hep::sim::Geant4EventReader.

Definition at line 135 of file EDM4hepFileReader.cpp.

◆ setParameters()

Geant4EventReader::EventReaderStatus dd4hep::sim::EDM4hepFileReader::setParameters ( std::map< std::string, std::string > &  parameters)
virtual

Read parameters set for this action.

Set the parameters for the class, in particular the name of the MCParticle list

Reimplemented from dd4hep::sim::Geant4EventReader.

Definition at line 324 of file EDM4hepFileReader.cpp.

Member Data Documentation

◆ m_collectionName

std::string dd4hep::sim::EDM4hepFileReader::m_collectionName
protected

Name of the MCParticle collection to read.

Definition at line 106 of file EDM4hepFileReader.cpp.

◆ m_eventHeaderCollectionName

std::string dd4hep::sim::EDM4hepFileReader::m_eventHeaderCollectionName
protected

Name of the EventHeader collection to read.

Definition at line 108 of file EDM4hepFileReader.cpp.

◆ m_reader

podio::Reader dd4hep::sim::EDM4hepFileReader::m_reader
protected

Reference to reader object.

Definition at line 104 of file EDM4hepFileReader.cpp.


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