ROOT Version: 6.12.04
Platform: Ubuntu 17.04
Compiler: gcc 7.2.0
Hi,
In attachment the macro that is causing me a little trouble. fitmass_root_talk.C (5.9 KB)
I am trying to fit different histograms in a cycle as you can see in the macro and all goes fine. However I have a problem with the graphic output of one of them.
I am quite sure is only a graphic problem beause the fit went well.
The total function that is fitting the distribution is a sum of 3 components. My purpose is to plot on the same pad the histo, the total fit function and the single components (2 gaussians for the picks and one power law for the continuum).
The parameters of the 3 functions are taken, after fitting, from the fit function (as you can see in the macro), so they should be aligned well with the red line (that is the fit function).
I checked with output to video that, after setting the parameters of the 3 functions as I told before, they are exactly the same as the parameters of the fit function.
In this canvas you can see there is the histo on the right that has the 3 functions as they were shifted upwards, while the bottom one is what I mean for “good” output. (the one without fit is ok, I didn’t fit that)
Of 10 histograms in total, only the one I am showing above is “wrong”.
All the other 9 are good as the bottom one.
I can’t explain this behavior, what do you suggest?
It is not a big fault, but I would like to know if I am missing something.
Davide