I posted this in the Pyroot subforum earlier, someone suggested I cross post it here.
I’m running a bunch of fits on a data set, defaulting to a Gaussian fit. However, sometimes that default fit fails to converge, in which case I would like to run a linear fit. I can’t seem to read the status of the failed fit though.
status = fit_hist.Fit("gaus","S")
print "Status1? ", status.Status()
if status==1:
status = fit_hist.Fit("x++","S")
print status.Status()
This always returns 0, no matter the outcome of the fit. I’ve also tried the .IsValid() method as well, with similar results.
FCN=4808 FROM HESSE STATUS=FAILED 11 CALLS 55 TOTAL
EDM=0 STRATEGY= 1 ERROR MATRIX UNCERTAINTY 100.0 per cent
EXT PARAMETER APPROXIMATE STEP FIRST
NO. NAME VALUE ERROR SIZE DERIVATIVE
1 Constant -1.52751e+03 6.75455e-01 -6.47143e+01 0.00000e+00
2 Mean 1.66445e+04 1.41421e+00 1.65371e+04 0.00000e+00
3 Sigma 3.44089e-01 3.90810e+02 -5.93897e-01 0.00000e+00
Status1? 0
Any suggestions on how to properly read out a failed fit?
The other thread is here:
viewtopic.php?f=14&t=19939&p=85700#p85700