Covariance matrix from TMinuit

Hello,
I would like to access the covariance matrix produced via a TMinuit fit.
I am able to view it with the MINUIT command “SHOW COV” but this
does not allow me to use the entries within the code (i.e. for further error
propagation).

Is there a function to retrieve the covariance matrix of the fitted parameters?

cheers,

Simon.

Hi Simon,

Have a look at the RootTalk Digest and querry for “minuit covariance” .

I have listed below the method TFitter::GetCovarianceMatrix() .
You can see that in case you do not use TFitter, you should do
something like

Int_t npars = gMinuit->GetNumPars();
Double_t covar = new Double_t[nparsnpars];
gMinuit->mnemat(covar,npars);

Double_t *TFitter::GetCovarianceMatrix() const
{
// return a pointer to the covariance matrix

if (fCovar) return fCovar;
Int_t npars = fMinuit->GetNumPars();
((TFitter*)this)->fCovar = new Double_t[npars*npars];
fMinuit->mnemat(fCovar,npars);
return fCovar;
}

Eddy