I have a basic code to perform a template fit using standard 1D histograms as inputs. To do this, I have created the different profiles using RooHistPdf. The construction has been done as (for each component):
RooDataHist *DH_hs1 = new RooDataHist("DH_hs1","hs1 Histogram",*x,hs1);
RooHistPdf *PDF_hs1 = new RooHistPdf("PDF_hs1","PDF for DH_hs1",RooArgSet(*x),*DH_hs1);
After put everything in a WS, I construct the model as:
then, the fit over data produces a [color=#0040FF]result A[/color].
Now, In order to include some nuisance parameters I have to construct the same model but using RooHistFunc instead of RooHistPdf. The procedure is:
RooDataHist *DH_hs1_Norm = new RooDataHist("DH_hs1_Norm","hs1 Histogram", *x, hs1_Norm);
Where [color=#FF0000]hs1_Norm[/color] histogram is normalized to 1. Then the RooHistFunc:
and finally, the new model using the RooHistFunc:
This fit result over the same data is called [color=#0040FF]result B[/color]
The point is that both results are completely differents. [color=#0040FF]Result A[/color] makes sense but not [color=#0040FF]Result B[/color], where one of the parameters goes up to the limit. So, my questions are:
- Does ASUM work for RooHistFunc as SUM works for RooHistPdf?
- Any idea why the model constructed with RooHistFunc does not agree with the one constructed with RooHistPdf?
I have attached the full code with its corresponding input and the output. I will really appreciate all your help/comments/suggestions about this topic.
Output.txt (10.3 KB)
Input.root (6.71 KB)
roofitQuestion.C (5.22 KB)