Fitting a Gaussian distribution with background using Roofit

I want to fit a Gaussian distribution with background (Chebychev function) using Roofit, but I am not able to set fitting procedure properly. What is wrong in the code? (3.7 KB)
The data file can de download at:


Before we dive in your code, could you perhaps compare what you have with the standard RooFit tutorial that shows how to fit two gaussians on top of a Chebychev background?


Thanks for your advice. I managed to improve the fitting, but I still have some doubts.
1 - How to change the fitting mecanism to Minuit2?
2 - Is there a command to reduce the verbose? I am using “PrintLevel=-1”, but my output has a lot of info yet.
3 - I can’t get a pdf with the plot of the histogram, the model and the backgroung. The canvas seems fine, but the pdf don’t. What am I doing wrong? (3.7 KB)

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