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