HepMC3 event record library
|
GenEvent I/O parsing and serialization for HEPEVT files.
Definition at line 32 of file ReaderHEPEVT.h.
#include <ReaderHEPEVT.h>
Public Member Functions | |
ReaderHEPEVT (const std::string &filename) | |
Default constructor. | |
ReaderHEPEVT (std::istream &) | |
The ctor to read from stream. | |
ReaderHEPEVT (std::shared_ptr< std::istream > s_stream) | |
The ctor to read from temp stream. | |
virtual bool | read_hepevt_event_header () |
Find and read event header line from file. | |
virtual bool | read_hepevt_particle (int i) |
read particle from file | |
bool | skip (const int) override |
skip events | |
bool | read_event (GenEvent &evt) override |
Read event from file. | |
void | close () override |
Close file stream. | |
bool | failed () override |
Get stream error state. | |
virtual std::shared_ptr< GenRunInfo > | run_info () const |
Get the global GenRunInfo object. | |
virtual void | set_options (const std::map< std::string, std::string > &options) |
Set options. | |
virtual std::map< std::string, std::string > | get_options () const |
Get options. | |
virtual void | set_run_info (std::shared_ptr< GenRunInfo > run) |
Set the global GenRunInfo object. | |
Data Fields | |
char * | hepevtbuffer = nullptr |
Pointer to HEPEVT Fortran common block/C struct. | |
Protected Attributes | |
std::map< std::string, std::string > | m_options |
Options. | |
Private Attributes | |
std::ifstream | m_file |
Input file. | |
std::shared_ptr< std::istream > | m_shared_stream = nullptr |
For ctor when reading from temp stream. | |
std::istream * | m_stream = nullptr |
For ctor when reading from stream. | |
bool | m_isstream |
toggles usage of m_file or m_stream | |
HEPEVT_Wrapper_Template< 100000 > | m_hepevt_interface |
Templated HEPEVT interface. | |
std::shared_ptr< GenRunInfo > | m_run_info |
The global GenRunInfo object. | |
ReaderHEPEVT | ( | const std::string & | filename | ) |
Default constructor.
Definition at line 18 of file ReaderHEPEVT.cc.
References m_file, and m_isstream.
ReaderHEPEVT | ( | std::istream & | stream | ) |
The ctor to read from stream.
Definition at line 32 of file ReaderHEPEVT.cc.
References m_isstream, and m_stream.
ReaderHEPEVT | ( | std::shared_ptr< std::istream > | s_stream | ) |
The ctor to read from temp stream.
Definition at line 45 of file ReaderHEPEVT.cc.
References m_isstream, m_shared_stream, and m_stream.
|
overridevirtual |
Close file stream.
Implements Reader.
Definition at line 183 of file ReaderHEPEVT.cc.
References m_file.
|
overridevirtual |
Get stream error state.
Implements Reader.
Definition at line 189 of file ReaderHEPEVT.cc.
References m_file, m_isstream, and m_stream.
|
inlinevirtualinherited |
Get options.
Reimplemented in ReaderPlugin.
Definition at line 53 of file Reader.h.
References m_options.
|
overridevirtual |
Read event from file.
Implements Reader.
Definition at line 157 of file ReaderHEPEVT.cc.
References GenEvent::clear(), m_file, m_hepevt_interface, m_isstream, m_stream, read_hepevt_event_header(), read_hepevt_particle(), GenEvent::set_run_info(), and GenEvent::weights().
|
virtual |
Find and read event header line from file.
Definition at line 76 of file ReaderHEPEVT.cc.
References m_file, m_hepevt_interface, m_isstream, and m_stream.
|
virtual |
read particle from file
[in] | i | Particle id |
Definition at line 106 of file ReaderHEPEVT.cc.
References HEPMC3_ERROR_LEVEL, m_file, m_hepevt_interface, m_isstream, Reader::m_options, and m_stream.
|
inlinevirtualinherited |
Get the global GenRunInfo object.
Reimplemented in ReaderGZ< T >, and ReaderPlugin.
Definition at line 44 of file Reader.h.
References m_run_info.
|
inlinevirtualinherited |
Set options.
Reimplemented in ReaderPlugin.
Definition at line 51 of file Reader.h.
References m_options.
|
inlinevirtualinherited |
Set the global GenRunInfo object.
Reimplemented in ReaderGZ< T >, and ReaderPlugin.
Definition at line 56 of file Reader.h.
References m_run_info.
|
overridevirtual |
skip events
Reimplemented from Reader.
Definition at line 59 of file ReaderHEPEVT.cc.
References failed(), m_file, m_isstream, and m_stream.
char* hepevtbuffer = nullptr |
Pointer to HEPEVT Fortran common block/C struct.
Definition at line 72 of file ReaderHEPEVT.h.
|
private |
Input file.
Definition at line 74 of file ReaderHEPEVT.h.
|
private |
Templated HEPEVT interface.
Definition at line 78 of file ReaderHEPEVT.h.
|
private |
toggles usage of m_file or m_stream
Definition at line 77 of file ReaderHEPEVT.h.
|
protectedinherited |
|
privateinherited |
The global GenRunInfo object.
|
private |
For ctor when reading from temp stream.
Definition at line 75 of file ReaderHEPEVT.h.
|
private |
For ctor when reading from stream.
Definition at line 76 of file ReaderHEPEVT.h.