Variable bin width in RooDataHist

Hi,

I am trying to create a RooDataHist from a TH1 with variable bin width.
As I understand it the binning should be taken from the TH1 automatically, however this does not seem to be the case. I have attached a very small, simple .C macro which shows what I am trying to do. I have tried in RooFit v3.12 with ROOT 5.25/00 and v3.14 with 5.28/00. Both give the same error when constructing the DataHist:

[#0] ERROR:InputArguments – RooBinning::binEdges ERROR: bin number must be in range (0,0)
[#0] ERROR:InputArguments – RooBinning::binEdges ERROR: bin number must be in range (0,0)
[#1] INFO:DataHandling – RooDataHist::adjustBinning(sig_hist): fit range of variable x1 expanded to nearest bin boundaries: [0,10] --> [0,0]

I’d really appreciate any feedback on this.
Best Regards,
Sinéad

VarBinWidth_RooDataHist_eg.C (826 Bytes)