ThePEG 2.3.0
|
The EventGenerator class manages a whole event generator run. More...
#include <EventGenerator.h>
Public Types | |
typedef map< pair< string, Exception::Severity >, int > | ExceptionMap |
A map of integers giving the number of times an exception of the key type has been thrown. | |
Public Types inherited from ThePEG::InterfacedBase | |
enum | InitState { initializing = -1 , uninitialized = 0 , initialized = 1 , runready = 2 } |
Enumeration reflecting the state of an InterfacedBase object. More... | |
Public Types inherited from ThePEG::Pointer::ReferenceCounted | |
typedef unsigned int | CounterType |
The integer type used for counting. | |
Public Member Functions | |
Standard constructors and destructors. | |
EventGenerator () | |
Default constructor. | |
EventGenerator (const EventGenerator &) | |
Copy-constructor. | |
virtual | ~EventGenerator () |
Destructor. | |
Access special objects in the run. | |
tSMPtr | standardModel () const |
Return a pointer to the standard model parameters. | |
tStrategyPtr | strategy () const |
Return a pointer to the strategy object containing a set of non-default particles to use. | |
tEHPtr | currentEventHandler () const |
Get the currently active EventHandler. | |
void | currentEventHandler (tEHPtr eh) |
Set the currently active EventHandler. | |
tStepHdlPtr | currentStepHandler () const |
Get the currently active step handler. | |
void | currentStepHandler (tStepHdlPtr sh) |
Set the currently active step handler. | |
tEHPtr | eventHandler () const |
Return a pointer to the EventHandler. | |
AnalysisVector & | analysisHandlers () |
Return the vector of analysis objects to be used in the run. | |
tHistFacPtr | histogramFactory () const |
Return a pointer to an associated factory objects for handling histograms to be used by AnalysisHandler s. | |
tEvtManipPtr | manipulator () const |
Return the EventManipulator used in the run. | |
Main functions to controll the run. | |
void | initialize (bool initOnly=false) |
Initialize this generator. | |
void | go (long next=1, long maxevent=-1, bool tics=false) |
Run this EventGenerator session. | |
EventPtr | shoot () |
Generate one event. | |
EventPtr | generateEvent (Event &event) |
Finish generating an event which has already been partially constructed from the outside. | |
EventPtr | generateEvent (Step &step) |
Finish generating an event starting from a step which has already been partially constructed from the outside. | |
void | finalize () |
Indicate that the run has ended and call finish() for all objects including this one. | |
bool | loadMain (string file) |
Dynamically load the Main class in the given file, making it run its Init() method where it may use this EventGenerator. | |
virtual Energy | maximumCMEnergy () const |
Return the maximum center of mass energy possible for an event. | |
long | currentEventNumber () const |
The number of the event currently being generated. | |
tcEventPtr | currentEvent () const |
Return the event being generated. | |
virtual void | dump () const |
Dump the full state of the current run - including the number of generated events, so that it can be fully continued from this point. | |
void | use (const Interfaced &i) |
Register a given object as used. | |
void | setSeed (long seed) |
Set the random seed for the global random number generator. | |
void | logWarning (const Exception &) |
Log a given exception. | |
long | N () const |
The number of events to be generated in this run. | |
CrossSection | histogramScale () const |
Histogram scale. | |
CrossSection | integratedXSec () const |
The total integrated cross section of the processes generated in this run. | |
CrossSection | integratedXSecErr () const |
The error estimate for the total integrated cross section of the processes generated in this run. | |
double | sumWeights () const |
The sum of all weight of the events generated so far. | |
Functions for accessing output files. | |
string | filename () const |
The base filename used in this run. | |
string | runName () const |
Return the name assigned to this run. | |
string | path () const |
The directory in which the filename() is located. | |
bool | useStdOut () const |
Has the generator been asked to redirect everything to standard output? | |
void | openOutputFiles () |
Open all ouput files. | |
void | flushOutputFile () |
Flush the content of the internal output string stream to the .out file. | |
void | closeOutputFiles () |
Close all ouput files. | |
ofstream & | outfile () |
Return a reference to the output file stream. | |
ofstream & | logfile () |
Return a reference to the log file stream. | |
ofstream & | reffile () |
Return a reference to the reference file stream. | |
ostream & | out () |
This stream should be used for output of information and statistics of an EventGenerator run in the finish() phase, after the actual generation has finished. | |
ostream & | log () |
Return a reference to the stream connected to the file for logging information. | |
ostream & | misc () |
Return a reference to a stream to be used to redirect cout for external modules which prints out messages there. | |
ostream & | ref () |
Return a reference to the stream connected to the filea for references from used objects. | |
Public Member Functions inherited from ThePEG::Interfaced | |
virtual | ~Interfaced () |
Empty virtual destructor. | |
virtual bool | defaultInit () |
Functions which are to be used during the actual event generation, after the setup is complete. | |
PPtr | getParticle (PID) const |
Create a new Particle instance given a id number. | |
PDPtr | getParticleData (PID) const |
Return a pointer to the ParticleData object corresponding to the given id number. | |
bool | used () const |
Returns true if this object has actally been used. | |
void | useMe () const |
Should be called to indicate that this object has actually been used. | |
tEGPtr | generator () const |
Return a pointer to the EventGenerator controlling the run. | |
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. | |
Public Member Functions inherited from ThePEG::InterfacedBase | |
virtual | ~InterfacedBase () |
The virtual (empty) destructor;. | |
string | fullName () const |
Returns the full name of this object including its path, e.g. | |
string | name () const |
Returns the name of this object, without the path. | |
string | path () const |
Returns the path to this object including the trailing '/'. | |
string | comment () const |
Returns a comment assigned to this object. | |
void | setup (istream &is) |
Read setup info from a standard istream is. | |
void | update () |
Calls the doupdate() function with recursion prevention. | |
void | init () |
Calls the doinit() function with recursion prevention. | |
virtual bool | preInitialize () const |
Return true if this object needs to be initialized before all other objects (except those for which this function also returns true). | |
void | initrun () |
Calls the doinitrun() function with recursion prevention. | |
void | finish () |
Calls the dofinish() function with recursion prevention. | |
void | touch () |
This function should be called every time something in this object has changed in a way that a sanity check with update() is needed. | |
void | reset () |
Set the state of this object to uninitialized. | |
void | clear () |
Calls reset() and unTouch(). | |
InitState | state () const |
Return the state of initialization of this object. | |
bool | locked () const |
Return true if the BaseRepository is not allowed to change the state of this object. | |
bool | touched () const |
Return true if the state of this object has been changed since the last call to update(). | |
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. | |
virtual void | debugme () const |
Print out debugging information for this object on std::cerr. | |
Public Member Functions inherited from ThePEG::Base | |
virtual | ~Base () |
The virtual destructor. | |
void | debug () const |
Print out debugging information for this object on std::cerr. | |
virtual void | debugme () const |
Print out debugging information for this object on std::cerr. | |
Public Member Functions inherited from ThePEG::Pointer::ReferenceCounted | |
CounterType | referenceCount () const |
Return the reference count. | |
Public Member Functions inherited from ThePEG::Named | |
Named (const string &newName=string()) | |
Constructor with name. | |
Named (const Named &)=default | |
Explicit default copy-constructor (too avoid compiler warnings) | |
const string & | name () const |
Return name. | |
bool | operator== (const Named &other) const |
Test for equality. | |
bool | operator< (const Named &other) const |
Lexicographical comparison. | |
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 Member Functions inherited from ThePEG::Interfaced | |
void | reporeg (IBPtr object, string name) const |
Register the given object in the Repository with the given name in a subdirectory with the same name as this object. | |
template<typename PtrT > | |
bool | setDefaultReference (PtrT &ptr, string classname, string objectname) |
If the pointer, ptr, to an object is not set, create an object of class classname and register it with the Repository with the given objectname in a sib-directory with the same name as this object. | |
Interfaced () | |
Protected default constructor. | |
Interfaced (const string &newName) | |
Protected constructor taking a name as argument. | |
Interfaced (const Interfaced &i) | |
Protected copy-constructor. | |
void | setGenerator (tEGPtr generator) |
Protected function to reset the generator pointer, required for automatic decayer generation in Herwig++ BSM models. | |
Protected Member Functions inherited from ThePEG::InterfacedBase | |
virtual void | readSetup (istream &is) |
Read setup info from a standard istream is. | |
virtual void | doupdate () |
Check sanity of the object during the setup phase. | |
virtual IVector | getReferences () |
Return a vector of all pointers to Interfaced objects used in this object. | |
virtual void | rebind (const TranslationMap &) |
Rebind pointer to other Interfaced objects. | |
InterfacedBase () | |
Protected default constructor. | |
InterfacedBase (string newName) | |
Protected constructor with the name given as argument. | |
InterfacedBase (const InterfacedBase &i) | |
Protected copy-constructor. | |
Protected Member Functions inherited from ThePEG::Pointer::ReferenceCounted | |
ReferenceCounted () | |
Default constructor. | |
ReferenceCounted (const ReferenceCounted &) | |
Copy-constructor. | |
ReferenceCounted & | operator= (const ReferenceCounted &) |
Assignment. | |
Protected Member Functions inherited from ThePEG::Named | |
const Named & | operator= (const Named &other) |
Assignment. | |
const string & | name (const string &newName) |
Set new name. | |
Friends | |
class | Repository |
The Repository is a friend. | |
Standard Interfaced functions. | |
vector< IPtr > | theDefaultObjects |
A vector of default objects. | |
ParticleMap | theLocalParticles |
Map of non-default particles used in this EventGenerator. | |
SMPtr | theStandardModel |
Pointer to an object containing standard model parameters. | |
StrategyPtr | theStrategy |
Pointer to a strategy object with other non-default particles to be used in this EventGenerator. | |
RanGenPtr | theRandom |
Pointer to the default RandomGenerator to be used in this run. | |
EHPtr | theEventHandler |
Pointer to the event handler used to generate the indivudual events. | |
AnalysisVector | theAnalysisHandlers |
A vector of all analysis handlers to be called after each event. | |
HistFacPtr | theHistogramFactory |
A pointer to an associated factory objects for handling histograms to be used by AnalysisHandler s. | |
EvtManipPtr | theEventManipulator |
A pointer to an optional event manipulator object. | |
string | thePath |
The directory where the input and output files resides. | |
string | theRunName |
The name of this run. | |
ofstream | theOutfile |
A reference to the output file stream. | |
ofstream | theLogfile |
A reference to the log file stream. | |
ofstream | theReffile |
A reference to the reference file stream. | |
ostringstream | theMiscStream |
A stream to be used to redirect cout for external modules which prints out messages there. | |
ostringstream | theOutStream |
A string stream used as a buffer for messages written to the .out file. | |
string | theOutFileName |
Remember the name of the file where the output should be sent. | |
long | theNumberOfEvents |
Number of events to be generated in this run. | |
ObjectSet | theObjects |
The set of all objects to be used in this run. | |
ObjectMap | theObjectMap |
All objects to be used in this run mapped to their name. | |
ParticleMap | theParticles |
The map of all particles to be used in this run, indexed by the id number. | |
PDVector | theQuickParticles |
A vector of particles indexed by the id number for quick access. | |
long | theQuickSize |
Only particles with id number less than theQuickSize are available in theQuickParticles. | |
bool | preinitializing |
A flag to tell if we are in the pre-initialization phase where objects with preInitialize() functions returning true are initialized before others. | |
MatcherSet | theMatchers |
The set of all matchers to be used in this run. | |
ObjectSet | usedObjects |
The set of objects which have actually been used in this run. | |
int | logNonDefault |
List all modified interfaces in the log file. | |
int | printEvent |
If the debug level is higher than 0, print the first 'printEvent' events to the logfile. | |
long | dumpPeriod |
If the debug level is higher than 0, dump the complete state of this run to the default dump file every 'dumpPeriod' events. | |
bool | keepAllDumps |
If this flag is true, keep all dump files of the run, labelled by event number. | |
long | debugEvent |
If the debug level is higher than 0, step up to the highest debug level just before the event with number debugEvent is performed. | |
int | maxWarnings |
The maximum number of warnings reported of each type. | |
int | maxErrors |
The maximum number of warnings and errors reported of each type. | |
ExceptionMap | theExceptions |
A map of all Exceptions which have been caught by the event generator and the number of time each exception type has been caught. | |
UseRandom * | theCurrentRandom |
The UseRandom object constructed for the duration of an EventGenerator run so that the default random number generator always can be accessed through the static methods of the UseRandom class. | |
CurrentGenerator * | theCurrentGenerator |
The CurrentGenerator object constructed for the duration of an EventGenerator run so that the default event generator always can be accessed through the static methods of the CurrentGenerator class. | |
tEHPtr | theCurrentEventHandler |
The currently active EventHandler. | |
tStepHdlPtr | theCurrentStepHandler |
The currently active step handler. | |
bool | useStdout |
Whether to use files or stdout for logging and output. | |
bool | theIntermediateOutput |
Whether to use a modified event number count. | |
vector< string > | theGlobalLibraries |
The global libraries needed for objects used in this EventGenerator. | |
long | ieve |
The current event number;. | |
double | weightSum |
The sum of the weights of the events produced so far. | |
int | theDebugLevel |
The debug level. | |
static ClassDescription< EventGenerator > | initEventGenerator |
Describe an abstract class with persistent data. | |
virtual void | doinit () |
Initialize this object after the setup phase before saving an EventGenerator to disk. | |
virtual void | doinitrun () |
Initialize this object. | |
virtual void | dofinish () |
Finalize this object. | |
void | finally () |
Additional things to do at the very end after the (do)finish(), such as closing output files etc. | |
ObjectSet & | objects () |
Return the set of all objects to be used in this run. | |
ObjectMap & | objectMap () |
Return the map of all objects to be used in this run indexed by their name. | |
void | generateReferences () |
Print out the .tex file with descriptions of and references to all models used in the run. | |
int | count (const Exception &) |
Increase and return the count for the given exception. | |
void | setLocalParticles (PDPtr pd, int) |
Utility function for the interface. | |
void | insLocalParticles (PDPtr pd, int) |
Utility function for the interface. | |
void | delLocalParticles (int place) |
Utility function for the interface. | |
vector< PDPtr > | getLocalParticles () const |
Utility function for the interface. | |
void | setPath (string newPath) |
Utility function for the interface. | |
string | defPath () const |
Utility function for the interface. | |
EventGenerator & | operator= (const EventGenerator &)=delete |
Private and non-existent assignment operator. | |
Access objects included in this run. | |
const ObjectSet & | objects () const |
Return the set of objects used in this run. | |
const ObjectMap & | objectMap () const |
Return the map of objects used in this run indexed by their name. | |
template<typename T > | |
Ptr< T >::pointer | getPtr (const T &) const |
Return a garbage collected pointer to a given object. | |
IBPtr | getPointer (string name) const |
Return a pointer to an object present in this run given its full name. | |
template<typename T > | |
Ptr< T >::pointer | getObject (string name) const |
Return a pointer to an object of type T present in this run given its full name. | |
template<typename T > | |
Ptr< T >::pointer | getDefault () const |
Return the default object for class T. | |
PPtr | getParticle (PID id) const |
Create a particle instance corresponding to the given id number. | |
PDPtr | getParticleData (PID id) const |
Return a pointer to the ParticleData object corresponding to the given id number. | |
const MatcherSet & | matchers () const |
Return a reference to the complete list of matchers in this generator. | |
const ParticleMap & | particles () const |
Return a reference to the complete map of particle data objects in this generator, indexed by their id numbers. | |
const ObjectSet & | used () const |
Return a reference to the set of objects which have been registered as used during the current run. | |
void | checkSignalState () |
Check if there has been an interrupt signal from the OS. | |
RandomGenerator & | random () const |
Return a reference to the default RandomGenerator object in this run. | |
void | setup (string newRunName, ObjectSet &newObjects, ParticleMap &newParticles, MatcherSet &newMatchers) |
Finish the setup of an event generator run. | |
Main virtual functions to be overridden by sub-classes. | |
virtual void | addTag (string tag) |
Append a tag to the run name. | |
virtual void | doGo (long next, long maxevent, bool tics) |
Run this EventGenerator session. | |
virtual void | doInitialize (bool initOnly=false) |
Initialize this generator. | |
virtual EventPtr | doShoot () |
Generate one event. | |
void | tic (long currev=0, long totev=0) const |
Write out the number of events generated and the elapsed time in suitable periods. | |
virtual EventPtr | doGenerateEvent (tEventPtr) |
Finish generating an event constructed from the outside. | |
virtual EventPtr | doGenerateEvent (tStepPtr) |
Finish generating an event starting from a Step constructed from the outside. | |
void | printException (const Exception &) |
Print the message of an exception to the log file. | |
bool | logException (const Exception &, tcEventPtr) |
Log a given exception. | |
void | N (long n) |
Set number of events to be generated. | |
void | runName (string f) |
Set the name of this run. | |
const vector< IPtr > & | defaultObjects () const |
Return the vector of default objects. | |
ParticleMap & | localParticles () |
Access the special particles used in this generator. | |
const ParticleMap & | localParticles () const |
Access the special particles used in this generator. | |
void | path (string f) |
Set the directory where the output files will be stored. | |
void | strategy (StrategyPtr) |
Set a pointer to the strategy object containing a set of non-default particles to use. | |
string | doSaveRun (string) |
Isolate, initialize and save this generator to a file. | |
string | doMakeRun (string) |
Isolate and initialize this generator. | |
The following functions may be called by objects belonging | |
to this event generator during the initialization phase (in the doinit() function). It is typically used by objects which need to introduce other Interfaced objects depending the parameters of the StandardModel object used. Note that objects which use these functions MUST override the preInitialize() function to return true, otherwize the whole initialization procedure may be corrupted. | |
bool | preinitRegister (IPtr obj, string fullname) |
Register a new object to be included in the run currently being initialized. | |
IPtr | preinitCreate (string classname, string fullname, string libraries="") |
Create a new Interfaced object to be used in the run being initialized. | |
string | preinitInterface (string fullname, string ifcname, string cmd, string value) |
Manipulate an interface of an Interfaced object. | |
string | preinitInterface (string fullname, string ifcname, int index, string cmd, string value) |
Manipulate an interface of vector type (RefVector or ParVector) of an Interfaced object. | |
string | preinitInterface (IPtr obj, string ifcname, string cmd, string value) |
Manipulate an interface of an Interfaced object. | |
string | preinitInterface (IPtr obj, string ifcname, int index, string cmd, string value) |
Manipulate an interface of vector type (RefVector or ParVector) of an Interfaced object. | |
bool | preinitRemove (IPtr obj) |
Remove the object. | |
tDMPtr | findDecayMode (string tag) const |
Find a decaymode given a decay tag. | |
tDMPtr | preinitCreateDecayMode (string tag) |
Create a decay mode according to the given tag. | |
tPDPtr | findParticle (string pdgname) const |
Find a particle in this run, using its PDG name. | |
tPMPtr | findMatcher (string name) const |
Find a matcher in this run given its name. | |
DMPtr | constructDecayMode (string &tag) |
Used internally by preinitCreateDecayMode();. | |
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. | |
const vector< string > & | globalLibraries () const |
The global libraries needed for objects used in this EventGenerator. | |
static void | Init () |
Standard Init function used to initialize the interface. | |
Additional Inherited Members | |
Static Public Member Functions inherited from ThePEG::Interfaced | |
static void | Init () |
Standard Init function. | |
Static Public Member Functions inherited from ThePEG::InterfacedBase | |
static void | Init () |
Standard Init function. | |
Static Public Member Functions inherited from ThePEG::Base | |
static void | Init () |
The standard Init function used to initialize the interfaces. | |
Public Attributes inherited from ThePEG::Pointer::ReferenceCounted | |
const unsigned long | uniqueId |
The unique ID. | |
Static Protected Member Functions inherited from ThePEG::Interfaced | |
static void | registerRepository (IBPtr) |
Register an Interfaced object with the Repository. | |
static void | registerRepository (IBPtr, string newName) |
Register an Interfaced object with the Repository, giving it a name. | |
The EventGenerator class manages a whole event generator run.
It keeps a list of all Interfaced objects which are needed for a particular run (these objects each have a pointer back to the EventGenerator). Some objects are special, such as a default RandomGenerator object, a StandardModelBase object and a Strategy object and lists of ParticleData and MatcherBase objects used in the run.
The EventGenerator
also manages information about the run such as the exceptions being thrown, files to write output and error messages to, etc.
There are three main external member functions:
go() generates a specified number of events and exits.
shoot() generates one Event and returns it.
generateEvent() takes an initial Step or a partially generated Event as argument and generates subsequent steps defined in the generator.
doShoot() is a virtual function called by shoot() and may be overridden in sub-classes.
doGenrateEvent() is a virtual function called by generateEvent() and may to be overridden in sub-classes.
Definition at line 68 of file EventGenerator.h.
typedef map<pair<string, Exception::Severity>, int> ThePEG::EventGenerator::ExceptionMap |
A map of integers giving the number of times an exception of the key type has been thrown.
Definition at line 79 of file EventGenerator.h.
|
inlinevirtual |
Append a tag to the run name.
Derived classes may put special meaning to the tags.
Reimplemented in ThePEG::MultiEventGenerator.
Definition at line 542 of file EventGenerator.h.
References runName().
|
inline |
Return the vector of analysis objects to be used in the run.
Definition at line 144 of file EventGenerator.h.
References theAnalysisHandlers.
|
protected |
Check if there has been an interrupt signal from the OS.
If that's the case, finalize() is called
|
protectedvirtual |
Make a simple clone of this object.
Implements ThePEG::InterfacedBase.
Reimplemented in ThePEG::MultiEventGenerator.
|
inline |
Get the currently active EventHandler.
Definition at line 119 of file EventGenerator.h.
References theCurrentEventHandler.
|
inline |
Set the currently active EventHandler.
Definition at line 124 of file EventGenerator.h.
References theCurrentEventHandler.
|
inline |
The number of the event currently being generated.
Definition at line 226 of file EventGenerator.h.
References ieve.
|
inline |
Get the currently active step handler.
Definition at line 129 of file EventGenerator.h.
References theCurrentStepHandler.
|
inline |
Set the currently active step handler.
Definition at line 134 of file EventGenerator.h.
References theCurrentStepHandler.
|
inlineprivate |
Return the vector of default objects.
Definition at line 551 of file EventGenerator.h.
References theDefaultObjects.
|
protectedvirtual |
Finalize this object.
Called in the run phase just after a run has ended. Used eg. to write out statistics.
Reimplemented from ThePEG::InterfacedBase.
Finish generating an event constructed from the outside.
Is called by generateEvent(tEventPtr).
Finish generating an event starting from a Step constructed from the outside.
Is called by generateEvent(tStepPtr).
|
protectedvirtual |
Run this EventGenerator session.
Is called from go(long,long,bool).
Reimplemented in ThePEG::MultiEventGenerator.
|
protectedvirtual |
Initialize this object after the setup phase before saving an EventGenerator to disk.
InitException | if object could not be initialized properly. |
Reimplemented from ThePEG::InterfacedBase.
|
protectedvirtual |
Initialize this generator.
Is called from initialize().
|
protectedvirtual |
Initialize this object.
Called in the run phase just before a run begins.
Reimplemented from ThePEG::InterfacedBase.
|
protectedvirtual |
Generate one event.
Is called from shoot().
|
inline |
Return a pointer to the EventHandler.
Definition at line 139 of file EventGenerator.h.
References theEventHandler.
|
inline |
The base filename used in this run.
The actual files are called filename.run
, filename.dump
, filename.out
, filename.log
and filename.tex
for the input configuration file, output dump file, output file, log file, and reference file respectively. The filename is constructed from the path() and runName().
Definition at line 297 of file EventGenerator.h.
void ThePEG::EventGenerator::finalize | ( | ) |
tDMPtr ThePEG::EventGenerator::findDecayMode | ( | string | tag | ) | const |
Find a decaymode given a decay tag.
tPMPtr ThePEG::EventGenerator::findMatcher | ( | string | name | ) | const |
Find a matcher in this run given its name.
tPDPtr ThePEG::EventGenerator::findParticle | ( | string | pdgname | ) | const |
Find a particle in this run, using its PDG name.
|
protectedvirtual |
Make a clone of this object, possibly modifying the cloned object to make it sane.
Reimplemented from ThePEG::InterfacedBase.
Reimplemented in ThePEG::MultiEventGenerator.
Finish generating an event which has already been partially constructed from the outside.
Calls the virtual method do doGenerateEvent().
Finish generating an event starting from a step which has already been partially constructed from the outside.
Calls the virtual method do doGenerateEvent().
Ptr< T >::pointer ThePEG::EventGenerator::getDefault | ( | ) | const |
Return the default object for class T.
Returns the null pointer if non-existent.
Referenced by ThePEG::CurrentGenerator::getDefault().
|
inline |
Return a pointer to an object of type T present in this run given its full name.
Return the null pointer if non-existent. Calls getPointer(string) and dynamically casts the result to the requested pointer type.
Definition at line 416 of file EventGenerator.h.
References getPointer(), and ThePEG::InterfacedBase::name().
Referenced by ThePEG::CurrentGenerator::getObject().
IBPtr ThePEG::EventGenerator::getPointer | ( | string | name | ) | const |
Return a pointer to an object present in this run given its full name.
Return the null pointer if non-existent.
Referenced by getObject(), and ThePEG::CurrentGenerator::getPointer().
Ptr< T >::pointer ThePEG::EventGenerator::getPtr | ( | const T & | ) | const |
Return a garbage collected pointer to a given object.
If the object is not included in the run, a null pointer will be returned.
Referenced by ThePEG::CurrentGenerator::getPtr().
|
inline |
The global libraries needed for objects used in this EventGenerator.
Definition at line 773 of file EventGenerator.h.
References theGlobalLibraries.
void ThePEG::EventGenerator::go | ( | long | next = 1 , |
long | maxevent = -1 , |
||
bool | tics = false |
||
) |
Run this EventGenerator session.
Calls the virtual method doGo().
next | the number of the firts event to be generated. If negative it is assumed that this generator was previously interrupted (or dumped to a file) and the execution will resume from where it started. Default is 1. |
maxevent | the maximum number of events to be generated. If negative the N() is used instead. Default is -1. |
tics | if true information the number of events generated and elapsed time will be written to std::cerr after each event. |
|
inline |
Return a pointer to an associated factory objects for handling histograms to be used by AnalysisHandler
s.
Definition at line 150 of file EventGenerator.h.
References theHistogramFactory.
CrossSection ThePEG::EventGenerator::histogramScale | ( | ) | const |
Histogram scale.
A histogram bin which has been filled with the weights associated with the Event objects should be scaled by this factor to give the correct cross section.
void ThePEG::EventGenerator::initialize | ( | bool | initOnly = false | ) |
Initialize this generator.
This is done automatically if 'go()' is used. Calls the virtual method doInitialize().
bool ThePEG::EventGenerator::loadMain | ( | string | file | ) |
Dynamically load the Main class in the given file, making it run its Init() method where it may use this EventGenerator.
Also call the initialize function before and the finish() function afterwards.
|
inlineprivate |
Access the special particles used in this generator.
Not relevant in the run phase.
Definition at line 557 of file EventGenerator.h.
References theLocalParticles.
|
inlineprivate |
Access the special particles used in this generator.
Not relevant in the run phase.
Definition at line 563 of file EventGenerator.h.
References theLocalParticles.
ostream & ThePEG::EventGenerator::log | ( | ) |
Return a reference to the stream connected to the file for logging information.
If no file is connected, BaseRepository::cout() will be used instead.
Referenced by ThePEG::CurrentGenerator::log().
|
inline |
Return a reference to the log file stream.
Definition at line 339 of file EventGenerator.h.
References theLogfile.
|
inline |
Return the EventManipulator used in the run.
Definition at line 155 of file EventGenerator.h.
References theEventManipulator.
|
inline |
Return a reference to the complete list of matchers in this generator.
Definition at line 443 of file EventGenerator.h.
References theMatchers.
|
virtual |
Return the maximum center of mass energy possible for an event.
Return zero if the assigned EventHander is not able to generatr full events.
|
inline |
Return a reference to a stream to be used to redirect cout for external modules which prints out messages there.
The output will instead be appended to the log() stream at the end of the run.
Definition at line 370 of file EventGenerator.h.
References theMiscStream.
|
inline |
The number of events to be generated in this run.
Definition at line 259 of file EventGenerator.h.
References theNumberOfEvents.
|
inlineprotected |
Set number of events to be generated.
Definition at line 529 of file EventGenerator.h.
References theNumberOfEvents.
|
inlineprotected |
Return the map of all objects to be used in this run indexed by their name.
Definition at line 841 of file EventGenerator.h.
References theObjectMap.
|
inline |
Return the map of objects used in this run indexed by their name.
Definition at line 393 of file EventGenerator.h.
References theObjectMap.
|
inlineprotected |
Return the set of all objects to be used in this run.
Definition at line 835 of file EventGenerator.h.
References theObjects.
|
inline |
Return the set of objects used in this run.
Definition at line 387 of file EventGenerator.h.
References theObjects.
ostream & ThePEG::EventGenerator::out | ( | ) |
This stream should be used for output of information and statistics of an EventGenerator run in the finish() phase, after the actual generation has finished.
When used at other times, the output will be cashed internally before written out in the finish() phase. This is then written to the .out file, or if useStdOut() is true, to BaseRepository::cout().
Referenced by ThePEG::CurrentGenerator::out().
|
inline |
Return a reference to the output file stream.
Definition at line 334 of file EventGenerator.h.
References theOutfile.
|
inline |
Return a reference to the complete map of particle data objects in this generator, indexed by their id numbers.
Definition at line 449 of file EventGenerator.h.
References theParticles.
|
inline |
The directory in which the filename() is located.
Definition at line 308 of file EventGenerator.h.
References thePath.
Referenced by filename().
|
inlineprivate |
Set the directory where the output files will be stored.
Definition at line 568 of file EventGenerator.h.
References thePath.
void ThePEG::EventGenerator::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. |
void ThePEG::EventGenerator::persistentOutput | ( | PersistentOStream & | os | ) | const |
Function used to write out object persistently.
os | the persistent output stream written to. |
IPtr ThePEG::EventGenerator::preinitCreate | ( | string | classname, |
string | fullname, | ||
string | libraries = "" |
||
) |
Create a new Interfaced object to be used in the run being initialized.
classname | the class name of the object being created. |
fullname | the full name including the directory path. Note that although the full path is given the object will not be inserted in the Repository, but only in this current EventGenerator. |
libraries | an optional list of shared libraries to be loaded to be able to create an object of the specified class. |
tDMPtr ThePEG::EventGenerator::preinitCreateDecayMode | ( | string | tag | ) |
Create a decay mode according to the given tag.
string ThePEG::EventGenerator::preinitInterface | ( | IPtr | obj, |
string | ifcname, | ||
int | index, | ||
string | cmd, | ||
string | value | ||
) |
Manipulate an interface of vector type (RefVector or ParVector) of an Interfaced object.
obj | the object to be manipulated. |
ifcname | the name of the interface to be used. |
index | the vector index corresponding to the element to be manipulated. |
cmd | the operation to be performed on the interface (set, get, insert or erase). |
value | Optional value to be passed to the interface. |
string ThePEG::EventGenerator::preinitInterface | ( | IPtr | obj, |
string | ifcname, | ||
string | cmd, | ||
string | value | ||
) |
Manipulate an interface of an Interfaced object.
obj | the object to be manipulated. |
ifcname | the name of the interface to be used. |
cmd | the operation to be performed on the interface (set or get). |
value | Optional value to be passed to the interface. |
string ThePEG::EventGenerator::preinitInterface | ( | string | fullname, |
string | ifcname, | ||
int | index, | ||
string | cmd, | ||
string | value | ||
) |
Manipulate an interface of vector type (RefVector or ParVector) of an Interfaced object.
fullname | the name including the full path of an object to be manipulated. |
ifcname | the name of the interface to be used. |
index | the vector index corresponding to the element to be manipulated. |
cmd | the operation to be performed on the interface (set, get, insert or erase). |
value | Optional value to be passed to the interface. |
string ThePEG::EventGenerator::preinitInterface | ( | string | fullname, |
string | ifcname, | ||
string | cmd, | ||
string | value | ||
) |
Manipulate an interface of an Interfaced object.
fullname | the name including the full path of an object to be manipulated. |
ifcname | the name of the interface to be used. |
cmd | the operation to be performed on the interface (set or get). |
value | Optional value to be passed to the interface. |
bool ThePEG::EventGenerator::preinitRegister | ( | IPtr | obj, |
string | fullname | ||
) |
Register a new object to be included in the run currently being initialized.
obj | (pointer to) the object being registered. |
fullname | the full name including the directory path. Note that although the full path is given the object will not be inserted in the Repository, but only in this current EventGenerator. |
|
inlineprotected |
Return a reference to the default RandomGenerator object in this run.
Definition at line 470 of file EventGenerator.h.
References theRandom.
Referenced by ThePEG::MultiEventGenerator::randomArg().
ostream & ThePEG::EventGenerator::ref | ( | ) |
Return a reference to the stream connected to the filea for references from used objects.
If no file is connected, BaseRepository::cout() will be used instead.
Referenced by ThePEG::CurrentGenerator::ref().
|
inline |
Return a reference to the reference file stream.
This file is used to output LaTeX text with information about the models used in the run.
Definition at line 346 of file EventGenerator.h.
References theReffile.
|
inline |
Return the name assigned to this run.
If no name is given, the name of the EventGenerator object is returned.
Definition at line 303 of file EventGenerator.h.
References ThePEG::InterfacedBase::name(), and theRunName.
Referenced by addTag(), and filename().
|
inlineprotected |
void ThePEG::EventGenerator::setSeed | ( | long | seed | ) |
Set the random seed for the global random number generator.
Also set the interfaced member variable.
|
protected |
Finish the setup of an event generator run.
Set run name, all particles, matchers and other objects to be used. Is used by the Repository when isolating an EventGenerator.
|
inline |
Return a pointer to the standard model parameters.
Definition at line 108 of file EventGenerator.h.
References theStandardModel.
Referenced by ThePEG::CurrentGenerator::standardModel().
|
inline |
Return a pointer to the strategy object containing a set of non-default particles to use.
Definition at line 114 of file EventGenerator.h.
References theStrategy.
Referenced by ThePEG::CurrentGenerator::strategy().
|
inline |
The sum of all weight of the events generated so far.
Definition at line 283 of file EventGenerator.h.
References weightSum.
void ThePEG::EventGenerator::use | ( | const Interfaced & | i | ) |
Register a given object as used.
Only objects registered in this way will be included in the file with model references.
|
inline |
Return a reference to the set of objects which have been registered as used during the current run.
Definition at line 455 of file EventGenerator.h.
References usedObjects.
|
inline |
Has the generator been asked to redirect everything to standard output?
Definition at line 314 of file EventGenerator.h.
References useStdout.
|
friend |
The Repository is a friend.
Definition at line 71 of file EventGenerator.h.
|
private |
If the debug level is higher than 0, step up to the highest debug level just before the event with number debugEvent is performed.
Definition at line 1052 of file EventGenerator.h.
|
private |
If the debug level is higher than 0, dump the complete state of this run to the default dump file every 'dumpPeriod' events.
If 'dumpPeriod' is -1, dumping is disabled completely, even when runs are aborted.
Definition at line 1040 of file EventGenerator.h.
|
protected |
The current event number;.
Definition at line 1007 of file EventGenerator.h.
Referenced by currentEventNumber().
|
staticprivate |
Describe an abstract class with persistent data.
Definition at line 1154 of file EventGenerator.h.
|
private |
If this flag is true, keep all dump files of the run, labelled by event number.
Definition at line 1046 of file EventGenerator.h.
|
private |
List all modified interfaces in the log file.
If positive always do this, if negative never do it. If zero, only do it if debugging is turned on.
Definition at line 1026 of file EventGenerator.h.
|
private |
The maximum number of warnings and errors reported of each type.
If more than maxErrors errors is reported for one type the run will be aborted. Disable the check by setting to -1.
Definition at line 1066 of file EventGenerator.h.
|
private |
The maximum number of warnings reported of each type.
If more than maxWarnings warnings of one type is issued, the generation will continue without reporting this warning.
Definition at line 1059 of file EventGenerator.h.
|
private |
A flag to tell if we are in the pre-initialization phase where objects with preInitialize() functions returning true are initialized before others.
Definition at line 990 of file EventGenerator.h.
|
private |
If the debug level is higher than 0, print the first 'printEvent' events to the logfile.
Definition at line 1032 of file EventGenerator.h.
|
private |
A vector of all analysis handlers to be called after each event.
Definition at line 892 of file EventGenerator.h.
Referenced by analysisHandlers().
|
private |
The currently active EventHandler.
Definition at line 1126 of file EventGenerator.h.
Referenced by currentEventHandler().
|
private |
The CurrentGenerator object constructed for the duration of an EventGenerator run so that the default event generator always can be accessed through the static methods of the CurrentGenerator class.
Definition at line 1121 of file EventGenerator.h.
|
private |
The UseRandom object constructed for the duration of an EventGenerator run so that the default random number generator always can be accessed through the static methods of the UseRandom class.
Definition at line 1113 of file EventGenerator.h.
|
private |
The currently active step handler.
Definition at line 1131 of file EventGenerator.h.
Referenced by currentStepHandler().
|
protected |
The debug level.
Definition at line 1017 of file EventGenerator.h.
|
private |
A vector of default objects.
Definition at line 860 of file EventGenerator.h.
Referenced by defaultObjects().
|
private |
Pointer to the event handler used to generate the indivudual events.
Definition at line 887 of file EventGenerator.h.
Referenced by eventHandler().
|
private |
A pointer to an optional event manipulator object.
Definition at line 903 of file EventGenerator.h.
Referenced by manipulator().
|
private |
A map of all Exceptions which have been caught by the event generator and the number of time each exception type has been caught.
Definition at line 1073 of file EventGenerator.h.
|
private |
The global libraries needed for objects used in this EventGenerator.
Definition at line 1147 of file EventGenerator.h.
Referenced by globalLibraries().
|
private |
A pointer to an associated factory objects for handling histograms to be used by AnalysisHandler
s.
Definition at line 898 of file EventGenerator.h.
Referenced by histogramFactory().
|
private |
Whether to use a modified event number count.
Definition at line 1142 of file EventGenerator.h.
|
private |
Map of non-default particles used in this EventGenerator.
Definition at line 865 of file EventGenerator.h.
Referenced by localParticles().
|
private |
A reference to the log file stream.
Definition at line 923 of file EventGenerator.h.
Referenced by logfile().
|
private |
The set of all matchers to be used in this run.
Definition at line 995 of file EventGenerator.h.
Referenced by matchers().
|
private |
A stream to be used to redirect cout for external modules which prints out messages there.
The output will instead be appended to the log() stream at the end of the run.
Definition at line 935 of file EventGenerator.h.
Referenced by misc().
|
private |
Number of events to be generated in this run.
Definition at line 955 of file EventGenerator.h.
Referenced by N().
|
private |
All objects to be used in this run mapped to their name.
Definition at line 965 of file EventGenerator.h.
Referenced by objectMap().
|
private |
The set of all objects to be used in this run.
Definition at line 960 of file EventGenerator.h.
Referenced by objects().
|
private |
A reference to the output file stream.
Definition at line 918 of file EventGenerator.h.
Referenced by outfile().
|
private |
Remember the name of the file where the output should be sent.
This is set int openOutputFiles().
Definition at line 950 of file EventGenerator.h.
|
private |
A string stream used as a buffer for messages written to the .out file.
The .out file should in rinciple only be written to in the end of a run, during the finish() phase, but if anything is written before that, it will be cashed in this string stream before written out properly in the end of the run.
Definition at line 944 of file EventGenerator.h.
|
private |
The map of all particles to be used in this run, indexed by the id number.
Definition at line 971 of file EventGenerator.h.
Referenced by particles().
|
private |
The directory where the input and output files resides.
Definition at line 908 of file EventGenerator.h.
Referenced by path().
|
private |
A vector of particles indexed by the id number for quick access.
Only particles with id number less than theQuickSize are available.
Definition at line 977 of file EventGenerator.h.
|
private |
Only particles with id number less than theQuickSize are available in theQuickParticles.
Definition at line 983 of file EventGenerator.h.
|
private |
Pointer to the default RandomGenerator to be used in this run.
Definition at line 881 of file EventGenerator.h.
Referenced by random().
|
private |
A reference to the reference file stream.
Definition at line 928 of file EventGenerator.h.
Referenced by reffile().
|
private |
|
private |
Pointer to an object containing standard model parameters.
Definition at line 870 of file EventGenerator.h.
Referenced by standardModel().
|
private |
Pointer to a strategy object with other non-default particles to be used in this EventGenerator.
Definition at line 876 of file EventGenerator.h.
Referenced by strategy().
|
private |
The set of objects which have actually been used in this run.
Definition at line 1000 of file EventGenerator.h.
Referenced by used().
|
private |
Whether to use files or stdout for logging and output.
Definition at line 1137 of file EventGenerator.h.
Referenced by useStdOut().
|
protected |
The sum of the weights of the events produced so far.
Definition at line 1012 of file EventGenerator.h.
Referenced by sumWeights().