createIntegral ratio uncertainty

Dear RooFit experts,

I am fitting a distribution with two components, sig and bkg. I have to calculate the ratio of the yield of the two components in a sub-range of the full fitting range. How can I evaluate the uncertainty on that value?

What I am doing is:

bkg_fraction = bkg_pdf.createIntegral(x,x,RangeName='mySubRange')
sig_fraction = sig_pdf.createIntegral(x,x,RangeName='mySubRange')

ratio = yield_bkg.GetVal()*bkg_fraction/(yield_sig.GetVal()*sig_fraction)

Where yield_bkg and yield_bkg are yield parameters of the pdf bkg_pdf and sig_pdf, respectively.

I can evaluate the uncertainty on bkg_fraction with bkg_fraction.getPropagatedError(fit_result,x). But how can I propagate properly to the ratio? I can do analytically, but I don’t know how to access to the the correlation with and between the _fractions.

Thank you in advance.

Hi @vberta,

you are almost there! What you need to do is to calculate the ratio not in vanilla C++, but create a RooFormulaVar for it:

RooFormulaVar ratio{"ratio", "x[0]*x[1]/(x[2]*x[3])",
                    {yield_bkg, bkg_fraction, yield_sig, sig_fraction}};

Then you can also call getPropagatedError() on the ratio, which considers the full covariance matrix!

Hats off to you for noticing that with the error propagation you would miss the correlations, I have seen many people miss that :slight_smile:

Cheers,
Jonas

Hi @jonas,

Works perfectly. Thank you very much for this solution! :slight_smile: (I didn’t realize that getPropagatedError() is also a method of RooAbsReal)

Cheers,
Valerio

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.