StepHandler
s.
More...
#include <HandlerGroup.h>
Public Types | |
typedef pair< StepHdlPtr, HintPtr > | StepWithHint |
Associate a StepHandler with a Hint object. | |
typedef vector< StepHdlPtr > | StepVector |
A vector of StepHandler objects. | |
typedef vector< StepWithHint > | StepHintVector |
A vector of StepHandler objects associated with Hint objects. | |
typedef deque< HintPtr > | HintVector |
A vector of Hint objects. | |
Public Member Functions | |
HandlerGroupBase () | |
Default constructor. | |
virtual | ~HandlerGroupBase () |
Destructor. | |
bool | empty () const |
Returns true if current selections in this group is empty. | |
void | init (const HandlerGroupBase &ext) |
Initialize, taking the default StepHandlers as the current ones, possibly overridden by the default ones in the auxilliary group supplied in the argument. | |
StepWithHint | next () |
Return the next step;. | |
void | addPreHandler (tStepHdlPtr sh, tHintPtr hint, const HandlerGroupBase &ext) |
Add a step handler, sh to the current list of pre-handlers. | |
void | addPostHandler (tStepHdlPtr sh, tHintPtr hint, const HandlerGroupBase &) |
Add a step handler, sh, to the current list of post-handlers. | |
void | addHint (tHintPtr hint, const HandlerGroupBase &ext) |
Add a hint to the currently selected main handler. | |
StepVector & | preHandlers () |
Return a reference to the list of default pre-handlers. | |
const StepVector & | preHandlers () const |
Return a reference to the list of default pre-handlers. | |
virtual tStepHdlPtr | defaultHandler () const =0 |
Return a pointer to the default main handler. | |
StepVector & | postHandlers () |
Return a reference to the list of default post-handlers. | |
const StepVector & | postHandlers () const |
Return a reference to the list of default post-handlers. | |
virtual tStepHdlPtr | handler () const =0 |
Return a pointer to the current main handler. | |
virtual void | setHandler ()=0 |
Unset the current main handler. | |
virtual bool | setHandler (tStepHdlPtr, const HandlerGroupBase &ext)=0 |
Set the current main handler, but also refill the current pre- and post- handlers with the defaults from ext. | |
virtual void | refillDefaultHandler (tStepHdlPtr)=0 |
Set the current main handler. | |
void | refillDefaults (const HandlerGroupBase &) |
Fill main, pre- and post- handlers with the default ones. | |
virtual void | clear () |
Clear all current handlers, but don't touch the default ones. | |
virtual string | handlerClass () const =0 |
Return the base class name of the main handler type. | |
void | interfaceSetPrehandler (StepHdlPtr p, int i) |
Utility function used for the interface. | |
void | interfaceInsertPrehandler (StepHdlPtr p, int i) |
Utility function used for the interface. | |
void | interfaceErasePrehandler (int i) |
Utility function used for the interface. | |
vector< StepHdlPtr > | interfaceGetPrehandlers () const |
Utility function used for the interface. | |
void | interfaceSetPosthandler (StepHdlPtr p, int i) |
Utility function used for the interface. | |
void | interfaceInsertPosthandler (StepHdlPtr p, int i) |
Utility function used for the interface. | |
void | interfaceErasePosthandler (int i) |
Utility function used for the interface. | |
vector< StepHdlPtr > | interfaceGetPosthandlers () const |
Utility function used for the interface. | |
virtual void | write (PersistentOStream &) const |
Write to persistent streams. | |
virtual void | read (PersistentIStream &) |
Read from persistent streams. | |
Protected Member Functions | |
HandlerGroupBase (const HandlerGroupBase &) | |
The copy constructor is only used via subclasses. | |
Protected Attributes | |
bool | isEmpty |
True if the current handlers are empty. | |
StepVector | theDefaultPreHandlers |
The default pre-handlers with hints. | |
StepVector | theDefaultPostHandlers |
The default post-handlers with hints. | |
StepHintVector | thePreHandlers |
The current pre-handlers with hints. | |
HintVector | theHints |
The current hints for the main handler. | |
StepHintVector | thePostHandlers |
The current post-handlers with hints. | |
Private Member Functions | |
void | checkInsert (StepHintVector ¤t, const StepVector &def) |
Add handlers from the def vector to the current, supplying them with default hints. | |
HandlerGroupBase & | operator= (const HandlerGroupBase &) |
Assignment is private. |
StepHandler
s.
The derived StepHandler has a main StepHandler (CascadeHandler, MultipleInteractionHandler, HadronizationHandler or DecayHandler) while this bease class has a list of pre-hadlers and a list of post-handlers.
The HandlerGroup
class is used in the EventHandler and SubProcessHandler to manage the post-sub-process handler, the cascade, multiple interaction, hadronization and decay handler groups. When an event is generated, after the main sub-process is performed, all handler groups are processed in turn. In each group the pre-hadnlers are run first, followed by the main handler (which may be run several times is more than one Hint has been specified) and finally the post-handlers are run.
When a group is initialised before each run, an auxilliary HandlerGroupBase object may be specified to override the default handlers in this group.
Definition at line 44 of file HandlerGroup.h.
typedef pair<StepHdlPtr, HintPtr> ThePEG::HandlerGroupBase::StepWithHint |
typedef vector<StepHdlPtr> ThePEG::HandlerGroupBase::StepVector |
typedef vector<StepWithHint> ThePEG::HandlerGroupBase::StepHintVector |
A vector of StepHandler objects associated with Hint objects.
Definition at line 55 of file HandlerGroup.h.
typedef deque<HintPtr> ThePEG::HandlerGroupBase::HintVector |
void ThePEG::HandlerGroupBase::addPreHandler | ( | tStepHdlPtr | sh, | |
tHintPtr | hint, | |||
const HandlerGroupBase & | ext | |||
) |
Add a step handler, sh to the current list of pre-handlers.
Optionally a hint may be specified. If the main handler has already been executed, the object is reinitialized using ext to override defaults.
void ThePEG::HandlerGroupBase::addPostHandler | ( | tStepHdlPtr | sh, | |
tHintPtr | hint, | |||
const HandlerGroupBase & | ||||
) |
Add a step handler, sh, to the current list of post-handlers.
Optionally a hint may be specified. If the main handler has already been executed, the object is reinitialized using ext to override defaults.
void ThePEG::HandlerGroupBase::addHint | ( | tHintPtr | hint, | |
const HandlerGroupBase & | ext | |||
) |
Add a hint to the currently selected main handler.
If the main handler has already been executed, the object is reinitialized using ext to override defaults.
virtual void ThePEG::HandlerGroupBase::refillDefaultHandler | ( | tStepHdlPtr | ) | [pure virtual] |
Set the current main handler.
If the null pointer use the default main handler.
Implemented in ThePEG::HandlerGroup< HDLR >, ThePEG::HandlerGroup< ThePEG::CascadeHandler >, ThePEG::HandlerGroup< ThePEG::HadronizationHandler >, ThePEG::HandlerGroup< ThePEG::SubProcessHandler >, ThePEG::HandlerGroup< ThePEG::DecayHandler >, and ThePEG::HandlerGroup< ThePEG::MultipleInteractionHandler >.
void ThePEG::HandlerGroupBase::refillDefaults | ( | const HandlerGroupBase & | ) |
Fill main, pre- and post- handlers with the default ones.
The default handlers in the argument takes precedence to this.
Referenced by init().