bugfix for class AliTRDLeastSquare nested inside AliTRDtrackerV1 (thanks to Theodor...
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 3 Aug 2009 09:03:00 +0000 (09:03 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 3 Aug 2009 09:03:00 +0000 (09:03 +0000)
TRD/AliTRDtrackerV1.cxx

index d120780..1cc9f77 100644 (file)
@@ -3650,9 +3650,10 @@ void AliTRDtrackerV1::AliTRDLeastSquare::Eval(){
   //   printf("fParams[0] = %f, fParams[1] = %f\n", fParams[0], fParams[1]);
   
   // Covariance matrix
-  fCovarianceMatrix[0] = fSums[4] - fSums[1] * fSums[1] / fSums[0];
-  fCovarianceMatrix[1] = fSums[5] - fSums[2] * fSums[2] / fSums[0];
-  fCovarianceMatrix[2] = fSums[3] - fSums[1] * fSums[2] / fSums[0];
+  Double_t sqrnorm = fSums[0] * fSums[0];
+  fCovarianceMatrix[0] = fSums[4] / fSums[0] - fSums[1] * fSums[1] / sqrnorm;
+  fCovarianceMatrix[1] = fSums[5] / fSums[0] - fSums[2] * fSums[2] / sqrnorm;
+  fCovarianceMatrix[2] = fSums[3] / fSums[0] - fSums[1] * fSums[2] / sqrnorm;
 }
 
 //_____________________________________________________________________________