What's the command to store fit parametes in an output file?

hi everybody,
i’m writing a macro that fits some spectra. I want the fit parameters saved in an output file.
I used a TGraph for the spectrum and a TF1 for the function that fits it.

I have everything ready but I don’t know which is the command that returns the values ​​of the parameters.
I have something like this at the end of my macro:

“fit1->GetPar(0)” should return the first fit parameter, but it doesn’t work because it’s not the right command.

in other words, i want all the information given by “gStyle->SetOptFit(1)” saved in a file.

can you help me, please?

i get it!

these are the right commands:

fit1->GetParameter(0) shows the value of the first fit parameter

fit1->GetParError(0) shows its error

thank you anyway :slight_smile: