thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
StepHandler.h
1// -*- C++ -*-
2//
3// StepHandler.h is a part of ThePEG - Toolkit for HEP Event Generation
4// Copyright (C) 1999-2019 Leif Lonnblad
5//
6// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8//
9#ifndef ThePEG_StepHandler_H
10#define ThePEG_StepHandler_H
11// This is the declaration of the StepHandler class.
12
14#include "ThePEG/Utilities/Exception.fh"
15#include "ThePEG/Handlers/HandlerBase.h"
16#include <stdexcept>
17
18namespace ThePEG {
19
41class StepHandler: public HandlerBase {
42
43public:
44
50 virtual ~StepHandler();
52
53public:
54
71 virtual void handle(EventHandler & eh, const tPVector & tagged,
72 const Hint & hint) = 0;
74
82
88
94 if ( !theNewStep ) createNewStep();
95 return theNewStep;
96 }
97
103 if ( theNewStep ) return theNewStep;
104 return theCurrentStep;
105 }
107
108public:
109
113 static void Init();
114
115protected:
116
121
122private:
123
129
134
140
141private:
142
147
151 StepHandler & operator=(const StepHandler &) = delete;
152
153};
154
161template <>
164 typedef HandlerBase NthBase;
165};
166
171template <>
172struct ClassTraits<StepHandler>: public ClassTraitsBase<StepHandler> {
174 static string className() { return "ThePEG::StepHandler"; }
175};
176
179}
180
181#endif /* ThePEG_StepHandler_H */
This is the main config header file for ThePEG.
A concreate implementation of ClassDescriptionBase describing an abstract class without persistent da...
The EventHandler is the base class used to implement event handlers in ThePEG.
Definition: EventHandler.h:63
HandlerBase is an abstract base class derived from the Interfaced class via the HandlerBaseT class ad...
Definition: HandlerBase.h:151
Hint is a base class to be used to pass information between StepHandler s, which cannot be convayed t...
Definition: Hint.h:48
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:519
StepHandler is the base class for implementing any model for a step in the event generation chain.
Definition: StepHandler.h:41
StepHandler & operator=(const StepHandler &)=delete
Private and non-existent assignment operator.
void eventHandler(tEHPtr)
Set a pointer to the EventHandler which made the last call to handle().
tStepPtr theNewStep
A pointer to a new step if created in the last call to handle().
Definition: StepHandler.h:133
tStepPtr theCurrentStep
A pointer to the current step.
Definition: StepHandler.h:139
void createNewStep()
Use the collision handler to create a new step.
virtual ~StepHandler()
The destructor.
tStepPtr currentStep()
If a new step has been created, return it, otherwise return the current step from the eventHandler().
Definition: StepHandler.h:102
tEHPtr eventHandler() const
Get a pointer to the EventHandler which made the last call to handle().
Definition: StepHandler.h:81
tEHPtr theEventHandler
A pointer to the (partial) collision handler which made the current call to handle().
Definition: StepHandler.h:128
tStepPtr newStep()
Return a pointer to a new step.
Definition: StepHandler.h:93
static void Init()
Standard Init function used to initialize the interface.
virtual void handle(EventHandler &eh, const tPVector &tagged, const Hint &hint)=0
The main function called by the EventHandler class to perform a step.
static AbstractNoPIOClassDescription< StepHandler > initStepHandler
Describe an abstract class without persistent data.
Definition: StepHandler.h:146
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
vector< tPPtr > tPVector
A vector of transient pointers to Particle objects.
Definition: Containers.h:82
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition: ClassTraits.h:161
static string className()
Return the name of class T.
Definition: ClassTraits.h:66
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30