Greetings all,
I am trying to perform a fit to a set of curves. I posted about this at the beginning of May and Lorenzo offered to help me with the fit, but the equation I was trying to fit to was incorrect and had to have a serious rethink of the physics of the situation before taking it forward.
The actual equation I need to fit is:
Sorry about the equation image and its size - I could get neither LaTex nor the BBcode size tags to work.
I have values for FW and Xk and I am trying to find the best global values for parameters G2 and G4. The various detector angles (theta) may give rise to somewhat different values for G2 and G4 but I am trying to get the single set of values that fits all four detector angles.
The various values for Xk are read from the ASCII file Xk.txt.
My many earlier attempts at this script had lots of badly formed C++ code, I think that I have tracked down most of the language errors.
I have tried to incorporate a simplified user-defined function “fTheta90” which contains just the numerator from the equation above (though I will eventually need to put the whole equation in). All that gets passed back by the user-defined function are values that approximate zero (not quite zero but infinitesimal).
I have tried making use of the various Xk values both in the form of arrays and as TGraphs but with no success.
Any guidance you can give on why only zero values that are being passed back by the user-defined function (and anything else I am doing wrong) would be greatly appreciated.
EDIT - I have tried the script in the following machine configs
ROOT 5.18/00b (branches/v5-18-00-patches@22563, Mar 20 2009, 00:45:00 on linuxx8664gcc)
CINT/ROOT C/C++ Interpreter version 5.16.29, Jan 08, 2008
and
ROOT 5.22/00 (trunk@26997, De 18 2008, 13:59:00 on win32)
CINT/ROOT C/C++ Interpreter version 5.16.29, Jan 08, 2008
Regards
Example_script.C (2.42 KB)
Example_script.C (2.42 KB)
PhiCanvas.root (16.6 KB)
Xk.txt (1.04 KB)