ThePEG  1.8.0
XSecCheck.h
1 // -*- C++ -*-
2 #ifndef THEPEG_XSecCheck_H
3 #define THEPEG_XSecCheck_H
4 //
5 // This is the declaration of the XSecCheck class.
6 //
7 
8 #include "ThePEG/Handlers/AnalysisHandler.h"
9 
10 namespace ThePEG {
11 
21 class XSecCheck: public AnalysisHandler {
22 
23 public:
24 
30  XSecCheck() : target(ZERO), tol(0.01), sumw(0.0) {}
31 
35  virtual ~XSecCheck();
37 
38 public:
39 
43  struct UnexpectedXSec: public Exception {};
44 
45 public:
46 
66  virtual void analyze(tEventPtr event, long ieve, int loop, int state);
68 
69 public:
70 
77  void persistentOutput(PersistentOStream & os) const;
78 
84  void persistentInput(PersistentIStream & is, int version);
86 
93  static void Init();
94 
95 protected:
96 
103  virtual IBPtr clone() const;
104 
109  virtual IBPtr fullclone() const;
111 
112 
113 
114 protected:
115 
122  virtual void doinitrun() {
124  sumw = 0.0;
125  }
126 
131  virtual void dofinish();
133 
134 private:
135 
140 
145  double tol;
146 
150  double sumw;
151 
152 private:
153 
159 
164  XSecCheck & operator=(const XSecCheck &);
165 
166 };
167 
168 }
169 
170 #include "ThePEG/Utilities/ClassTraits.h"
171 
172 namespace ThePEG {
173 
178 template <>
179 struct BaseClassTrait<XSecCheck,1> {
181  typedef AnalysisHandler NthBase;
182 };
183 
186 template <>
187 struct ClassTraits<XSecCheck>
188  : public ClassTraitsBase<XSecCheck> {
190  static string className() { return "ThePEG::XSecCheck"; }
198  static string library() { return "XSecCheck.so"; }
199 };
200 
203 }
204 
205 #endif /* THEPEG_XSecCheck_H */