PYTHIA  8.303
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Reader Class Reference

#include <LHEF3.h>

Public Member Functions

 Reader (string filenameIn)
 
 Reader (istream *is)
 
 ~Reader ()
 Clean up.
 
bool setup (string filenameIn)
 
bool readEvent (HEPEUP *peup=0)
 
void clearEvent ()
 Reset values of all event-related members to their defaults.
 
vector< double > weights_detailed_vector ()
 
vector< string > weightnames_detailed_vector ()
 

Public Attributes

bool isGood
 Save if the initialisation worked.
 
int version
 XML file version.
 
string outsideBlock
 
string headerBlock
 All lines from the header block.
 
string headerComments
 
HEPRUP heprup
 The standard init information.
 
string initComments
 Additional comments found in the init block.
 
HEPEUP hepeup
 The standard information about the last read event.
 
string eventComments
 Additional comments found with the last read event.
 
vector< double > weights_detailed_vec
 The detailed weights associated with this event, linearized to a vector.
 
vector< string > weightnames_detailed_vec
 

Protected Member Functions

bool getLine ()
 Used internally to read a single line from the stream. More...
 

Protected Attributes

string filename
 Name of file-to-be-read.
 
igzstream * intstream
 
istream * file
 
string currentLine
 The last line read in from the stream in getline().
 

Detailed Description

The Reader class is initialized with a stream from which to read a version 1/3 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:

Constructor & Destructor Documentation

Reader ( string  filenameIn)
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.

Member Function Documentation

bool getLine ( )
inlineprotected

Used internally to read a single line from the stream.

Replace single by double quotes

bool readEvent ( HEPEUP peup = 0)

Read an event from the file and store it in the hepeup object. Optional comment lines are stored in the eventComments member variable.

Read an event from the file and store it in the hepeup object. Optional comment lines are stored in the eventComments member variable. return true if the read was successful.

Check if the initialization was successful. Otherwise we will not read any events.

Keep reading lines until we hit the next event or the end of the event block. Save any inbetween lines. Exit if we didn't find an event.

Get event attributes.

We found an event. The first line determines how many subsequent particle lines we have.

Read all particle lines.

Now read any additional comments.

Scan the init block for XML tags

bool setup ( string  filenameIn)
inline

(Re)initialize the Reader with a filename from which to read an event file. After this, all information from the header and init block is available.

filename: File name (not used as the input file stream is given) isIn : Name of the input file stream.

Member Data Documentation

istream* file
protected

The stream we are reading from. This may be a pointer to an external stream or the internal intstream.

igzstream* intstream
protected

A local stream which is unused if a stream is supplied from the outside.

string outsideBlock

All lines (since the last readEvent()) outside the header, init and event tags.


The documentation for this class was generated from the following files: