I am having a problem with the statistics panel of my fit. I am trying to fit the same function in my spectrum with different ranges but even though I change the range, my fit parameters, chi-square / ndf and etc don’t change in the fit statistics panel but if I ask to print in the terminal, using for example:
Hi,
Probably, since you are doing many fits with different ranges, the results refer to different fit results.
The best, is for each fit, you keep the TFitResult object , return by TH1::Fit when using option S.
You can then always add the desired values in the fit statistics panel.
when you say it, it’s for example, to me to do something like that:
h1->Fit("f4", "S");
?
and I am doing many fits but it’s not at the same time in my script. Actually, I run my script for each new range because of this I can’t understand why my fits in the statistics panel keep showing the same results, since they are independent.
I tried to do this but still doesn’t work =/ and also I am not doing each fit in the same time in my scrip, actually I run my script for each new range fit and save the results, because of this I cant understand why the results is the same even when I change the range, also, the Chi square and NDF make no sense for me, because I fiting 4 bins with a function that have 2 parameters (and the fit looks good for me) and I got a Chi square/NDF = 29.13/11. What do you think it can be?
I forgot to comment on all these lines that make the fit (how a said, I run only one fit per time, so I think I should let just the line that makes the fit that I want).
Doing this my Chi-square / ndf in the statistics panel is equal to that I print in the terminal using this