I am trying to fit the sum of a double sided Crystal Ball (for signal) and an Exponential (for background) to a weighted RooDataset, via an unbinned maximum likelihood fit.
I am performing the fit in a sub range of the master variable.
The fit goes fine, and the fitted values of the yields make sense. But when I attempt to plot the results, the background shape is a lot higher than the total fit. It looks like the normalization of the background is wrong. This happens even though I pass the SumCoefRange option in the fitTo command. I don’t understand why the normalization is off only for one of the fit components.
I am attaching my runnable test code, input workspace, and a screenshot of the fit output.
So you are always plotting the sumPdf, and the total sum is normalised to the data. Then, you select only the named components (you can also select multiple using commas), but the normalisation is still with reference to the total sum.