HepMC3 event record library
|
#include <LHEF.h>
Public Member Functions | |
Reader (std::istream &is) | |
Reader (std::string filename) | |
bool | readEvent () |
void | openeventfile (int ifile) |
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 &) |
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:
|
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 Reader::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 Reader::dirpath, and Reader::init().
|
private |
The default constructor should never be used.
|
inlineprotected |
Definition at line 2957 of file LHEF.h.
References Reader::currentLine.
|
inlineprotected |
Used internally to read a single line from the stream.
Definition at line 2950 of file LHEF.h.
References Reader::currentLine, and Reader::file.
|
inlineprivate |
Used internally in the constructors to read header and init blocks.
Definition at line 2787 of file LHEF.h.
References Reader::currentFind(), Reader::currentLine, XMLTag::deleteAll(), HEPRUP::eventfiles, Reader::file, XMLTag::findXMLTags(), Reader::getline(), Reader::headerBlock, Reader::heprup, Reader::initComments, Reader::initfile, Reader::openeventfile(), Reader::outsideBlock, and Reader::version.
|
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 2932 of file LHEF.h.
References Reader::curreventfile, Reader::currfileevent, Reader::dirpath, Reader::efile, HEPRUP::eventfiles, Reader::file, and Reader::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 Reader::currentFind(), Reader::currentLine, Reader::currevent, Reader::curreventfile, Reader::currfileevent, XMLTag::deleteAll(), HEPRUP::eventfiles, XMLTag::findXMLTags(), Reader::getline(), Reader::hepeup, Reader::heprup, HEPRUP::NPRUP, Reader::openeventfile(), and Reader::outsideBlock.
|
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 |
The standard init information.
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.