Fixing a PDF contribution in RooRealSumPdf

Hello experts,

I am trying to make use of a composite pdf, similar to the RooFit example 201.

I have currently a working fit with three pdfs [pdf1, pdf2, pdf3] existing as RooHistFunc. I then build my model with
model = ROOT.RooRealSumPdf(“model”, “1+2+3”, [pdf1, pdf2, pdf3], [coeff1, coeff2]), where [coeff1, coeff2] exist as RooRealVar.

This works okay, but I would like to fix the contribution of pdf3 to be 5% of the total pdf. If I add a third constant coefficient, coeff3, to the set in the model definition, my fit no longer converges to coeff1+coeff2+coeff3 = 1. Could someone please help me to employ this behavior, as I cannot seem to find this type of procedure in a RooFit example.

Thanks!

Hi @N_grieser, welcome to the ROOT forum!

Just like in RooFit example 201, you should use the RooAddPdf and not the RooRealSumPdf to get the PDFs and coefficients normalized properly.

That means that your three PDFs should also be created as RooHistPdf and not RooHistFunc. The interface is the same, you just got to replace the class name. Then, you should be able to do exactly what you intended to do, defining three coefficients and then fixing the third one to 0.05 by using setConstant().

I hope that helps you to solve the problem, don’t hesitate to ask if you have further issues!

Jonas

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