Herwig 7 is hosted by Hepforge, IPPP Durham
Herwig  7.1.4
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:

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. More...
 
virtual ~BasicLesHouchesFileReader ()
 Destructor.
 
Virtual functions specified by the LesHouchesReader base class.
virtual void initialize (LesHouchesEventHandler &eh)
 Initialize. More...
 
virtual double getEvent ()
 Calls readEvent() or uncacheEvent() to read information into the LesHouches common block variables. More...
 
virtual bool readEvent ()
 Calls doReadEvent() and performs pre-defined reweightings. More...
 
virtual void skip (long n)
 Skip n events. More...
 
virtual long scan ()
 Scan the file or stream to obtain information about cross section weights and particles etc. More...
 
virtual void open ()
 Open a file with events. More...
 
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. More...
 
Functions used by the persistent I/O system.
void persistentOutput (PersistentOStream &os) const
 Function used to write out object persistently. More...
 
void persistentInput (PersistentIStream &is, int version)
 Function used to read in object persistently. More...
 
- Public Member Functions inherited from ThePEG::LesHouchesReader
 LesHouchesReader (bool active=false)
 
 LesHouchesReader (const LesHouchesReader &)
 
tXCombPtr getXComb ()
 
tSubProPtr getSubProcess ()
 
virtual void initStat ()
 
double reweight ()
 
virtual void fillEvent ()
 
void reset ()
 
virtual void setWeightScale (long neve)
 
long NEvents () const
 
long currentPosition () const
 
long maxScan () const
 
bool active () const
 
bool negativeWeights () const
 
const XSecStatxSecStats () const
 
const StatMapprocessStats () const
 
void select (double weight)
 
void accept ()
 
void reject (double w)
 
virtual void increaseMaxXSec (CrossSection maxxsec)
 
tPExtrPtr partonExtractor () const
 
tCascHdlPtr CKKWHandler () const
 
const PartonPairVec & partonBins () const
 
const XCombMapxCombs () const
 
const Cutscuts () const
 
void persistentOutput (PersistentOStream &os) const
 
void persistentInput (PersistentIStream &is, int version)
 
 LesHouchesReader (bool active=false)
 
 LesHouchesReader (const LesHouchesReader &)
 
virtual vector< string > optWeightsNamesFunc ()=0
 
tXCombPtr getXComb ()
 
tSubProPtr getSubProcess ()
 
virtual void initStat ()
 
double reweight ()
 
virtual void fillEvent ()
 
void reset ()
 
virtual void setWeightScale (long neve)
 
double eventWeight () const
 
const map< string, double > & optionalEventWeights () const
 
const int & optionalEventnpLO () const
 
const PBIPairpartonBinInstances () const
 
const PPairbeams () const
 
const PPairincoming () const
 
const PVectoroutgoing () const
 
const PVectorintermediates () const
 
int maxMultCKKW () const
 
int minMultCKKW () const
 
long NEvents () const
 
long currentPosition () const
 
long maxScan () const
 
bool active () const
 
bool negativeWeights () const
 
const XSecStatxSecStats () const
 
const StatMapprocessStats () const
 
void select (double weight)
 
void accept ()
 
void reject (double w)
 
virtual void increaseMaxXSec (CrossSection maxxsec)
 
tPExtrPtr partonExtractor () const
 
tCascHdlPtr CKKWHandler () const
 
const PartonPairVec & partonBins () const
 
const XCombMapxCombs () const
 
const Cutscuts () const
 
void persistentOutput (PersistentOStream &os) const
 
void persistentInput (PersistentIStream &is, int version)
 
- Public Member Functions inherited from HandlerBaseT< UseRandom >
double rnd () const
 
double rnd (double xu) const
 
double rnd (double xl, double xu) const
 
bool rndbool () const
 
bool rndbool (double p) const
 
bool rndbool (double p1, double p2) const
 
int rndsign (double p1, double p2, double p3) const
 
int rnd2 (double p0, double p1) const
 
int rnd3 (double p0, double p1, double p2) const
 
int rnd4 (double p0, double p1, double p2, double p3) const
 
long irnd (long xu=2) const
 
long irnd (long xl, long xu) const
 
const StandardModelBase & SM () const
 
tSMPtr standardModel () const
 
- Public Member Functions inherited from ThePEG::Interfaced
virtual bool defaultInit ()
 
PPtr getParticle (PID) const
 
PDPtr getParticleData (PID) const
 
bool used () const
 
void useMe () const
 
tEGPtr generator () const
 
void persistentOutput (PersistentOStream &os) const
 
