HepMC3 event record library
|
The Reader class is initialized with a stream from which to read a version 1/2 Les Houches Accord event file. In the constructor of the Reader object the optional header information is read and then the mandatory init is read. After this the whole header block including the enclosing lines with tags are available in the public headerBlock member variable. Also the information from the init block is available in the heprup member variable and any additional comment lines are available in initComments. After each successful call to the readEvent() function the standard Les Houches Accord information about the event is available in the hepeup member variable and any additional comments in the eventComments variable. A typical reading sequence would look as follows:
#include <LHEF.h>
Public Member Functions | |
Reader (std::istream &is) | |
Reader (std::string filename) | |
bool | readEvent () |
void | openeventfile (int ifile) |
std::ios_base::iostate | initfile_rdstate () const |
std::ios_base::iostate | file_rdstate () const |
Data Fields | |
int | version |
std::string | outsideBlock |
std::string | headerBlock |
HEPRUP | heprup |
std::string | initComments |
HEPEUP | hepeup |
std::string | eventComments |
int | currevent |
int | curreventfile |
int | currfileevent |
std::string | dirpath |
Protected Member Functions | |
bool | getline () |
bool | currentFind (std::string str) const |
Protected Attributes | |
std::ifstream | intstream |
std::istream * | file |
std::istream * | initfile |
std::ifstream | efile |
std::string | currentLine |
Private Member Functions | |
void | init () |
Reader () | |
Reader (const Reader &) | |
Reader & | operator= (const Reader &) |
|
inline |
Initialize the Reader with a stream from which to read an event file. After the constructor is called the whole header block including the enclosing lines with tags are available in the public headerBlock member variable. Also the information from the init block is available in the heprup member variable and any additional comment lines are available in initComments.
is | the stream to read from. |
Definition at line 2756 of file LHEF.h.
References currevent, curreventfile, currfileevent, dirpath, file, and init().
|
inline |
Initialize the Reader with a filename from which to read an event file. After the constructor is called the whole header block including the enclosing lines with tags are available in the public headerBlock member variable. Also the information from the init block is available in the heprup member variable and any additional comment lines are available in initComments.
filename | the name of the file to read from. |
Definition at line 2772 of file LHEF.h.
References currevent, curreventfile, currfileevent, dirpath, file, init(), and intstream.
|
private |
The default constructor should never be used.
|
inlineprotected |
Definition at line 2958 of file LHEF.h.
References currentLine.
|
inline |
|
inlineprotected |
Used internally to read a single line from the stream.
Definition at line 2951 of file LHEF.h.
References currentLine, and file.
|
inlineprivate |
Used internally in the constructors to read header and init blocks.
Definition at line 2787 of file LHEF.h.
References currentFind(), currentLine, XMLTag::deleteAll(), file, XMLTag::findXMLTags(), getline(), headerBlock, heprup, initComments, initfile, openeventfile(), outsideBlock, and version.
|
inline |
|
inline |
Open the efentfile with index ifile. If another eventfile is being read, its remaining contents is discarded. This is a noop if current read session is not a multi-file run.
Definition at line 2933 of file LHEF.h.
References curreventfile, currfileevent, dirpath, efile, file, and heprup.
|
inline |
Read an event from the file and store it in the hepeup object. Optional comment lines are stored i the eventComments member variable.
Definition at line 2868 of file LHEF.h.
References currentFind(), currentLine, currevent, curreventfile, currfileevent, XMLTag::deleteAll(), XMLTag::findXMLTags(), getline(), hepeup, heprup, openeventfile(), outsideBlock, and readEvent().
|
protected |
int currevent |
int curreventfile |
int currfileevent |
std::string dirpath |
|
protected |
std::string eventComments |
|
protected |
std::string headerBlock |
All lines from the header block.
HEPEUP hepeup |
The standard information about the last read event.
HEPRUP heprup |
std::string initComments |
Additional comments found in the init block.
|
protected |
|
protected |
std::string outsideBlock |
All lines (since the last readEvent()) outside the header, init and event tags.