File: Interfaced.h
Description:
The Interfaced class is derived from the
InterfacedBase class adding a couple of things
particular to Pythia7, in an attempt to keep the
InterfacedBase class as generic as possible.
The main addition is that the Interfaced class has a
pointer to an EventGenerator object. During the
run-phase this point to the EventGenerator controlling the run in
which the Interfaced object is used. Through this
EventGenerator there is quick access to eg. the set of
ParticleData objects used, and the default
RandomGenerator for the run. Note that no
EventGenerator object is available to the
Interfaced object during the setup phase.
See
also:
namespace Pythia7
CLASS
Interfaced:
Base class:
Friends
Public members:
inline virtual ~Interfaced();
Empty virtual destructor
Functions which are to be used during the actual event
generation, after the setup is complete.
PPtr getParticle(long) const;
Create a new particle instance given a id number.
PDPtr getParticleData(long) const;
Return a pointer to the particle data object corresponding to the
given id number.
inline bool used() const;
Returns true if this object has actally been used.
inline void useMe() const;
Should be called to indicate that this object has actually been
used.
void persistentOutput(PersistentOStream &) const;
void persistentInput(PersistentIStream &, int);
Standard functions for writing and reading from persistent streams.
static void Init();
Standard Init function used to initialize the interface.
Protected members:
static void registerRepository(IBPtr);
static void registerRepository(IBPtr, string newName);
Avoid other classes including the Repository class just to use
the Register function.
inline Interfaced();
inline Interfaced(string newName);
inline Interfaced(const Interfaced &);
Protected constructors.
inline tEGPtr generator() const;
Return a pointer to the EventGenerator controlling the run.
During the setup phase this returns a null pointer.
inline virtual void doupdate() throw(UpdateException) = 0;
This function is called everytime the object setup is
changed. Also if the setup is changed for an object on which this
is dependent. It should throw an UpdateException if the setup is
such that the object would not work properly. Note that the
'generator()' is not available when this method is called.
inline virtual void doinit() throw (InitException) = 0;
This is called before the start of an event generation
run. Nothing should have changed since the last 'update' call.
If the setup is not sane, an InitException should be thrown.
inline virtual void dofinish() = 0;
This is called after the event generation run is done. It can
e.g. be used to write out statistics on the output file.
Private members:
void setUsed() const;
Used internally by 'useMe'
tEGPtr theGenerator;
A pointer to the EventGenerator controlling the run.
mutable bool theUseFlag;
Flag to tell whether this object has been used or not.
static AbstractClassDescription<Interfaced> initInterfaced;
Standard Initialization object.
Interfaced & operator=(const Interfaced &);
Private and non-existent assignment operator.
Public members:
virtual void debug() const;
This method may be implemented by derived classes to facilitate
debugging.
template <>
STRUCT
BaseClassTrait<Interfaced,1>
Public members:
typedef InterfacedBase NthBase;
template <>
STRUCT
ClassTraits<Interfaced>:
Public members:
static string className() { return "/Pythia7/Interfaced"; }
DEFINED MACROS
INCLUDED FILES
Pythia7/Config/Pythia7.h
InterfacedBase.h
Interfaced.icc