]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
A piece of new code to handle clusters constrained to planes arbitrarily oriented...
authorbelikov <belikov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Jun 2007 07:33:50 +0000 (07:33 +0000)
committerbelikov <belikov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 11 Jun 2007 07:33:50 +0000 (07:33 +0000)
STEER/AliCluster.h
STEER/AliCluster3D.cxx [new file with mode: 0644]
STEER/AliCluster3D.h [new file with mode: 0644]
STEER/AliKalmanTrack.cxx
STEER/AliKalmanTrack.h
STEER/STEERLinkDef.h
STEER/libSTEER.pkg

index e88b0b72553e8e80508faef02ce69dba9accbf0e..c0bc2b7095416aae6196f8a5e21f6db6d332d9d8 100644 (file)
@@ -45,7 +45,7 @@ class AliCluster : public TObject {
   virtual void Use(Int_t = 0) {;}
 
   Bool_t   GetGlobalXYZ(Float_t xyz[3]) const;
-  Bool_t   GetGlobalCov(Float_t cov[6]) const;
+  virtual Bool_t   GetGlobalCov(Float_t cov[6]) const;
   Bool_t   GetXRefPlane(Float_t &xref) const;
 
   Bool_t   Misalign();
@@ -62,10 +62,10 @@ class AliCluster : public TObject {
  protected:
 
   const TGeoHMatrix*   GetTracking2LocalMatrix() const;
+  TGeoHMatrix*         GetMatrix(Bool_t original = kFALSE) const;
 
  private:
 
-  TGeoHMatrix*         GetMatrix(Bool_t original = kFALSE) const;
   TGeoPNEntry*         GetPNEntry() const;
 
   Int_t    fTracks[3];//MC labels
diff --git a/STEER/AliCluster3D.cxx b/STEER/AliCluster3D.cxx
new file mode 100644 (file)
index 0000000..edd2bdd
--- /dev/null
@@ -0,0 +1,103 @@
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ *                                                                        *
+ * Author: The ALICE Off-line Project.                                    *
+ * Contributors are mentioned in the code where appropriate.              *
+ *                                                                        *
+ * Permission to use, copy, modify and distribute this software and its   *
+ * documentation strictly for non-commercial purposes is hereby granted   *
+ * without fee, provided that the above copyright notice appears in all   *
+ * copies and that both the copyright notice and this permission notice   *
+ * appear in the supporting documentation. The authors make no claims     *
+ * about the suitability of this software for any purpose. It is          *
+ * provided "as is" without express or implied warranty.                  *
+ **************************************************************************/
+
+//-------------------------------------------------------------------------
+//                         Class AliCluster3D
+//  This is an extension of the AliCluster class for the case when
+//  the sensitive plane this cluster belongs to is arbitrarily oriented
+//  in space.  This class can serve as the base for the TOF and HMPID
+//  clusters.
+//
+// cvetan.cheshkov@cern.ch & jouri.belikov@cern.ch    5/3/2007
+//-------------------------------------------------------------------------
+#include <TGeoManager.h>
+#include <TGeoMatrix.h>
+
+#include "AliCluster3D.h"
+#include "AliLog.h"
+
+ClassImp(AliCluster3D)
+
+//______________________________________________________________________________
+AliCluster3D::AliCluster3D():
+  AliCluster(),
+  fSigmaX2(0),
+  fSigmaXY(0),
+  fSigmaXZ(0)
+{
+  // Default constructor
+}
+
+//______________________________________________________________________________
+AliCluster3D::AliCluster3D(UShort_t volId, 
+   Float_t x,   Float_t y,   Float_t z,
+   Float_t sx2, Float_t sxy, Float_t sxz,
+                Float_t sy2, Float_t syz, 
+                             Float_t sz2, const Int_t *lab):
+  AliCluster(volId,x,y,z,sy2,sz2,syz,lab),
+  fSigmaX2(sx2),
+  fSigmaXY(sxy),
+  fSigmaXZ(sxz)
+{
+//-------------------------------------------------------------------------
+// The main constructor
+//-------------------------------------------------------------------------
+}
+
+//______________________________________________________________________________
+AliCluster3D::AliCluster3D(const AliCluster3D& cluster):
+  AliCluster(cluster),
+  fSigmaX2(cluster.fSigmaX2),
+  fSigmaXY(cluster.fSigmaXY),
+  fSigmaXZ(cluster.fSigmaXZ)
+{
+  // Copy constructor
+}
+
+//______________________________________________________________________________
+Bool_t AliCluster3D::GetGlobalCov(Float_t cov[6]) const
+{
+
+  // Get the covariance matrix in the global coordinate system.
+  // All the needed information is taken only
+  // from TGeo.
+
+  if (!gGeoManager || !gGeoManager->IsClosed()) {
+    AliError("gGeoManager doesn't exist or it is still opened !");
+    return kFALSE;
+  }
+
+  const TGeoHMatrix *mt = GetTracking2LocalMatrix();
+  if (!mt) return kFALSE;
+
+  TGeoHMatrix *ml = GetMatrix();
+  if (!ml) return kFALSE;
+
+  TGeoHMatrix m;
+  Double_t tcov[9] = { fSigmaX2, fSigmaXY,     fSigmaXZ, 
+                      fSigmaXY, GetSigmaY2(), GetSigmaYZ(), 
+                      fSigmaXZ, GetSigmaYZ(), GetSigmaZ2()};
+  m.SetRotation(tcov);
+  m.Multiply(&mt->Inverse());
+  m.Multiply(&ml->Inverse());
+  m.MultiplyLeft(mt);
+  m.MultiplyLeft(ml);
+  Double_t *ncov = m.GetRotationMatrix();
+  cov[0] = ncov[0]; cov[1] = ncov[1]; cov[2] = ncov[2];
+  cov[3] = ncov[4]; cov[4] = ncov[5];
+  cov[5] = ncov[8];
+
+  return kTRUE;
+}
diff --git a/STEER/AliCluster3D.h b/STEER/AliCluster3D.h
new file mode 100644 (file)
index 0000000..8339691
--- /dev/null
@@ -0,0 +1,48 @@
+#ifndef ALICLUSTER3D_H
+#define ALICLUSTER3D_H
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice                               */
+
+//-------------------------------------------------------------------------
+//                         Class AliCluster3D
+//  This is an extension of the AliCluster class for the case when
+//  the sensitive plane this cluster belongs to is arbitrarily oriented
+//  in space.  This class can serve as the base for the TOF and HMPID
+//  clusters.
+//
+//  cvetan.cheshkov@cern.ch  & jouri.belikov@cern.ch     5/6/2007
+//-------------------------------------------------------------------------
+
+#include <AliCluster.h>
+
+class TGeoHMatrix;
+class TGeoPNEntry;
+
+class AliCluster3D : public AliCluster {
+public:
+  AliCluster3D();
+  AliCluster3D(UShort_t volId, 
+     Float_t x,   Float_t y,   Float_t z,
+     Float_t sx2, Float_t sxy, Float_t sxz,
+                  Float_t sy2, Float_t syz, 
+                               Float_t sz2, const Int_t *lab = NULL);
+  AliCluster3D(const AliCluster3D& cluster);
+  virtual ~AliCluster3D() {;}
+
+  virtual Bool_t GetGlobalCov(Float_t cov[6]) const;
+
+  Float_t GetSigmaX2() const {return fSigmaX2;}
+  Float_t GetSigmaXY() const {return fSigmaXY;}
+  Float_t GetSigmaXZ() const {return fSigmaXZ;}
+
+private:
+  AliCluster3D &operator=(const AliCluster3D& cluster);
+
+  Float_t fSigmaX2;  // Additional elements 
+  Float_t fSigmaXY;  // of 
+  Float_t fSigmaXZ;  // the covariance matrix 
+  
+  ClassDef(AliCluster3D,1) // Barrel detectors cluster
+};
+
+#endif
index a3d09ffe168ea699e88ede8f3061a230a477e0c2..253d32b39ec00aff0de6bafb66c1723231f39a73 100644 (file)
 //        Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
 //-------------------------------------------------------------------------
 #include <TGeoManager.h>
+#include <TMatrixDSym.h>
+
 #include "AliKalmanTrack.h"
+#include "AliCluster3D.h"
 
 ClassImp(AliKalmanTrack)
 
@@ -61,6 +64,43 @@ 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 5e491c454483a09afc36d489abde099c799c9d4b..1399e74a8e42b1577b996849fefaf4ce8add0fc2 100644 (file)
@@ -17,6 +17,7 @@
 #include "AliPID.h"
 
 class AliCluster;
+class AliCluster3D;
 
 class AliKalmanTrack : public AliExternalTrackParam {
 public:
@@ -27,6 +28,7 @@ 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;
 
index d15e237ec61799c876992a0e366adb8f2c297bb6..12278568c84cd13fff5ad06dfad34375ef4b9c74 100644 (file)
 #pragma link C++ class AliSignalProcesor+;
 #pragma link C++ class  AliHelix+;
 #pragma link C++ class  AliCluster+;
+#pragma link C++ class  AliCluster3D+;
 #pragma link C++ class  AliTracker+;
 #pragma link C++ class  AliV0+;
 #pragma link C++ class  AliKink+;
index f2ab01ae00485b9d7d22f651ba9f3642a8653f10..8424e664cd0e8ecc6737d9b3cc7751cb2cf0b72b 100644 (file)
@@ -35,7 +35,8 @@ AliAlignmentTracks.cxx \
 AliExpression.cxx \
 AliCTPRawData.cxx AliCTPRawStream.cxx \
 AliMathBase.cxx AliSignalProcesor.cxx \
-AliTracker.cxx AliCluster.cxx AliHelix.cxx AliV0.cxx AliKink.cxx \
+AliTracker.cxx AliCluster.cxx AliCluster3D.cxx \
+AliHelix.cxx AliV0.cxx AliKink.cxx \
 AliSelectorRL.cxx AliSplineFit.cxx \
 AliMagFMapsV1.cxx \
 AliDCSValue.cxx AliDCSSensor.cxx AliDCSSensorArray.cxx \