From 4b189f983ce2075d49631cc6f1309f4461f94b8d Mon Sep 17 00:00:00 2001 From: belikov Date: Fri, 15 Jun 2007 11:58:56 +0000 Subject: [PATCH] Removing the dependence on AliCluster3D --- STEER/AliExternalTrackParam.cxx | 46 +++++++++++++++++++++++++++++++++ STEER/AliExternalTrackParam.h | 2 ++ STEER/AliKalmanTrack.cxx | 38 --------------------------- STEER/AliKalmanTrack.h | 1 - 4 files changed, 48 insertions(+), 39 deletions(-) diff --git a/STEER/AliExternalTrackParam.cxx b/STEER/AliExternalTrackParam.cxx index 3620beae826..ab5665ad38e 100644 --- a/STEER/AliExternalTrackParam.cxx +++ b/STEER/AliExternalTrackParam.cxx @@ -25,6 +25,7 @@ // are implemented. // Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch // /////////////////////////////////////////////////////////////////////////////// +#include #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 diff --git a/STEER/AliExternalTrackParam.h b/STEER/AliExternalTrackParam.h index 534648c35a0..4621fbdff9d 100644 --- a/STEER/AliExternalTrackParam.h +++ b/STEER/AliExternalTrackParam.h @@ -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); diff --git a/STEER/AliKalmanTrack.cxx b/STEER/AliKalmanTrack.cxx index 253d32b39ec..8aa79b7ddf2 100644 --- a/STEER/AliKalmanTrack.cxx +++ b/STEER/AliKalmanTrack.cxx @@ -21,7 +21,6 @@ // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch //------------------------------------------------------------------------- #include -#include #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() { diff --git a/STEER/AliKalmanTrack.h b/STEER/AliKalmanTrack.h index 1399e74a8e4..399cfecff86 100644 --- a/STEER/AliKalmanTrack.h +++ b/STEER/AliKalmanTrack.h @@ -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; -- 2.39.3