]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliESDtrack.h
Removing the obsolete SetHMPIDcluster() and GetHMPIDcluster() functions (A. Mastroserio)
[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   Double_t M() const { return GetMass(); }
72   Double_t E() const;
73   Double_t Y() const;
74
75   Bool_t GetConstrainedPxPyPz(Double_t *p) const {
76     if (!fCp) return kFALSE;
77     return fCp->GetPxPyPz(p);
78   }
79   Bool_t GetConstrainedXYZ(Double_t *r) const {
80     if (!fCp) return kFALSE;
81     return fCp->GetXYZ(r);
82   }
83   const AliExternalTrackParam *GetConstrainedParam() const {return fCp;}
84   Bool_t GetConstrainedExternalParameters
85               (Double_t &alpha, Double_t &x, Double_t p[5]) const;
86   Bool_t GetConstrainedExternalCovariance(Double_t cov[15]) const;
87   Double_t GetConstrainedChi2() const {return fCchi2;}
88   //
89     
90
91
92   Bool_t GetInnerPxPyPz(Double_t *p) const {
93     if (!fIp) return kFALSE;
94     return fIp->GetPxPyPz(p);
95   }
96   const AliExternalTrackParam * GetInnerParam() const { return fIp;}
97   const AliExternalTrackParam * GetTPCInnerParam() const {return fTPCInner;}
98   Bool_t GetInnerXYZ(Double_t *r) const {
99     if (!fIp) return kFALSE;
100     return fIp->GetXYZ(r);
101   }
102   Bool_t GetInnerExternalParameters
103         (Double_t &alpha, Double_t &x, Double_t p[5]) const;
104   Bool_t GetInnerExternalCovariance(Double_t cov[15]) const;
105  
106   const AliExternalTrackParam * GetOuterParam() const { return fOp;}
107   Bool_t GetOuterPxPyPz(Double_t *p) const {
108     if (!fOp) return kFALSE;
109     return fOp->GetPxPyPz(p);
110   }
111   Bool_t GetOuterXYZ(Double_t *r) const {
112     if (!fOp) return kFALSE;
113     return fOp->GetXYZ(r);
114   }
115   Bool_t GetOuterExternalParameters
116         (Double_t &alpha, Double_t &x, Double_t p[5]) const;
117   Bool_t GetOuterExternalCovariance(Double_t cov[15]) const;
118
119
120   Int_t GetNcls(Int_t idet) const;
121   Int_t GetClusters(Int_t idet, Int_t *idx) const;
122  
123   void    SetITSpid(const Double_t *p);
124   void    GetITSpid(Double_t *p) const;
125   Float_t GetITSsignal() const {return fITSsignal;}
126   Float_t GetITSchi2() const {return fITSchi2;}
127   Int_t   GetITSclusters(Int_t *idx) const;
128   UChar_t GetITSClusterMap() const {return fITSClusterMap;}
129   Int_t   GetITSLabel() const {return fITSLabel;}
130   void    SetITStrack(AliKalmanTrack * track){
131      fFriendTrack->SetITStrack(track);
132   }
133   AliKalmanTrack *GetITStrack(){
134      return fFriendTrack->GetITStrack();
135   }
136
137   void    SetTPCpid(const Double_t *p);
138   void    GetTPCpid(Double_t *p) const;
139   void    SetTPCPoints(Float_t points[4]){
140      for (Int_t i=0;i<4;i++) fTPCPoints[i]=points[i];
141   }
142   void    SetTPCPointsF(UChar_t  findable){fTPCnclsF = findable;}
143   Int_t   GetTPCNcls() const { return fTPCncls;}
144   Int_t   GetTPCNclsF() const { return fTPCnclsF;}
145   Float_t GetTPCPoints(Int_t i) const {return fTPCPoints[i];}
146   void    SetKinkIndexes(Int_t points[3]) {
147      for (Int_t i=0;i<3;i++) fKinkIndexes[i] = points[i];
148   }
149   void    SetV0Indexes(Int_t points[3]) {
150      for (Int_t i=0;i<3;i++) fV0Indexes[i] = points[i];
151   }
152   void    SetTPCsignal(Float_t signal, Float_t sigma, UChar_t npoints){ 
153      fTPCsignal = signal; fTPCsignalS = sigma; fTPCsignalN = npoints;
154   }
155   Float_t GetTPCsignal() const {return fTPCsignal;}
156   Float_t GetTPCsignalSigma() const {return fTPCsignalS;}
157   UShort_t GetTPCsignalN() const {return fTPCsignalN;}
158   Float_t GetTPCchi2() const {return fTPCchi2;}
159   Int_t   GetTPCclusters(Int_t *idx) const;
160   Float_t GetTPCdensity(Int_t row0, Int_t row1) const;
161   Int_t   GetTPCLabel() const {return fTPCLabel;}
162   Int_t   GetKinkIndex(Int_t i) const { return fKinkIndexes[i];}
163   Int_t   GetV0Index(Int_t i) const { return fV0Indexes[i];}
164   const TBits& GetTPCClusterMap() const {return fTPCClusterMap;}
165   const TBits& GetTPCSharedMap() const {return fTPCSharedMap;}
166   void    SetTPCClusterMap(const TBits amap) {fTPCClusterMap = amap;}
167   void    SetTPCSharedMap(const TBits amap) {fTPCSharedMap = amap;}
168   void    SetTRDpid(const Double_t *p);
169   
170 // A.Bercuci
171   void    SetTRDpidQuality(UChar_t q){fTRDpidQuality = q;}
172   UChar_t GetTRDpidQuality() const {return fTRDpidQuality;}
173 // end A.Bercuci
174         
175         void    SetTRDQuality(Float_t quality){fTRDQuality=quality;}
176   Float_t GetTRDQuality()const {return fTRDQuality;}
177   void    SetTRDBudget(Float_t budget){fTRDBudget=budget;}
178   Float_t GetTRDBudget()const {return fTRDBudget;}
179   void    SetTRDsignals(Float_t dedx, Int_t i, Int_t j) {fTRDsignals[i][j]=dedx;}
180   void    SetTRDTimBin(Int_t timbin, Int_t i) {fTRDTimBin[i]=timbin;}
181   void    GetTRDpid(Double_t *p) const;
182   Float_t GetTRDsignal() const {return fTRDsignal;}
183   Float_t GetTRDsignals(Int_t iPlane, Int_t iSlice=-1) const { if (iSlice == -1) 
184     return (fTRDsignals[iPlane][0] + fTRDsignals[iPlane][1] + fTRDsignals[iPlane][2])/3.0;
185     return fTRDsignals[iPlane][iSlice];
186   }
187   Int_t   GetTRDTimBin(Int_t i) const {return fTRDTimBin[i];}
188   Float_t GetTRDchi2() const {return fTRDchi2;}
189   Int_t   GetTRDclusters(Int_t *idx) const;
190   Int_t   GetTRDncls() const {return fTRDncls;}
191   void    SetTRDpid(Int_t iSpecies, Float_t p);
192   Float_t GetTRDpid(Int_t iSpecies) const;
193   Int_t   GetTRDLabel() const {return fTRDLabel;}
194
195   void    SetTRDtrack(AliKalmanTrack * track){
196      fFriendTrack->SetTRDtrack(track);
197   }
198   AliKalmanTrack *GetTRDtrack(){
199      return fFriendTrack->GetTRDtrack();
200   }
201
202   void    SetTOFsignal(Double_t tof) {fTOFsignal=tof;}
203   Float_t GetTOFsignal() const {return fTOFsignal;}
204   void    SetTOFsignalToT(Double_t ToT) {fTOFsignalToT=ToT;}
205   Float_t GetTOFsignalToT() const {return fTOFsignalToT;}
206   void    SetTOFsignalRaw(Double_t tof) {fTOFsignalRaw=tof;}
207   Float_t GetTOFsignalRaw() const {return fTOFsignalRaw;}
208   void    SetTOFsignalDz(Double_t dz) {fTOFsignalDz=dz;}
209   Float_t GetTOFsignalDz() const {return fTOFsignalDz;}
210   Float_t GetTOFchi2() const {return fTOFchi2;}
211   void    SetTOFpid(const Double_t *p);
212   void    SetTOFLabel(const Int_t *p);
213   void    GetTOFpid(Double_t *p) const;
214   void    GetTOFLabel(Int_t *p) const;
215   void    GetTOFInfo(Float_t *info) const;
216   void    SetTOFInfo(Float_t *info);
217   Int_t   GetTOFCalChannel() const {return fTOFCalChannel;}
218   Int_t   GetTOFcluster() const {return fTOFindex;}
219   void    SetTOFcluster(Int_t index) {fTOFindex=index;}
220   void    SetTOFCalChannel(Int_t index) {fTOFCalChannel=index;}
221
222 // HMPID methodes +++++++++++++++++++++++++++++++++ (kir)
223   void    SetHMPIDsignal(Double_t theta) {fHMPIDsignal=theta;}
224   Float_t GetHMPIDsignal() const {return fHMPIDsignal;}
225   void    SetHMPIDpid(const Double_t *p);
226   void    GetHMPIDpid(Double_t *p) const;  
227   void    SetHMPIDchi2(Double_t chi2) {fHMPIDchi2=chi2;}
228   Float_t GetHMPIDchi2() const {return fHMPIDchi2;}
229   void    SetHMPIDcluIdx(Int_t ch,Int_t idx) {fHMPIDcluIdx=ch*1000000+idx;}
230   Int_t   GetHMPIDcluIdx() const {return fHMPIDcluIdx;}
231   void    SetHMPIDtrk(Float_t  x, Float_t  y, Float_t  th, Float_t  ph) {
232      fHMPIDtrkX=x; fHMPIDtrkY=y; fHMPIDtrkTheta=th; fHMPIDtrkPhi=ph;
233   }
234   void    GetHMPIDtrk(Float_t &x, Float_t &y, Float_t &th, Float_t &ph) const {
235      x=fHMPIDtrkX; y=fHMPIDtrkY; th=fHMPIDtrkTheta; ph=fHMPIDtrkPhi;
236   }
237   void    SetHMPIDmip(Float_t  x, Float_t  y, Int_t q, Int_t nph=0) {
238      fHMPIDmipX=x; fHMPIDmipY=y; fHMPIDqn=1000000*q+nph;
239   }
240   void    GetHMPIDmip(Float_t &x,Float_t &y,Int_t &q,Int_t &nph) const {
241      x=fHMPIDmipX; y=fHMPIDmipY; q=fHMPIDqn/1000000; nph=fHMPIDqn%1000000;
242   }
243   Bool_t  IsHMPID() const {return fFlags&kHMPIDpid;}
244
245
246   Int_t GetEMCALcluster() {return fEMCALindex;}
247   void SetEMCALcluster(Int_t index) {fEMCALindex=index;}
248   Bool_t IsEMCAL() const {return fFlags&kEMCALmatch;}
249
250   void SetTrackPointArray(AliTrackPointArray *points) {
251     fFriendTrack->SetTrackPointArray(points);
252   }
253   const AliTrackPointArray *GetTrackPointArray() const {
254     return fFriendTrack->GetTrackPointArray(); 
255   }
256   Bool_t RelateToVertex(const AliESDVertex *vtx, Double_t b, Double_t maxd);
257   void GetImpactParameters(Float_t &xy,Float_t &z) const {xy=fD; z=fZ;}
258   void GetImpactParameters(Float_t p[2], Float_t cov[3]) const {
259     p[0]=fD; p[1]=fZ; cov[0]=fCdd; cov[1]=fCdz; cov[2]=fCzz;
260   }
261   virtual void Print(Option_t * opt) const ; 
262
263   enum {
264     kITSin=0x0001,kITSout=0x0002,kITSrefit=0x0004,kITSpid=0x0008,
265     kTPCin=0x0010,kTPCout=0x0020,kTPCrefit=0x0040,kTPCpid=0x0080,
266     kTRDin=0x0100,kTRDout=0x0200,kTRDrefit=0x0400,kTRDpid=0x0800,
267     kTOFin=0x1000,kTOFout=0x2000,kTOFrefit=0x4000,kTOFpid=0x8000,
268     kHMPIDpid=0x20000,
269     kEMCALmatch=0x40000,
270     kTRDbackup=0x80000,
271     kTRDStop=0x20000000,
272     kESDpid=0x40000000,
273     kTIME=0x80000000
274   }; 
275   enum {
276     kNPlane = 6,
277     kNSlice = 3,
278     kEMCALNoMatch = -999999999
279   };
280 protected:
281   
282
283   ULong_t   fFlags;         // Reconstruction status flags 
284   Int_t     fLabel;         // Track label
285   Int_t     fID;            // Unique ID of the track
286   Float_t   fTrackLength;   // Track length
287   Float_t   fD;             // Impact parameter in XY plane
288   Float_t   fZ;             // Impact parameter in Z
289   Float_t   fCdd,fCdz,fCzz; // Covariance matrix of the impact parameters 
290   Float_t   fTrackTime[AliPID::kSPECIES]; // TOFs estimated by the tracking
291   Float_t   fR[AliPID::kSPECIES]; // combined "detector response probability"
292
293   Int_t   fStopVertex;  // Index of the stop vertex
294
295   AliExternalTrackParam *fCp; // Track parameters constrained to the primary vertex
296   Double32_t fCchi2; // chi2 at the primary vertex
297
298
299   AliExternalTrackParam *fIp; // Track parameters at the first measured point (TPC)
300   AliExternalTrackParam *fTPCInner; // Track parameters at the first measured point (TPC) - first itteration
301
302
303   AliExternalTrackParam *fOp; // Track parameters at the last measured point (TPC or TRD) 
304
305   // ITS related track information
306   Float_t fITSchi2;        // chi2 in the ITS
307   Int_t   fITSncls;        // number of clusters assigned in the ITS
308   UChar_t fITSClusterMap;  // map of clusters, one bit per a layer 
309   Float_t fITSsignal;      // detector's PID signal
310   Float_t fITSr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
311   Int_t   fITSLabel;       // label according TPC
312
313   // TPC related track information
314   Float_t  fTPCchi2;       // chi2 in the TPC
315   Int_t    fTPCncls;       // number of clusters assigned in the TPC
316   UShort_t fTPCnclsF;      // number of findable clusters in the TPC
317   TBits    fTPCClusterMap; // Map of clusters, one bit per padrow; 1 if has a cluster on given padrow
318   TBits    fTPCSharedMap;  // Map of clusters, one bit per padrow; 1 if has a shared cluster on given padrow
319   Float_t  fTPCsignal;     // detector's PID signal
320   UShort_t fTPCsignalN;    // number of points used for dEdx
321   Float_t  fTPCsignalS;    // RMS of dEdx measurement
322   Float_t  fTPCr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
323   Int_t    fTPCLabel;      // label according TPC
324   Float_t  fTPCPoints[4];  // TPC points -first, max. dens, last and max density
325   Int_t    fKinkIndexes[3];// array of indexes of posible kink candidates 
326   Int_t    fV0Indexes[3];  // array of indexes of posible kink candidates 
327
328   // TRD related track information
329   Float_t fTRDchi2;        // chi2 in the TRD
330   UChar_t fTRDncls;        // number of clusters assigned in the TRD
331   UChar_t fTRDncls0;       // number of clusters assigned in the TRD before first material cross
332   Float_t fTRDsignal;      // detector's PID signal
333   Float_t fTRDsignals[kNPlane][kNSlice];  // TRD signals from all six planes in 3 slices each
334   Int_t   fTRDTimBin[kNPlane];   // Time bin of Max cluster from all six planes
335   Float_t fTRDr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
336         // A.Bercuci
337         UChar_t fTRDpidQuality;   // TRD PID quality according to number of planes. 6 is the best
338   Int_t   fTRDLabel;       // label according TRD
339   Float_t fTRDQuality;     // trd quality factor for TOF
340   Float_t fTRDBudget;      // trd material budget
341
342
343   // TOF related track information
344   Float_t fTOFchi2;        // chi2 in the TOF
345   Int_t   fTOFindex;       // index of the assigned TOF cluster
346   Int_t   fTOFCalChannel;  // Channel Index of the TOF Signal 
347   Float_t fTOFsignal;      // detector's PID signal
348   Float_t fTOFsignalToT;   // detector's ToT signal
349   Float_t fTOFsignalRaw;   // detector's uncorrected time signal
350   Float_t fTOFsignalDz;    // local z  of track's impact on the TOF pad 
351   Float_t fTOFr[AliPID::kSPECIES]; // "detector response probabilities" (for the PID)
352   Int_t   fTOFLabel[3];    // TOF label 
353   Float_t fTOFInfo[10];    //! TOF informations
354
355   // HMPID related track information                 (kir)
356   Float_t fHMPIDchi2;       // chi2 in the HMPID
357   Int_t   fHMPIDqn;         // 1000000*QDC + number of photon clusters
358   Int_t   fHMPIDcluIdx;     // 1000000*chamber id + cluster idx of the assigned MIP cluster
359   Float_t fHMPIDsignal;     // HMPID PID signal (Theta ckov, rad)
360   Float_t fHMPIDr[AliPID::kSPECIES];// "detector response probabilities" (for the PID)
361   Float_t fHMPIDtrkTheta;   // theta of the track extrapolated to the HMPID, LORS
362   Float_t fHMPIDtrkPhi;     // phi of the track extrapolated to the HMPID, LORS
363   Float_t fHMPIDtrkX;       // x of the track impact, LORS 
364   Float_t fHMPIDtrkY;       // y of the track impact, LORS 
365   Float_t fHMPIDmipX;       // x of the MIP in LORS
366   Float_t fHMPIDmipY;       // y of the MIP in LORS
367   
368   // EMCAL related track information
369   Int_t fEMCALindex;   // index of associated EMCAL cluster (AliESDCaloCluster)
370
371   AliESDfriendTrack *fFriendTrack; //! All the complementary information
372
373  private:
374
375   AliESDtrack & operator=(const AliESDtrack & ) {return *this;}
376
377   ClassDef(AliESDtrack,39)  //ESDtrack 
378 };
379
380 #endif 
381