Access fit paramters without plotting

Hi, I am trying to fit a TH2D using ->Fit. After the fit I am trying to store the fit parameters using ->GetParameter.

Using the optional parameters for Fit, i would like to disable plotting of the fit results. I achieved this using the N optional parameter. However, this means the fit parameters are not stored, and I can no longer access them using ->GetParameter. Is there any way to get the fit parameters while not plotting the fitted result?

Thanks

according to this : root.cern.ch/root/html534/TH1.html#TH1:Fit
what you need is the option 0 not N

Ah, i had read the option “0” on the parameter list as the letter O, not the number 0. A trivial mistake, thanks for the help

Actually, you can use either “N” or “0” (note: “zero”, not “capital O”).
Assuming that you have:
TF2 *MyTF2Pointer = new TF2(“MyTF2Name”, …);
Try:
MyTH2D->Fit(MyTF2Pointer, “N”); // or … MyTH2D->Fit(“MyTF2Name”, “N”);
MyTF2Pointer->GetParameter(0)
or:
MyTH2D->Fit(MyTF2Pointer, “0”); // or … MyTH2D>Fit(“MyTF2Name”, “0”);
MyTH2D->GetFunction(“MyTF2Name”)->GetParameter(0)
MyTF2Pointer->GetParameter(0)
If you decide to use “0”, see also the ‘Warning when using the option “0”’ in the TH1::Fit method description.