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 |
Create a Writer object giving a stream to write to.
os | the stream where the event file is written. |
Definition at line 3133 of file LHEF.h.
References curreventfile, currfileevent, dirpath, file, initfile, and lastevent.
|
inline |
Create a Writer object giving a filename to write to.
filename | the name of the event file to be written. |
Definition at line 3141 of file LHEF.h.
References curreventfile, currfileevent, dirpath, file, initfile, intstream, and lastevent.
|
inline |
The destructor writes out the final XML end-tag.
Definition at line 3151 of file LHEF.h.
References curreventfile, currfileevent, file, heprup, initfile, and 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 3180 of file LHEF.h.
References eventStream.
|
inline |
Add comment lines to the next event to be written out with this stream.
Definition at line 3200 of file LHEF.h.
References eventStream.
|
inline |
Add header lines consisting of XML code with this stream.
Definition at line 3166 of file LHEF.h.
References headerStream.
|
inline |
Add header lines consisting of XML code with this stream.
Definition at line 3186 of file LHEF.h.
References headerStream.
|
inline |
Initialize the writer.
Definition at line 3207 of file LHEF.h.
References curreventfile, currfileevent, heprup, lastevent, openeventfile(), and writeinit().
|
inline |
Add comment lines to the init block with this stream.
Definition at line 3173 of file LHEF.h.
References initStream.
|
inline |
Add comment lines to the init block with this stream.
Definition at line 3193 of file LHEF.h.
References initStream.
|
inline |
Open a new event file, possibly closing a previous opened one.
Definition at line 3217 of file LHEF.h.
References curreventfile, currfileevent, dirpath, efile, file, EventFile::filename, heprup, and EventFile::neve.
|
inline |
Write the current HEPEUP object to the stream;
Definition at line 3277 of file LHEF.h.
References curreventfile, currfileevent, file, hepeup, heprup, lastevent, and openeventfile().
|
inline |
Write out an optional header block followed by the standard init block information together with any comment lines.
Definition at line 3246 of file LHEF.h.
References file, headerStream, and heprup.
|
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 |