I am calculating some efficiencies. I use one TH1F where I read from data and one TH1F on which I call FillRandom. Both TH1F have same number of bin min and MAX. I then apply the infamous
TGraphAsymmErrors *grA = new TGraphAsymmErrors() ;
grA->Divide(TH1F_data,TH1F_fillRandom,"cl=0.683 b(1,1) mode");
There is something I do not understand. If I set the number of bins too small or if I not scan from 0 I get this error:
Info in <TROOT::TEfficiency::CheckEntries>: Histograms are not consistent: passed bin content > total bin content
Error in <TROOT::TEfficiency::CheckConsistency>: passed TEfficiency objects do not have consistent bin contents
Error in <TGraphAsymmErrors::Divide>: passed histograms are not consistent
But when I use a coarser binning everything works fine.
FillRandom fills fa1_hA following the distribution of fa1A. TGraphAsymmErrors::Divide(pass, all) in binomial mode requires that for each bin, the entries in pass are less or equal those in all. But calling this function, the agreement between you and ROOT is that pass is a subset of all. If you fill too many entries into pass (by reducing the bin width or increasing the number of entries) then that’s not the case anymore. Even if you adjust these parameters you can end up with cases where pass <= all is violated, because you use FillRandom() which creates a random distribution.
In general, creating an efficiency (or pass fraction) from a sampled distribution is a fairly fragile procedure. Are you sure you’re really looking for a binomial uncertainty here?
Thanks for the answer, no technically I do not need a binomial uncertainty here because my values are far from 1 or 0.
What would you suggest could be the best method?