00001 // -*- C++ -*- 00002 // 00003 // AnalysisHandler.h is a part of ThePEG - Toolkit for HEP Event Generation 00004 // Copyright (C) 1999-2007 Leif Lonnblad 00005 // 00006 // ThePEG is licenced under version 2 of the GPL, see COPYING for details. 00007 // Please respect the MCnet academic guidelines, see GUIDELINES for details. 00008 // 00009 #ifndef ThePEG_AnalysisHandler_H 00010 #define ThePEG_AnalysisHandler_H 00011 // This is the declaration of the AnalysisHandler class. 00012 00013 #include "HandlerBase.h" 00014 #include "AnalysisHandler.fh" 00015 #include "ThePEG/Vectors/LorentzRotation.h" 00016 #include "ThePEG/Analysis/FactoryBase.h" 00017 #include "ThePEG/EventRecord/Event.h" 00018 #include <stdexcept> 00019 00020 namespace ThePEG { 00021 00041 class AnalysisHandler: public HandlerBase { 00042 00043 public: 00044 00048 typedef FactoryBase::tH1DPtr tH1DPtr; 00049 00053 typedef FactoryBase::tcH1DPtr tcH1DPtr; 00054 00055 public: 00056 00077 virtual void analyze(tEventPtr event, long ieve, int loop, int state); 00078 00085 virtual LorentzRotation transform(tEventPtr event) const; 00086 00092 virtual void analyze(const tPVector & particles); 00093 00098 virtual void analyze(tPPtr particle); 00099 00101 00109 bool checkHistogramFactory(bool warn = false) const; 00110 00114 FactoryBase & histogramFactory(); 00115 00119 const FactoryBase & histogramFactory() const; 00120 00129 void normalize(tH1DPtr h, CrossSection unit = picobarn) const; 00130 00134 void unitNormalize(tH1DPtr h) const; 00136 00137 public: 00138 00145 void persistentOutput(PersistentOStream & os) const; 00146 00152 void persistentInput(PersistentIStream & is, int version); 00153 00155 00159 static void Init(); 00160 00161 protected: 00162 00169 virtual IBPtr clone() const; 00170 00175 virtual IBPtr fullclone() const; 00176 00178 00179 private: 00180 00185 AnalysisVector theSlaves; 00187 00188 public: 00189 00191 class NoHistFactory: public InitException {}; 00192 00193 private: 00194 00199 static ClassDescription<AnalysisHandler> initAnalysisHandler; 00200 00201 }; 00202 00207 template <> 00208 struct BaseClassTrait<AnalysisHandler,1>: public ClassTraitsType { 00210 typedef HandlerBase NthBase; 00211 }; 00212 00215 template <> 00216 struct ClassTraits<AnalysisHandler>: public ClassTraitsBase<AnalysisHandler> { 00218 static string className() { return "ThePEG::AnalysisHandler"; } 00219 }; 00220 00223 } 00224 00225 #endif /* ThePEG_AnalysisHandler_H */