#include <LesHouchesFileReader.h>
Public Member Functions | |
string | filename () const |
Return the name of the file from where to read events. | |
FILE * | file () |
The file handle to read from. | |
Standard constructors and destructors. | |
LesHouchesFileReader () | |
Default constructor. | |
LesHouchesFileReader (const LesHouchesFileReader &) | |
Copy-constructor. | |
virtual | ~LesHouchesFileReader () |
Destructor. | |
Virtual functions specified by the LesHouchesReader base class. | |
virtual void | initialize (LesHouchesEventHandler &eh) |
Initialize. | |
virtual void | open () |
Open a file with events. | |
virtual void | close () |
Close the file from which events have been read. | |
virtual bool | doReadEvent () |
Read the next event from the file or stream into the corresponding protected variables. | |
Functions used by the persistent I/O system. | |
void | persistentOutput (PersistentOStream &os) const |
Function used to write out object persistently. | |
void | persistentInput (PersistentIStream &is, int version) |
Function used to read in object persistently. | |
Static Public Member Functions | |
static void | Init () |
Standard Init function used to initialize the interfaces. | |
Protected Member Functions | |
Clone Methods. | |
virtual IBPtr | clone () const |
Make a simple clone of this object. | |
virtual IBPtr | fullclone () const |
Make a clone of this object, possibly modifying the cloned object to make it sane. | |
Protected Attributes | |
CFileLineReader | cfile |
The wrapper around the C FILE stream from which to read. | |
long | neve |
The number of events in this file. | |
long | ieve |
The current event number. | |
string | LHFVersion |
If the file is a standard Les Houches formatted file (LHF) this is its version number. | |
string | outsideBlock |
If LHF. | |
string | headerBlock |
If LHF. | |
string | initComments |
If LHF. | |
map< string, string > | initAttributes |
If LHF. | |
string | eventComments |
If LHF. | |
map< string, string > | eventAttributes |
If LHF. | |
Private Member Functions | |
LesHouchesFileReader & | operator= (const LesHouchesFileReader &) |
Private and non-existent assignment operator. | |
Private Attributes | |
FILE * | theFile |
The file handle from which derived classes should read. | |
string | theFileName |
The name of the file from where to read events. | |
Static Private Attributes | |
static ClassDescription < LesHouchesFileReader > | initLesHouchesFileReader |
Describe an abstract base class with persistent data. |
It inherits from LesHouchesReader and extends it by defining a file handle to be read from, which is opened and closed by the open() and close() functions. Note that the file handle is a standard C filehandle and not a C++ stream. This is because there is no standard way in C++ to connect a pipe to a stream for reading eg. gzipped files. This class is able to read plain event files conforming to the Les Houches Event File accord.
Definition at line 36 of file LesHouchesFileReader.h.
ThePEG::LesHouchesFileReader::LesHouchesFileReader | ( | const LesHouchesFileReader & | ) |
Copy-constructor.
Note that a file which is opened in the object copied from will have to be reopened in this.
virtual void ThePEG::LesHouchesFileReader::initialize | ( | LesHouchesEventHandler & | eh | ) | [virtual] |
Initialize.
This function is called by the LesHouchesEventHandler to which this object is assigned.
Reimplemented from ThePEG::LesHouchesReader.
virtual void ThePEG::LesHouchesFileReader::open | ( | ) | [virtual] |
Open a file with events.
Derived classes should overwrite it and first calling it before reading in the run information into the corresponding protected variables.
Implements ThePEG::LesHouchesReader.
Reimplemented in ThePEG::MadGraphReader.
virtual bool ThePEG::LesHouchesFileReader::doReadEvent | ( | ) | [virtual] |
Read the next event from the file or stream into the corresponding protected variables.
Return false if there is no more events or if this was not a LHF event file.
Implements ThePEG::LesHouchesReader.
Reimplemented in ThePEG::MadGraphReader.
void ThePEG::LesHouchesFileReader::persistentOutput | ( | PersistentOStream & | os | ) | const |
Function used to write out object persistently.
os | the persistent output stream written to. |
Reimplemented from ThePEG::LesHouchesReader.
Reimplemented in ThePEG::MadGraphReader.
void ThePEG::LesHouchesFileReader::persistentInput | ( | PersistentIStream & | is, | |
int | version | |||
) |
Function used to read in object persistently.
is | the persistent input stream read from. | |
version | the version number of the object when written. |
Reimplemented from ThePEG::LesHouchesReader.
Reimplemented in ThePEG::MadGraphReader.
virtual IBPtr ThePEG::LesHouchesFileReader::clone | ( | ) | const [protected, virtual] |
Make a simple clone of this object.
Implements ThePEG::InterfacedBase.
Reimplemented in ThePEG::MadGraphReader.
virtual IBPtr ThePEG::LesHouchesFileReader::fullclone | ( | ) | const [protected, virtual] |
Make a clone of this object, possibly modifying the cloned object to make it sane.
Reimplemented from ThePEG::InterfacedBase.
Reimplemented in ThePEG::MadGraphReader.
string ThePEG::LesHouchesFileReader::LHFVersion [protected] |
If the file is a standard Les Houches formatted file (LHF) this is its version number.
If empty, this is not a Les Houches formatted file
Definition at line 163 of file LesHouchesFileReader.h.
string ThePEG::LesHouchesFileReader::outsideBlock [protected] |
If LHF.
All lines (since the last open() or readEvent()) outside the header, init and event tags.
Definition at line 169 of file LesHouchesFileReader.h.
string ThePEG::LesHouchesFileReader::headerBlock [protected] |
string ThePEG::LesHouchesFileReader::initComments [protected] |
If LHF.
Additional comments found in the init block.
Definition at line 179 of file LesHouchesFileReader.h.
map<string,string> ThePEG::LesHouchesFileReader::initAttributes [protected] |
If LHF.
Map of attributes (name-value pairs) found in the init tag.
Definition at line 185 of file LesHouchesFileReader.h.
string ThePEG::LesHouchesFileReader::eventComments [protected] |
If LHF.
Additional comments found with the last read event.
Definition at line 190 of file LesHouchesFileReader.h.
map<string,string> ThePEG::LesHouchesFileReader::eventAttributes [protected] |
If LHF.
Map of attributes (name-value pairs) found in the last event tag.
Definition at line 196 of file LesHouchesFileReader.h.