thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.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.
 
typedef vector< StepHdlPtrStepVector
 A vector of StepHandler objects.
 
typedef vector< StepWithHintStepHintVector
 A vector of StepHandler objects associated with Hint objects.
 
typedef deque< HintPtrHintVector
 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.
 
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.
 
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< 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 &)=delete
 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.

◆ 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.

◆ 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.

◆ clear()

◆ defaultHandler()

◆ empty()

bool ThePEG::HandlerGroupBase::empty ( ) const
inline

Returns true if current selections in this group is empty.

Definition at line 75 of file HandlerGroup.h.

References isEmpty.

◆ handler()

◆ handlerClass()

◆ init()

void ThePEG::HandlerGroupBase::init ( const HandlerGroupBase ext)
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().

◆ postHandlers() [1/2]

StepVector & ThePEG::HandlerGroupBase::postHandlers ( )
inline

Return a reference to the list of default post-handlers.

Definition at line 135 of file HandlerGroup.h.

References theDefaultPostHandlers.

◆ postHandlers() [2/2]

const StepVector & ThePEG::HandlerGroupBase::postHandlers ( ) const
inline

Return a reference to the list of default post-handlers.

Definition at line 140 of file HandlerGroup.h.

References theDefaultPostHandlers.

◆ preHandlers() [1/2]

StepVector & ThePEG::HandlerGroupBase::preHandlers ( )
inline

Return a reference to the list of default pre-handlers.

Definition at line 120 of file HandlerGroup.h.

References theDefaultPreHandlers.

◆ preHandlers() [2/2]

const StepVector & ThePEG::HandlerGroupBase::preHandlers ( ) const
inline

Return a reference to the list of default pre-handlers.

Definition at line 125 of file HandlerGroup.h.

References theDefaultPreHandlers.

◆ read()

◆ refillDefaultHandler()

virtual void ThePEG::HandlerGroupBase::refillDefaultHandler ( tStepHdlPtr  )
pure virtual

◆ 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().

◆ setHandler() [1/2]

◆ setHandler() [2/2]

virtual bool ThePEG::HandlerGroupBase::setHandler ( tStepHdlPtr  ,
const HandlerGroupBase ext 
)
pure virtual

◆ write()

Member Data Documentation

◆ isEmpty

bool ThePEG::HandlerGroupBase::isEmpty
protected

True if the current handlers are empty.

Definition at line 240 of file HandlerGroup.h.

Referenced by empty().

◆ theDefaultPostHandlers

StepVector ThePEG::HandlerGroupBase::theDefaultPostHandlers
protected

The default post-handlers with hints.

Definition at line 260 of file HandlerGroup.h.

Referenced by postHandlers().

◆ theDefaultPreHandlers

StepVector ThePEG::HandlerGroupBase::theDefaultPreHandlers
protected

The default pre-handlers with hints.

Definition at line 255 of file HandlerGroup.h.

Referenced by preHandlers().

◆ theHints

HintVector ThePEG::HandlerGroupBase::theHints
protected

The current hints for the main handler.

Definition at line 270 of file HandlerGroup.h.

◆ thePostHandlers

StepHintVector ThePEG::HandlerGroupBase::thePostHandlers
protected

The current post-handlers with hints.

Definition at line 275 of file HandlerGroup.h.

◆ thePreHandlers

StepHintVector ThePEG::HandlerGroupBase::thePreHandlers
protected

The current pre-handlers with hints.

Definition at line 265 of file HandlerGroup.h.


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