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