HepMC3 event record library
|
The Writer class is initialized with a stream to which to write a version 1.0 Les Houches Accord event file. In the constructor of the Writer object the main XML tag is written out, with the corresponding end tag is written in the destructor. After a Writer object has been created, it is possible to assign standard init information in the heprup member variable. In addition any XML formatted information can be added to the headerBlock member variable (directly or via the addHeader() function). Further comment line (beginning with a #
character) can be added to the initComments variable (directly or with the addInitComment() function). After this information is set, it should be written out to the file with the init() function.
Before each event is written out with the writeEvent() function, the standard event information can then be assigned to the hepeup variable and optional comment lines (beginning with a #
character) may be given to the eventComments variable (directly or with the addEventComment() function).
#include <LHEF.h>
Public Member Functions | |
Writer (std::ostream &os) | |
Writer (std::string filename) | |
~Writer () | |
std::ostream & | headerBlock () |
std::ostream & | initComments () |
std::ostream & | eventComments () |
void | headerBlock (const std::string &a) |
void | initComments (const std::string &a) |
void | eventComments (const std::string &a) |
void | init () |
bool | openeventfile (int ifile) |
void | writeinit () |
void | writeEvent () |
Data Fields | |
HEPRUP | heprup |
HEPEUP | hepeup |
Protected Attributes | |
std::ofstream | intstream |
std::ostream * | file |
std::ostream * | initfile |
std::ofstream | efile |
int | lastevent |
int | curreventfile |
int | currfileevent |
std::string | dirpath |
Private Member Functions | |
Writer () | |
Writer (const Writer &) | |
Writer & | operator= (const Writer &) |
Private Attributes | |
std::ostringstream | headerStream |
std::ostringstream | initStream |
std::ostringstream | eventStream |
|
inline |
|
inline |
Create a Writer object giving a filename to write to.
filename | the name of the event file to be written. |
Definition at line 3106 of file LHEF.h.
References Writer::dirpath.
|
inline |
The destructor writes out the final XML end-tag.
Definition at line 3116 of file LHEF.h.
References Writer::curreventfile, Writer::currfileevent, HEPRUP::eventfiles, Writer::file, Writer::heprup, Writer::initfile, and Writer::writeinit().
|
private |
The default constructor should never be used.
|
inline |
Add comment lines to the next event to be written out with this stream.
Definition at line 3144 of file LHEF.h.
References Writer::eventStream.
|
inline |
Add comment lines to the next event to be written out with this stream.
Definition at line 3164 of file LHEF.h.
References Writer::eventStream.
|
inline |
Add header lines consisting of XML code with this stream.
Definition at line 3130 of file LHEF.h.
References Writer::headerStream.
|
inline |
Add header lines consisting of XML code with this stream.
Definition at line 3150 of file LHEF.h.
References Writer::headerStream.
|
inline |
Initialize the writer.
Definition at line 3171 of file LHEF.h.
References Writer::curreventfile, Writer::currfileevent, HEPRUP::eventfiles, Writer::heprup, Writer::lastevent, Writer::openeventfile(), and Writer::writeinit().
|
inline |
Add comment lines to the init block with this stream.
Definition at line 3137 of file LHEF.h.
References Writer::initStream.
|
inline |
Add comment lines to the init block with this stream.
Definition at line 3157 of file LHEF.h.
References Writer::initStream.
|
inline |
Open a new event file, possibly closing a previous opened one.
Definition at line 3181 of file LHEF.h.
References Writer::curreventfile, Writer::currfileevent, Writer::dirpath, Writer::efile, HEPRUP::eventfiles, Writer::file, EventFile::filename, Writer::heprup, and EventFile::neve.
|
inline |
Write the current HEPEUP object to the stream;
Definition at line 3241 of file LHEF.h.
References Writer::curreventfile, Writer::currfileevent, HEPRUP::eventfiles, Writer::file, Writer::hepeup, Writer::heprup, Writer::lastevent, Writer::openeventfile(), and HEPEUP::print().
|
inline |
Write out an optional header block followed by the standard init block information together with any comment lines.
Definition at line 3210 of file LHEF.h.
References Writer::file, Writer::headerStream, Writer::heprup, HEPRUP::print(), and HEPRUP::version.
|
protected |
|
protected |
|
protected |
|
protected |
|
private |
|
protected |
|
private |
HEPEUP hepeup |
The standard information about the event we will write next.
HEPRUP heprup |
|
protected |
|
private |
|
protected |
|
protected |