I have a RooHistPdf with variable binning which I am plotting with data that has the same variable binning. The code that does the important plotting is shown below. In the attached plot you can clearly see that the normalization is wrong. I’m pretty sure that this is only a normalization problem in the plotting. I have done same using uniform binning and the fit values are essentially unchanged and the plot looks look just fine. How do I get the plotting to do the right thing?
RooAbsBinning& plotBins = var->getBinning(“plotBinning”);
RooPlot * sframe = var->frame();
totalPdf->plotOn(sframe,ProjWData(*data), DrawOption(“LF”), FillStyle(1001),
FillColor(kOrange), LineColor(kOrange), Name(“h_total”),
data->plotOn(sframe, RooFit::DataError(errorType_), Name(“theData”),