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