]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/AliHLTTPCTrack.h
added new helper components to libAliHLTUtil (EsdCollector and AliHLTOUTPublisher...
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCTrack.h
CommitLineData
3cde846d 1// XEmacs -*-C++-*-
a6c02c85 2// @(#) $Id$
4aa41877 3// Original: AliHLTTrack.h,v 1.18 2005/03/31 04:48:58 cvetan
3cde846d 4
a6c02c85 5#ifndef ALIHLTTPCTRACK_H
6#define ALIHLTTPCTRACK_H
7
297174de 8//* This file is property of and copyright by the ALICE HLT Project *
9//* ALICE Experiment at CERN, All rights reserved. *
10//* See cxx source for full Copyright notice *
3cde846d 11
12/** @file AliHLTTPCTrack.h
4fdaad1e 13 @author Anders Vestbo, Uli Frankenfeld, maintained by Matthias Richter
3cde846d 14 @date
15 @brief HLT TPC track base class (conformal mapping)
16*/
17
18#include "AliTPCtrack.h"
19
a6c02c85 20class AliHLTTPCVertex;
21class AliHLTTPCSpacePointData;
22
3cde846d 23/**
24 * @class AliHLTTPCTrack
25 * This class implements the representation of a TPC track, used by the
26 * HLT conformal mapping track finder. <br>
27 * It was originally separated from the offline TPC track class, but in
28 * order to adjust the output format to the offline ESD, AliHLTTPCTrack
29 * now inherits from AliHLTtrack.
297174de 30 *
31 * @ingroup alihlt_tpc
3cde846d 32 */
33class AliHLTTPCTrack : public AliTPCtrack {
a6c02c85 34
35 public:
36
37 AliHLTTPCTrack();
38 virtual ~AliHLTTPCTrack();
39
3cde846d 40 /**
41 * Copy track parameters.
42 * @param track pointer to source track
43 */
44 virtual void Copy(AliHLTTPCTrack* track);
5d2abf3b 45 using AliTPCtrack::Copy; //TODO: Check if "virtual void Copy(TObject*)" does what it is supposed to do.
3cde846d 46
47 /**
48 * Compare two tracks by the number of hits
49 * @return 0 if equal number of hits,
50 * 1 if this > track
51 * -1 if this < track
52 */
a6c02c85 53 virtual Int_t Compare(const AliHLTTPCTrack *track) const;
5d2abf3b 54 using AliTPCtrack::Compare; //TODO: Check if "virtual Int_t Compare(TObject*)" does what it is supposed to do.
3cde846d 55
56 /**
57 * Fit the assigned spacepoints to a helix.
58 * The function sets teh track parameters.
59 */
a6c02c85 60 virtual void CalculateHelix();
61
62 Bool_t CalculateReferencePoint(Double_t angle,Double_t radius=132);//Calculate Reference Point
63 Bool_t CalculateEdgePoint(Double_t angle);//Calculate crossing point with line
64 Bool_t CalculatePoint(Double_t xplane); //Calculate crossing point with X-plane
65 Bool_t IsPoint() {return fIsPoint;}
66 Double_t GetCrossingAngle(Int_t padrow,Int_t slice=-1);
67 Bool_t GetCrossingPoint(Int_t padrow,Float_t *xyz);
68 Double_t GetDistance(Double_t /*x0*/,Double_t /*x1*/){return 0;}
69 void UpdateToFirstPoint();
2a083ac4 70 void GetClosestPoint(AliHLTTPCVertex *vertex,Double_t &closestX,Double_t &closestY,Double_t &closestZ);
a6c02c85 71 void Rotate(Int_t slice,Bool_t tolocal=kFALSE);
72 Bool_t IsLocal() const {return fIsLocal;}
5d2abf3b 73 virtual void Print(Option_t* option = "") const;
74 using AliTPCtrack::Print;
a6c02c85 75
76 // getter
77 Double_t GetFirstPointX() const {return fFirstPoint[0];}
78 Double_t GetFirstPointY() const {return fFirstPoint[1];}
79 Double_t GetFirstPointZ() const {return fFirstPoint[2];}
80 Double_t GetLastPointX() const {return fLastPoint[0];}
81 Double_t GetLastPointY() const {return fLastPoint[1];}
82 Double_t GetLastPointZ() const {return fLastPoint[2];}
83
84 Double_t GetPointPsi() const {return fPointPsi;}
85 Double_t GetPointX() const {return fPoint[0];}
86 Double_t GetPointY() const {return fPoint[1];}
87 Double_t GetPointZ() const {return fPoint[2];}
88
89 Double_t GetPt() const {return fPt;}
90 Double_t GetTgl() const {return fTanl;}
91 Double_t GetPsi() const {return fPsi;}
92 Double_t GetPhi0() const {return fPhi0;}
93 Double_t GetR0() const {return fR0;}
94 Double_t GetZ0() const {return fFirstPoint[2];}
95 Float_t GetPID() const {return fPID;}
96
97 Double_t GetPterr() const {return fPterr;}
98 Double_t GetPsierr() const {return fPsierr;}
99 Double_t GetTglerr() const {return fTanlerr;}
100
101 Double_t GetKappa() const {return fKappa;}
102 Double_t GetRadius() const {return fRadius;}
103 Double_t GetCenterX() const {return fCenterX;}
104 Double_t GetCenterY() const {return fCenterY;}
105
106 Int_t GetNHits() const {return fNHits;}
107 Int_t GetNumberOfPoints() const {return fNHits;}
108 Bool_t ComesFromMainVertex() const {return fFromMainVertex;}
109
110 Double_t GetPx() const {return fPt*cos(fPsi);}
111 Double_t GetPy() const {return fPt*sin(fPsi);}
112 Double_t GetPz() const {return fPt*fTanl;}
113
114 Double_t GetP() const;
115 Double_t GetPseudoRapidity() const;
116 Double_t GetRapidity() const;
117
118 Int_t GetCharge() const {return fQ;}
119 Int_t GetMCid() const {return fMCid;}
120 Double_t GetLength() const {return fLength;}
121
122 Int_t GetFirstRow() const {return fRowRange[0];}
123 Int_t GetLastRow() const {return fRowRange[1];}
124 Int_t GetSector() const {return fSector;}
125
126 UInt_t *GetHitNumbers() {return fHitNumbers;}
127
128 // setter
129 void SetPID(Float_t pid) {fPID=pid;}
130 void SetMCid(Int_t f) {fMCid = f;}
131 void SetFirstPoint(Double_t f,Double_t g,Double_t h) {fFirstPoint[0]=f; fFirstPoint[1]=g; fFirstPoint[2]=h;}
132 void SetLastPoint(Double_t f,Double_t g,Double_t h) {fLastPoint[0]=f; fLastPoint[1]=g; fLastPoint[2]=h;}
25097926 133 void SetHits(Int_t nhits,UInt_t *hits);
a6c02c85 134 void SetPhi0(Double_t f) {fPhi0 = f;}
135 void SetPsi(Double_t f) {fPsi = f;}
136 void SetR0(Double_t f) {fR0 = f;}
137 void SetTgl(Double_t f) {fTanl =f;}
138 void SetZ0(Double_t f) {fFirstPoint[2] = f;}
139 void SetPt(Double_t f) {fPt = f;}
140 void SetLength(Double_t f) {fLength = f;}
141 void SetPterr(Double_t f) {fPterr = f;}
142 void SetPsierr(Double_t f) {fPsierr = f;}
143 void SetZ0err(Double_t f) {fZ0err = f;}
144 void SetTglerr(Double_t f) {fTanlerr = f;}
145 void SetKappa(Double_t f) {fKappa = f;}
146 void SetNHits(Int_t f) {fNHits = f;}
147 void SetRowRange(Int_t f,Int_t g) {fRowRange[0]=f; fRowRange[1]=g;}
148 void SetSector(Int_t f) {fSector = f;}
149 void SetRadius(Double_t f) {fRadius = f;}
150 void SetCenterX(Double_t f) {fCenterX = f;}
151 void SetCenterY(Double_t f) {fCenterY = f;}
152 void SetCharge(Int_t f) {fQ = f;}
153 void ComesFromMainVertex(Bool_t f) {fFromMainVertex = f;}
154
3cde846d 155 /**
156 * Convert all track parameters to the format of AliKalmanTrack
157 * The AliKalmanTrack class implements the track parametrization for offline ITS, TPC
158 * and TRD tracking. The function calculates and sets the parameters of the
159 * parent class (Note: AliHLTTPCTrack inherits from AliTPCtrack and thus
160 * AliKalmanTrack).
161 */
162 int Convert2AliKalmanTrack();
163
a6c02c85 164 private:
165
166 Int_t fNHits; //Number of hits
167 Int_t fMCid; //Assigned id from MC data.
168
169 Double_t fKappa; // Signed curvature (projected to a circle)
170 Double_t fRadius; // Radius of the helix (projected to a circle)
171 Double_t fCenterX; // x coordinate of the center of the helix (projected to a circle)
172 Double_t fCenterY; // y coordinate of the center of the helix (projected to a circle)
173 Bool_t fFromMainVertex; // true if tracks origin is the main vertex, otherwise false
174
175 Int_t fRowRange[2]; //Subsector where this track was build
176 Int_t fSector; //Sector # where this track was build
177
178 //data from momentum fit
179 Int_t fQ; //charge measured fit
180
181 //track parameters:
182 Double_t fTanl; //tan of dipangle
183 Double_t fPsi; //azimuthal angle of the momentum
184 Double_t fPt; //transverse momentum
185 Double_t fLength; //length of track (s)
186
187 Double_t fPterr; //error in pt
188 Double_t fPsierr; //error in psi
189 Double_t fZ0err; //error in first point
190 Double_t fTanlerr; //error in tanl
191
192 Double_t fPhi0; //azimuthal angle of the first point
193 Double_t fR0; //radius of the first point
194 Double_t fZ0; //z coordinate of the first point (fFirstPoint[2])
195
196 Double_t fFirstPoint[3]; //first point
197 Double_t fLastPoint[3]; //last point
198 Double_t fPoint[3]; //point
199 Double_t fPointPsi; //azimuthal angle of the momentum at Point
200
201 Bool_t fIsPoint; //Helix crosses the X-plane
202 Bool_t fIsLocal; //Track given in local coordinates.
203
204 Float_t fPID; //pid
25097926 205 static const int fgkHitArraySize=159; // size of hit array
206 UInt_t fHitNumbers[fgkHitArraySize]; //Array of hit numbers for this track
a6c02c85 207
208 Bool_t IsPoint(Bool_t ispoint) {fIsPoint = ispoint;return fIsPoint;}
209
3cde846d 210 ClassDef(AliHLTTPCTrack,2) //Base track class
a6c02c85 211};
212#endif