void persistentInput (PersistentIStream &is, int version)
 
PPtr getParticle (PID) const
 
PDPtr getParticleData (PID) const
 
bool used () const
 
void useMe () const
 
tEGPtr generator () const
 
void persistentOutput (PersistentOStream &os) const
 
void persistentInput (PersistentIStream &is, int version)
 
- Public Member Functions inherited from ThePEG::InterfacedBase
string fullName () const
 
string name () const
 
string path () const
 
string comment () const
 
void setup (istream &is)
 
virtual void debugme () const
 
void update ()
 
void init ()
 
void initrun ()
 
void finish ()
 
void touch ()
 
void reset ()
 
void clear ()
 
InitState state () const
 
bool locked () const
 
bool touched () const
 
void persistentOutput (PersistentOStream &os) const
 
void persistentInput (PersistentIStream &is, int version)
 
void update ()
 
void init ()
 
void initrun ()
 
void finish ()
 
void touch ()
 
void reset ()
 
void clear ()
 
InitState state () const
 
bool locked () const
 
bool touched () const
 
void persistentOutput (PersistentOStream &os) const
 
void persistentInput (PersistentIStream &is, int version)
 
- Public Member Functions inherited from ThePEG::Base
void debug () const
 
- Public Member Functions inherited from ThePEG::Pointer::ReferenceCounted
CounterType referenceCount () const
 
- Public Member Functions inherited from ThePEG::Named
 Named (const string &newName=string())
 
const string & name () const
 
bool operator== (const Named &other) const
 
bool operator< (const Named &other) const
 
- Public Member Functions inherited from LastXCombInfo<>
const XComb & lastXComb () const
 
tXCPtr lastXCombPtr () const
 
const XComb & lastHeadXComb () const
 
tXCPtr lastHeadXCombPtr () const
 
const EventHandlerlastEventHandler () const
 
tPExtrPtr lastExtractor () const
 
PDFT pdf (tcPPtr parton) const
 
const CutslastCuts () const
 
tCutsPtr lastCutsPtr () const
 
const PPairlastParticles () const
 
Energy2 lastS () const
 
const PPairlastPartons () const
 
Energy2 lastSHat () const
 
double lastTau () const
 
double lastY () const
 
double lastP1 () const
 
double lastP2 () const
 
double lastL1 () const
 
double lastL2 () const
 
double lastX1 () const
 
double lastX2 () const
 
double lastE1 () const
 
double lastE2 () const
 
double lastFL1L2 () const
 
Energy2 lastScale () const
 
double lastAlphaS () const
 
double lastAlphaEM () const
 
const vector< Lorentz5Momentum > & meMomenta () const
 
double lastME2 () const
 
double lastPreweight () const
 
double jacobian () const
 
CrossSection lastMECrossSection () const
 
double lastMEPDFWeight () const
 
double lastMECouplings () const
 
tSubProPtr subProcess () const
 
const cPDVectormePartonData () const
 
const XComb & lastXComb () const
 
tXCPtr lastXCombPtr () const
 
const XComb & lastHeadXComb () const
 
tXCPtr lastHeadXCombPtr () const
 
const EventHandlerlastEventHandler () const
 
tPExtrPtr lastExtractor () const
 
PDFT pdf (tcPPtr parton) const
 
const CutslastCuts () const
 
tCutsPtr lastCutsPtr () const
 
const PPairlastParticles () const
 
Energy2 lastS () const
 
const PPairlastPartons () const
 
Energy2 lastSHat () const
 
double lastTau () const
 
double lastY () const
 
double lastP1 () const
 
double lastP2 () const
 
double lastL1 () const
 
double lastL2 () const
 
double lastX1 () const
 
double lastX2 () const
 
double lastE1 () const
 
double lastE2 () const
 
double lastFL1L2 () const
 
Energy2 lastScale () const
 
double lastAlphaS () const
 
double lastAlphaEM () const
 
const vector< Lorentz5Momentum > & meMomenta () const
 
double lastME2 () const
 
double lastPreweight () const
 
double jacobian () const
 
CrossSection lastMECrossSection () const
 
double lastMEPDFWeight () const
 
double lastMECouplings () const
 
tSubProPtr subProcess () const
 
const cPDVectormePartonData () const
 

Static Public Member Functions

static void Init ()
 Standard Init function used to initialize the interfaces.
 
- Static Public Member Functions inherited from ThePEG::LesHouchesReader
static void Init ()
 
static size_t eventSize (int N)
 
