Error when fiting "Error in <ROOT::Math::FitResult>"

I am trying to do the same fit I am doing many times before in the same script. I added a new fit with a new set of data and it gives me this output:

Error in ROOT::Math::FitResult: FitConfiguration and Minimizer result are not consistent
Number of free parameters from FitConfig = 3
Number of free parameters from Minimizer = 2

And I can not find the source of the error, nor do I completely understand the error message.

In addition to that, if I swap the defenition of the function from: [0]*exp(-0.5*((x-[1])/[2])**2) to "gaus(0)" this error message disappears but myscript still does not work properly.

Any ideas where to start looking?


It looks there are some inconsistencies. Can you please post your script, so we can understand what is happening.


I have attached a snippet of my code with the relevent parts. I inherinted this script so it is not the most pretty peace of software and redoes many things via copy paste. These parts I have left out.

It builds on a script that has to be run before this that makes 3D Histograms (time difference of two detectors, pictures of relevant histos attached). It takes these and runs through all events checks their bin, checks if that bin has benn processed already, makes a projection of that bin in z direction and tries to do a gauss fit on that projection (1D histos).

I am trying to add another detector and analyze its time difference distribution but this is where the error arises and I do not know why.
In addition to this I have realized that by running the script a second time without closing root in between, the errors do not show up anymore but the script still does not produce the expected result but only an empty histogram.
.LookingForError.txt (5.8 KB)


From your code it is not clear what the problem is. If you are still having it, please add a full running macro. You can store the histograms in a ROOT file and attach also that file to this post


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