RooHistPdf with unequal binning

Hi ROOT experts,

could you please help me understand this RooFit/ROOT issue that I am having:

I want to create a 2-dim PDF for my SM background which has constant entries given by MC efficiencies.

I do:

[code]RooRealVar mT(“mT”,“mT”, 0.0, 800.);
RooRealVar meff(“meff”,“meff”, 0.0, 5000.);

// Meff
// | C | D
// | — + —
// | A | B
// ------------- mT
Double_t effBkgA = 0.71943690000000005;
Double_t effBkgB = 0.1085825;
Double_t effBkgC = 0.13874990000000001;
Double_t effBkgD = 0.033230700000000002;

// x == mT
xBins = 2
double _xLimits[xBins+1]={0,100,800};
TArrayD xLimits(xBins+1,_xLimits);
// y == meff
yBins = 2
double _yLimits[yBins+1]={0,800,5000};
TArrayD yLimits(yBins+1,_yLimits);

TH2F smBkgd(“smBkgd”,“Standard Model Background”, xBins, _xLimits, yBins, _yLimits);
smBkgd.Fill( 50,400, effBkgA);
smBkgd.Fill(150,400, effBkgB);
smBkgd.Fill( 50,1000, effBkgC);
smBkgd.Fill(150,1000, effBkgD);

RooDataHist smHist(“smHist”,“Standard Model Background”, RooArgSet(mT,meff), &smBkgd);
RooHistPdf smPdf(“smPdf”,“Standard Model Background PDF”,RooArgSet(mT,meff),smHist);

TH2F bkgdHist(“bkgdHist”,“SM Bkg histogram”,xBins, _xLimits, yBins, _yLimits);
smPdf.fillHistogram(&bkgdHist,RooArgList(mT,meff));
bkgdHist.DrawCopy(“LEGO”);[/code]

My problem is that the input and output histograms (smBkgd, bkgdHist) do not agree. While the input hist nicely follows my MC efficiencies, the one created from the PDF does not anymore :frowning:
If I use equal bin sizes everything works fine, but that’s not what I want to do.

Any idea what I am missing here ?

Thanks!
Till

This problem is fixed in root 5.20 (i just tried).
Till

that was maybe too fast …

in root 5.20, the TH2 filled from the RooHistPdf isn’t normalized correctly.
however, in contrast to root 5.18d a bkgdHist.GetBinContent(1,1)/bkgdHist.Integral() is right.

but when I go on and use this RooHistPdf, I get very funny results. I suspect this is because of the wrong normalization.

Are there any examples on RooHistPdf with variable bin sizes ?

Cheers,
Till

Hi,

Another round of fixes as gone into 5.21/04 that specifically address the issue of handling non-uniform bins. Can you try that version?

Wouter