- Static Public Member Functions inherited from ThePEG::HandlerBase
static void Init ()
 
- Static Public Member Functions inherited from ThePEG::Interfaced
static void Init ()
 
- Static Public Member Functions inherited from ThePEG::InterfacedBase
static void Init ()
 
- Static Public Member Functions inherited from ThePEG::Base
static void Init ()
 

Protected Member Functions

Clone Methods.
virtual IBPtr clone () const
 Make a simple clone of this object. More...
 
virtual IBPtr fullclone () const
 Make a clone of this object, possibly modifying the cloned object to make it sane. More...
 
- Protected Member Functions inherited from ThePEG::LesHouchesReader
virtual bool checkPartonBin ()
 
virtual void createParticles ()
 
virtual tcPBPair createPartonBinInstances ()
 
virtual void createBeams ()
 
virtual void connectMothers ()
 
void NEvents (long x)
 
XCombMapxCombs ()
 
virtual void doinitrun ()
 
virtual void dofinish ()
 
virtual void initPDFs ()
 
string cacheFileName () const
 
bool cutEarly () const
 
CFile cacheFile () const
 
void openReadCacheFile ()
 
void openWriteCacheFile ()
 
void closeCacheFile ()
 
void cacheEvent () const
 
bool uncacheEvent ()
 
void reopen ()
 
virtual bool checkPartonBin ()
 
virtual void createParticles ()
 
virtual tcPBPair createPartonBinInstances ()
 
virtual void createBeams ()
 
virtual void connectMothers ()
 
void NEvents (long x)
 
XCombMapxCombs ()
 
virtual void doinitrun ()
 
virtual void dofinish ()
 
virtual void initPDFs ()
 
- Protected Member Functions inherited from ThePEG::Interfaced
void reporeg (IBPtr object, string name) const
 
bool setDefaultReference (PtrT &ptr, string classname, string objectname)
 
 Interfaced (const string &newName)
 
 Interfaced (const Interfaced &i)
 
void setGenerator (tEGPtr generator)
 
- Protected Member Functions inherited from ThePEG::InterfacedBase
 InterfacedBase (string newName)
 
 InterfacedBase (const InterfacedBase &i)
 
virtual void readSetup (istream &is)
 
virtual void doupdate ()
 
virtual IVector getReferences ()
 
virtual void rebind (const TranslationMap &)
 
virtual void readSetup (istream &is)
 
virtual void doupdate ()
 
virtual IVector getReferences ()
 
virtual void rebind (const TranslationMap &)
 
- Protected Member Functions inherited from ThePEG::Pointer::ReferenceCounted
 ReferenceCounted (const ReferenceCounted &)
 
ReferenceCountedoperator= (const ReferenceCounted &)
 
 ReferenceCounted (const ReferenceCounted &)
 
ReferenceCountedoperator= (const ReferenceCounted &)
 
- Protected Member Functions inherited from ThePEG::Named
const Namedoperator= (const Named &other)
 
const string & name (const string &newName)
 

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. More...
 
string outsideBlock
 If LHF. More...
 
string headerBlock
 If LHF. More...
 
string initComments
 If LHF. More...
 
map< string, string > initAttributes
 If LHF. More...
 
string eventComments
 If LHF. More...
 
map< string, string > eventAttributes
 If LHF. More...
 
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< BasicLesHouchesFileReaderinitBasicLesHouchesFileReader
 Describe an abstract base class with persistent data.
 
virtual void doinit ()
 Initialize this object after the setup phase before saving an EventGenerator to disk. More...
 
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.
 

Additional Inherited Members

- Public Types inherited from ThePEG::InterfacedBase
enum  InitState
 
- Public Types inherited from ThePEG::Pointer::ReferenceCounted
typedef unsigned int CounterType
 
- Public Types inherited from LastXCombInfo<>
typedef ThePEG::Ptr< XComb >::pointer XCPtr
 
typedef ThePEG::Ptr< XComb >::const_pointer cXCPtr
 
typedef ThePEG::Ptr< XComb >::transient_pointer tXCPtr
 
typedef ThePEG::Ptr< XComb >::transient_const_pointer tcXCPtr
 
- Public Attributes inherited from ThePEG::LesHouchesReader
vector< string > optionalWeightsNames
 
- Public Attributes inherited from ThePEG::InterfacedBase
 initializing
 
 uninitialized
 
 initialized
 
 runready
 
- Public Attributes inherited from ThePEG::Pointer::ReferenceCounted
const unsigned long uniqueId
 
- Static Protected Member Functions inherited from ThePEG::LesHouchesReader
static char * mwrite (char *pos, const T &t, size_t n=1)
 
