ThePEG is hosted by Hepforge, IPPP Durham
ThePEG  2.1.0
ThePEG::HandlerGroupBase Class Referenceabstract

HandlerGroupBase is the base class for the templated HandlerGroup utility class to manage a group of StepHandlers. More...

#include <HandlerGroup.h>

Inheritance diagram for ThePEG::HandlerGroupBase:

Public Types

typedef pair< StepHdlPtr, HintPtrStepWithHint
 Associate a StepHandler with a Hint object. More...
 
typedef vector< StepHdlPtrStepVector
 A vector of StepHandler objects. More...
 
typedef vector< StepWithHintStepHintVector
 A vector of StepHandler objects associated with Hint objects. More...
 
typedef deque< HintPtrHintVector
 A vector of Hint objects. More...
 

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. More...
 
void addPostHandler (tStepHdlPtr sh, tHintPtr hint, const HandlerGroupBase &)
 Add a step handler, sh, to the current list of post-handlers. More...
 
void addHint (tHintPtr hint, const HandlerGroupBase &ext)
 Add a hint to the currently selected main handler. More...
 
StepVectorpreHandlers ()
 Return a reference to the list of default pre-handlers.
 
const StepVectorpreHandlers () const
 Return a reference to the list of default pre-handlers.
 
virtual tStepHdlPtr defaultHandler () const =0
 Return a pointer to the default main handler.
 
StepVectorpostHandlers ()
 Return a reference to the list of default post-handlers.
 
const StepVectorpostHandlers () 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. More...
 
void refillDefaults (const HandlerGroupBase &)
 Fill main, pre- and post- handlers with the default ones. More...
 
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< StepHdlPtrinterfaceGetPrehandlers () 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< StepHdlPtrinterfaceGetPosthandlers () 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 &current, const StepVector &def)
 Add handlers from the def vector to the current, supplying them with default hints.
 
HandlerGroupBaseoperator= (const HandlerGroupBase &)
 Assignment is private.
 

Detailed Description

HandlerGroupBase is the base class for the templated HandlerGroup utility class to manage a group of StepHandlers.

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.

See also
HandlerGroup

Definition at line 44 of file HandlerGroup.h.

Member Typedef Documentation

◆ HintVector

A vector of Hint objects.

Definition at line 58 of file HandlerGroup.h.

◆ StepHintVector

A vector of StepHandler objects associated with Hint objects.

Definition at line 55 of file HandlerGroup.h.

◆ StepVector

A vector of StepHandler objects.

Definition at line 52 of file HandlerGroup.h.

◆ StepWithHint

Associate a StepHandler with a Hint object.

Definition at line 49 of file HandlerGroup.h.

Member Function Documentation

◆ addHint()

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.

Referenced by init().

◆ addPostHandler()

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.

Referenced by init().

◆ addPreHandler()

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.

Referenced by init().

◆ refillDefaultHandler()

◆ refillDefaults()

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(), and postHandlers().


The documentation for this class was generated from the following file: