// -*- C++ -*- #ifndef __SCHOOL_ANALYSIS_HANDLER_H__ #define __SCHOOL_ANALYSIS_HANDLER_H__ 1 #include "analysis.h" #include namespace school { class analysis_handler { public: // default constructor analysis_handler(); // destructor; note we do not intent to derive classes from // analysis_handler ~analysis_handler(); // insert an analysis into this analysis handler template void add_analysis(const Analysis& ana) { _M_analyses.push_back(new Analysis(ana)); } // analyse an event void analyze(const event& ev, double weight); // calculate the integrated cross section and its error std::pair cross_section() const; // finalize this analysis handler void finalize(); private: // the lists of analyses to consider std::list _M_analyses; // the sum of weights double _M_sum_of_weights; // the sum of weights squared double _M_sum_of_squared_weights; // the total number of points unsigned long _M_n_points; }; } #endif