ROOT.gStyle.SetOptFit(1111)

Sorry, I meant (float)f->GetParameter are trustworthy and f->GetParameter are not?

f->GetParameter is fine, it returns s double.

In TGraphPainter (my example) parameters were still converted.

@couet In your last plot, the parameters and their errors are fine now. However, the “chi2” and “Prob” are still converted.

   printf("chi2 = %5.17g (%5.17g)\n", f->GetChisquare(), ((float)f->GetChisquare()));
   printf("Prob = %5.17g (%5.17g)\n", f->GetProb(), ((float)f->GetProb()));
   printf("p0 = %5.17g (%5.17g)\n", f->GetParameter(0), ((float)f->GetParameter(0)));
   printf("+- %5.17g (%5.17g)\n", f->GetParError(0), ((float)f->GetParError(0)));
   printf("p1 = %5.17g (%5.17g)\n", f->GetParameter(1), ((float)f->GetParameter(1)));
   printf("+- %5.17g (%5.17g)\n", f->GetParError(1), ((float)f->GetParError(1)));

Yes I know/see . In THistPainter it is the same. I wonder why. Maybe @moneta has an idea. I agree it seems not a good idea…

Hi both,
just one last question: if my extracted values were fine all along how can I change the values shown in the inset of the canvas?

Right now you cannot, they are converted to float. The only way would be that you draw the stats yourself with TText or via: ROOT: TPaveStats Class Reference

OK, thanks again a lot for your help!

@couet, I don’t see any reason to convert these parameters to float, you can go ahead removing it.

1 Like

PR here: Fit params were converted to float. by couet · Pull Request #12506 · root-project/root · GitHub