I am trying to do an unbinned 2D fit where I create the PDFs from 2D histograms, where one of the axis of the histogram has variable bins and the other axis has uniform bins. My model looks something like:
RooHistPdf rBkg1_Pdf("rBkg1_Pdf","rBkg1_Pdf",RooArgSet(rMass,rPt),RooDataHist("rBkg_hist","rBkg_hist",RooArgList(rMass,rPt),hBkg),0); RooHistPdf rComp_Pdf("rComp_Pdf","rComp_Pdf",RooArgSet(rMass,rPt),RooDataHist("rComp_Hist","rComp_Hist",RooArgList(rMass,rPt),hComp),order); RooRealVar f2("f2","Number of particles",0,nEntries); RooAddPdf Model("Model","Extended sum templates",RooArgList(rBkg1_Pdf,rComp_Pdf), RooArgList( RooConst(f1),f2,));
where f1 is fixed and only f2 is a free parameter in the fit.
But I encountered the following problems:
- After I fit the data and make the projection in a given rPt range with uniform rMass bins and I plot only the rBkg1_Pdf component I see there is a shift, even tho f1 is fixed. You can see this in the plots below where I compared the data with the histogram (that is use for the PDF) and what I get when i plot the component from the fit.
How can I make this component from the fit to have the same shape as the red open bullet histogram?
- If I look at the other projection where I have variable bins , the fit is working, but I see the normalization is off because I have variable bins. Do you have any suggestions how can I fix this?
Thanks in advance!