Question store best fit as float after minimization

Dear Users,

I have a simple question which I could not find the answer to after looking through the documentation. I am performing a minimisation with TMinuit, and instead of outputting the best fit parameters and their errors, I wanted to store them as floats in my code; is there a direct way of doing this?
Currently performing the minimization with

gMinuit = TMinuit(2)
#[...]
gMinuit.Migrad()

outputs all the information, and I have further found that with

amin, edm, errdef = ctypes.c_double(0.18), ctypes.c_double(0.19), ctypes.c_double(0.20)
nvpar, nparx, icstat = ctypes.c_int(1983), ctypes.c_int(1984), ctypes.c_int(1985)
gMinuit.mnstat( amin, edm, errdef, nvpar, nparx, icstat )
gMinuit.mnprin( 3, amin )

one can get only the best fit parameters and their errors to be printed, but I would like to store them as variables.
Thanks in advance for your help.

Hi,

You can use gMinuit.GetParameter or gMinuit.mnpout.
Otherwise, you can use the recommended Minimizer class. I will provide you an example in Minimization in PyROOT

Lorenzo

Thanks! Just to clarify things, the initially specified parameter value currentValue and its error currentError can be arbitrary here? Are they just used to allocate the return values to an address?

yes, this is correct. Just used to pass multiple return values.

Lorenzo

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