HepMC3 event record library
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes | Private Attributes
ReaderHEPEVT Class Reference

Detailed Description

GenEvent I/O parsing and serialization for HEPEVT files.

Definition at line 32 of file ReaderHEPEVT.h.

#include <ReaderHEPEVT.h>

+ Inheritance diagram for ReaderHEPEVT:
+ Collaboration diagram for ReaderHEPEVT:

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.
 
std::shared_ptr< GenRunInforun_info () const
 Get the global GenRunInfo object.
 
void set_options (const std::map< std::string, std::string > &options)
 Set options.
 
std::map< std::string, std::string > get_options () const
 Set options.
 

Data Fields

char * hepevtbuffer
 Pointer to HEPEVT Fortran common block/C struct.
 

Protected Member Functions

void set_run_info (std::shared_ptr< GenRunInfo > run)
 Set the global GenRunInfo object.
 

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
 For ctor when reading from temp stream.
 
std::istream * m_stream
 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< GenRunInfom_run_info
 The global GenRunInfo object.
 

Constructor & Destructor Documentation

◆ ReaderHEPEVT() [1/3]

ReaderHEPEVT ( const std::string &  filename)

◆ ReaderHEPEVT() [2/3]

ReaderHEPEVT ( std::istream &  stream)

◆ ReaderHEPEVT() [3/3]

ReaderHEPEVT ( std::shared_ptr< std::istream >  s_stream)

Member Function Documentation

◆ close()

void close ( )
overridevirtual

Close file stream.

Implements Reader.

Definition at line 177 of file ReaderHEPEVT.cc.

References ReaderHEPEVT::m_file.

◆ failed()

bool failed ( )
overridevirtual

Get stream error state.

Implements Reader.

Definition at line 183 of file ReaderHEPEVT.cc.

References ReaderHEPEVT::m_file, ReaderHEPEVT::m_isstream, and ReaderHEPEVT::m_stream.

◆ get_options()

std::map< std::string, std::string > get_options ( ) const
inlineinherited

Set options.

Definition at line 58 of file Reader.h.

References Reader::m_options.

◆ read_event()

bool read_event ( GenEvent evt)
overridevirtual

◆ read_hepevt_event_header()

bool read_hepevt_event_header ( )
virtual

◆ read_hepevt_particle()

bool read_hepevt_particle ( int  i)
virtual

◆ run_info()

std::shared_ptr< GenRunInfo > run_info ( ) const
inlineinherited

Get the global GenRunInfo object.

Examples
LHEF_example_cat.cc.

Definition at line 44 of file Reader.h.

References Reader::m_run_info.

◆ set_options()

void set_options ( const std::map< std::string, std::string > &  options)
inlineinherited

Set options.

Definition at line 53 of file Reader.h.

References Reader::m_options.

◆ set_run_info()

void set_run_info ( std::shared_ptr< GenRunInfo run)
inlineprotectedinherited

Set the global GenRunInfo object.

Definition at line 64 of file Reader.h.

References Reader::m_run_info.

◆ skip()

bool skip ( const int  n)
overridevirtual

skip events

Reimplemented from Reader.

Definition at line 58 of file ReaderHEPEVT.cc.

References ReaderHEPEVT::failed(), ReaderHEPEVT::m_file, ReaderHEPEVT::m_isstream, and ReaderHEPEVT::m_stream.

Field Documentation

◆ hepevtbuffer

char* hepevtbuffer

Pointer to HEPEVT Fortran common block/C struct.

Definition at line 72 of file ReaderHEPEVT.h.

◆ m_file

std::ifstream m_file
private

Input file.

Definition at line 74 of file ReaderHEPEVT.h.

◆ m_hepevt_interface

HEPEVT_Wrapper_Template<100000> m_hepevt_interface
private

Templated HEPEVT interface.

Definition at line 78 of file ReaderHEPEVT.h.

◆ m_isstream

bool m_isstream
private

toggles usage of m_file or m_stream

Definition at line 77 of file ReaderHEPEVT.h.

◆ m_options

std::map<std::string, std::string> m_options
protectedinherited

options

Definition at line 68 of file Reader.h.

◆ m_run_info

std::shared_ptr<GenRunInfo> m_run_info
privateinherited

The global GenRunInfo object.

Definition at line 71 of file Reader.h.

◆ m_shared_stream

std::shared_ptr<std::istream> m_shared_stream
private

For ctor when reading from temp stream.

Definition at line 75 of file ReaderHEPEVT.h.

◆ m_stream

std::istream* m_stream
private

For ctor when reading from stream.

Definition at line 76 of file ReaderHEPEVT.h.


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