00001
00002
00011
00012
00013 #ifndef APReweight_h
00014 #define APReweight_h
00015
00016 #include "APReweightBase.h"
00017 #include <string>
00018 #include <vector>
00019
00020 class TTree;
00021 class TH1;
00022 class TH1D;
00023 class TAxis;
00024 class APWeightEntry;
00025
00026 class APReweight : public APReweightBase {
00027
00028 public:
00029 APReweight();
00030 APReweight(TTree* denominator, std::string denominator_branch, TTree* numerator, std::string numerator_branch, unsigned int n_bins, double x_min, double x_max, bool isTrig = false);
00031 APReweight(std::vector< double > denominator, std::vector< double > numerator, unsigned int n_bins, double x_min, double x_max, bool isTrig = false);
00032 APReweight(TH1* denominator_in, TH1* numerator_in, bool isTrig = false);
00033 virtual ~APReweight();
00035 void ReadEfficiency(TH1* efficiency_in, TH1* err_low_in, TH1* err_high_in = 0);
00037 APWeightEntry* GetBinWeight(unsigned int bin) const;
00038 APWeightEntry* GetWeight(double value) const;
00040 double GetSampleScale() const;
00041 unsigned int NBins() const;
00042 unsigned int GetBin(double value) const;
00044 TH1D* GetDenominatorHist() const;
00045 TH1D* GetNumeratorHist() const;
00047 void SetSystUncert(double rel_uncert);
00048 void SetQuietMode(bool isQuiet = true);
00050
00051
00052 private:
00053 TH1D* _denominator_hist;
00054 TH1D* _numerator_hist;
00055 std::vector< APWeightEntry* > _weights;
00056 unsigned int _n_bins;
00057 TAxis *_axis;
00058 };
00059
00060 #endif