Hello everyone. I have copied and modified the following code in pyROOT. I keep getting the error message: Fit:0: RuntimeWarning: Abnormal termination of minimization. Invalid FitResult (status = 4 ). Now and I need to SetPrecision of the minimizer to 0.1 to get converged results, but I don’t know how to do it in pyROOT. Thank you

import numpy as np
from ROOT import TCanvas, TGraph
from ROOT import kGreen
from ROOT import TF1

#Data
data = np.loadtxt(‘lep.txt’)
r = data[:, 0]
V = data[:, 1]

#Canvas to plot on and graph
c = TCanvas()
g = TGraph(r.size, r.astype(np.double),V.astype(np.double))

Yes! My comment is that in the current script there’s no fitter yet, so we have to make one in order to be able to set its configuration. We discussed a similar problem here:

It’s C++, but I hope that it’s straightforward to translate it to Python. Let us know if it doesn’t work. (And also if you get it to work. Maybe somebody else will have the same problem in the future.)

I am not sure that SetPrecision is the right thing to do in this case. You should normally used the default precision value since you are doing a simple fit and the likelihood/chisquare is computed using double precision.
If your fit does not converge, maybe is due to a different problem, e.g. bad initial parameter values