thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
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 
13 #include "ThePEG/Config/ThePEG.h"
14 #include "ThePEG/Utilities/Exception.fh"
15 #include "ThePEG/Handlers/HandlerBase.h"
16 #include <stdexcept>
17 
18 namespace ThePEG {
19 
41 class StepHandler: public HandlerBase {
42 
43 public:
44 
50  virtual ~StepHandler();
52 
53 public:
54 
71  virtual void handle(EventHandler & eh, const tPVector & tagged,
72  const Hint & hint) = 0;
74 
81  tEHPtr eventHandler() const { return theEventHandler; }
82 
87  void eventHandler(tEHPtr);
88 
94  if ( !theNewStep ) createNewStep();
95  return theNewStep;
96  }
97 
103  if ( theNewStep ) return theNewStep;
104  return theCurrentStep;
105  }
107 
108 public:
109 
113  static void Init();
114 
115 protected:
116 
120  void createNewStep();
121 
122 private:
123 
129 
134 
140 
141 private:
142 
147 
151  StepHandler & operator=(const StepHandler &) = delete;
152 
153 };
154 
161 template <>
162 struct BaseClassTrait<StepHandler,1>: public ClassTraitsType {
164  typedef HandlerBase NthBase;
165 };
166 
171 template <>
172 struct ClassTraits<StepHandler>: public ClassTraitsBase<StepHandler> {
174  static string className() { return "ThePEG::StepHandler"; }
175 };
176 
179 }
180 
181 #endif /* ThePEG_StepHandler_H */
tStepPtr newStep()
Return a pointer to a new step.
Definition: StepHandler.h:93
The EventHandler is the base class used to implement event handlers in ThePEG.
Definition: EventHandler.h:63
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30
static void Init()
Standard Init function used to initialize the interface.
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:519
virtual ~StepHandler()
The destructor.
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
This is the main config header file for ThePEG.
StepHandler is the base class for implementing any model for a step in the event generation chain...
Definition: StepHandler.h:41
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
A concreate implementation of ClassDescriptionBase describing an abstract class without persistent da...
Hint is a base class to be used to pass information between StepHandler s, which cannot be convayed t...
Definition: Hint.h:48
tStepPtr theCurrentStep
A pointer to the current step.
Definition: StepHandler.h:139
static AbstractNoPIOClassDescription< StepHandler > initStepHandler
Describe an abstract class without persistent data.
Definition: StepHandler.h:146
tStepPtr theNewStep
A pointer to a new step if created in the last call to handle().
Definition: StepHandler.h:133
HandlerBase is an abstract base class derived from the Interfaced class via the HandlerBaseT class ad...
Definition: HandlerBase.h:151
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
StepHandler & operator=(const StepHandler &)=delete
Private and non-existent assignment operator.
tEHPtr theEventHandler
A pointer to the (partial) collision handler which made the current call to handle().
Definition: StepHandler.h:128
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
virtual void handle(EventHandler &eh, const tPVector &tagged, const Hint &hint)=0
The main function called by the EventHandler class to perform a step.
void createNewStep()
Use the collision handler to create a new step.
The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG...
Definition: ClassTraits.h:52