I’m fitting a pol4 function to a TGraphErrors. The fit appears to work fine and outputs the parameters to screen and the statsbox.
However, I’d like to access the parameters so I can use them later.
Does anybody know how I can do this?
I’d preferably like to avoid fitting on a user defined function such as TF1(“myfunc”, " + *x + xx + … etc)
This is my first post so I’d be really grateful for your help!
Many thanks in advance
TF1 *fpol4 = g->GetFunction("pol4");
gr = new TGraph(sizeof(x)/sizeof(x),x,y);
TF1 *fpol2 = gr->GetFunction(“pol2”);
Double_t mypars = fpol2->GetParameters();
printf(“All my pars\n”);
printf("%d => %6.1f\n",i,mypars[i]);
Check the definition of all the available functions in the next link
Rene, Kris - thanks your replies were really helpful.