00001
00002
00011
00012
00013 #ifndef APWeightHist_h
00014 #define APWeightHist_h
00015 #include "TH1D.h"
00016 #include <string>
00017
00018 class APWeightEntry;
00019 class TGraphErrors;
00020 class TGraphAsymmErrors;
00021
00022 class APWeightHist : public TH1D {
00023
00024 public:
00025 APWeightHist(const char *name,const char *title, const int n_bins, const float x_min, const float x_max);
00026 APWeightHist();
00027 ~APWeightHist();
00028 using TH1D::Fill;
00029 int Fill(const double value, APWeightEntry* weight);
00030 TGraphAsymmErrors* GetGraphStatUncert(bool autocompute = true);
00031 TGraphErrors* GetGraphSystUncert(bool simple = true, bool autocompute = true);
00032 void ComputeGraph(const int prec = 250);
00033 TH1D* GetBinPDF(unsigned int bin, bool autocompute = true);
00034
00035
00036
00037 private:
00038 double _computed_entries;
00039 std::vector< std::vector< APWeightEntry* > > _binned_weights;
00040 std::vector< TH1D* > _bin_dists;
00041 std::vector< double > fSumSys2;
00042 TGraphAsymmErrors* _graph_stat;
00043 TGraphErrors* _graph_syst;
00044 int _prec;
00046 };
00047
00048 #endif