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();
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
--- /dev/null
+/**************************************************************************
+ * 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;
+}
--- /dev/null
+#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
// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
//-------------------------------------------------------------------------
#include <TGeoManager.h>
+#include <TMatrixDSym.h>
+
#include "AliKalmanTrack.h"
+#include "AliCluster3D.h"
ClassImp(AliKalmanTrack)
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()
{
#include "AliPID.h"
class AliCluster;
+class AliCluster3D;
class AliKalmanTrack : public AliExternalTrackParam {
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;
#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+;
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 \