I am trying to fit a mass distribution using 2 double gaussians, a polynomial background and a cross-feed component (where a kaon is wrongly reconstructed as a pion and vice-versa).
The cross-feed component shape is known but extremely difficult to fit. I have therefore used a RooKeysPDF to take the crossfeed shape directly from real data
In the mass fit I want the RooKeysPDF shape to stay fixed but the yield to float…however when I try to run the fit (relevant code lines below) the RooKeysPDF cross-feed component always falls to zero - which is very suspicious - is the highlighted code step allowed? Do I need to do something special when using RooKeysPDF as a component in a larger fitting PDF?
Please see the attached plots which show that my fitting data is correctly imported and the RooKeysPDF is correctly produced - it seems there is something going wrong in the fitting step
Any comments/suggestions greatly appreciated-
// Import the mass distribution data I wish to fit (RooDataSetData) //blah blah blah..... // Create the RooKeysPDF // Import the background data I wish to use for the RooKeysPDF shape... RooKeysPdf CrossfeedShape("RooKeysPDFKaonCrossfeed", "RooKeysPDFKaonCrossfeed", Dplus_Dplus_DTF_M, TestData); // Create the complete PDF used to fit the mass distribution (RooDataSet Data) RooRealVar yieldCF("yieldCF", "yieldCF", num_entries/100 , 0, num_entries/10 ) // And other yields.... // IS THIS STEP VALID???!!! RooAddPdf sumPDF("SumPDF", "SumPDF", RooArgList(gauss1, gauss2, gauss3, gauss4, poly, CrossfeedShape), RooArgList(yieldgauss1, yieldgauss2, yieldgauss3, yieldgauss4, yieldpoly, yieldCF)); // Fit the distribution Dplus_Dplus_DTF_M.setRange(1820, 2050); sumPDF.fitTo(Data);