herwig is hosted by Hepforge, IPPP Durham
Herwig++  2.7.0
Herwig::BasicLesHouchesFileReader Class Reference

BasicLesHouchesFileReader derives from the LesHouchesReader base class to be used for objects which read event files from matrix element generators. More...

#include <BasicLesHouchesFileReader.h>

Inheritance diagram for Herwig::BasicLesHouchesFileReader:

List of all members.

Public Member Functions

string filename () const
 Return the name of the file from where to read events.
Standard constructors and destructors.
 BasicLesHouchesFileReader ()
 Default constructor.
 BasicLesHouchesFileReader (const BasicLesHouchesFileReader &)
 Copy-constructor.
virtual ~BasicLesHouchesFileReader ()
 Destructor.
Virtual functions specified by the LesHouchesReader base class.
virtual void initialize (LesHouchesEventHandler &eh)
 Initialize.
virtual double getEvent ()
 Calls readEvent() or uncacheEvent() to read information into the LesHouches common block variables.
virtual bool readEvent ()
 Calls doReadEvent() and performs pre-defined reweightings.
virtual void skip (long n)
 Skip n events.
virtual long scan ()
 Scan the file or stream to obtain information about cross section weights and particles etc.
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.

Standard (and non-standard) Interfaced functions.

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.
string theFileName
 The name of the file from where to read events.
bool overSampling_
 Determines whether events in the LH file are or are not read more than once in order to generate the requested number of events.
static ClassDescription
< BasicLesHouchesFileReader
initBasicLesHouchesFileReader
 Describe an abstract base class with persistent data.
virtual void doinit ()
 Initialize this object after the setup phase before saving an EventGenerator to disk.
virtual bool preInitialize () const
 Return true if this object needs to be initialized before all other objects because it needs to extract PDFs from the event file.
BasicLesHouchesFileReaderoperator= (const BasicLesHouchesFileReader &)
 Private and non-existent assignment operator.

Detailed Description

BasicLesHouchesFileReader derives from the LesHouchesReader base class to be used for objects which read event files from matrix element generators.

It extends LesHouchesReader 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.

See also:
The interfaces defined for BasicLesHouchesFileReader.
LesHouchesReader
BasicLesHouchesFileReader

Definition at line 44 of file BasicLesHouchesFileReader.h.


Constructor & Destructor Documentation

Copy-constructor.

Note that a file which is opened in the object copied from will have to be reopened in this.


Member Function Documentation

virtual IBPtr Herwig::BasicLesHouchesFileReader::clone ( ) const [protected, virtual]

Make a simple clone of this object.

Returns:
a pointer to the new object.

Implements ThePEG::InterfacedBase.

virtual void Herwig::BasicLesHouchesFileReader::doinit ( ) [protected, virtual]

Initialize this object after the setup phase before saving an EventGenerator to disk.

Exceptions:
InitExceptionif object could not be initialized properly.

Reimplemented from ThePEG::LesHouchesReader.

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.

virtual IBPtr Herwig::BasicLesHouchesFileReader::fullclone ( ) const [protected, virtual]

Make a clone of this object, possibly modifying the cloned object to make it sane.

Returns:
a pointer to the new object.

Reimplemented from ThePEG::InterfacedBase.

virtual double Herwig::BasicLesHouchesFileReader::getEvent ( ) [virtual]

Calls readEvent() or uncacheEvent() to read information into the LesHouches common block variables.

This function is called by the LesHouchesEventHandler if this reader has been selectod to produce an event.

Returns:
the weight asociated with this event. If negative weights are allowed it should be between -1 and 1, otherwise between 0 and 1. If outside these limits the previously estimated maximum is violated. Note that the estimated maximum then should be updated from the outside.

Reimplemented from ThePEG::LesHouchesReader.

Initialize.

This function is called by the LesHouchesEventHandler to which this object is assigned.

Reimplemented from ThePEG::LesHouchesReader.

virtual void Herwig::BasicLesHouchesFileReader::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.

Function used to read in object persistently.

Parameters:
isthe persistent input stream read from.
versionthe version number of the object when written.

Reimplemented from ThePEG::LesHouchesReader.

Function used to write out object persistently.

Parameters:
osthe persistent output stream written to.

Reimplemented from ThePEG::LesHouchesReader.

Calls doReadEvent() and performs pre-defined reweightings.

A sub-class overrides this function it must make sure that the corresponding reweightings are done.

Reimplemented from ThePEG::LesHouchesReader.

virtual long Herwig::BasicLesHouchesFileReader::scan ( ) [virtual]

Scan the file or stream to obtain information about cross section weights and particles etc.

This function should fill the variables corresponding to the /HEPRUP/ common block. The function returns the number of events scanned.

Reimplemented from ThePEG::LesHouchesReader.

virtual void Herwig::BasicLesHouchesFileReader::skip ( long  n) [virtual]

Skip n events.

Used by LesHouchesEventHandler to make sure that a file is scanned an even number of times in case the events are not ramdomly distributed in the file.

Reimplemented from ThePEG::LesHouchesReader.


Member Data Documentation

If LHF.

Map of attributes (name-value pairs) found in the last event tag.

Definition at line 251 of file BasicLesHouchesFileReader.h.

If LHF.

Additional comments found with the last read event.

Definition at line 245 of file BasicLesHouchesFileReader.h.

If LHF.

All lines from the header block.

Definition at line 229 of file BasicLesHouchesFileReader.h.

map<string,string> Herwig::BasicLesHouchesFileReader::initAttributes [protected]

If LHF.

Map of attributes (name-value pairs) found in the init tag.

Definition at line 240 of file BasicLesHouchesFileReader.h.

If LHF.

Additional comments found in the init block.

Definition at line 234 of file BasicLesHouchesFileReader.h.

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 218 of file BasicLesHouchesFileReader.h.

If LHF.

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

Definition at line 224 of file BasicLesHouchesFileReader.h.


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