static const char * mread (const char *pos, T &t, size_t n=1)
 
- Static Protected Member Functions inherited from ThePEG::Interfaced
static void registerRepository (IBPtr)
 
static void registerRepository (IBPtr, string newName)
 
- Protected Attributes inherited from ThePEG::LesHouchesReader
HEPRUP heprup
 
HEPEUP hepeup
 
tcPDPair inData
 
pair< PDFPtr, PDFPtrinPDF
 
pair< cPDFPtr, cPDFPtroutPDF
 
PExtrPtr thePartonExtractor
 
tCascHdlPtr theCKKW
 
PartonPairVec thePartonBins
 
XCombMap theXCombs
 
CutsPtr theCuts
 
long theNEvents
 
long position
 
int reopened
 
long theMaxScan
 
bool scanning
 
bool isActive
 
string theCacheFileName
 
bool doCutEarly
 
XSecStat stats
 
StatMap statmap
 
PBIPair thePartonBinInstances
 
ObjectIndexer< long, ColourLinecolourIndex
 
ObjectIndexer< long, ParticleparticleIndex
 
PPair theBeams
 
PPair theIncoming
 
PVector theOutgoing
 
PVector theIntermediates
 
CFile theCacheFile
 
ReweightVector reweights
 
ReweightVector preweights
 
double preweight
 
bool reweightPDF
 
bool doInitPDFs
 
int theMaxMultCKKW
 
int theMinMultCKKW
 
double lastweight
 
map< string, double > optionalWeights
 
double maxFactor
 
int optionalnpLO
 
int optionalnpNLO
 
CrossSection weightScale
 
vector< double > xSecWeights
 
map< int, double > maxWeights
 
bool skipping
 
unsigned int theMomentumTreatment
 
bool useWeightWarnings
 
bool theReOpenAllowed
 
bool theIncludeSpin
 
- Protected Attributes inherited from LastXCombInfo<>
XCPtr theLastXComb
 

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

◆ BasicLesHouchesFileReader()

Herwig::BasicLesHouchesFileReader::BasicLesHouchesFileReader ( const BasicLesHouchesFileReader )

Copy-constructor.

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

Member Function Documentation

◆ clone()

virtual IBPtr Herwig::BasicLesHouchesFileReader::clone ( ) const
protectedvirtual

Make a simple clone of this object.

Returns
a pointer to the new object.

Implements ThePEG::InterfacedBase.

◆ doinit()

virtual void Herwig::BasicLesHouchesFileReader::doinit ( )
protectedvirtual

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.

◆ doReadEvent()

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

◆ fullclone()

virtual IBPtr Herwig::BasicLesHouchesFileReader::fullclone ( ) const
protectedvirtual

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.

◆ getEvent()

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()

virtual void Herwig::BasicLesHouchesFileReader::initialize ( LesHouchesEventHandler eh)
virtual

Initialize.

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

Reimplemented from ThePEG::LesHouchesReader.

◆ open()

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.

◆ persistentInput()

void Herwig::BasicLesHouchesFileReader::persistentInput ( PersistentIStream is,
int  version 
)

Function used to read in object persistently.

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

◆ persistentOutput()

void Herwig::BasicLesHouchesFileReader::persistentOutput ( PersistentOStream os) const

Function used to write out object persistently.

Parameters
osthe persistent output stream written to.

◆ readEvent()

virtual bool Herwig::BasicLesHouchesFileReader::readEvent ( )
virtual

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.

◆ scan()

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.

◆ skip()

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

◆ eventAttributes

map<string,string> Herwig::BasicLesHouchesFileReader::eventAttributes
protected

If LHF.

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

Definition at line 251 of file BasicLesHouchesFileReader.h.

◆ eventComments

string Herwig::BasicLesHouchesFileReader::eventComments
protected

If LHF.

Additional comments found with the last read event.

Definition at line 245 of file BasicLesHouchesFileReader.h.

◆ headerBlock

string Herwig::BasicLesHouchesFileReader::headerBlock
protected

If LHF.

All lines from the header block.

Definition at line 229 of file BasicLesHouchesFileReader.h.

◆ initAttributes

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.

◆ initComments

string Herwig::BasicLesHouchesFileReader::initComments
protected

If LHF.

Additional comments found in the init block.

Definition at line 234 of file BasicLesHouchesFileReader.h.

◆ LHFVersion

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

◆ outsideBlock

string Herwig::BasicLesHouchesFileReader::outsideBlock
protected

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: