1 #ifndef ALITRACKPOINTARRAY_H
2 #define ALITRACKPOINTARRAY_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
6 //////////////////////////////////////////////////////////////////////////////
7 // Class AliTrackPoint //
8 // This class represent a single track space-point. //
9 // It is used to access the points array defined in AliTrackPointArray. //
10 // Note that the space point coordinates are given in the global frame. //
12 // cvetan.cheshkov@cern.ch 3/11/2005 //
13 //////////////////////////////////////////////////////////////////////////////
16 #include <TMatrixDSym.h>
18 class AliTrackPoint : public TObject {
22 AliTrackPoint(Float_t x, Float_t y, Float_t z, const Float_t *cov, UShort_t volid, Float_t charge = 0, Float_t drifttime = 0);
23 AliTrackPoint(const Float_t *xyz, const Float_t *cov, UShort_t volid, Float_t charge = 0, Float_t drifttime = 0);
24 AliTrackPoint(const AliTrackPoint &p);
25 AliTrackPoint& operator= (const AliTrackPoint& p);
26 virtual ~AliTrackPoint() {}
28 // Multiplication with TGeoMatrix and distance between points (chi2) to be implemented
30 void SetXYZ(Float_t x, Float_t y, Float_t z, const Float_t *cov = 0);
31 void SetXYZ(const Float_t *xyz, const Float_t *cov = 0);
32 void SetVolumeID(UShort_t volid) { fVolumeID = volid; }
33 void SetCharge(Float_t charge) { fCharge = charge; }
34 void SetDriftTime(Float_t time) { fDriftTime = time; }
36 Float_t GetX() const { return fX; }
37 Float_t GetY() const { return fY; }
38 Float_t GetZ() const { return fZ; }
39 void GetXYZ(Float_t *xyz, Float_t *cov = 0) const;
40 const Float_t *GetCov() const { return &fCov[0]; }
41 UShort_t GetVolumeID() const { return fVolumeID; }
42 Float_t GetCharge() const { return fCharge; }
43 Float_t GetDriftTime() const { return fDriftTime;}
45 Float_t GetResidual(const AliTrackPoint &p, Bool_t weighted = kFALSE) const;
46 Bool_t GetPCA(const AliTrackPoint &p, AliTrackPoint &out) const;
48 Float_t GetAngle() const;
49 void SetAlignCovMatrix(const TMatrixDSym alignparmtrx);
51 AliTrackPoint& Rotate(Float_t alpha) const;
52 AliTrackPoint& MasterToLocal() const;
54 void Print(Option_t *) const;
58 Float_t fX; // X coordinate
59 Float_t fY; // Y coordinate
60 Float_t fZ; // Z coordinate
61 Float_t fCharge; // Cluster charge in arbitrary units
62 Float_t fDriftTime;// Drift time in SDD (in ns)
63 Float_t fCov[6]; // Cov matrix
64 UShort_t fVolumeID; // Volume ID
66 ClassDef(AliTrackPoint,3)
69 //////////////////////////////////////////////////////////////////////////////
70 // Class AliTrackPointArray //
71 // This class contains the ESD track space-points which are used during //
72 // the alignment procedures. Each space-point consist of 3 coordinates //
73 // (and their errors) and the index of the sub-detector which contains //
74 // the space-point. //
75 // cvetan.cheshkov@cern.ch 3/11/2005 //
76 //////////////////////////////////////////////////////////////////////////////
78 class AliTrackPointArray : public TObject {
83 AliTrackPointArray(Int_t npoints);
84 AliTrackPointArray(const AliTrackPointArray &array);
85 AliTrackPointArray& operator= (const AliTrackPointArray& array);
86 virtual ~AliTrackPointArray();
88 // Bool_t AddPoint(Int_t i, AliCluster *cl, UShort_t volid);
89 Bool_t AddPoint(Int_t i, const AliTrackPoint *p);
91 Int_t GetNPoints() const { return fNPoints; }
92 Int_t GetCovSize() const { return fSize; }
93 Bool_t GetPoint(AliTrackPoint &p, Int_t i) const;
94 // Getters for fast access to the coordinate arrays
95 const Float_t* GetX() const { return &fX[0]; }
96 const Float_t* GetY() const { return &fY[0]; }
97 const Float_t* GetZ() const { return &fZ[0]; }
98 const Float_t* GetCharge() const { return &fCharge[0]; }
99 const Float_t* GetDriftTime() const { return &fDriftTime[0]; }
100 const Float_t* GetCov() const { return &fCov[0]; }
101 const UShort_t* GetVolumeID() const { return &fVolumeID[0]; }
103 Bool_t HasVolumeID(UShort_t volid) const;
105 void Sort(Bool_t down=kTRUE);
108 Bool_t fSorted; // Sorted flag
110 Int_t fNPoints; // Number of space points
111 Float_t *fX; //[fNPoints] Array with space point X coordinates
112 Float_t *fY; //[fNPoints] Array with space point Y coordinates
113 Float_t *fZ; //[fNPoints] Array with space point Z coordinates
114 Float_t *fCharge; //[fNPoints] Array with clusters charge
115 Float_t *fDriftTime; //[fNPoints] Array with drift times
116 Int_t fSize; // Size of array with cov matrices = 6*N of points
117 Float_t *fCov; //[fSize] Array with space point coordinates cov matrix
118 UShort_t *fVolumeID; //[fNPoints] Array of space point volume IDs
120 ClassDef(AliTrackPointArray,4)