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 | init () |
bool | openeventfile (int ifile) |
void | writeinit () |
void | writeEvent () |
Data Fields | |
std::ostringstream | headerStream |
HEPRUP | heprup |
std::ostringstream | initStream |
HEPEUP | hepeup |
std::ostringstream | eventStream |
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 &) |
|
inline |
|
inline |
|
inline |
|
private |
The default constructor should never be used.
|
inline |
Add comment lines to the next event to be written out with this stream.
|
inline |
Add header lines consisting of XML code with this stream.
|
inline |
|
inline |
|
inline |
Open a new event file, possibly closing a previous opened one.
Definition at line 3185 of file LHEF.h.
References EventFile::filename, and EventFile::neve.
|
inline |
Write the current HEPEUP object to the stream;
|
inline |
|
protected |
|
protected |
|
protected |
|
protected |
std::ostringstream eventStream |
|
protected |
std::ostringstream headerStream |
HEPEUP hepeup |
The standard information about the event we will write next.
HEPRUP heprup |
The standard init information.
|
protected |
std::ostringstream initStream |
|
protected |
|
protected |