I’m fitting a quadratic to some data, so I’m fitting two parameters. These parameters are then written in the standard TPavestats box but I would like to write them to a text file.
How do I open a text file then write these parameters to it and save it?
Any help would be much appreciated.
Associated functions
====================
One or more object (typically a TF1*) can be added to the list
of functions (fFunctions) associated to each histogram.
When TH1::Fit is invoked, the fitted function is added to this list.
Given an histogram h, one can retrieve an associated function
with: TF1 *myfunc = h->GetFunction(“myfunc”);
Access to the fit results
=========================
If the histogram is made persistent, the list of
associated functions is also persistent. Given a pointer (see above)
to an associated function myfunc, one can retrieve the function/fit
parameters with calls such as:
Double_t chi2 = myfunc->GetChisquare();
Double_t par0 = myfunc->GetParameter(0); //value of 1st parameter
Double_t err0 = myfunc->GetParError(0); //error on first parameter