Asymmetric errors in histograms

Dear experts,

After a quick search I see that there is no way to set asymmetric bin errors in histograms.

I hope this is just outdated info, because I’m honestly shocked :open_mouth: I’ve changed my fitting code from using histograms to graphs and then to histograms again because of inadequencies in either object (or in my understanding of them!), and I really want to stick to histograms this time.

So if this possibility doesn’t exist, do you suggest a way to make my fit understand that the error bars don’t extend below zero?

Best regards,
Eleni

you should use TGraphAsymErrors.
root.cern.ch/root/html534/TGraphAsymmErrors.html

Hi,

An histogram should be used to represent counts (or weighted counts). So in the first case you have Poisson errors, and you can get symmetric errors, the Poisson confidence intervals (from Garwood), by calling the function TH1::SetBinErrorOption(TH1::kPoisson).
And when fitting an histogram you should use the likelihood method.

If you have just random points with some user defined asymmetric errors, you should then use the TGraphAsymErrors class, as suggested by Olivier

Best Regards

Lorenzo

1 Like