AliRoot Core  ee782a0 (ee782a0)
AliTrackPointArray.h
Go to the documentation of this file.
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 
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 //
14 
15 #include <TObject.h>
16 #include <TMatrixDSym.h>
17 #include "Rtypes.h"
18 
19 class TGeoRotation;
20 
21 class AliTrackPoint : public TObject {
22 
23  public:
24 
25  AliTrackPoint();
26  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);
27  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);
30  virtual ~AliTrackPoint() {}
31 
32  // Multiplication with TGeoMatrix and distance between points (chi2) to be implemented
33 
34  void SetXYZ(Float_t x, Float_t y, Float_t z, const Float_t *cov = 0);
35  void SetXYZ(const Float_t *xyz, const Float_t *cov = 0);
36  void SetCov(const Float_t *cov);
37  void SetVolumeID(UShort_t volid) { fVolumeID = volid; }
38  void SetCharge(Float_t charge) { fCharge = charge; }
39  void SetDriftTime(Float_t time) { fDriftTime = time; }
40  void SetChargeRatio(Float_t ratio) { fChargeRatio= ratio; }
41  void SetClusterType(Int_t clutype) { fClusterType= clutype; }
42  void SetExtra(Bool_t flag=kTRUE) { fIsExtra = flag; }
43 
44  Float_t GetX() const { return fX; }
45  Float_t GetY() const { return fY; }
46  Float_t GetZ() const { return fZ; }
47  void GetXYZ(Float_t *xyz, Float_t *cov = 0) const;
48  const Float_t *GetCov() const { return &fCov[0]; }
49  UShort_t GetVolumeID() const { return fVolumeID; }
50  Float_t GetCharge() const { return fCharge; }
51  Float_t GetDriftTime() const { return fDriftTime;}
52  Float_t GetChargeRatio() const { return fChargeRatio;}
53  Int_t GetClusterType() const { return fClusterType;}
54  Bool_t IsExtra() const { return fIsExtra;}
55 
56  Float_t GetResidual(const AliTrackPoint &p, Bool_t weighted = kFALSE) const;
57  Bool_t GetPCA(const AliTrackPoint &p, AliTrackPoint &out) const;
58 
59  Float_t GetAngle() const;
60  Bool_t GetRotMatrix(TGeoRotation& rot) const;
61  void SetAlignCovMatrix(const TMatrixDSym& alignparmtrx);
62 
63  AliTrackPoint& Rotate(Float_t alpha) const;
65 
66  void Print(Option_t *) const;
67 
68  private:
69 
70  Float_t fX; // X coordinate
71  Float_t fY; // Y coordinate
72  Float_t fZ; // Z coordinate
73  Float_t fCharge; // Cluster charge in arbitrary units
74  Float_t fDriftTime;// Drift time in SDD (in ns)
75  Float_t fChargeRatio; // Charge ratio in SSD
76  Int_t fClusterType; // Cluster Type (encoded info on size and shape)
77  Float_t fCov[6]; // Cov matrix
78  Bool_t fIsExtra; // attached by tracker but not used in fit
79  UShort_t fVolumeID; // Volume ID
80 
81  ClassDef(AliTrackPoint,7)
82 };
83 
85 // Class AliTrackPointArray //
86 // This class contains the ESD track space-points which are used during //
87 // the alignment procedures. Each space-point consist of 3 coordinates //
88 // (and their errors) and the index of the sub-detector which contains //
89 // the space-point. //
90 // cvetan.cheshkov@cern.ch 3/11/2005 //
92 
93 class AliTrackPointArray : public TObject {
94 
95  public:
96 
97  enum {kTOFBugFixed=BIT(14)};
98 
103  virtual ~AliTrackPointArray();
104 
105  // Bool_t AddPoint(Int_t i, AliCluster *cl, UShort_t volid);
106  Bool_t AddPoint(Int_t i, const AliTrackPoint *p);
107 
108  Int_t GetNPoints() const { return fNPoints; }
109  Int_t GetCovSize() const { return fSize; }
110  Bool_t GetPoint(AliTrackPoint &p, Int_t i) const;
111  // Getters for fast access to the coordinate arrays
112  const Float_t* GetX() const { return &fX[0]; }
113  const Float_t* GetY() const { return &fY[0]; }
114  const Float_t* GetZ() const { return &fZ[0]; }
115  const Float_t* GetCharge() const { return &fCharge[0]; }
116  const Float_t* GetDriftTime() const { return &fDriftTime[0]; }
117  const Float_t* GetChargeRatio() const { return &fChargeRatio[0]; }
118  const Int_t* GetClusterType() const { return &fClusterType[0]; }
119  const Bool_t* GetExtra() const { return &fIsExtra[0]; }
120  const Float_t* GetCov() const { return &fCov[0]; }
121  const UShort_t* GetVolumeID() const { return &fVolumeID[0]; }
122 
123  Bool_t HasVolumeID(UShort_t volid) const;
124  void Print(Option_t *) const;
125 
126  void Sort(Bool_t down=kTRUE);
127 
128  private:
129  Bool_t fSorted; // Sorted flag
130 
131  Int_t fNPoints; // Number of space points
132  Float_t *fX; //[fNPoints] Array with space point X coordinates
133  Float_t *fY; //[fNPoints] Array with space point Y coordinates
134  Float_t *fZ; //[fNPoints] Array with space point Z coordinates
135  Float_t *fCharge; //[fNPoints] Array with clusters charge
136  Float_t *fDriftTime; //[fNPoints] Array with drift times
137  Float_t *fChargeRatio; //[fNPoints] Array with charge ratio
138  Int_t *fClusterType; //[fNPoints] Array with cluster type
139  Bool_t *fIsExtra; //[fNPoints] Array with extra flags
140  Int_t fSize; // Size of array with cov matrices = 6*N of points
141  Float_t *fCov; //[fSize] Array with space point coordinates cov matrix
142  UShort_t *fVolumeID; //[fNPoints] Array of space point volume IDs
143 
144  ClassDef(AliTrackPointArray,7)
145 };
146 
147 #endif
148 
const Float_t * GetCov() const
UShort_t GetVolumeID() const
virtual ~AliTrackPoint()
void Print(Option_t *) const
Float_t GetChargeRatio() const
Float_t GetAngle() const
AliTrackPoint & MasterToLocal() const
const Float_t * GetY() const
Int_t GetCovSize() const
Int_t GetNPoints() const
void SetAlignCovMatrix(const TMatrixDSym &alignparmtrx)
void SetCharge(Float_t charge)
Float_t p[]
Definition: kNNTest.C:133
const Bool_t * GetExtra() const
void SetDriftTime(Float_t time)
npoints
Definition: driftITSTPC.C:85
void SetChargeRatio(Float_t ratio)
const UShort_t * GetVolumeID() const
void SetXYZ(Float_t x, Float_t y, Float_t z, const Float_t *cov=0)
TObjArray * array
Definition: AnalyzeLaser.C:12
Float_t GetY() const
void SetVolumeID(UShort_t volid)
const Int_t * GetClusterType() const
void SetCov(const Float_t *cov)
Float_t GetZ() const
const Float_t * GetCov() const
Bool_t IsExtra() const
Int_t GetClusterType() const
Float_t GetDriftTime() const
const Float_t * GetCharge() const
Float_t GetX() const
void SetExtra(Bool_t flag=kTRUE)
Float_t GetResidual(const AliTrackPoint &p, Bool_t weighted=kFALSE) const
Float_t GetCharge() const
const Float_t * GetChargeRatio() const
Bool_t GetRotMatrix(TGeoRotation &rot) const
AliTrackPoint & operator=(const AliTrackPoint &p)
Bool_t GetPCA(const AliTrackPoint &p, AliTrackPoint &out) const
const Float_t * GetZ() const
AliTrackPoint & Rotate(Float_t alpha) const
void SetClusterType(Int_t clutype)
void GetXYZ(Float_t *xyz, Float_t *cov=0) const
const Float_t * GetDriftTime() const
const Float_t * GetX() const