]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding method to get the orietation of the sensitive layer on which the space-point...
authorcvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 28 Oct 2008 16:00:43 +0000 (16:00 +0000)
committercvetan <cvetan@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 28 Oct 2008 16:00:43 +0000 (16:00 +0000)
STEER/AliTrackPointArray.cxx
STEER/AliTrackPointArray.h

index ab44a73c5499029843324549422f4b2f611ad3bb..aa1c8d7f4acf69d77d7d84e116bb17327a2f4be0 100644 (file)
@@ -25,6 +25,8 @@
 #include <TMath.h>
 #include <TMatrixD.h>
 #include <TMatrixDSym.h>
+#include <TGeoMatrix.h>
+#include <TMatrixDSymEigen.h>
 
 #include "AliTrackPointArray.h"
 
@@ -466,6 +468,32 @@ Float_t AliTrackPoint::GetAngle() const
 
 }
 
+//______________________________________________________________________________
+Bool_t AliTrackPoint::GetRotMatrix(TGeoRotation& rot) const
+{
+  // Returns the orientation of the
+  // sensitive layer (using cluster
+  // covariance matrix).
+  // Assumes that cluster has errors only in the layer's plane.
+  // Return value is kTRUE in case of success.
+
+  TMatrixDSym mcov(3);
+  {
+    const Float_t *cov=GetCov();
+    mcov(0,0)=cov[0]; mcov(0,1)=cov[1]; mcov(0,2)=cov[2];
+    mcov(1,0)=cov[1]; mcov(1,1)=cov[3]; mcov(1,2)=cov[4];
+    mcov(2,0)=cov[2]; mcov(2,1)=cov[4]; mcov(2,2)=cov[5];
+  }
+
+  TMatrixDSymEigen eigen(mcov);
+  TMatrixD eigenMatrix = eigen.GetEigenVectors();
+
+  rot.SetMatrix(eigenMatrix.GetMatrixArray());
+
+  return kTRUE;
+}
+
+
 //_____________________________________________________________________________
 AliTrackPoint& AliTrackPoint::Rotate(Float_t alpha) const
 {
index 29d315e05855f10e4c0d0be5cbe83b3ab5786033..250f0317883fd81919aa9b85427ddcd92636e2b6 100644 (file)
@@ -15,6 +15,8 @@
 #include <TObject.h>
 #include <TMatrixDSym.h>
 
+class TGeoRotation;
+
 class AliTrackPoint : public TObject {
 
  public:
@@ -46,6 +48,7 @@ class AliTrackPoint : public TObject {
   Bool_t   GetPCA(const AliTrackPoint &p, AliTrackPoint &out) const;
 
   Float_t  GetAngle() const;
+  Bool_t   GetRotMatrix(TGeoRotation& rot) const;
   void SetAlignCovMatrix(const TMatrixDSym alignparmtrx);
 
   AliTrackPoint& Rotate(Float_t alpha) const;
@@ -63,7 +66,7 @@ class AliTrackPoint : public TObject {
   Float_t  fCov[6];   // Cov matrix
   UShort_t fVolumeID; // Volume ID
 
-  ClassDef(AliTrackPoint,3)
+  ClassDef(AliTrackPoint,4)
 };
 
 //////////////////////////////////////////////////////////////////////////////