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