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

GenEvent I/O parsing and serialization for HEPEVT files. More...

#include <ReaderHEPEVT.h>

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

Public Member Functions

 ReaderHEPEVT (const std::string &filename)
 Default constructor. More...
 
 ReaderHEPEVT (std::istream &)
 The ctor to read from stdin. More...
 
virtual bool read_hepevt_event_header ()
 Find and read event header line from file. More...
 
virtual bool read_hepevt_particle (int i)
 read particle from file More...
 
bool skip (const int) override
 skip events More...
 
bool read_event (GenEvent &evt) override
 Read event from file. More...
 
void close () override
 Close file stream. More...
 
bool failed () override
 Get stream error state. More...
 
std::shared_ptr< GenRunInforun_info () const
 Get the global GenRunInfo object. More...
 
void set_options (const std::map< std::string, std::string > &options)
 Set options. More...
 
std::map< std::string,
std::string > 
get_options () const
 Set options. More...
 

Data Fields

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

Protected Member Functions

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

Protected Attributes

std::map< std::string,
std::string > 
m_options
 options More...
 

Private Attributes

std::ifstream m_file
 Input file. More...
 
std::istream * m_stream
 For ctor when reading from stdin. More...
 
bool m_isstream
 toggles usage of m_file or m_stream More...
 

Detailed Description

GenEvent I/O parsing and serialization for HEPEVT files.

Definition at line 32 of file ReaderHEPEVT.h.

Constructor & Destructor Documentation

ReaderHEPEVT ( const std::string &  filename)
ReaderHEPEVT ( std::istream &  stream)

Member Function Documentation

void close ( )
overridevirtual

Close file stream.

Implements Reader.

Definition at line 167 of file ReaderHEPEVT.cc.

References ReaderHEPEVT::hepevtbuffer, and ReaderHEPEVT::m_file.

bool failed ( )
overridevirtual

Get stream error state.

Implements Reader.

Definition at line 174 of file ReaderHEPEVT.cc.

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

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

Set options.

Definition at line 58 of file Reader.h.

References Reader::m_options.

bool read_event ( GenEvent evt)
overridevirtual
bool read_hepevt_event_header ( )
virtual
bool read_hepevt_particle ( int  i)
virtual
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.

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.

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.

bool skip ( const int  n)
overridevirtual

skip events

Reimplemented from Reader.

Definition at line 47 of file ReaderHEPEVT.cc.

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

Field Documentation

char* hepevtbuffer

Pointer to HEPEVT Fortran common block/C struct.

Definition at line 72 of file ReaderHEPEVT.h.

std::ifstream m_file
private

Input file.

Definition at line 74 of file ReaderHEPEVT.h.

bool m_isstream
private

toggles usage of m_file or m_stream

Definition at line 76 of file ReaderHEPEVT.h.

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

options

Definition at line 68 of file Reader.h.

std::istream* m_stream
private

For ctor when reading from stdin.

Definition at line 75 of file ReaderHEPEVT.h.


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