]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliESDtrack.h
Increase version
[u/mrichter/AliRoot.git] / STEER / AliESDtrack.h
1
2 #ifndef ALIESDTRACK_H
3 #define ALIESDTRACK_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 /* $Id$ */
8
9 //-------------------------------------------------------------------------
10 //                          Class AliESDtrack
11 //   This is the class to deal with during the physics analysis of data
12 //      
13 //         Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch 
14 //-------------------------------------------------------------------------
15 /*****************************************************************************
16  *  Use GetExternalParameters() and GetExternalCovariance() to access the    *
17  *      track information regardless of its internal representation.         *
18  * This formation is now fixed in the following way:                         *
19  *      external param0:   local Y-coordinate of a track (cm)                *
20  *      external param1:   local Z-coordinate of a track (cm)                *
21  *      external param2:   local sine of the track momentum azimuthal angle  *
22  *      external param3:   tangent of the track momentum dip angle           *
23  *      external param4:   1/pt (1/(GeV/c))                                  *
24  *****************************************************************************/
25
26 #include <TBits.h>
27 #include "AliExternalTrackParam.h"
28 #include "AliPID.h"
29 #include "AliESDfriendTrack.h"
30
31 class TParticle;
32 class AliESDVertex;
33 class AliKalmanTrack;
34 class AliTrackPointArray;
35
36 class AliESDtrack : public AliExternalTrackParam {
37 public:
38   AliESDtrack();
39   AliESDtrack(const AliESDtrack& track);
40   AliESDtrack(TParticle * part);
41   virtual ~AliESDtrack();
42   const AliESDfriendTrack *GetFriendTrack() const {return fFriendTrack;}
43   void SetFriendTrack(const AliESDfriendTrack *t) {
44     delete fFriendTrack; fFriendTrack=new AliESDfriendTrack(*t);
45     // CKB
46   }
47   void AddCalibObject(TObject * object);     // add calib object to the list
48   TObject *  GetCalibObject(Int_t index);    // return calib objct at given position
49   void MakeMiniESDtrack();
50   void SetID(Int_t id) { fID =id;}
51   Int_t GetID() const { return fID;}
52   void SetStatus(ULong_t flags) {fFlags|=flags;}
53   void ResetStatus(ULong_t flags) {fFlags&=~flags;}
54   Bool_t UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags);
55   void SetIntegratedLength(Double_t l) {fTrackLength=l;}
56   void SetIntegratedTimes(const Double_t *times);
57   void SetESDpid(const Double_t *p);
58   void GetESDpid(Double_t *p) const;
59   
60   Bool_t IsOn(Int_t mask) const {return (fFlags&mask)>0;}
61   ULong_t GetStatus() const {return fFlags;}
62   Int_t GetLabel() const {return fLabel;}
63   void SetLabel(Int_t label) {fLabel = label;}
64
65   void GetExternalParameters(Double_t &x, Double_t p[5]) const;
66   void GetExternalCovariance(Double_t cov[15]) const;
67
68   Double_t GetIntegratedLength() const {return fTrackLength;}
69   void GetIntegratedTimes(Double_t *times) const;
70   Double_t GetMass() const;
71
72   Bool_t GetConstrainedPxPyPz(Double_t *p) const {
73     if (!fCp) return kFALSE;
74     return fCp->GetPxPyPz(p);
75   }
76   Bool_t GetConstrainedXYZ(Double_t *r) const {
77     if (!fCp) return kFALSE;
78     return fCp->GetXYZ(r);
79   }
80   const AliExternalTrackParam *GetConstrainedParam() const {return fCp;}
81   Bool_t GetConstrainedExternalParameters
82               (Double_t &alpha, Double_t &x, Double_t p[5]) const;
83   Bool_t GetConstrainedExternalCovariance(Double_t cov[15]) const;
84   Double_t GetConstrainedChi2() const {return fCchi2;}
85
86
87   Bool_t GetInnerPxPyPz(Double_t *p) const {
88     if (!fIp) return kFALSE;
89     return fIp->GetPxPyPz(p);
90   }
91   const AliExternalTrackParam * GetInnerParam() const { return fIp;}
92   Bool_t GetInnerXYZ(Double_t *r) const {
93     if (!fIp) return kFALSE;
94     return fIp->GetXYZ(r);
95   }
96   Bool_t GetInnerExternalParameters
97         (Double_t &alpha, Double_t &x, Double_t p[5]) const;
98   Bool_t GetInnerExternalCovariance(Double_t cov[15]) const;
99  
100   const AliExternalTrackParam * GetOuterParam() const { return fOp;}
101   Bool_t GetOuterPxPyPz(Double_t *p) const {
102     if (!fOp) return kFALSE;
103     return fOp->GetPxPyPz(p);
104   }
105   Bool_t GetOuterXYZ(Double_t *r) const {
106     if (!fOp) return kFALSE;
107     return fOp->GetXYZ(r);
108   }
109   Bool_t GetOuterExternalParameters
110         (Double_t &alpha, Double_t &x, Double_t p[5]) const;
111   Bool_t GetOuterExternalCovariance(Double_t cov[15]) const;
112
113
114   Int_t GetNcls(Int_t idet) const;
115   Int_t GetClusters(Int_t idet, Int_t *idx) const;
116  
117   void    SetITSpid(const Double_t *p);
118   void    GetITSpid(Double_t *p) const;
119   Float_t GetITSsignal() const {return fITSsignal;}
120   Float_t GetITSchi2() const {return fITSchi2;}
121   Int_t   GetITSclusters(Int_t *idx) const;
122   UChar_t GetITSClusterMap() const {return fITSClusterMap;}
123   Int_t   GetITSLabel() const {return fITSLabel;}
124   void    SetITStrack(AliKalmanTrack * track){
125      fFriendTrack->SetITStrack(track);
126   }
127   AliKalmanTrack *GetITStrack(){
128      return fFriendTrack->GetITStrack();
129   }
130
131   void    SetTPCpid(const Double_t *p);
132   void    GetTPCpid(Double_t *p) const;
133   void    SetTPCPoints(Float_t points[4]){
134      for (Int_t i=0;i<4;i++) fTPCPoints[i]=points[i];
135   }
136   void    SetTPCPointsF(UChar_t  findable){fTPCnclsF = findable;}
137   Int_t   GetTPCNcls() const { return fTPCncls;}
138   Int_t   GetTPCNclsF() const { return fTPCnclsF;}
139   Float_t GetTPCPoints(Int_t i) const {return fTPCPoints[i];}
140   void    SetKinkIndexes(Int_t points[3]) {
141      for (Int_t i=0;i<3;i++) fKinkIndexes[i] = points[i];
142   }
143   void    SetV0Indexes(Int_t points[3]) {
144      for (Int_t i=0;i<3;i++) fV0Indexes[i] = points[i];
145   }
146   void    SetTPCsignal(Float_t signal, Float_t sigma, UChar_t npoints){ 
147      fTPCsignal = signal; fTPCsignalS = sigma; fTPCsignalN = npoints;
148   }
149   Float_t GetTPCsignal() const {return fTPCsignal;}
150   Float_t GetTPCsignalSigma() const {return fTPCsignalS;}
151   UShort_t GetTPCsignalN() const {return fTPCsignalN;}
152   Float_t GetTPCchi2() const {return fTPCchi2;}
153   Int_t   GetTPCclusters(Int_t *idx) const;
154   Float_t GetTPCdensity(Int_t row0, Int_t row1) const;
155   Int_t   GetTPCLabel() const {return fTPCLabel;}
156   Int_t   GetKinkIndex(Int_t i) const { return fKinkIndexes[i];}
157   Int_t   GetV0Index(Int_t i) const { return fV0Indexes[i];}
158   const TBits& GetTPCClusterMap() const {return fTPCClusterMap;}
159   
160   void    SetTRDpid(const Double_t *p);
161   void    SetTRDQuality(Float_t quality){fTRDQuality=quality;}
162   Float_t GetTRDQuality()const {return fTRDQuality;}
163   void    SetTRDBudget(Float_t budget){fTRDBudget=budget;}
164   Float_t GetTRDBudget()const {return fTRDBudget;}
165   void    SetTRDsignals(Float_t dedx, Int_t i, Int_t j) {fTRDsignals[i][j]=dedx;}
166   void    SetTRDTimBin(Int_t timbin, Int_t i) {fTRDTimBin[i]=timbin;}
167   void    GetTRDpid(Double_t *p) const;
168   Float_t GetTRDsignal() const {return fTRDsignal;}
169   Float_t GetTRDsignals(Int_t iPlane, Int_t iSlice=-1) const { if (iSlice == -1) 
170     return (fTRDsignals[iPlane][0] + fTRDsignals[iPlane][1] + fTRDsignals[iPlane][2])/3.0;
171     return fTRDsignals[iPlane][iSlice];
172   }
173   Int_t   GetTRDTimBin(Int_t i) const {return fTRDTimBin[i];}
174   Float_t GetTRDchi2() const {return fTRDchi2;}
175   Int_t   GetTRDclusters(Int_t *idx) const;
176   Int_t   GetTRDncls() const {return fTRDncls;}
177   void    SetTRDpid(Int_t iSpecies, Float_t p);
178   Float_t GetTRDpid(Int_t iSpecies) const;
179   Int_t   GetTRDLabel() const {return fTRDLabel;}
180
181   void    SetTRDtrack(AliKalmanTrack * track){
182      fFriendTrack->SetTRDtrack(track);
183   }
184   AliKalmanTrack *GetTRDtrack(){
185      return fFriendTrack->GetTRDtrack();
186   }
187
188   void    SetTOFsignal(Double_t tof) {fTOFsignal=tof;}
189   Float_t GetTOFsignal() const {return fTOFsignal;}
190   void    SetTOFsignalToT(Double_t ToT) {fTOFsignalToT=ToT;}
191   Float_t GetTOFsignalToT() const {return fTOFsignalToT;}
192   void    SetTOFsignalRaw(Double_t tof) {fTOFsignalRaw=tof;}
193   Float_t GetTOFsignalRaw() const {return fTOFsignalRaw;}
194   void    SetTOFsignalDz(Double_t dz) {fTOFsignalDz=dz;}
195   Float_t GetTOFsignalDz() const {return fTOFsignalDz;}
196   Float_t GetTOFchi2() const {return fTOFchi2;}
197   void    SetTOFpid(const Double_t *p);
198   void    SetTOFLabel(const Int_t *p);
199   void    GetTOFpid(Double_t *p) const;
200   void    GetTOFLabel(Int_t *p) const;
201   void    GetTOFInfo(Float_t *info) const;
202   void    SetTOFInfo(Float_t *info);
203   Int_t   GetTOFCalChannel() const {return fTOFCalChannel;}
204   Int_t   GetTOFcluster() const {return fTOFindex;}
205   void    SetTOFcluster(Int_t index) {fTOFindex=index;}
206   void    SetTOFCalChannel(Int_t index) {fTOFCalChannel=index;}
207
208 // HMPID methodes +++++++++++++++++++++++++++++++++ (kir)
209   void    SetHMPIDsignal(Double_t theta) {fHMPIDsignal=theta;}
210   Float_t GetHMPIDsignal() const {return fHMPIDsignal;}
211   void    SetHMPIDpid(const Double_t *p);
212   void    GetHMPIDpid(Double_t *p) const;  
213   void    SetHMPIDchi2(Double_t chi2) {fHMPIDchi2=chi2;}
214   Float_t GetHMPIDchi2() const {return fHMPIDchi2;}
215   void    SetHMPIDcluster(Int_t index) {fHMPIDcluIdx=index;}
216   Int_t   GetHMPIDcluster() const {return fHMPIDcluIdx;}
217   void    SetHMPIDcluIdx(Int_t ch,Int_t idx) {fHMPIDcluIdx=ch*1000000+idx;}
218   Int_t   GetHMPIDcluIdx() const {return fHMPIDcluIdx;}
219   void    SetHMPIDtrk(Float_t  x, Float_t  y, Float_t  th, Float_t  ph) {
220      fHMPIDtrkX=x; fHMPIDtrkY=y; fHMPIDtrkTheta=th; fHMPIDtrkPhi=ph;
221   }
222   void    GetHMPIDtrk(Float_t &x, Float_t &y, Float_t &th, Float_t &ph) const {
223      x=fHMPIDtrkX; y=fHMPIDtrkY; th=fHMPIDtrkTheta; ph=fHMPIDtrkPhi;
224   }
225   void    SetHMPIDmip(Float_t  x, Float_t  y, Int_t q, Int_t nph=0) {
226      fHMPIDmipX=x; fHMPIDmipY=y; fHMPIDqn=100000*q+nph;
227   }
228   void    GetHMPIDmip(Float_t &x,Float_t &y,Int_t &q,Int_t &nph) const {
229      x=fHMPIDmipX; y=fHMPIDmipY; q=fHMPIDqn/1000000; nph=fHMPIDqn%1000000;
230   }
231   Bool_t  IsHMPID() const {return fFlags&kHMPIDpid;}
232
233
234   Int_t GetEMCALcluster() {return fEMCALindex;}
235   void SetEMCALcluster(Int_t index) {fEMCALindex=index;}
236   Bool_t IsEMCAL() const {return fFlags&kEMCALmatch;}
237
238   void SetTrackPointArray(AliTrackPointArray *points) {
239     fFriendTrack->SetTrackPointArray(points);
240   }
241   const AliTrackPointArray *GetTrackPointArray() const {
242     return fFriendTrack->GetTrackPointArray(); 
243   }
244   Bool_t RelateToVertex(const AliESDVertex *vtx, Double_t b, Double_t maxd);
245   void GetImpactParameters(Float_t &xy,Float_t &z) const {xy=fD; z=fZ;}
246   void GetImpactParameters(Float_t p[2], Float_t cov[3]) const {
247     p[0]=fD; p[1]=fZ; cov[0]=fCdd; cov[1]=fCdz; cov[2]=fCzz;
248   }
249   virtual void Print(Option_t * opt) const ; 
250
251   //MI
252   Bool_t PropagateTo(Double_t x, Double_t b, Double_t mass, Double_t maxStep,
253                      Bool_t rotateTo=kTRUE, Double_t maxSnp=0.8);
254
255   enum {
256     kITSin=0x0001,kITSout=0x0002,kITSrefit=0x0004,kITSpid=0x0008,
257     kTPCin=0x0010,kTPCout=0x0020,kTPCrefit=0x0040,kTPCpid=0x0080,
258     kTRDin=0x0100,kTRDout=0x0200,kTRDrefit=0x0400,kTRDpid=0x0800,
259     kTOFin=0x1000,kTOFout=0x2000,kTOFrefit=0x4000,kTOFpid=0x8000,
260     kHMPIDpid=0x20000,
261     kEMCALmatch=0x40000,
262     kTRDbackup=0x80000,
263     kTRDStop=0x20000000,
264     kESDpid=0x40000000,
265     kTIME=0x80000000
266   }; 
267   enum {
268     kNPlane = 6,
269     kNSlice = 3,
270     kEMCALNoMatch = -999999999
271   };
272 protected:
273   
274
275   ULong_t   fFlags;         // Reconstruction status flags 
276   Int_t     fLabel;         // Track label
277   Int_t     fID;            // Unique ID of the track
278   Float_t   fTrackLength;   // Track length
279   Float_t   fD;             // Impact parameter in XY plane
280   Float_t   fZ;             // Impact parameter in Z
281   Float_t   fCdd,fCdz,fCzz; // Covariance matrix of the impact parameters 
282   Float_t   fTrackTime[AliPID::kSPECIES]; // TOFs estimated by the tracking
283   Float_t   fR[AliPID::kSPECIES]; // combined "detector response probability"
284
285   Int_t   fStopVertex;  // Index of the stop vertex
286
287   AliExternalTrackParam *fCp; // Track parameters constrained to the primary vertex
288   Double32_t fCchi2; // chi2 at the primary vertex
289
290
291   AliExternalTrackParam *fIp; // Track parameters at the first measured point (TPC)
292
293
294   AliExternalTrackParam *fOp; // Track parameters at the last measured point (TPC or TRD) 
295
296   // ITS related track information
297   Float_t fITSchi2;        // chi2 in the ITS
298   Int_t   fITSncls;        // number of clusters assigned in the ITS
299   UChar_t fITSClusterMap;  // map of clusters, one bit per a layer 
300   Float_t fITSsignal;      // detector's PID signal
301   Float_t fITSr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
302   Int_t   fITSLabel;       // label according TPC
303
304   // TPC related track information
305   Float_t  fTPCchi2;       // chi2 in the TPC
306   Int_t    fTPCncls;       // number of clusters assigned in the TPC
307   UShort_t fTPCnclsF;      // number of findable clusters in the TPC
308   TBits    fTPCClusterMap; // Map of clusters, one bit per padrow; 1 if has a cluster on given padrow
309   Float_t  fTPCsignal;     // detector's PID signal
310   UShort_t fTPCsignalN;    // number of points used for dEdx
311   Float_t  fTPCsignalS;    // RMS of dEdx measurement
312   Float_t  fTPCr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
313   Int_t    fTPCLabel;      // label according TPC
314   Float_t  fTPCPoints[4];  // TPC points -first, max. dens, last and max density
315   Int_t    fKinkIndexes[3];// array of indexes of posible kink candidates 
316   Int_t    fV0Indexes[3];  // array of indexes of posible kink candidates 
317
318   // TRD related track information
319   Float_t fTRDchi2;        // chi2 in the TRD
320   Int_t   fTRDncls;        // number of clusters assigned in the TRD
321   Int_t   fTRDncls0;       // number of clusters assigned in the TRD before first material cross
322   Float_t fTRDsignal;      // detector's PID signal
323   Float_t fTRDsignals[kNPlane][kNSlice];  // TRD signals from all six planes in 3 slices each
324   Int_t   fTRDTimBin[kNPlane];   // Time bin of Max cluster from all six planes
325   Float_t fTRDr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
326   Int_t   fTRDLabel;       // label according TRD
327   Float_t fTRDQuality;     // trd quality factor for TOF
328   Float_t fTRDBudget;      // trd material budget
329
330
331   // TOF related track information
332   Float_t fTOFchi2;        // chi2 in the TOF
333   Int_t   fTOFindex;       // index of the assigned TOF cluster
334   Int_t   fTOFCalChannel;  // Channel Index of the TOF Signal 
335   Float_t fTOFsignal;      // detector's PID signal
336   Float_t fTOFsignalToT;   // detector's ToT signal
337   Float_t fTOFsignalRaw;   // detector's uncorrected time signal
338   Float_t fTOFsignalDz;    // local z  of track's impact on the TOF pad 
339   Float_t fTOFr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
340   Int_t   fTOFLabel[3];    // TOF label 
341   Float_t fTOFInfo[10];    //! TOF informations
342
343   // HMPID related track information                 (kir)
344   Float_t fHMPIDchi2;       // chi2 in the HMPID
345   Int_t   fHMPIDqn;         // 1000000*QDC + number of photon clusters
346   Int_t   fHMPIDcluIdx;     // 1000000*chamber id + cluster idx of the assigned MIP cluster
347   Float_t fHMPIDsignal;     // HMPID PID signal (Theta ckov, rad)
348   Float_t fHMPIDr[AliPID::kSPECIES];// "detector response probabilities" (for the PID)
349   Float_t fHMPIDtrkTheta;   // theta of the track extrapolated to the HMPID, LORS
350   Float_t fHMPIDtrkPhi;     // phi of the track extrapolated to the HMPID, LORS
351   Float_t fHMPIDtrkX;       // x of the track impact, LORS 
352   Float_t fHMPIDtrkY;       // y of the track impact, LORS 
353   Float_t fHMPIDmipX;       // x of the MIP in LORS
354   Float_t fHMPIDmipY;       // y of the MIP in LORS
355   
356   // EMCAL related track information
357   Int_t fEMCALindex;   // index of associated EMCAL cluster (AliESDCaloCluster)
358
359   AliESDfriendTrack *fFriendTrack; //! All the complementary information
360
361  private:
362
363   AliESDtrack & operator=(const AliESDtrack & ) {return *this;}
364
365   ClassDef(AliESDtrack,36)  //ESDtrack 
366 };
367
368 #endif 
369