]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Removing the dependence on AliCluster3D
authorbelikov <belikov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 15 Jun 2007 11:58:56 +0000 (11:58 +0000)
committerbelikov <belikov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 15 Jun 2007 11:58:56 +0000 (11:58 +0000)
STEER/AliExternalTrackParam.cxx
STEER/AliExternalTrackParam.h
STEER/AliKalmanTrack.cxx
STEER/AliKalmanTrack.h

index 3620beae8264b613f76b9be9eee3572442707b4b..ab5665ad38efabf41440e68f07b1e0727ccd424e 100644 (file)
@@ -25,6 +25,7 @@
 // are implemented.
 // Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch                            //
 ///////////////////////////////////////////////////////////////////////////////
+#include <TMatrixDSym.h>
 #include "AliExternalTrackParam.h"
 #include "AliESDVertex.h"
 #include "AliLog.h"
@@ -459,6 +460,51 @@ AliExternalTrackParam::GetPredictedChi2(Double_t p[2],Double_t cov[3]) const {
   return (d*szz*d - 2*d*sdz*z + z*sdd*z)/det;
 }
 
+Double_t AliExternalTrackParam::
+GetPredictedChi2(Double_t p[3],Double_t covyz[3],Double_t covxyz[3]) const {
+  //----------------------------------------------------------------
+  // Estimate the chi2 of the 3D space point "p" and
+  // the fill covariance matrix "covyz" and "covxyz"
+  //
+  // Cov(x,x) ... :   covxyz[0]
+  // Cov(y,x) ... :   covxyz[1]  covyz[0]
+  // Cov(z,x) ... :   covxyz[2]  covyz[1]  covyz[2]
+  //----------------------------------------------------------------
+
+  Double_t res[3] = {
+    GetX() - p[0],
+    GetY() - p[1],
+    GetZ() - p[2]
+  };
+
+  Double_t f=GetSnp();
+  if (TMath::Abs(f) >= kAlmost1) return kVeryBig;
+  Double_t r=TMath::Sqrt(1.- f*f);
+  Double_t a=f/r, b=GetTgl()/r;
+
+  Double_t s2=333.*333.;  //something reasonably big (cm^2)
+  TMatrixDSym v(3);
+  v(0,0)=  s2;  v(0,1)=  a*s2;                 v(0,2)=  b*s2;;
+  v(1,0)=a*s2;  v(1,1)=a*a*s2 + GetSigmaY2();  v(1,2)=a*b*s2 + GetSigmaZY();
+  v(2,0)=b*s2;  v(2,1)=a*b*s2 + GetSigmaZY();  v(2,2)=b*b*s2 + GetSigmaZ2();
+
+  v(0,0)+=covxyz[0]; v(0,1)+=covxyz[1]; v(0,2)+=covxyz[2];
+  v(1,0)+=covxyz[1]; v(1,1)+=covyz[0];  v(1,2)+=covyz[1];
+  v(2,0)+=covxyz[2]; v(2,1)+=covyz[1];  v(2,2)+=covyz[2];
+
+  v.Invert();
+  if (!v.IsValid()) return kVeryBig;
+
+  Double_t chi2=0.;
+  for (Int_t i = 0; i < 3; i++)
+    for (Int_t j = 0; j < 3; j++) chi2 += res[i]*res[j]*v(i,j);
+
+  return chi2;  
+
+
+}
+
 Bool_t AliExternalTrackParam::Update(Double_t p[2], Double_t cov[3]) {
   //------------------------------------------------------------------
   // Update the track parameters with the space point "p" having
index 534648c35a0ee493b27f6e0e13e12cd9d778d972..4621fbdff9d4d930634f579bc583c895df825cd2 100644 (file)
@@ -90,6 +90,8 @@ class AliExternalTrackParam: public TObject {
   Bool_t CorrectForMaterial(Double_t d, Double_t x0, Double_t mass,
                            Double_t (*f)(Double_t)=ApproximateBetheBloch);
   Double_t GetPredictedChi2(Double_t p[2],Double_t cov[3]) const;
+  Double_t 
+    GetPredictedChi2(Double_t p[3],Double_t covyz[3],Double_t covxyz[3]) const;
   Bool_t Update(Double_t p[2],Double_t cov[3]);
   Bool_t Rotate(Double_t alpha);
   Bool_t PropagateTo(Double_t x, Double_t b);
index 253d32b39ec00aff0de6bafb66c1723231f39a73..8aa79b7ddf2c0a51bba8a3bb9f9ddc31828e19ea 100644 (file)
@@ -21,7 +21,6 @@
 //        Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
 //-------------------------------------------------------------------------
 #include <TGeoManager.h>
-#include <TMatrixDSym.h>
 
 #include "AliKalmanTrack.h"
 #include "AliCluster3D.h"
@@ -64,43 +63,6 @@ AliKalmanTrack::AliKalmanTrack(const AliKalmanTrack &t):
       fIntegratedTime[i] = t.fIntegratedTime[i];
 }
 
-//_______________________________________________________________________
-Double_t AliKalmanTrack::GetPredictedChi2(const AliCluster3D *c) const {
-  //
-  //  Calculate the predicted Chi2 for a 3D cluster "c" 
-  //
-  Double_t res[3] = {
-    GetX() - c->GetX(),
-    GetY() - c->GetY(),
-    GetZ() - c->GetZ()
-  };
-
-  Double_t f=GetSnp();
-  if (TMath::Abs(f) >= kAlmost1) return kVeryBig;
-  Double_t r=TMath::Sqrt(1.- f*f);
-  Double_t a=f/r, b=GetTgl()/r;
-
-  Double_t s2=333.*333.;  //something reasonably big (cm^2)
-  TMatrixDSym v(3);
-  v(0,0)=  s2;  v(0,1)=  a*s2;                 v(0,2)=  b*s2;;
-  v(1,0)=a*s2;  v(1,1)=a*a*s2 + GetSigmaY2();  v(1,2)=a*b*s2 + GetSigmaZY();
-  v(2,0)=b*s2;  v(2,1)=a*b*s2 + GetSigmaZY();  v(2,2)=b*b*s2 + GetSigmaZ2();
-
-  v(0,0)+=c->GetSigmaX2(); v(0,1)+=c->GetSigmaXY(); v(0,2)+=c->GetSigmaXZ();
-  v(1,0)+=c->GetSigmaXY(); v(1,1)+=c->GetSigmaY2(); v(1,2)+=c->GetSigmaYZ();
-  v(2,0)+=c->GetSigmaXZ(); v(2,1)+=c->GetSigmaYZ(); v(2,2)+=c->GetSigmaZ2();
-
-  v.Invert();
-  if (!v.IsValid()) return kVeryBig;
-
-  Double_t chi2=0.;
-  for (Int_t i = 0; i < 3; i++)
-    for (Int_t j = 0; j < 3; j++) chi2 += res[i]*res[j]*v(i,j);
-
-  return chi2;  
-}
-
 //_______________________________________________________________________
 void AliKalmanTrack::StartTimeIntegral() 
 {
index 1399e74a8e42b1577b996849fefaf4ce8add0fc2..399cfecff863213a7491ae5372d28823d4679a7c 100644 (file)
@@ -28,7 +28,6 @@ public:
   void SetLabel(Int_t lab) {fLab=lab;}
 
   virtual Double_t GetPredictedChi2(const AliCluster *c) const = 0;
-  virtual Double_t GetPredictedChi2(const AliCluster3D *c) const;
   virtual Bool_t PropagateTo(Double_t xr, Double_t x0, Double_t rho) = 0;
   virtual Bool_t Update(const AliCluster* c, Double_t chi2, Int_t index) = 0;