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>
20 class AliTrackPoint : public TObject {
24 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,Float_t chargeratio = 0, Int_t clutype = 0);
25 AliTrackPoint(const Float_t *xyz, const Float_t *cov, UShort_t volid, Float_t charge = 0, Float_t drifttime = 0,Float_t chargeratio = 0, Int_t clutype=0);
26 AliTrackPoint(const AliTrackPoint &p);
27 AliTrackPoint& operator= (const AliTrackPoint& p);
28 virtual ~AliTrackPoint() {}
30 // Multiplication with TGeoMatrix and distance between points (chi2) to be implemented
32 void SetXYZ(Float_t x, Float_t y, Float_t z, const Float_t *cov = 0);
33 void SetXYZ(const Float_t *xyz, const Float_t *cov = 0);
34 void SetCov(const Float_t *cov);
35 void SetVolumeID(UShort_t volid) { fVolumeID = volid; }
36 void SetCharge(Float_t charge) { fCharge = charge; }
37 void SetDriftTime(Float_t time) { fDriftTime = time; }
38 void SetChargeRatio(Float_t ratio) { fChargeRatio= ratio; }
39 void SetClusterType(Int_t clutype) { fClusterType= clutype; }
40 void SetExtra(Bool_t flag=kTRUE) { fIsExtra = flag; }
42 Float_t GetX() const { return fX; }
43 Float_t GetY() const { return fY; }
44 Float_t GetZ() const { return fZ; }
45 void GetXYZ(Float_t *xyz, Float_t *cov = 0) const;
46 const Float_t *GetCov() const { return &fCov[0]; }
47 UShort_t GetVolumeID() const { return fVolumeID; }
48 Float_t GetCharge() const { return fCharge; }
49 Float_t GetDriftTime() const { return fDriftTime;}
50 Float_t GetChargeRatio() const { return fChargeRatio;}
51 Int_t GetClusterType() const { return fClusterType;}
52 Bool_t IsExtra() const { return fIsExtra;}
54 Float_t GetResidual(const AliTrackPoint &p, Bool_t weighted = kFALSE) const;
55 Bool_t GetPCA(const AliTrackPoint &p, AliTrackPoint &out) const;
57 Float_t GetAngle() const;
58 Bool_t GetRotMatrix(TGeoRotation& rot) const;
59 void SetAlignCovMatrix(const TMatrixDSym& alignparmtrx);
61 AliTrackPoint& Rotate(Float_t alpha) const;
62 AliTrackPoint& MasterToLocal() const;
64 void Print(Option_t *) const;
68 Float_t fX; // X coordinate
69 Float_t fY; // Y coordinate
70 Float_t fZ; // Z coordinate
71 Float_t fCharge; // Cluster charge in arbitrary units
72 Float_t fDriftTime;// Drift time in SDD (in ns)
73 Float_t fChargeRatio; // Charge ratio in SSD
74 Int_t fClusterType; // Cluster Type (encoded info on size and shape)
75 Float_t fCov[6]; // Cov matrix
76 Bool_t fIsExtra; // attached by tracker but not used in fit
77 UShort_t fVolumeID; // Volume ID
79 ClassDef(AliTrackPoint,7)
82 //////////////////////////////////////////////////////////////////////////////
83 // Class AliTrackPointArray //
84 // This class contains the ESD track space-points which are used during //
85 // the alignment procedures. Each space-point consist of 3 coordinates //
86 // (and their errors) and the index of the sub-detector which contains //
87 // the space-point. //
88 // cvetan.cheshkov@cern.ch 3/11/2005 //
89 //////////////////////////////////////////////////////////////////////////////
91 class AliTrackPointArray : public TObject {
96 AliTrackPointArray(Int_t npoints);
97 AliTrackPointArray(const AliTrackPointArray &array);
98 AliTrackPointArray& operator= (const AliTrackPointArray& array);
99 virtual ~AliTrackPointArray();
101 // Bool_t AddPoint(Int_t i, AliCluster *cl, UShort_t volid);
102 Bool_t AddPoint(Int_t i, const AliTrackPoint *p);
104 Int_t GetNPoints() const { return fNPoints; }
105 Int_t GetCovSize() const { return fSize; }
106 Bool_t GetPoint(AliTrackPoint &p, Int_t i) const;
107 // Getters for fast access to the coordinate arrays
108 const Float_t* GetX() const { return &fX[0]; }
109 const Float_t* GetY() const { return &fY[0]; }
110 const Float_t* GetZ() const { return &fZ[0]; }
111 const Float_t* GetCharge() const { return &fCharge[0]; }
112 const Float_t* GetDriftTime() const { return &fDriftTime[0]; }
113 const Float_t* GetChargeRatio() const { return &fChargeRatio[0]; }
114 const Int_t* GetClusterType() const { return &fClusterType[0]; }
115 const Bool_t* GetExtra() const { return &fIsExtra[0]; }
116 const Float_t* GetCov() const { return &fCov[0]; }
117 const UShort_t* GetVolumeID() const { return &fVolumeID[0]; }
119 Bool_t HasVolumeID(UShort_t volid) const;
120 void Print(Option_t *) const;
122 void Sort(Bool_t down=kTRUE);
125 Bool_t fSorted; // Sorted flag
127 Int_t fNPoints; // Number of space points
128 Float_t *fX; //[fNPoints] Array with space point X coordinates
129 Float_t *fY; //[fNPoints] Array with space point Y coordinates
130 Float_t *fZ; //[fNPoints] Array with space point Z coordinates
131 Float_t *fCharge; //[fNPoints] Array with clusters charge
132 Float_t *fDriftTime; //[fNPoints] Array with drift times
133 Float_t *fChargeRatio; //[fNPoints] Array with charge ratio
134 Int_t *fClusterType; //[fNPoints] Array with cluster type
135 Bool_t *fIsExtra; //[fNPoints] Array with extra flags
136 Int_t fSize; // Size of array with cov matrices = 6*N of points
137 Float_t *fCov; //[fSize] Array with space point coordinates cov matrix
138 UShort_t *fVolumeID; //[fNPoints] Array of space point volume IDs
140 ClassDef(AliTrackPointArray,7)