Draw fit parameters

Dear co-rooters,

I am fitting two sets of data points. I want to get the fit parameters and draw them in the same TMultiGraph as a function.

mass_T1.C (9.8 KB)


I’m not sure what you mean by “draw” the fit parameters, but to show them on the canvas you can simply use TLatex, or add them to a TPaveText, for instance. The fitted function is automatically drawn on the same pad when you do Fit, but to separately draw a function with the same resulting parameters, you can just create, e.g., a TF1 using those parameters and draw it on top of the pad/canvas you want; for a “pol4” the function should be p[0] + p[1]*x + ... + p[4]*x^4 (the fit parameters being p[i]).

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