]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliTrackPointArray.h
datamember added in AliGeomManager with number of alignable volumes per subdetector...
[u/mrichter/AliRoot.git] / STEER / AliTrackPointArray.h
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                               */
5
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.   //
11 //                                                                          //
12 //   cvetan.cheshkov@cern.ch 3/11/2005                                      //
13 //////////////////////////////////////////////////////////////////////////////
14
15 #include <TObject.h>
16 #include <TMatrixDSym.h>
17
18 class TGeoRotation;
19
20 class AliTrackPoint : public TObject {
21
22  public:
23   AliTrackPoint();
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);
25   AliTrackPoint(const Float_t *xyz, const Float_t *cov, UShort_t volid, Float_t charge = 0, Float_t drifttime = 0);
26   AliTrackPoint(const AliTrackPoint &p);
27   AliTrackPoint& operator= (const AliTrackPoint& p);
28   virtual ~AliTrackPoint() {}
29
30   // Multiplication with TGeoMatrix and distance between points (chi2) to be implemented
31
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     SetVolumeID(UShort_t volid) { fVolumeID = volid; }
35   void     SetCharge(Float_t charge) { fCharge = charge; }
36   void     SetDriftTime(Float_t time) { fDriftTime = time; }
37
38   Float_t  GetX() const { return fX; }
39   Float_t  GetY() const { return fY; }
40   Float_t  GetZ() const { return fZ; }
41   void     GetXYZ(Float_t *xyz, Float_t *cov = 0) const;
42   const Float_t *GetCov() const { return &fCov[0]; }
43   UShort_t GetVolumeID() const { return fVolumeID; }
44   Float_t  GetCharge() const { return fCharge; }
45   Float_t  GetDriftTime() const { return fDriftTime;}
46
47   Float_t  GetResidual(const AliTrackPoint &p, Bool_t weighted = kFALSE) const;
48   Bool_t   GetPCA(const AliTrackPoint &p, AliTrackPoint &out) const;
49
50   Float_t  GetAngle() const;
51   Bool_t   GetRotMatrix(TGeoRotation& rot) const;
52   void SetAlignCovMatrix(const TMatrixDSym alignparmtrx);
53
54   AliTrackPoint& Rotate(Float_t alpha) const;
55   AliTrackPoint& MasterToLocal() const;
56
57   void     Print(Option_t *) const;
58
59  private:
60
61   Float_t  fX;        // X coordinate
62   Float_t  fY;        // Y coordinate
63   Float_t  fZ;        // Z coordinate
64   Float_t  fCharge;   // Cluster charge in arbitrary units
65   Float_t  fDriftTime;// Drift time in SDD (in ns)
66   Float_t  fCov[6];   // Cov matrix
67   UShort_t fVolumeID; // Volume ID
68
69   ClassDef(AliTrackPoint,4)
70 };
71
72 //////////////////////////////////////////////////////////////////////////////
73 //                          Class AliTrackPointArray                        //
74 //   This class contains the ESD track space-points which are used during   //
75 //   the alignment procedures. Each space-point consist of 3 coordinates    //
76 //   (and their errors) and the index of the sub-detector which contains    //
77 //   the space-point.                                                       //
78 //   cvetan.cheshkov@cern.ch 3/11/2005                                      //
79 //////////////////////////////////////////////////////////////////////////////
80
81 class AliTrackPointArray : public TObject {
82
83  public:
84
85   AliTrackPointArray();
86   AliTrackPointArray(Int_t npoints);
87   AliTrackPointArray(const AliTrackPointArray &array);
88   AliTrackPointArray& operator= (const AliTrackPointArray& array);
89   virtual ~AliTrackPointArray();
90
91   //  Bool_t    AddPoint(Int_t i, AliCluster *cl, UShort_t volid);
92   Bool_t    AddPoint(Int_t i, const AliTrackPoint *p);
93
94   Int_t     GetNPoints() const { return fNPoints; }
95   Int_t     GetCovSize() const { return fSize; }
96   Bool_t    GetPoint(AliTrackPoint &p, Int_t i) const;
97   // Getters for fast access to the coordinate arrays
98   const Float_t*  GetX() const { return &fX[0]; }
99   const Float_t*  GetY() const { return &fY[0]; }
100   const Float_t*  GetZ() const { return &fZ[0]; }
101   const Float_t*  GetCharge() const { return &fCharge[0]; }
102   const Float_t*  GetDriftTime() const { return &fDriftTime[0]; }
103   const Float_t*  GetCov() const { return &fCov[0]; }
104   const UShort_t* GetVolumeID() const { return &fVolumeID[0]; }
105
106   Bool_t    HasVolumeID(UShort_t volid) const;
107
108   void Sort(Bool_t down=kTRUE);
109
110  private:
111   Bool_t fSorted;        // Sorted flag
112
113   Int_t     fNPoints;    // Number of space points
114   Float_t   *fX;         //[fNPoints] Array with space point X coordinates
115   Float_t   *fY;         //[fNPoints] Array with space point Y coordinates
116   Float_t   *fZ;         //[fNPoints] Array with space point Z coordinates
117   Float_t   *fCharge;    //[fNPoints] Array with clusters charge
118   Float_t   *fDriftTime; //[fNPoints] Array with drift times
119   Int_t     fSize;       // Size of array with cov matrices = 6*N of points
120   Float_t   *fCov;       //[fSize] Array with space point coordinates cov matrix
121   UShort_t  *fVolumeID;  //[fNPoints] Array of space point volume IDs
122
123   ClassDef(AliTrackPointArray,4)
124 };
125
126 #endif