Getting the bin edges from a RooDataHist?

Hi all,

So I can interate over the bins in the RooDataHist with calls to numEntries() and get(), and use the returned RooArgSet to get the bin centers, but is there any easy way to get the bin widths for RooRealVar dimensions?

The values returned in the arguments list have their max/min set to the range of the whole dataset.


1 Like


From a RooRealVar you can get the binning, for example if you have a RooRealVar x , done with uniform binning you can do :

RooUniformBinning & b = (RooUniformBinning &) x.getBinning(0); 

and then you get the low/upper edge information using RooUniformBinning::binLow / binHIgh methods


Ahh! Brill, I will give that a go.