thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
ThePEG::HandlerGroup< HDLR > Class Template Reference

HandlerGroup is a templated utility class to manage a group of StepHandlers. More...

#include <HandlerGroup.h>

Inheritance diagram for ThePEG::HandlerGroup< HDLR >:

Public Types

typedef Ptr< HDLR >::pointer HdlPtr
 A pointer to the template argument class.
 
typedef Ptr< HDLR >::transient_pointer tHdlPtr
 A transient pointer to the template argument class.
 
- Public Types inherited from ThePEG::HandlerGroupBase
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

virtual ~HandlerGroup ()
 Destructor.
 
virtual bool setHandler (tStepHdlPtr, const HandlerGroupBase &ext)
 Set the current main handler.
 
virtual void setHandler ()
 Unset the current main handler.
 
virtual tStepHdlPtr handler () const
 Return a pointer to the current main handler.
 
virtual tStepHdlPtr defaultHandler () const
 Return a pointer to the default main handler.
 
virtual void refillDefaultHandler (tStepHdlPtr)
 Set the current main handler.
 
virtual void clear ()
 Clear all current handlers, but don't touch the default ones.
 
virtual string handlerClass () const
 Return the base class name of the main handler type.
 
void interfaceSetHandler (HdlPtr)
 Utility function used for the interface.
 
HdlPtr interfaceGetHandler () const
 Utility function used for the interface.
 
virtual void write (PersistentOStream &os) const
 Write to persistent streams.
 
virtual void read (PersistentIStream &is)
 Read from persistent streams.
 
- Public Member Functions inherited from ThePEG::HandlerGroupBase
 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.
 

Private Member Functions

HandlerGroup< HDLR > & operator= (const HandlerGroup< HDLR > &)=delete
 Assignment is private.
 

Private Attributes

HdlPtr theDefaultHandler
 The default main handler.
 
HdlPtr theHandler
 The current main handler.
 

Additional Inherited Members

- Protected Member Functions inherited from ThePEG::HandlerGroupBase
 HandlerGroupBase (const HandlerGroupBase &)
 The copy constructor is only used via subclasses.
 
- Protected Attributes inherited from ThePEG::HandlerGroupBase
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.
 

Detailed Description

template<typename HDLR>
class ThePEG::HandlerGroup< HDLR >

HandlerGroup is a templated utility class to manage a group of StepHandlers.

All HandlerGroup classes are derived from the HandlerGroupBase class. As an example the specialization HandlerGroup<CascadeHandler> keeps a CascadeHandler object and associated pre- and post- StepHandlers, defining shich steps should be performed before the perturbative cascade, which object should be used for the cascade and which steps should be performed after.

The HandlerGroup keesp both a default main handler and the corresponding default pre- and post- handlers as well as the main handler and pre/post hadlers chosen for the current event. The current handlers are accompanied by Hints. Handlers which are copied from the default ones are accompanied by the default Hint, while handlers supplied from the outside may be accompanied by any kind of hint. The main handler can be supplied with several hints, the pre- and post- handlers may only have one hint each.

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.

See also
EventHandler
SubProcessHandler
StepHandler
CascadeHandler
MultipleInteractionHandler
HadronizationHandler
DecayHandler

Definition at line 321 of file HandlerGroup.h.

Member Typedef Documentation

◆ HdlPtr

template<typename HDLR >
typedef Ptr<HDLR>::pointer ThePEG::HandlerGroup< HDLR >::HdlPtr

A pointer to the template argument class.

Definition at line 326 of file HandlerGroup.h.

◆ tHdlPtr

template<typename HDLR >
typedef Ptr<HDLR>::transient_pointer ThePEG::HandlerGroup< HDLR >::tHdlPtr

A transient pointer to the template argument class.

Definition at line 329 of file HandlerGroup.h.

Member Function Documentation

◆ clear()

template<typename HDLR >
virtual void ThePEG::HandlerGroup< HDLR >::clear ( )
virtual

Clear all current handlers, but don't touch the default ones.

Reimplemented from ThePEG::HandlerGroupBase.

◆ defaultHandler()

template<typename HDLR >
virtual tStepHdlPtr ThePEG::HandlerGroup< HDLR >::defaultHandler ( ) const
inlinevirtual

Return a pointer to the default main handler.

Implements ThePEG::HandlerGroupBase.

Definition at line 359 of file HandlerGroup.h.

References ThePEG::HandlerGroup< HDLR >::theDefaultHandler.

◆ handler()

template<typename HDLR >
virtual tStepHdlPtr ThePEG::HandlerGroup< HDLR >::handler ( ) const
inlinevirtual

Return a pointer to the current main handler.

Implements ThePEG::HandlerGroupBase.

Definition at line 352 of file HandlerGroup.h.

References ThePEG::HandlerGroup< HDLR >::theHandler.

◆ handlerClass()

template<typename HDLR >
virtual string ThePEG::HandlerGroup< HDLR >::handlerClass ( ) const
virtual

Return the base class name of the main handler type.

Implements ThePEG::HandlerGroupBase.

◆ read()

template<typename HDLR >
virtual void ThePEG::HandlerGroup< HDLR >::read ( PersistentIStream is)
inlinevirtual

◆ refillDefaultHandler()

template<typename HDLR >
virtual void ThePEG::HandlerGroup< HDLR >::refillDefaultHandler ( tStepHdlPtr  )
virtual

Set the current main handler.

If the null pointer use the default main handler.

Implements ThePEG::HandlerGroupBase.

◆ setHandler() [1/2]

template<typename HDLR >
virtual void ThePEG::HandlerGroup< HDLR >::setHandler ( )
inlinevirtual

Unset the current main handler.

Implements ThePEG::HandlerGroupBase.

Definition at line 347 of file HandlerGroup.h.

References ThePEG::HandlerGroup< HDLR >::theHandler.

◆ setHandler() [2/2]

template<typename HDLR >
virtual bool ThePEG::HandlerGroup< HDLR >::setHandler ( tStepHdlPtr  ,
const HandlerGroupBase ext 
)
virtual

Set the current main handler.

Also refill the current pre- and post- handlers with the defaults from ext.

Implements ThePEG::HandlerGroupBase.

◆ write()

template<typename HDLR >
virtual void ThePEG::HandlerGroup< HDLR >::write ( PersistentOStream os) const
inlinevirtual

Member Data Documentation

◆ theDefaultHandler

template<typename HDLR >
HdlPtr ThePEG::HandlerGroup< HDLR >::theDefaultHandler
private

◆ theHandler

template<typename HDLR >
HdlPtr ThePEG::HandlerGroup< HDLR >::theHandler
private

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