]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AOD/AliAODTrack.h
Fix in inline methods declarations
[u/mrichter/AliRoot.git] / STEER / AOD / AliAODTrack.h
1 #ifndef AliAODTrack_H
2 #define AliAODTrack_H
3 /* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7
8 //-------------------------------------------------------------------------
9 //     AOD track implementation of AliVTrack
10 //     Author: Markus Oldenburg, CERN
11 //-------------------------------------------------------------------------
12
13 #include <TRef.h>
14 #include <TBits.h>
15
16 #include "AliVTrack.h"
17 #include "AliAODVertex.h"
18 #include "AliAODRedCov.h"
19 #include "AliAODPid.h"
20  
21
22 class AliVVertex;
23 class AliDetectorPID;
24 class AliTPCdEdxInfo;
25 class AliAODEvent;
26
27 class AliAODTrack : public AliVTrack {
28
29  public:
30   
31   enum AODTrk_t {kUndef = -1, 
32                  kPrimary, 
33                  kSecondary, 
34                  kOrphan};
35
36   enum AODTrkBits_t {
37     kIsDCA=BIT(14),   // set if fPosition is the DCA and not the position of the first point
38     kUsedForVtxFit=BIT(15), // set if this track was used to fit the vertex it is attached to
39     kUsedForPrimVtxFit=BIT(16), // set if this track was used to fit the primary vertex
40     kIsTPCConstrained=BIT(17), // set if this track is a SA TPC track constrained to the SPD vertex, needs to be skipped in any track loop to avoid double counting
41     kIsHybridTPCCG=BIT(18), // set if this track can be used as a hybrid track i.e. Gbobal tracks with certain slecetion plus the TPC constrained tracks that did not pass the selection
42     kIsGlobalConstrained=BIT(19), // set if this track is a global track constrained to the vertex, needs to be skipped in any track loop to avoid double counting
43     kIsHybridGCG=BIT(20)// set if this track can be used as a hybrid track i.e. tracks with certain slecetion plus the global constraint tracks that did not pass the selection
44   };
45
46
47   enum AODTrkFilterBits_t {
48     kTrkTPCOnly            = BIT(0), // Standard TPC only tracks
49     kTrkITSsa              = BIT(1), // ITS standalone
50     kTrkITSConstrained     = BIT(2), // Pixel OR necessary for the electrons
51     kTrkElectronsPID       = BIT(3),    // PID for the electrons
52     kTrkGlobalNoDCA        = BIT(4), // standard cuts with very loose DCA
53     kTrkGlobal             = BIT(5),  // standard cuts with tight DCA cut
54     kTrkGlobalSDD          = BIT(6), // standard cuts with tight DCA but with requiring the first SDD cluster instead of an SPD cluster tracks selected by this cut are exclusive to those selected by the previous cut
55     kTrkTPCOnlyConstrained = BIT(7) // TPC only tracks: TPConly information constrained to SPD vertex in the filter below
56   };
57   
58
59   enum AODTrkPID_t {
60     kElectron     =  0,
61     kMuon         =  1,
62     kPion         =  2,
63     kKaon         =  3,
64     kProton       =  4,
65     kDeuteron     =  5,
66     kTriton       =  6,
67     kHelium3      =  7,
68     kAlpha        =  8,
69     kUnknown      =  9,
70     kMostProbable = -1
71   };
72
73   AliAODTrack();
74   AliAODTrack(Short_t id,
75               Int_t label,
76               Double_t p[3],
77               Bool_t cartesian,
78               Double_t x[3],
79               Bool_t dca,
80               Double_t covMatrix[21],
81               Short_t q,
82               UChar_t itsClusMap,
83               Double_t pid[10],
84               AliAODVertex *prodVertex,
85               Bool_t usedForVtxFit,
86               Bool_t usedForPrimVtxFit,
87               AODTrk_t ttype=kUndef,
88               UInt_t selectInfo=0,
89               Float_t chi2perNDF = -999.);
90
91   AliAODTrack(Short_t id,
92               Int_t label,
93               Float_t p[3],
94               Bool_t cartesian,
95               Float_t x[3],
96               Bool_t dca,
97               Float_t covMatrix[21],
98               Short_t q,
99               UChar_t itsClusMap,
100               Float_t pid[10],
101               AliAODVertex *prodVertex,
102               Bool_t usedForVtxFit,
103               Bool_t usedForPrimVtxFit,
104               AODTrk_t ttype=kUndef,
105               UInt_t selectInfo=0,
106               Float_t chi2perNDF = -999.);
107
108   virtual ~AliAODTrack();
109   AliAODTrack(const AliAODTrack& trk); 
110   AliAODTrack& operator=(const AliAODTrack& trk);
111
112   // kinematics
113   virtual Double_t OneOverPt() const { return (fMomentum[0] != 0.) ? 1./fMomentum[0] : -999.; }
114   virtual Double_t Phi()       const { return fMomentum[1]; }
115   virtual Double_t Theta()     const { return fMomentum[2]; }
116   
117   virtual Double_t Px() const { return fMomentum[0] * TMath::Cos(fMomentum[1]); }
118   virtual Double_t Py() const { return fMomentum[0] * TMath::Sin(fMomentum[1]); }
119   virtual Double_t Pz() const { return fMomentum[0] / TMath::Tan(fMomentum[2]); }
120   virtual Double_t Pt() const { return fMomentum[0]; }
121   virtual Double_t P()  const { return TMath::Sqrt(Pt()*Pt()+Pz()*Pz()); }
122   virtual Bool_t   PxPyPz(Double_t p[3]) const { p[0] = Px(); p[1] = Py(); p[2] = Pz(); return kTRUE; }
123
124   virtual Double_t Xv() const { return GetProdVertex() ? GetProdVertex()->GetX() : -999.; }
125   virtual Double_t Yv() const { return GetProdVertex() ? GetProdVertex()->GetY() : -999.; }
126   virtual Double_t Zv() const { return GetProdVertex() ? GetProdVertex()->GetZ() : -999.; }
127   virtual Bool_t   XvYvZv(Double_t x[3]) const { x[0] = Xv(); x[1] = Yv(); x[2] = Zv(); return kTRUE; }
128
129   Double_t Chi2perNDF()  const { return fChi2perNDF; }
130   UShort_t GetTPCNcls()  const { 
131     UShort_t cl = fTPCFitMap.CountBits();
132     if(cl==0)cl = fTPCClusterMap.CountBits();// backward compatibility
133     return cl;
134   }
135   
136   virtual Double_t M() const { return M(GetMostProbablePID()); }
137   Double_t M(AODTrkPID_t pid) const;
138   virtual Double_t E() const { return E(GetMostProbablePID()); }
139   Double_t E(AODTrkPID_t pid) const;
140   Double_t E(Double_t m) const { return TMath::Sqrt(P()*P() + m*m); }
141   virtual Double_t Y() const { return Y(GetMostProbablePID()); }
142   Double_t Y(AODTrkPID_t pid) const;
143   Double_t Y(Double_t m) const;
144   
145   virtual Double_t Eta() const { return -TMath::Log(TMath::Tan(0.5 * fMomentum[2])); }
146
147   virtual Short_t  Charge() const {return fCharge; }
148
149   virtual Bool_t   PropagateToDCA(const AliVVertex *vtx, 
150           Double_t b, Double_t maxd, Double_t dz[2], Double_t covar[3]);
151
152   // PID
153   virtual const Double_t *PID() const { return fPID; }
154   AODTrkPID_t GetMostProbablePID() const;
155   void ConvertAliPIDtoAODPID();
156   void SetDetPID(AliAODPid *aodpid) {fDetPid = aodpid;}
157
158   template <typename T> void GetPID(T *pid) const {
159     for(Int_t i=0; i<10; ++i) pid[i]=fPID[i];}
160  
161   template <typename T> void SetPID(const T *pid) {
162     if(pid) for(Int_t i=0; i<10; ++i) fPID[i]=pid[i];
163     else {for(Int_t i=0; i<10; fPID[i++]=0.) ; fPID[AliAODTrack::kUnknown]=1.;}}
164
165   Bool_t IsOn(Int_t mask) const {return (fFlags&mask)>0;}
166   ULong_t GetStatus() const { return GetFlags(); }
167   ULong_t GetFlags() const { return fFlags; }
168
169   Int_t   GetID() const { return (Int_t)fID; }
170   Int_t   GetLabel() const { return fLabel; } 
171   Char_t  GetType() const { return fType;}
172   Bool_t  IsPrimaryCandidate() const;
173   Bool_t  GetUsedForVtxFit() const { return TestBit(kUsedForVtxFit); }
174   Bool_t  GetUsedForPrimVtxFit() const { return TestBit(kUsedForPrimVtxFit); }
175
176   Bool_t  IsHybridGlobalConstrainedGlobal() const { return TestBit(kIsHybridGCG); }
177   Bool_t  IsHybridTPCConstrainedGlobal() const { return TestBit(kIsHybridTPCCG); }
178   Bool_t  IsTPCOnly() const { return IsTPCConstrained(); } // obsolete bad naming
179   Bool_t  IsTPCConstrained() const { return TestBit(kIsTPCConstrained); }
180   Bool_t  IsGlobalConstrained() const { return TestBit(kIsGlobalConstrained); }
181   //
182   Int_t   GetTOFBunchCrossing(Double_t b=0, Bool_t tpcPIDonly=kFALSE) const;
183   //
184   template <typename T> void GetP(T *p) const {
185     p[0]=fMomentum[0]; p[1]=fMomentum[1]; p[2]=fMomentum[2];}
186
187 //  template <typename T> void GetPxPyPz(T *p) const {
188 //    p[0] = Px(); p[1] = Py(); p[2] = Pz();}
189   Bool_t GetPxPyPz(Double_t *p) const;
190
191   template <typename T> Bool_t GetPosition(T *x) const {
192     x[0]=fPosition[0]; x[1]=fPosition[1]; x[2]=fPosition[2];
193     return TestBit(kIsDCA);}
194
195   template <typename T> void SetCovMatrix(const T *covMatrix) {
196     if(!fCovMatrix) fCovMatrix=new AliAODRedCov<6>();
197     fCovMatrix->SetCovMatrix(covMatrix);}
198
199   template <typename T> Bool_t GetCovMatrix(T *covMatrix) const {
200     if(!fCovMatrix) return kFALSE;
201     fCovMatrix->GetCovMatrix(covMatrix); return kTRUE;}
202
203   Bool_t GetXYZ(Double_t *p) const {
204     return GetPosition(p); }
205   
206   Bool_t GetXYZAt(Double_t x, Double_t b, Double_t *r) const;
207   
208   Bool_t GetCovarianceXYZPxPyPz(Double_t cv[21]) const {
209     return GetCovMatrix(cv);}
210
211   void RemoveCovMatrix() {delete fCovMatrix; fCovMatrix=NULL;}
212
213   Double_t XAtDCA() const { return fPositionAtDCA[0]; }
214   Double_t YAtDCA() const { return fPositionAtDCA[1]; }
215   Double_t ZAtDCA() const {
216     if (IsMuonTrack()) return fPosition[2];
217     else if (TestBit(kIsDCA)) return fPosition[1];
218     else return -999.; }
219   Bool_t   XYZAtDCA(Double_t x[3]) const { x[0] = XAtDCA(); x[1] = YAtDCA(); x[2] = ZAtDCA(); return kTRUE; }
220   
221   Double_t DCA() const {
222     if (IsMuonTrack()) return TMath::Sqrt(XAtDCA()*XAtDCA() + YAtDCA()*YAtDCA());
223     else if (TestBit(kIsDCA)) return fPosition[0];
224     else return -999.; }
225   
226   Double_t PxAtDCA() const { return fMomentumAtDCA[0]; }
227   Double_t PyAtDCA() const { return fMomentumAtDCA[1]; }
228   Double_t PzAtDCA() const { return fMomentumAtDCA[2]; }
229   Double_t PAtDCA() const { return TMath::Sqrt(PxAtDCA()*PxAtDCA() + PyAtDCA()*PyAtDCA() + PzAtDCA()*PzAtDCA()); }
230   Bool_t   PxPyPzAtDCA(Double_t p[3]) const { p[0] = PxAtDCA(); p[1] = PyAtDCA(); p[2] = PzAtDCA(); return kTRUE; }
231   
232   Double_t GetRAtAbsorberEnd() const { return fRAtAbsorberEnd; }
233   
234   UChar_t  GetITSClusterMap() const       { return (UChar_t)(fITSMuonClusterMap&0xff); }
235   Int_t    GetITSNcls() const; 
236   Bool_t   HasPointOnITSLayer(Int_t i) const { return TESTBIT(GetITSClusterMap(),i); }
237   UShort_t GetHitsPatternInTrigCh() const { return (UShort_t)((fITSMuonClusterMap&0xff00)>>8); }
238   UInt_t   GetMUONClusterMap() const      { return (fITSMuonClusterMap&0x3ff0000)>>16; }
239   UInt_t   GetITSMUONClusterMap() const   { return fITSMuonClusterMap; }
240   
241   Bool_t  TestFilterBit(UInt_t filterBit) const {return (Bool_t) ((filterBit & fFilterMap) != 0);}
242   Bool_t  TestFilterMask(UInt_t filterMask) const {return (Bool_t) ((filterMask & fFilterMap) == filterMask);}
243   void    SetFilterMap(UInt_t i){fFilterMap = i;}
244   UInt_t  GetFilterMap() const {return fFilterMap;}
245
246   const TBits& GetTPCClusterMap() const {return fTPCClusterMap;}
247   const TBits* GetTPCClusterMapPtr() const {return &fTPCClusterMap;}
248   const TBits& GetTPCFitMap() const {return fTPCFitMap;}
249   Float_t GetTPCClusterInfo(Int_t nNeighbours=3, Int_t type=0, Int_t row0=0, Int_t row1=159, Int_t /*type*/=0) const;
250   
251   const TBits& GetTPCSharedMap() const {return fTPCSharedMap;}
252   void    SetTPCClusterMap(const TBits amap) {fTPCClusterMap = amap;}
253   void    SetTPCSharedMap(const TBits amap) {fTPCSharedMap = amap;}
254   void    SetTPCFitMap(const TBits amap) {fTPCFitMap = amap;}
255   void    SetTPCPointsF(UShort_t  findable){fTPCnclsF = findable;}
256   void    SetTPCNCrossedRows(UInt_t n)     {fTPCNCrossedRows = n;}
257
258   UShort_t GetTPCNclsF() const { return fTPCnclsF;}
259   UShort_t GetTPCNCrossedRows()  const { return fTPCNCrossedRows;}
260   Float_t  GetTPCFoundFraction() const { return fTPCNCrossedRows>0 ? float(GetTPCNcls())/fTPCNCrossedRows : 0;}
261
262   // Calorimeter Cluster
263   Int_t GetEMCALcluster() const {return fCaloIndex;}
264   void SetEMCALcluster(Int_t index) {fCaloIndex=index;}
265   Bool_t IsEMCAL() const {return fFlags&kEMCALmatch;}
266
267   Double_t GetTrackPhiOnEMCal() const {return fTrackPhiOnEMCal;}
268   Double_t GetTrackEtaOnEMCal() const {return fTrackEtaOnEMCal;}
269   void SetTrackPhiEtaOnEMCal(Double_t phi,Double_t eta) {fTrackPhiOnEMCal=phi;fTrackEtaOnEMCal=eta;}
270
271   Int_t GetPHOScluster() const {return fCaloIndex;}
272   void SetPHOScluster(Int_t index) {fCaloIndex=index;}
273   Bool_t IsPHOS() const {return fFlags&kPHOSmatch;}
274
275   //pid signal interface
276   Double_t  GetITSsignal()       const { return fDetPid?fDetPid->GetITSsignal():0.;    }
277   Double_t  GetTPCsignal()       const { return fDetPid?fDetPid->GetTPCsignal():0.;    }
278   Double_t  GetTPCsignalTunedOnData() const { return fTPCsignalTuned;}
279   void      SetTPCsignalTunedOnData(Double_t signal) {fTPCsignalTuned = signal;}
280   UShort_t  GetTPCsignalN()      const { return fDetPid?fDetPid->GetTPCsignalN():0;    }
281   virtual AliTPCdEdxInfo* GetTPCdEdxInfo() const {return fDetPid?fDetPid->GetTPCdEdxInfo():0;}
282   Double_t  GetTPCmomentum()     const { return fDetPid?fDetPid->GetTPCmomentum():0.;  }
283   Double_t  GetTOFsignal()       const { return fDetPid?fDetPid->GetTOFsignal():0.;    }
284   Double_t  GetHMPIDsignal()     const { return 0.;  } // TODO: To be implemented properly with the new HMPID object
285   
286   void      GetIntegratedTimes(Double_t *times) const {if (fDetPid) fDetPid->GetIntegratedTimes(times); }
287   Double_t  GetTRDslice(Int_t plane, Int_t slice) const;
288   Double_t  GetTRDmomentum(Int_t plane, Double_t */*sp*/=0x0) const;
289   Double_t  GetTRDchi2()                 const {return fDetPid ? fDetPid->GetTRDChi2() : -1;}
290   UChar_t   GetTRDncls(Int_t layer = -1) const;
291   UChar_t   GetTRDntrackletsPID() const;
292   Int_t     GetNumberOfTRDslices() const { return fDetPid?fDetPid->GetTRDnSlices():0; }
293   void      GetHMPIDpid(Double_t */*p*/) const { return; } // TODO: To be implemented properly with the new HMPID object
294
295   const AliAODEvent* GetAODEvent() const {return fAODEvent;}
296   void SetAODEvent(const AliAODEvent* ptr){fAODEvent = ptr;}
297
298   AliAODPid    *GetDetPid() const { return fDetPid; }
299   AliAODVertex *GetProdVertex() const { return (AliAODVertex*)fProdVertex.GetObject(); }
300   
301   // print
302   void  Print(const Option_t *opt = "") const;
303
304   // setters
305   void SetFlags(ULong_t flags) { fFlags = flags; }
306   void SetStatus(ULong_t flags) { fFlags|=flags; }
307   void ResetStatus(ULong_t flags) { fFlags&=~flags; }
308
309   void SetID(Short_t id) { fID = id; }
310   void SetLabel(Int_t label) { fLabel = label; }
311
312   template <typename T> void SetPosition(const T *x, Bool_t isDCA = kFALSE);
313   void SetDCA(Double_t d, Double_t z);
314   void SetUsedForVtxFit(Bool_t used = kTRUE) { used ? SetBit(kUsedForVtxFit) : ResetBit(kUsedForVtxFit); }
315   void SetUsedForPrimVtxFit(Bool_t used = kTRUE) { used ? SetBit(kUsedForPrimVtxFit) : ResetBit(kUsedForPrimVtxFit); }
316
317   void SetIsTPCOnly(Bool_t b = kTRUE) { SetIsTPCConstrained(b); }// obsolete bad naming
318
319   void SetIsTPCConstrained(Bool_t b = kTRUE) { b ? SetBit(kIsTPCConstrained) : ResetBit(kIsTPCConstrained); }
320   void SetIsHybridTPCConstrainedGlobal(Bool_t hybrid = kTRUE) { hybrid ? SetBit(kIsHybridTPCCG) : ResetBit(kIsHybridTPCCG); }
321
322   void SetIsGlobalConstrained(Bool_t b = kTRUE) { b ? SetBit(kIsGlobalConstrained) : ResetBit(kIsGlobalConstrained); }
323   void SetIsHybridGlobalConstrainedGlobal(Bool_t hybrid = kTRUE) { hybrid ? SetBit(kIsHybridGCG) : ResetBit(kIsHybridGCG); }
324
325
326
327   void SetOneOverPt(Double_t oneOverPt) { fMomentum[0] = 1. / oneOverPt; }
328   void SetPt(Double_t pt) { fMomentum[0] = pt; };
329   void SetPhi(Double_t phi) { fMomentum[1] = phi; }
330   void SetTheta(Double_t theta) { fMomentum[2] = theta; }
331   template <typename T> void SetP(const T *p, Bool_t cartesian = kTRUE);
332   void SetP() {fMomentum[0]=fMomentum[1]=fMomentum[2]=-999.;}
333
334   void SetXYAtDCA(Double_t x, Double_t y) {fPositionAtDCA[0] = x; fPositionAtDCA[1] = y;}
335   void SetPxPyPzAtDCA(Double_t pX, Double_t pY, Double_t pZ) {fMomentumAtDCA[0] = pX; fMomentumAtDCA[1] = pY; fMomentumAtDCA[2] = pZ;}
336   
337   void SetRAtAbsorberEnd(Double_t r) { fRAtAbsorberEnd = r; }
338   
339   void SetCharge(Short_t q) { fCharge = q; }
340   void SetChi2perNDF(Double_t chi2perNDF) { fChi2perNDF = chi2perNDF; }
341
342   void SetITSClusterMap(UChar_t itsClusMap)                 { fITSMuonClusterMap = (fITSMuonClusterMap&0xffffff00)|(((UInt_t)itsClusMap)&0xff); }
343   void SetHitsPatternInTrigCh(UShort_t hitsPatternInTrigCh) { fITSMuonClusterMap = (fITSMuonClusterMap&0xffff00ff)|((((UInt_t)hitsPatternInTrigCh)&0xff)<<8); }
344   void SetMuonClusterMap(UInt_t muonClusMap)                { fITSMuonClusterMap = (fITSMuonClusterMap&0xfc00ffff)|((muonClusMap&0x3ff)<<16); }
345   void SetITSMuonClusterMap(UInt_t itsMuonClusMap)          { fITSMuonClusterMap = itsMuonClusMap; }
346   void SetMUONtrigHitsMapTrg(UInt_t muonTrigHitsMap) { fMUONtrigHitsMapTrg = muonTrigHitsMap; }
347   UInt_t GetMUONTrigHitsMapTrg() { return fMUONtrigHitsMapTrg; }
348   void SetMUONtrigHitsMapTrk(UInt_t muonTrigHitsMap) { fMUONtrigHitsMapTrk = muonTrigHitsMap; }
349   UInt_t GetMUONTrigHitsMapTrk() { return fMUONtrigHitsMapTrk; }
350
351   Int_t GetMatchTrigger() const {return fITSMuonClusterMap>>30;}
352                                         //  0 Muon track does not match trigger
353                                         //  1 Muon track match but does not pass pt cut
354                                         //  2 Muon track match Low pt cut
355                                         //  3 Muon track match High pt cut
356   void     SetMatchTrigger(Int_t MatchTrigger);
357   Bool_t   MatchTrigger() const { return (GetMatchTrigger()>0); }         //  Muon track matches trigger track
358   Bool_t   MatchTriggerLowPt()   const  { return (GetMatchTrigger()>1); } //  Muon track matches trigger track and passes Low pt cut
359   Bool_t   MatchTriggerHighPt()  const  { return (GetMatchTrigger()>2); } //  Muon track matches trigger track and passes High pt cut
360   Bool_t   MatchTriggerDigits()  const;                                   //  Muon track matches trigger digits
361   Double_t GetChi2MatchTrigger() const  { return fChi2MatchTrigger;}
362   void     SetChi2MatchTrigger(Double_t Chi2MatchTrigger) {fChi2MatchTrigger = Chi2MatchTrigger; }
363   Bool_t   HitsMuonChamber(Int_t MuonChamber, Int_t cathode = -1) const;  // Check if track hits Muon chambers
364   Bool_t   IsMuonTrack() const { return (GetMUONClusterMap()>0) ? kTRUE : kFALSE; }
365   
366   void     Connected(Bool_t flag) {flag ? SETBIT(fITSMuonClusterMap,26) : CLRBIT(fITSMuonClusterMap,26);}
367   Bool_t   IsConnected() const {return TESTBIT(fITSMuonClusterMap,26);}
368
369   void     SetProdVertex(TObject *vertex) { fProdVertex = vertex; }
370   void     SetType(AODTrk_t ttype) { fType=ttype; }
371
372   // Trasient PID object, is owned by the track
373   virtual void  SetDetectorPID(const AliDetectorPID *pid);
374   virtual const AliDetectorPID* GetDetectorPID() const { return fDetectorPID; }
375
376   // Dummy
377   Int_t    PdgCode() const {return 0;}
378   
379  private :
380
381   // Momentum & position
382   Double32_t    fMomentum[3];       // momemtum stored in pt, phi, theta
383   Double32_t    fPosition[3];       // position of first point on track or dca
384   
385   Double32_t    fMomentumAtDCA[3];  // momentum (px,py,pz) at DCA
386   Double32_t    fPositionAtDCA[2];  // trasverse position (x,y) at DCA
387   
388   Double32_t    fRAtAbsorberEnd;    // transverse position r at the end of the muon absorber
389   
390   Double32_t    fChi2perNDF;        // chi2/NDF of momentum fit
391   Double32_t    fChi2MatchTrigger;  // chi2 of trigger/track matching
392   Double32_t    fPID[10];           // [0.,1.,8] pointer to PID object
393
394   ULong_t       fFlags;             // reconstruction status flags 
395   Int_t         fLabel;             // track label, points back to MC track
396   
397   UInt_t        fITSMuonClusterMap; // map of ITS and muon clusters, one bit per layer
398                                     // (ITS: bit 1-8, muon trigger: bit 9-16, muon tracker: bit 17-26, muon match trigger: bit 31-32) 
399   UInt_t        fMUONtrigHitsMapTrg; // Muon trigger hits map from trigger
400   UInt_t        fMUONtrigHitsMapTrk; // Muon trigger hits map from tracker track extrapolation
401   UInt_t        fFilterMap;         // filter information, one bit per set of cuts
402
403   TBits         fTPCFitMap;      // Map of clusters, one bit per padrow; if has a cluster on given padrow which is used in the fit   
404   TBits         fTPCClusterMap;     // Map of clusters, one bit per padrow; 1 if has a cluster on given padrow
405   TBits         fTPCSharedMap;      // Map of clusters, one bit per padrow; 1 if has a shared cluster on given padrow
406
407   UShort_t      fTPCnclsF;          // findable clusters
408   UShort_t      fTPCNCrossedRows;   // n crossed rows
409
410   Short_t       fID;                // unique track ID, points back to the ESD track
411
412   Char_t        fCharge;            // particle charge
413   Char_t        fType;              // Track Type
414
415   Int_t         fCaloIndex;         // index of associated EMCAL/PHOS cluster (AliAODCaloCluster)
416
417   
418   AliAODRedCov<6> *fCovMatrix;      // covariance matrix (x, y, z, px, py, pz)
419   AliAODPid    *fDetPid;            // more detailed or detector specific raw pid information
420   mutable const AliDetectorPID* fDetectorPID; //! transient object to cache calibrated PID information
421   TRef          fProdVertex;        // vertex of origin
422
423   Double_t      fTrackPhiOnEMCal;   // phi of track after being propagated to 430cm
424   Double_t      fTrackEtaOnEMCal;   // eta of track after being propagated to 430cm
425
426   Double_t      fTPCsignalTuned;    //! TPC signal tuned on data when using MC
427
428   const AliAODEvent* fAODEvent;     //! 
429
430   ClassDef(AliAODTrack, 19);
431 };
432
433 inline Bool_t  AliAODTrack::IsPrimaryCandidate() const
434 {
435     // True of track passes primary particle selection (independent of type) 
436     // 
437     if (fFilterMap) {
438         return kTRUE;
439     } else {
440         return kFALSE;
441     }
442 }
443
444 inline Int_t AliAODTrack::GetITSNcls() const 
445 {
446   // Number of points in ITS
447   Int_t n=0;
448   for(Int_t i=0;i<6;i++) if(HasPointOnITSLayer(i)) n++;
449   return n;
450 }
451
452 //______________________________________________________________________________
453 template <typename T> 
454 void AliAODTrack::SetPosition(const T *x, const Bool_t dca) 
455 {
456   // set the position
457
458   if (x) {
459     if (!dca) {
460       ResetBit(kIsDCA);
461
462       fPosition[0] = x[0];
463       fPosition[1] = x[1];
464       fPosition[2] = x[2];
465     } else {
466       SetBit(kIsDCA);
467       // don't know any better yet
468       fPosition[0] = -999.;
469       fPosition[1] = -999.;
470       fPosition[2] = -999.;
471     }
472   } else {
473     ResetBit(kIsDCA);
474
475     fPosition[0] = -999.;
476     fPosition[1] = -999.;
477     fPosition[2] = -999.;
478   }
479 }
480
481 //template<> void AliAODTrack::SetPosition(const double *, Bool_t);
482
483 #endif