How to access the members of TFitResultPtr object?

I use a function to fit datas, the result is:


Minimizer is Minuit / Migrad
Chi2 = 212873
NDf = 27
Edm = 5.92296e-08
NCalls = 239
p0 = 3092.05 +/- 45.1136
p1 = 14753.9 +/- 0.0636319
p2 = 36.9984 +/- 1.53866
p3 = 0.00946903 +/- 0.00637705
p4 = -0.479135 +/- 88.7926


how to access the members like:
Chi2
NDf
Edm
NCalls
p0
p1
p2
p3
p4

I think @moneta can help you.

Hi,

TFitResultPtr r = hist->Fit(myFunction,"S");
Double_t chi2   = r->Chi2();
UInt_t Ndf = r->Ndf();
Double_t Edm   = r->Edm();
UInt_t NCalls = r->NCalls();
Double_t p0 = r->Parameter(0);
Double_t p1 = r->Parameter(1);
Double_t p2 = r->Parameter(2);
Double_t p3 = r->Parameter(3);
Double_t p4 = r->Parameter(4);

see ROOT: ROOT::Fit::FitResult Class Reference

@ yus, thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.