]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliTrackPointArray.h
b7c6aa48145e98191e0957a65ff0bc9acae17857
[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
17 class AliTrackPoint : public TObject {
18
19  public:
20   AliTrackPoint();
21   AliTrackPoint(Float_t x, Float_t y, Float_t z, const Float_t *cov, UShort_t volid);
22   AliTrackPoint(const Float_t *xyz, const Float_t *cov, UShort_t volid);
23   AliTrackPoint(const AliTrackPoint &p);
24   AliTrackPoint& operator= (const AliTrackPoint& p);
25   virtual ~AliTrackPoint() {}
26
27   // Multiplication with TGeoMatrix and distance between points (chi2) to be implemented
28
29   void     SetXYZ(Float_t x, Float_t y, Float_t z, const Float_t *cov = 0);
30   void     SetXYZ(const Float_t *xyz, const Float_t *cov = 0);
31   void     SetVolumeID(UShort_t volid) { fVolumeID = volid; }
32
33   Float_t  GetX() const { return fX; }
34   Float_t  GetY() const { return fY; }
35   Float_t  GetZ() const { return fZ; }
36   void     GetXYZ(Float_t *xyz, Float_t *cov = 0) const;
37   const Float_t *GetCov() const { return &fCov[0]; }
38   UShort_t GetVolumeID() const { return fVolumeID; }
39
40   Float_t  GetResidual(const AliTrackPoint &p, Bool_t weighted = kFALSE) const;
41
42   Float_t  GetAngle() const;
43   AliTrackPoint& Rotate(Float_t alpha) const;
44   AliTrackPoint& MasterToLocal() const;
45
46   void     Print(Option_t *) const;
47
48  private:
49
50   Float_t  fX;        // X coordinate
51   Float_t  fY;        // Y coordinate
52   Float_t  fZ;        // Z coordinate
53   Float_t  fCov[6];   // Cov matrix
54   UShort_t fVolumeID; // Volume ID
55
56   ClassDef(AliTrackPoint,1)
57 };
58
59 //////////////////////////////////////////////////////////////////////////////
60 //                          Class AliTrackPointArray                        //
61 //   This class contains the ESD track space-points which are used during   //
62 //   the alignment procedures. Each space-point consist of 3 coordinates    //
63 //   (and their errors) and the index of the sub-detector which contains    //
64 //   the space-point.                                                       //
65 //   cvetan.cheshkov@cern.ch 3/11/2005                                      //
66 //////////////////////////////////////////////////////////////////////////////
67
68 class AliTrackPointArray : public TObject {
69
70  public:
71
72   AliTrackPointArray();
73   AliTrackPointArray(Int_t npoints);
74   AliTrackPointArray(const AliTrackPointArray &array);
75   AliTrackPointArray& operator= (const AliTrackPointArray& array);
76   virtual ~AliTrackPointArray();
77
78   //  Bool_t    AddPoint(Int_t i, AliCluster *cl, UShort_t volid);
79   Bool_t    AddPoint(Int_t i, const AliTrackPoint *p);
80
81   Int_t     GetNPoints() const { return fNPoints; }
82   Int_t     GetCovSize() const { return fSize; }
83   Bool_t    GetPoint(AliTrackPoint &p, Int_t i) const;
84   // Getters for fast access to the coordinate arrays
85   const Float_t*  GetX() const { return &fX[0]; }
86   const Float_t*  GetY() const { return &fY[0]; }
87   const Float_t*  GetZ() const { return &fZ[0]; }
88   const Float_t*  GetCov() const { return &fCov[0]; }
89   const UShort_t* GetVolumeID() const { return &fVolumeID[0]; }
90
91   Bool_t    HasVolumeID(UShort_t volid) const;
92
93  private:
94
95   Int_t     fNPoints;    // Number of space points
96   Float_t   *fX;         //[fNPoints] Array with space point X coordinates
97   Float_t   *fY;         //[fNPoints] Array with space point Y coordinates
98   Float_t   *fZ;         //[fNPoints] Array with space point Z coordinates
99   Int_t     fSize;       // Size of array with cov matrices = 6*N of points
100   Float_t   *fCov;       //[fSize] Array with space point coordinates cov matrix
101   UShort_t  *fVolumeID;  //[fNPoints] Array of space point volume IDs
102
103   ClassDef(AliTrackPointArray,1)
104 };
105
106 #endif