ThePEG  1.8.0
AnalysisHandler.h
1 // -*- C++ -*-
2 //
3 // AnalysisHandler.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2011 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 2 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 */