Rivet  1.8.0
BinnedHistogram.hh
00001 // -*- C++ -*-
00002 #ifndef RIVET_BINNEDHISTOGRAM_HH
00003 #define RIVET_BINNEDHISTOGRAM_HH
00004 #include "Rivet/Rivet.hh"
00005 
00006 namespace Rivet {
00007 
00008   class Analysis;
00009 
00010 
00017   template<typename T>
00018   class BinnedHistogram {
00019   public:
00020 
00022     BinnedHistogram() {
00023       return;
00024     }
00025 
00028     const BinnedHistogram<T>& addHistogram(const T& binMin,
00029                                            const T& binMax,
00030                                            AIDA::IHistogram1D* histo);
00031 
00034     AIDA::IHistogram1D* fill(const T& bin,
00035                              const T& val,
00036                              double weight);
00037 
00040     void scale(const T& scale, Analysis* ana);
00041 
00042     const vector<AIDA::IHistogram1D*>& getHistograms() const { return _histos; }
00043     vector<AIDA::IHistogram1D*>& getHistograms() { return _histos; }
00044 
00045 
00046   private:
00047 
00048     map<T, AIDA::IHistogram1D*> _histosByUpperBound;
00049     map<T, AIDA::IHistogram1D*> _histosByLowerBound;
00050     vector<AIDA::IHistogram1D*> _histos;
00051     map<AIDA::IHistogram1D*, T> _binWidths;
00052 
00053   };
00054 
00055 
00056 }
00057 
00058 #endif