RooCurve::average(Model) invalid range

Hi @Natilus!

Thanks for sharing parts of your code. I can’t run it though, which is a problem for fully understanding it, as I can’t experiment with it. The header and main function is missing. It would have helped also to add the terminal output and resulting plot.

But just from reading it: I have a few suggestions to address your issues.

  1. About the large chi2: it seems that you’re using RooCurve::chiSquare(). I would not recommend this, for reasons I have explained in this post:
    How to correctly extract the chi2, ndf, p-value of a RooFitResult - #3 by astauffe
    Can you try with RooAbsPdf::createChi2()?

  2. It’s true, when you call RooAddPdf::getVal(normSet) you’ll get the normalized value, which is not matching with your unnormalized histograms. You can use RooAddPdf::expectedEvents() to get the post-fit value of the total yield, which would be this scaling factor.

Does this help? Sorry for the long latency in replies. We’re wrapping up the next ROOT release, so the forum is falling a bit behind :frowning:

Cheers,
Jonas