Multiple fits with SetOptFit parameters

Hello everyone,

I’m quite new to root and I hope you can help me with a fitting problem. I have several data points with errors in a TGraphErrors plot and try to fit them with a constant (pol0) and a straight line (pol1). With the “+” option of Fit I’m able to fit with both functions, access the parameters and I can also print them with cout. But in the SetOptFit-box only the parameter of the first function shows up. Does anyone know how to print both parameter sets in the same pave? I’ve tried with TText on my own but there are only character constants accepted, no variables like the parameters, and in the C-file of the plot only the line

exists which obviously has already the p0-parameter as a char const.

Hope you can help me.

Thanks in advance

Petra

Hi Petra,
use AddText(Form("name: %s par0=%g par1=%g", fitfunc->GetName(), par0, par1)); Form uses the same parameters as printf, and returns a const char* containing all the values you passed it. So for %s, %g etc see the doc of the C(++) function printf.
Axel.

hi! In a similar situation I have this error:
No module named ‘Form’
Can you help me?
Thanks, Enica.

Can you post a little script showing this error message ?