I am accessing the RooHist object from a TCanvas where it was plotted using RooDataHist::plotOn.
I am not sure if the RooDataHist was built with histograms with PoissonErrors. Would that matter?
Well, the errors are poissonian, i.e. sqrt(bin_content), but plotted symmetrically, which is good approximation only for a bin content >= 4 .
(Btw, I think this is the same that TH1::SetBinErrorOption(TH1::kPoisson)) does.)
The only solution is to set the asymmetric bins by your self. RooHist is a (derives from) TGraphAsymmErrors: you can use the methods SetPointError to set the errors you need.
In RooFit to plot Poisson (which is the default if you have unweighted data) you need to use the plot option DataError(RooAbsData::Poisson). Your plot looks to me done with the option DataError(RooAbsData::SumW2).
Probably you have weighted data.
For your second question you can use the code below:
thanks. this is very helpful. I believe this implementation also gives the correct upper for 0 bin contents, right, as opposed to the standard RooFit value?