Problem with TGraphAsymmErrors


I’m using a TGraphAsymmErrors to calculate efficiency, due to some events with minus weights I have less events in total hist than pass hist in a few bins, leading to errors:

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 as I learnt from … ors:Divide, “If the denominator becomes 0 or pass > total, the corresponding bin is skipped.” Do I miss something?

Thank you in advance.


I think the documentation is wrong and we need to fix. It does not make sense compute a binomial error is passed is less than total, so this means there is a problem in the input histogram. I prefer not to change this in ROOT.

I understand with negative weights this can happen, but probably in that case you would need to compute the error yourself taking into account what negative weight means. If it is deleting events you should compute the error on the ratio from

Npassed - Npassed_deleted

Ntotal - Ntotal_deleted

Best Regards


Thank you Lorenzo!