ThePEG 2.3.0
|
HandlerGroupBase is the base class for the templated HandlerGroup utility class to manage a group of 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 &)=delete |
Assignment is private. | |
HandlerGroupBase is the base class for the templated HandlerGroup utility class to manage a group of 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 deque<HintPtr> ThePEG::HandlerGroupBase::HintVector |
A vector of Hint objects.
Definition at line 58 of file HandlerGroup.h.
typedef vector<StepWithHint> ThePEG::HandlerGroupBase::StepHintVector |
A vector of StepHandler objects associated with Hint objects.
Definition at line 55 of file HandlerGroup.h.
typedef vector<StepHdlPtr> ThePEG::HandlerGroupBase::StepVector |
A vector of StepHandler objects.
Definition at line 52 of file HandlerGroup.h.
typedef pair<StepHdlPtr, HintPtr> ThePEG::HandlerGroupBase::StepWithHint |
Associate a StepHandler with a Hint object.
Definition at line 49 of file HandlerGroup.h.
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.
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::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.
|
virtual |
Clear all current handlers, but don't touch the default ones.
Reimplemented in ThePEG::HandlerGroup< HDLR >, ThePEG::HandlerGroup< ThePEG::SubProcessHandler >, ThePEG::HandlerGroup< ThePEG::CascadeHandler >, ThePEG::HandlerGroup< ThePEG::MultipleInteractionHandler >, ThePEG::HandlerGroup< ThePEG::HadronizationHandler >, and ThePEG::HandlerGroup< ThePEG::DecayHandler >.
Referenced by init().
|
pure virtual |
Return a pointer to the default main handler.
Implemented in ThePEG::HandlerGroup< HDLR >, ThePEG::HandlerGroup< ThePEG::SubProcessHandler >, ThePEG::HandlerGroup< ThePEG::CascadeHandler >, ThePEG::HandlerGroup< ThePEG::MultipleInteractionHandler >, ThePEG::HandlerGroup< ThePEG::HadronizationHandler >, and ThePEG::HandlerGroup< ThePEG::DecayHandler >.
|
inline |
Returns true if current selections in this group is empty.
Definition at line 75 of file HandlerGroup.h.
References isEmpty.
|
pure virtual |
Return a pointer to the current main handler.
Implemented in ThePEG::HandlerGroup< HDLR >, ThePEG::HandlerGroup< ThePEG::SubProcessHandler >, ThePEG::HandlerGroup< ThePEG::CascadeHandler >, ThePEG::HandlerGroup< ThePEG::MultipleInteractionHandler >, ThePEG::HandlerGroup< ThePEG::HadronizationHandler >, and ThePEG::HandlerGroup< ThePEG::DecayHandler >.
|
pure virtual |
Return the base class name of the main handler type.
Implemented in ThePEG::HandlerGroup< HDLR >, ThePEG::HandlerGroup< ThePEG::SubProcessHandler >, ThePEG::HandlerGroup< ThePEG::CascadeHandler >, ThePEG::HandlerGroup< ThePEG::MultipleInteractionHandler >, ThePEG::HandlerGroup< ThePEG::HadronizationHandler >, and ThePEG::HandlerGroup< ThePEG::DecayHandler >.
|
inline |
Initialize, taking the default StepHandlers as the current ones, possibly overridden by the default ones in the auxilliary group supplied in the argument.
Definition at line 82 of file HandlerGroup.h.
References clear(), and refillDefaults().
|
inline |
Return a reference to the list of default post-handlers.
Definition at line 135 of file HandlerGroup.h.
References theDefaultPostHandlers.
|
inline |
Return a reference to the list of default post-handlers.
Definition at line 140 of file HandlerGroup.h.
References theDefaultPostHandlers.
|
inline |
Return a reference to the list of default pre-handlers.
Definition at line 120 of file HandlerGroup.h.
References theDefaultPreHandlers.
|
inline |
Return a reference to the list of default pre-handlers.
Definition at line 125 of file HandlerGroup.h.
References theDefaultPreHandlers.
|
virtual |
Read from persistent streams.
Reimplemented in ThePEG::HandlerGroup< HDLR >, ThePEG::HandlerGroup< ThePEG::SubProcessHandler >, ThePEG::HandlerGroup< ThePEG::CascadeHandler >, ThePEG::HandlerGroup< ThePEG::MultipleInteractionHandler >, ThePEG::HandlerGroup< ThePEG::HadronizationHandler >, and ThePEG::HandlerGroup< ThePEG::DecayHandler >.
Referenced by ThePEG::HandlerGroup< HDLR >::read().
|
pure virtual |
Set the current main handler.
If the null pointer use the default main handler.
Implemented in ThePEG::HandlerGroup< HDLR >, ThePEG::HandlerGroup< ThePEG::SubProcessHandler >, ThePEG::HandlerGroup< ThePEG::CascadeHandler >, ThePEG::HandlerGroup< ThePEG::MultipleInteractionHandler >, ThePEG::HandlerGroup< ThePEG::HadronizationHandler >, and ThePEG::HandlerGroup< ThePEG::DecayHandler >.
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().
|
pure virtual |
Unset the current main handler.
Implemented in ThePEG::HandlerGroup< HDLR >, ThePEG::HandlerGroup< ThePEG::SubProcessHandler >, ThePEG::HandlerGroup< ThePEG::CascadeHandler >, ThePEG::HandlerGroup< ThePEG::MultipleInteractionHandler >, ThePEG::HandlerGroup< ThePEG::HadronizationHandler >, and ThePEG::HandlerGroup< ThePEG::DecayHandler >.
|
pure virtual |
Set the current main handler, but also refill the current pre- and post- handlers with the defaults from ext.
Implemented in ThePEG::HandlerGroup< HDLR >, ThePEG::HandlerGroup< ThePEG::SubProcessHandler >, ThePEG::HandlerGroup< ThePEG::CascadeHandler >, ThePEG::HandlerGroup< ThePEG::MultipleInteractionHandler >, ThePEG::HandlerGroup< ThePEG::HadronizationHandler >, and ThePEG::HandlerGroup< ThePEG::DecayHandler >.
|
virtual |
Write to persistent streams.
Reimplemented in ThePEG::HandlerGroup< HDLR >, ThePEG::HandlerGroup< ThePEG::SubProcessHandler >, ThePEG::HandlerGroup< ThePEG::CascadeHandler >, ThePEG::HandlerGroup< ThePEG::MultipleInteractionHandler >, ThePEG::HandlerGroup< ThePEG::HadronizationHandler >, and ThePEG::HandlerGroup< ThePEG::DecayHandler >.
Referenced by ThePEG::HandlerGroup< HDLR >::write().
|
protected |
True if the current handlers are empty.
Definition at line 240 of file HandlerGroup.h.
Referenced by empty().
|
protected |
The default post-handlers with hints.
Definition at line 260 of file HandlerGroup.h.
Referenced by postHandlers().
|
protected |
The default pre-handlers with hints.
Definition at line 255 of file HandlerGroup.h.
Referenced by preHandlers().
|
protected |
The current hints for the main handler.
Definition at line 270 of file HandlerGroup.h.
|
protected |
The current post-handlers with hints.
Definition at line 275 of file HandlerGroup.h.
|
protected |
The current pre-handlers with hints.
Definition at line 265 of file HandlerGroup.h.