Fitting 2+ Functions Smultaneously Using Minuit

I am aware that this is what minexam.cxx does, but I am having a hard time understanding what the program is actually doing. I need to fit a set of data to a function with four parameters, with the first parameter variable according to a counter (the first 100 or so data points use one parameter, the next use a different one, etc) to minimize the chi square value. Can anyone please help explain how minexam is working? I see that they generated random data and then calculated chi square, but I am not sure how to vary the program to use the function, data, and parameters I want.

I am under the assumption that minexam is calculating the chi square value and then using Minuit to minimize it for the best fit. If anyone could help explain any of this program, it would be very much appreciated!
Thanks!

1 Like

Hi,

For combined fits , I would suggest you to look at the example

root.cern.ch/root/html534/tutori … Fit.C.html

and if you want just to create and minimise your own chi2, look at the example

root.cern.ch/root/html534/tutori … ion.C.html

Lorenzo