How to use IntegralError?

Hi, everyone

I have a question about using IntegralError.

I refered to next URL.

I used this example for my code.

TFitResultPtr r = histo->Fit(func, "S");
func->IntegralError(x1,x2,r->GetParams(), r->GetCovarianceMatrix()->GetMatrixArray() );

I used this function after fitting histogram.
But, my code doesn’t work.

Error is next:

error: member reference type 'TMatrixDSym' (aka 'TMatrixTSym<double>') is not a pointer; did you mean to use '.'?

I refered to next example

Maybe, this code is corresponding code

  auto covMatrix = fitResult->GetCovarianceMatrix();
  double sigma_integral = fitFunc->IntegralError(0,1, fitResult->GetParams() , covMatrix.GetMatrixArray());

But I don’t know how different my code is.

Could you tell me how to solve this error?

I’m sure @moneta will give you some hints


TFitResult returns a covariance matrix by value and not its pointer. See ROOT: TFitResult Class Reference

So use . instead of ->:

TFitResultPtr r = histo->Fit(func, "S");
func->IntegralError(x1,x2,r->GetParams(), r->GetCovarianceMatrix().GetMatrixArray() );



Sorry, I overlooked this one…

Hi, Lorenzo.

Thanks for your reply!
My code worked well after your modification.