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