thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
AnalysisHandler.h
1 // -*- C++ -*-
2 //
3 // AnalysisHandler.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_AnalysisHandler_H
10 #define ThePEG_AnalysisHandler_H
11 // This is the declaration of the AnalysisHandler class.
12 
13 #include "HandlerBase.h"
14 #include "AnalysisHandler.fh"
15 #include "ThePEG/Vectors/LorentzRotation.h"
16 #include "ThePEG/Analysis/FactoryBase.h"
17 #include "ThePEG/EventRecord/Event.h"
18 #include <stdexcept>
19 
20 namespace ThePEG {
21 
42 
43 public:
44 
49 
54 
59 
64 
65 public:
66 
87  virtual void analyze(tEventPtr event, long ieve, int loop, int state);
88 
97  virtual LorentzRotation transform(tEventPtr event) const;
98 
105  virtual LorentzRotation transform(tcEventPtr event) const;
106 
113  virtual void analyze(const tPVector & particles);
114 
121  virtual void analyze(const tPVector & particles, double weight);
122 
128  virtual void analyze(tPPtr particle);
129 
135  virtual void analyze(tPPtr particle, double weight);
136 
138 
146  bool checkHistogramFactory(bool warn = false) const;
147 
152 
156  const FactoryBase & histogramFactory() const;
157 
162  AIDA::IHistogramFactory & iHistogramFactory() const {
164  }
165 
174  void normalize(tH1DPtr h, CrossSection unit = picobarn) const;
175 
179  void unitNormalize(tH1DPtr h) const;
181 
182 public:
183 
190  void persistentOutput(PersistentOStream & os) const;
191 
197  void persistentInput(PersistentIStream & is, int version);
198 
200 
204  static void Init();
205 
206 protected:
207 
214  virtual IBPtr clone() const;
215 
220  virtual IBPtr fullclone() const;
221 
223 
224 private:
225 
232 
233 public:
234 
236  class NoHistFactory: public InitException {};
237 
238 private:
239 
245 
246 };
247 
252 template <>
255  typedef HandlerBase NthBase;
256 };
257 
260 template <>
261 struct ClassTraits<AnalysisHandler>: public ClassTraitsBase<AnalysisHandler> {
263  static string className() { return "ThePEG::AnalysisHandler"; }
264 };
265 
268 }
269 
270 #endif /* ThePEG_AnalysisHandler_H */
PersistentIStream is used to read persistent objects from a stream where they were previously written...
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data...
FactoryBase::tH2DPtr tH2DPtr
Convenient typedef for pointer to AIDA::IHistogram1D.
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition: RCPtr.h:696
The LorentzRotation class combine a SpinOneLorentzRotation and a spin SpinHalfLorentzRotation to prov...
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:519
AIDA::IHistogram2D * tH2DPtr
Convenient typedef for pointer to AIDA::IHistogram2D.
Definition: FactoryBase.h:64
Here is the documentation of the FactoryBase class.
Definition: FactoryBase.h:47
virtual LorentzRotation transform(tEventPtr event) const
Transform the event to the desired Lorentz frame and return the corresponding LorentzRotation.
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
The AnalysisHandler is the base class of all analysis objects which may be handled by the FullEventGe...
AnalysisVector theSlaves
A list of slave analysis objects which are called for the same extracted particles and in the same Lo...
void normalize(tH1DPtr h, CrossSection unit=picobarn) const
Normalize the histogran h using the collected statistics from the EventGenerator. ...
AIDA::IHistogramFactory & histogramFactory() const
A pointer to the underlying AIDA::IHistogramFactory object.
InitState state() const
Return the state of initialization of this object.
FactoryBase::tcH1DPtr tcH1DPtr
Convenient typedef for pointer to AIDA::IHistogram1D.
const AIDA::IHistogram2D * tcH2DPtr
Convenient typedef for pointer to const AIDA::IHistogram2D.
Definition: FactoryBase.h:69
static void Init()
Standard Init function used to initialize the interface.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
virtual void analyze(tEventPtr event, long ieve, int loop, int state)
Analyze a given Event.
bool checkHistogramFactory(bool warn=false) const
Check if the associated EventGenerator has been assigned a histogram factory.
static ClassDescription< AnalysisHandler > initAnalysisHandler
The static object used to initialize the description of this class.
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
FactoryBase & histogramFactory()
Access the HistogramFactory from the EventGenerator.
AIDA::IHistogramFactory & iHistogramFactory() const
Access the underlying AIDA::IHistogramFactory in the HistogramFactory from the EventGenerator.
FactoryBase::tcH2DPtr tcH2DPtr
Convenient typedef for pointer to AIDA::IHistogram1D.
HandlerBase is an abstract base class derived from the Interfaced class via the HandlerBaseT class ad...
Definition: HandlerBase.h:151
AIDA::IHistogram1D * tH1DPtr
Convenient typedef for pointer to AIDA::IHistogram1D.
Definition: FactoryBase.h:54
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
virtual IBPtr fullclone() const
Make a clone of this object, possibly modifying the cloned object to make it sane.
FactoryBase::tH1DPtr tH1DPtr
Convenient typedef for pointer to AIDA::IHistogram1D.
virtual IBPtr clone() const
Make a simple clone of this object.
const AIDA::IHistogram1D * tcH1DPtr
Convenient typedef for pointer to const AIDA::IHistogram1D.
Definition: FactoryBase.h:59
vector< tPPtr > tPVector
A vector of transient pointers to Particle objects.
Definition: Containers.h:82
Exception class used if no histogram factory was found.
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
vector< AnaPtr > AnalysisVector
A vector of pointers to AnalysisHandler objects.
Definition: Containers.h:112
void unitNormalize(tH1DPtr h) const
Normalize the histogran h to unit integral.
The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG...
Definition: ClassTraits.h:52