1 #ifndef PhysicsTools_Utilities_HistoPoissonLikelihoodRatio_h
2 #define PhysicsTools_Utilities_HistoPoissonLikelihoodRatio_h
16 nBins_ = histo->GetNbinsX();
17 xMin_ = histo->GetXaxis()->GetXmin();
18 xMax_ = histo->GetXaxis()->GetXmax();
21 cont_.push_back(histo->GetBinContent(
i+1));
25 double chi2lambda = 0;
37 nBins_ = histo->GetNbinsX();
38 xMin_ = histo->GetXaxis()->GetXmin();
39 xMax_ = histo->GetXaxis()->GetXmax();
51 T &
function() {
return *
t_; }
52 const T &
function()
const {
return *
t_; }
64 unsigned int ndof = f.
numberOfBins() - numberOfFreeParameters;
65 std::cout <<
"chi-squared/n.d.o.f. = " << amin <<
"/" << ndof <<
" = " << amin/ndof
66 <<
"; prob: " << TMath::Prob(amin, ndof)
double operator()() const
size_t numberOfBins() const
HistoPoissonLikelihoodRatio()
std::vector< double > cont_
void setHistos(TH1 *histo)
HistoPoissonLikelihoodRatio(T &t, TH1 *histo, double rangeMin, double rangeMax)
static void print(double amin, unsigned int numberOfFreeParameters, const HistoPoissonLikelihoodRatio< T > &f)