DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Basic geant4 event reader class. This interface/base-class must be implemented by concrete readers. More...
#include <Geant4InputAction.h>
Public Types | |
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 |
Public Member Functions | |
Geant4EventReader (const std::string &nam) | |
Initializing constructor. More... | |
virtual | ~Geant4EventReader () |
Default destructor. More... | |
Geant4Context * | context () 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 EventReaderStatus | setParameters (std::map< std::string, std::string > &) |
pass parameters to the event reader object More... | |
virtual void | checkParameters (std::map< std::string, std::string > &) |
make sure that all parameters have been processed, otherwise throw exceptions More... | |
virtual void | registerRunParameters () |
Register Run Parameters. More... | |
Protected Member Functions | |
template<typename T > | |
void | _getParameterValue (std::map< std::string, std::string > ¶meters, std::string const ¶meterName, T ¶meter, T defaultValue) |
transform the string parameter value into the type of parameter More... | |
Protected Attributes | |
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... | |
Geant4InputAction * | m_inputAction { nullptr } |
The input action context. More... | |
Basic geant4 event reader class. This interface/base-class must be implemented by concrete readers.
Base class to read input files containing simulation data.
Definition at line 60 of file Geant4InputAction.h.
Definition at line 64 of file Geant4InputAction.h.
typedef std::vector<Particle*> dd4hep::sim::Geant4EventReader::Particles |
Definition at line 65 of file Geant4InputAction.h.
Definition at line 63 of file Geant4InputAction.h.
typedef std::vector<Vertex*> dd4hep::sim::Geant4EventReader::Vertices |
Definition at line 66 of file Geant4InputAction.h.
Status codes of the event reader object. Anything with NOT low-bit set is an error.
Enumerator | |
---|---|
EVENT_READER_ERROR | |
EVENT_READER_OK | |
EVENT_READER_NO_DIRECT | |
EVENT_READER_NO_PRIMARIES | |
EVENT_READER_NO_FACTORY | |
EVENT_READER_IO_ERROR | |
EVENT_READER_EOF |
Definition at line 68 of file Geant4InputAction.h.
Geant4EventReader::Geant4EventReader | ( | const std::string & | nam | ) |
Initializing constructor.
Definition at line 32 of file Geant4InputAction.cpp.
|
virtual |
Default destructor.
Definition at line 37 of file Geant4InputAction.cpp.
|
inlineprotected |
transform the string parameter value into the type of parameter
removes parameter from the parameters map
Definition at line 92 of file Geant4InputAction.h.
|
virtual |
make sure that all parameters have been processed, otherwise throw exceptions
check if all parameters have been consumed by the reader, otherwise throws exception
Definition at line 71 of file Geant4InputAction.cpp.
Geant4Context * Geant4EventReader::context | ( | ) | const |
Get the context (from the input action)
Definition at line 41 of file Geant4InputAction.cpp.
|
inline |
return current Event Number
Definition at line 118 of file Geant4InputAction.h.
|
inline |
Flag if direct event access (by event sequence number) is supported (Default: false)
Definition at line 116 of file Geant4InputAction.h.
|
virtual |
Move to the indicated event number.
For pure sequential access, the default implementation will skip events one by one. For technologies supporting direct event access the default implementation will be empty.
Reimplemented in dd4hep::sim::Geant4EventReaderHepMC, dd4hep::sim::Geant4EventReaderGuineaPig, dd4hep::sim::LCIOStdHepReader, dd4hep::sim::HEPMC3FileReader, dd4hep::sim::LCIOFileReader, and dd4hep::sim::Geant4EventReaderHepEvt.
Definition at line 113 of file Geant4InputAction.cpp.
|
inline |
File name.
Definition at line 114 of file Geant4InputAction.h.
|
pure virtual |
Read an event and fill a vector of MCParticles.
The additional argument
Implemented in dd4hep::sim::HEPMC3EventReader.
|
inlinevirtual |
Register Run Parameters.
Reimplemented in dd4hep::sim::HEPMC3FileReader.
Definition at line 144 of file Geant4InputAction.h.
void Geant4EventReader::setInputAction | ( | Geant4InputAction * | action | ) |
Set the input action.
Definition at line 50 of file Geant4InputAction.cpp.
|
inlinevirtual |
pass parameters to the event reader object
Reimplemented in dd4hep::sim::Geant4EventReaderGuineaPig, dd4hep::sim::HEPMC3FileReader, and dd4hep::sim::LCIOFileReader.
Definition at line 138 of file Geant4InputAction.h.
|
virtual |
Skip event. To be implemented for sequential sources.
Reimplemented in dd4hep::sim::Geant4EventReaderHepMC, dd4hep::sim::Geant4EventReaderGuineaPig, dd4hep::sim::LCIOStdHepReader, dd4hep::sim::LCIOFileReader, and dd4hep::sim::Geant4EventReaderHepEvt.
Definition at line 55 of file Geant4InputAction.cpp.
|
protected |
Current event number.
Definition at line 83 of file Geant4InputAction.h.
|
protected |
Flag if direct event access is supported. To be explicitly set by subclass constructors.
Definition at line 81 of file Geant4InputAction.h.
|
protected |
The input action context.
Definition at line 85 of file Geant4InputAction.h.
|
protected |
File name to be opened and read.
Definition at line 79 of file Geant4InputAction.h.