]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliESDtrack.h
Adding new code for kink and V0 reconstruction (AliESDkink and AliESDV0MI classes...
[u/mrichter/AliRoot.git] / STEER / AliESDtrack.h
1 #ifndef ALIESDTRACK_H
2 #define ALIESDTRACK_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 //-------------------------------------------------------------------------
9 //                          Class AliESDtrack
10 //   This is the class to deal with during the physics analysis of data
11 //      
12 //         Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch 
13 //-------------------------------------------------------------------------
14
15 #include <TBits.h>
16 #include <TObject.h>
17 class AliKalmanTrack;
18
19 class AliESDtrack : public TObject {
20 public:
21   AliESDtrack();
22   AliESDtrack(const AliESDtrack& track);
23   virtual ~AliESDtrack();
24   void SetID(Int_t id) { fID =id;}
25   Int_t GetID(){ return fID;}
26   void SetStatus(ULong_t flags) {fFlags|=flags;}
27   void ResetStatus(ULong_t flags) {fFlags&=~flags;}
28   Bool_t UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags);
29   void SetIntegratedLength(Double_t l) {fTrackLength=l;}
30   void SetIntegratedTimes(const Double_t *times);
31   void SetESDpid(const Double_t *p);
32   void GetESDpid(Double_t *p) const;
33   
34   ULong_t GetStatus() const {return fFlags;}
35   Int_t GetLabel() const {return fLabel;}
36   Double_t GetAlpha() const {return fRalpha;}
37   void GetExternalParameters(Double_t &x, Double_t p[5]) const;
38   Bool_t GetExternalParametersAt(Double_t x, Double_t p[5]) const;
39   void GetExternalCovariance(Double_t cov[15]) const;
40   Double_t GetIntegratedLength() const {return fTrackLength;}
41   void GetIntegratedTimes(Double_t *times) const;
42   Double_t GetMass() const;
43   Double_t GetP() const;
44   void GetPxPyPz(Double_t *p) const;
45   void GetXYZ(Double_t *r) const;
46   void GetCovariance(Double_t cov[21]) const;
47   Int_t GetSign() const {return (fRp[4]>0) ? 1 : -1;} 
48
49   void SetConstrainedTrackParams(const AliKalmanTrack *t, Double_t chi2);
50
51   Double_t GetConstrainedAlpha() const {return fCalpha;}
52   Double_t GetConstrainedChi2() const {return fCchi2;}
53   void GetConstrainedExternalParameters(Double_t &x, Double_t p[5]) const;
54   void GetConstrainedExternalCovariance(Double_t cov[15]) const;
55
56   void GetConstrainedPxPyPz(Double_t *p) const;
57   void GetConstrainedXYZ(Double_t *r) const;
58
59   void GetInnerPxPyPz(Double_t *p) const;
60   void GetInnerXYZ(Double_t *r) const;
61   void GetInnerExternalParameters(Double_t &x, Double_t p[5]) const;//skowron
62   void GetInnerExternalCovariance(Double_t cov[15]) const;//skowron
63   Double_t GetInnerAlpha() const {return fIalpha;}
64   
65   
66   void GetOuterPxPyPzPHOS(Double_t *p) const;
67   void GetOuterPxPyPzEMCAL(Double_t *p) const;
68   void GetOuterXYZPHOS(Double_t *r) const;
69   void GetOuterXYZEMCAL(Double_t *r) const;
70
71   void SetITSpid(const Double_t *p);
72   void SetITSChi2MIP(const Float_t *chi2mip);
73   void SetITStrack(AliKalmanTrack * track){fITStrack=track;}
74   void GetITSpid(Double_t *p) const;
75   Float_t GetITSsignal() const {return fITSsignal;}
76   Float_t GetITSchi2() const {return fITSchi2;}
77   Int_t GetITSclusters(UInt_t *idx) const;
78   Int_t GetITSLabel() const {return fITSLabel;}
79   Float_t GetITSFakeRatio() const {return fITSFakeRatio;}
80   AliKalmanTrack * GetITStrack(){return fITStrack;}
81
82   void SetTPCpid(const Double_t *p);
83   void GetTPCpid(Double_t *p) const;
84   void SetTPCPoints(Float_t points[4]){for (Int_t i=0;i<4;i++) fTPCPoints[i]=points[i];}
85   void SetKinkIndexes(Int_t points[3]) {for (Int_t i=0;i<3;i++) fKinkIndexes[i] = points[i];}
86   void SetV0Indexes(Int_t points[3]) {for (Int_t i=0;i<3;i++) fV0Indexes[i] = points[i];}
87   Float_t GetTPCsignal() const {return fTPCsignal;}
88   Float_t GetTPCchi2() const {return fTPCchi2;}
89   Int_t GetTPCclusters(Int_t *idx) const;
90   Int_t GetTPCLabel() const {return fTPCLabel;}
91   Int_t GetKinkIndex(Int_t i) const { return fKinkIndexes[i];}
92   Int_t GetV0Index(Int_t i) const { return fV0Indexes[i];}
93   const TBits& GetTPCClusterMap() const {return fTPCClusterMap;}
94   
95   void SetTRDpid(const Double_t *p);
96   void SetTRDtrack(AliKalmanTrack * track){fTRDtrack=track;}
97   void GetTRDpid(Double_t *p) const;
98   Float_t GetTRDsignal() const {return fTRDsignal;}
99   Float_t GetTRDchi2() const {return fTRDchi2;}
100   Int_t GetTRDclusters(UInt_t *idx) const;
101   Int_t GetTRDncls() const {return fTRDncls;}
102   void    SetTRDpid(Int_t iSpecies, Float_t p);
103   Float_t GetTRDpid(Int_t iSpecies) const;
104   Int_t GetTRDLabel() const {return fTRDLabel;}
105   void GetTRDExternalParameters(Double_t &x, Double_t &alpha, Double_t p[5], Double_t cov[15]) const;//MI
106   AliKalmanTrack * GetTRDtrack(){return fTRDtrack;}
107
108   void SetTOFsignal(Double_t tof) {fTOFsignal=tof;}
109   Float_t GetTOFsignal() const {return fTOFsignal;}
110   Float_t GetTOFchi2() const {return fTOFchi2;}
111   void    SetTOFpid(const Double_t *p);
112   void    SetTOFLabel(const Int_t *p);
113   void    GetTOFpid(Double_t *p) const;
114   void    GetTOFLabel(Int_t *p) const;
115   void    GetTOFInfo(Float_t *info) const;
116   void    SetTOFInfo(Float_t *info);
117   UInt_t  GetTOFcluster() const {return fTOFindex;}
118   void  SetTOFcluster(UInt_t index) {fTOFindex=index;}
119   
120   void    SetRICHsignal(Double_t beta) {fRICHsignal=beta;}
121   Float_t GetRICHsignal() const {return fRICHsignal;}
122   void    SetRICHpid(const Double_t *p);
123   void    GetRICHpid(Double_t *p) const;
124   
125   void SetPHOSposition(const Double_t *pos)  {
126     fPHOSpos[0] = pos[0]; fPHOSpos[1]=pos[1]; fPHOSpos[2]=pos[2];
127   }
128   void SetPHOSsignal(Double_t ene) {fPHOSsignal = ene; }
129   void SetPHOSpid(const Double_t *p);
130   void GetPHOSposition(Double_t *pos) const {
131     pos[0]=fPHOSpos[0]; pos[1]=fPHOSpos[1]; pos[2]=fPHOSpos[2];
132   }
133   Float_t GetPHOSsignal() const {return fPHOSsignal;}
134   void GetPHOSpid(Double_t *p) const;  
135
136   void SetEMCALposition(const Double_t *pos)  {
137     fEMCALpos[0] = pos[0]; fEMCALpos[1]=pos[1]; fEMCALpos[2]=pos[2];
138   }
139   void SetEMCALsignal(Double_t ene) {fEMCALsignal = ene; }
140   void SetEMCALpid(const Double_t *p);
141   void GetEMCALposition(Double_t *pos) const {
142     pos[0]=fEMCALpos[0]; pos[1]=fEMCALpos[1]; pos[2]=fEMCALpos[2];
143   }
144   Float_t GetEMCALsignal() const {return fEMCALsignal;}
145   void GetEMCALpid(Double_t *p) const;  
146
147   Bool_t IsOn(Int_t mask) const {return (fFlags&mask)>0;}
148   Bool_t IsRICH()  const {return fFlags&kRICHpid;}
149   Bool_t IsPHOS()  const {return fFlags&kPHOSpid;}
150   Bool_t IsEMCAL() const {return fFlags&kEMCALpid;}
151
152   virtual void Print(Option_t * opt) const ; 
153
154   enum {
155     kITSin=0x0001,kITSout=0x0002,kITSrefit=0x0004,kITSpid=0x0008,
156     kTPCin=0x0010,kTPCout=0x0020,kTPCrefit=0x0040,kTPCpid=0x0080,
157     kTRDin=0x0100,kTRDout=0x0200,kTRDrefit=0x0400,kTRDpid=0x0800,
158     kTOFin=0x1000,kTOFout=0x2000,kTOFrefit=0x4000,kTOFpid=0x8000,
159     kPHOSpid=0x10000, kRICHpid=0x20000, kEMCALpid=0x40000,
160     kTRDbackup=0x80000,
161     kTRDStop=0x20000000,
162     kESDpid=0x40000000,
163     kTIME=0x80000000
164   }; 
165   enum {
166     kSPECIES=5, // Number of particle species recognized by the PID
167     kSPECIESN=10, //  Number of charged+neutral particle species recognized by the PHOS/EMCAL PID
168     kElectron=0, kMuon=1, kPion=2, kKaon=3, kProton=4, kPhoton=5, 
169     kPi0=6, kNeutron=7, kKaon0=8, kEleCon=9 // PHOS/EMCAL definition
170   };
171 protected:
172   ULong_t   fFlags;        // Reconstruction status flags 
173   Int_t     fLabel;        // Track label
174   Int_t     fID;           // Unique ID of the track
175   Float_t   fTrackLength;         // Track length
176   Float_t   fTrackTime[kSPECIES]; // TOFs estimated by the tracking
177   Float_t   fR[kSPECIES];         // combined "detector response probability"
178
179   Int_t     fStopVertex;          // Index of stop vertex
180
181 //Running track parameters
182   Double_t fRalpha;  // track rotation angle
183   Double_t fRx;      // X-coordinate of the track reference plane 
184   Double_t fRp[5];   // external track parameters  
185   Double_t fRc[15];  // external cov. matrix of the track parameters
186
187 //Track parameters constrained to the primary vertex
188   Double_t fCalpha;   // Track rotation angle
189   Double_t fCx;       // x-coordinate of the track reference plane
190   Double_t fCp[5];    // external track parameters
191   Double_t fCc[15];   // external cov. matrix of the track parameters
192   Double_t fCchi2; //chi2 at the primary vertex
193
194 //Track parameters at the inner wall of the TPC
195   Double_t fIalpha;   // Track rotation angle
196   Double_t fIx;       // x-coordinate of the track reference plane
197   Double_t fIp[5];    // external track parameters
198   Double_t fIc[15];   // external cov. matrix of the track parameters
199 //Track parameters at the inner wall of the TRD 
200   Double_t fTalpha;   // Track rotation angle
201   Double_t fTx;       // x-coordinate of the track reference plane
202   Double_t fTp[5];    // external track parameters
203   Double_t fTc[15];   // external cov. matrix of the track parameters
204
205 //Track parameters at the radius of the PHOS
206   Double_t fOalpha;   //! Track rotation angle
207   Double_t fOx;       //! x-coordinate of the track reference plane
208   Double_t fOp[5];    //! external track parameters
209   Double_t fOc[15];   //! external cov. matrix of the track parameters
210
211 //Track parameters at the radius of the EMCAL
212   Double_t fXalpha;   //! Track rotation angle
213   Double_t fXx;       //! x-coordinate of the track reference plane
214   Double_t fXp[5];    //! external track parameters
215   Double_t fXc[15];   //! external cov. matrix of the track parameters
216
217   // ITS related track information
218   Float_t fITSchi2;        // chi2 in the ITS
219   Float_t fITSchi2MIP[12];     // chi2s in the ITS
220   Int_t   fITSncls;        // number of clusters assigned in the ITS
221   UInt_t  fITSindex[6];    //! indices of the assigned ITS clusters
222   Float_t fITSsignal;      // detector's PID signal
223   Float_t fITSr[kSPECIES]; // "detector response probabilities" (for the PID)
224   Int_t   fITSLabel;       // label according TPC
225   Float_t fITSFakeRatio;   // ration of fake tracks
226   AliKalmanTrack * fITStrack; //! OWNER: pointer to the ITS track -- currently for debug purpose
227   
228   // TPC related track information
229   Float_t fTPCchi2;        // chi2 in the TPC
230   Int_t   fTPCncls;        // number of clusters assigned in the TPC
231   Int_t  fTPCindex[180];  //! indices of the assigned TPC clusters
232   TBits   fTPCClusterMap;  // Map of clusters, one bit per padrow; 1 if has a cluster on given padrow
233   Float_t fTPCsignal;      // detector's PID signal
234   Float_t fTPCr[kSPECIES]; // "detector response probabilities" (for the PID)
235   Int_t   fTPCLabel;       // label according TPC
236   Float_t fTPCPoints[4];   // TPC points -first, max. dens, last and max density
237   Int_t   fKinkIndexes[3]; // array of indexes of posible kink candidates 
238   Int_t   fV0Indexes[3]; // array of indexes of posible kink candidates 
239   // TRD related track information
240   Float_t fTRDchi2;        // chi2 in the TRD
241   Int_t   fTRDncls;        // number of clusters assigned in the TRD
242   Int_t   fTRDncls0;       // number of clusters assigned in the TRD before first material cross
243   UInt_t  fTRDindex[130];   //! indices of the assigned TRD clusters
244   Float_t fTRDsignal;      // detector's PID signal
245   Float_t fTRDr[kSPECIES]; // "detector response probabilities" (for the PID)
246   Int_t   fTRDLabel;       // label according TRD
247   AliKalmanTrack * fTRDtrack; //! OWNER: pointer to the TRD track -- currently for debug purpose
248   // TOF related track information
249   Float_t fTOFchi2;        // chi2 in the TOF
250   UInt_t  fTOFindex;       // index of the assigned TOF cluster
251   Float_t fTOFsignal;      // detector's PID signal
252   Float_t fTOFr[kSPECIES]; // "detector response probabilities" (for the PID)
253   Int_t   fTOFLabel[3];       // TOF label 
254   Float_t fTOFInfo[10];       //! TOF informations
255   // PHOS related track information 
256   Float_t fPHOSpos[3]; // position localised by PHOS in global coordinate system
257   Float_t fPHOSsignal; // energy measured by PHOS
258   Float_t fPHOSr[kSPECIESN]; // PID information from PHOS
259
260   // EMCAL related track information 
261   Float_t fEMCALpos[3]; //position localised by EMCAL in global coordinate system
262   Float_t fEMCALsignal; // energy measured by EMCAL
263   Float_t fEMCALr[kSPECIESN]; // PID information from EMCAL
264
265   // HMPID related track information
266   Float_t fRICHsignal;     // detector's PID signal (beta for RICH)
267   Float_t fRICHr[kSPECIES];// "detector response probabilities" (for the PID)
268         
269   ClassDef(AliESDtrack,9)  //ESDtrack 
270 };
271
272 #endif 
273