]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AOD/AliAODTrack.h
Merge remote-tracking branch 'origin/master' into TPCdev
[u/mrichter/AliRoot.git] / STEER / AOD / AliAODTrack.h
CommitLineData
df9db588 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//-------------------------------------------------------------------------
4f6e22bd 9// AOD track implementation of AliVTrack
df9db588 10// Author: Markus Oldenburg, CERN
11//-------------------------------------------------------------------------
12
13#include <TRef.h>
507ed024 14#include <TBits.h>
df9db588 15
4f6e22bd 16#include "AliVTrack.h"
df9db588 17#include "AliAODVertex.h"
5d62ce04 18#include "AliAODRedCov.h"
7be1db84 19#include "AliAODPid.h"
c8fe2783 20
df9db588 21
6dc40b1c 22class AliVVertex;
00a38d07 23class AliDetectorPID;
af48efa8 24class AliTPCdEdxInfo;
aab77ed0 25class AliAODEvent;
42fcc729 26class AliTOFHeader;
6dc40b1c 27
4f6e22bd 28class AliAODTrack : public AliVTrack {
df9db588 29
30 public:
31
1912763f 32 enum AODTrk_t {kUndef = -1,
33 kPrimary,
34 kSecondary,
35 kOrphan};
df9db588 36
37 enum AODTrkBits_t {
dc825b15 38 kIsDCA=BIT(14), // set if fPosition is the DCA and not the position of the first point
1912763f 39 kUsedForVtxFit=BIT(15), // set if this track was used to fit the vertex it is attached to
ed47dd92 40 kUsedForPrimVtxFit=BIT(16), // set if this track was used to fit the primary vertex
9e3e4265 41 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
42 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
43 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
44 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
df9db588 45 };
46
0e31a30a 47
48 enum AODTrkFilterBits_t {
ba54e4d4 49 kTrkTPCOnly = BIT(0), // Standard TPC only tracks
50 kTrkITSsa = BIT(1), // ITS standalone
51 kTrkITSConstrained = BIT(2), // Pixel OR necessary for the electrons
52 kTrkElectronsPID = BIT(3), // PID for the electrons
53 kTrkGlobalNoDCA = BIT(4), // standard cuts with very loose DCA
54 kTrkGlobal = BIT(5), // standard cuts with tight DCA cut
55 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
56 kTrkTPCOnlyConstrained = BIT(7) // TPC only tracks: TPConly information constrained to SPD vertex in the filter below
0e31a30a 57 };
58
59
4697e4fb 60 enum AODTrkPID_t {
1912763f 61 kElectron = 0,
62 kMuon = 1,
63 kPion = 2,
64 kKaon = 3,
65 kProton = 4,
4697e4fb 66 kDeuteron = 5,
67 kTriton = 6,
68 kHelium3 = 7,
69 kAlpha = 8,
70 kUnknown = 9,
71 kMostProbable = -1
72 };
df9db588 73
74 AliAODTrack();
02153d58 75 AliAODTrack(Short_t id,
df9db588 76 Int_t label,
77 Double_t p[3],
78 Bool_t cartesian,
79 Double_t x[3],
80 Bool_t dca,
81 Double_t covMatrix[21],
82 Short_t q,
83 UChar_t itsClusMap,
df9db588 84 AliAODVertex *prodVertex,
1912763f 85 Bool_t usedForVtxFit,
dc825b15 86 Bool_t usedForPrimVtxFit,
ec40c484 87 AODTrk_t ttype=kUndef,
862ce351 88 UInt_t selectInfo=0,
89 Float_t chi2perNDF = -999.);
df9db588 90
76b98553 91
02153d58 92 AliAODTrack(Short_t id,
df9db588 93 Int_t label,
94 Float_t p[3],
95 Bool_t cartesian,
96 Float_t x[3],
97 Bool_t dca,
98 Float_t covMatrix[21],
99 Short_t q,
100 UChar_t itsClusMap,
df9db588 101 AliAODVertex *prodVertex,
1912763f 102 Bool_t usedForVtxFit,
dc825b15 103 Bool_t usedForPrimVtxFit,
ec40c484 104 AODTrk_t ttype=kUndef,
862ce351 105 UInt_t selectInfo=0,
106 Float_t chi2perNDF = -999.);
df9db588 107
108 virtual ~AliAODTrack();
109 AliAODTrack(const AliAODTrack& trk);
110 AliAODTrack& operator=(const AliAODTrack& trk);
111
112 // kinematics
16b65f2a 113 virtual Double_t OneOverPt() const { return (fMomentum[0] != 0.) ? 1./fMomentum[0] : -999.; }
df9db588 114 virtual Double_t Phi() const { return fMomentum[1]; }
115 virtual Double_t Theta() const { return fMomentum[2]; }
116
16b65f2a 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]; }
df9db588 121 virtual Double_t P() const { return TMath::Sqrt(Pt()*Pt()+Pz()*Pz()); }
c683ddc2 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
c4460410 129 Double_t Chi2perNDF() const { return fChi2perNDF; }
a2c30af1 130
131 UShort_t GetTPCnclsS(Int_t i0=0,Int_t i1=159) const {
132 UShort_t cl = fTPCSharedMap.CountBits(i0)-fTPCSharedMap.CountBits(i1);
0914b519 133 return cl;
134 }
4697e4fb 135
a2c30af1 136 UShort_t GetTPCncls(Int_t i0=0,Int_t i1=159) const {
137 UShort_t cl = fTPCFitMap.CountBits(i0)-fTPCFitMap.CountBits(i1);
138 if(cl==0)cl = fTPCClusterMap.CountBits(i0)-fTPCClusterMap.CountBits(i1);// backward compatibility
139 return cl;
140 }
141
142 UShort_t GetTPCNcls() const { return GetTPCncls(); }
143
4697e4fb 144 virtual Double_t M() const { return M(GetMostProbablePID()); }
145 Double_t M(AODTrkPID_t pid) const;
146 virtual Double_t E() const { return E(GetMostProbablePID()); }
147 Double_t E(AODTrkPID_t pid) const;
148 Double_t E(Double_t m) const { return TMath::Sqrt(P()*P() + m*m); }
149 virtual Double_t Y() const { return Y(GetMostProbablePID()); }
150 Double_t Y(AODTrkPID_t pid) const;
151 Double_t Y(Double_t m) const;
df9db588 152
153 virtual Double_t Eta() const { return -TMath::Log(TMath::Tan(0.5 * fMomentum[2])); }
df9db588 154
155 virtual Short_t Charge() const {return fCharge; }
156
6dc40b1c 157 virtual Bool_t PropagateToDCA(const AliVVertex *vtx,
158 Double_t b, Double_t maxd, Double_t dz[2], Double_t covar[3]);
159
df9db588 160 // PID
161 virtual const Double_t *PID() const { return fPID; }
4697e4fb 162 AODTrkPID_t GetMostProbablePID() const;
163 void ConvertAliPIDtoAODPID();
e68fa179 164 void SetDetPID(AliAODPid *aodpid) {fDetPid = aodpid;}
df9db588 165
76b98553 166 void SetPIDForTracking(Int_t pid) {fPIDForTracking = pid;}
167 Int_t GetPIDForTracking() const {return fPIDForTracking;}
168 Double_t GetMassForTracking() const;
169
cdd730d0 170 template <typename T> void GetPID(T *pid) const {
76b98553 171 for(Int_t i=0; i<10; ++i) pid[i] = fPID ? fPID[i]:0;}
df9db588 172
cdd730d0 173 template <typename T> void SetPID(const T *pid) {
76b98553 174 if (pid) {
175 if (!fPID) fPID = new Double32_t[10];
176 for(Int_t i=0; i<10; ++i) fPID[i]=pid[i];
177 }
178 else {delete[] fPID; fPID = 0;}
179 }
180
6efb741f 181 Bool_t IsOn(Int_t mask) const {return (fFlags&mask)>0;}
182 ULong_t GetStatus() const { return GetFlags(); }
183 ULong_t GetFlags() const { return fFlags; }
184
4f6e22bd 185 Int_t GetID() const { return (Int_t)fID; }
02153d58 186 Int_t GetLabel() const { return fLabel; }
a2c30af1 187 void GetTOFLabel(Int_t *p) const;
188
189
02153d58 190 Char_t GetType() const { return fType;}
862ce351 191 Bool_t IsPrimaryCandidate() const;
02153d58 192 Bool_t GetUsedForVtxFit() const { return TestBit(kUsedForVtxFit); }
193 Bool_t GetUsedForPrimVtxFit() const { return TestBit(kUsedForPrimVtxFit); }
9e3e4265 194
195 Bool_t IsHybridGlobalConstrainedGlobal() const { return TestBit(kIsHybridGCG); }
196 Bool_t IsHybridTPCConstrainedGlobal() const { return TestBit(kIsHybridTPCCG); }
197 Bool_t IsTPCOnly() const { return IsTPCConstrained(); } // obsolete bad naming
198 Bool_t IsTPCConstrained() const { return TestBit(kIsTPCConstrained); }
199 Bool_t IsGlobalConstrained() const { return TestBit(kIsGlobalConstrained); }
76e6ee6a 200 //
1cecd6e3 201 Int_t GetTOFBunchCrossing(Double_t b=0, Bool_t tpcPIDonly=kFALSE) const;
76e6ee6a 202 //
cdd730d0 203 template <typename T> void GetP(T *p) const {
df9db588 204 p[0]=fMomentum[0]; p[1]=fMomentum[1]; p[2]=fMomentum[2];}
205
cdd730d0 206// template <typename T> void GetPxPyPz(T *p) const {
c8fe2783 207// p[0] = Px(); p[1] = Py(); p[2] = Pz();}
208 Bool_t GetPxPyPz(Double_t *p) const;
df9db588 209
cdd730d0 210 template <typename T> Bool_t GetPosition(T *x) const {
df9db588 211 x[0]=fPosition[0]; x[1]=fPosition[1]; x[2]=fPosition[2];
212 return TestBit(kIsDCA);}
213
cdd730d0 214 template <typename T> void SetCovMatrix(const T *covMatrix) {
5d62ce04 215 if(!fCovMatrix) fCovMatrix=new AliAODRedCov<6>();
df9db588 216 fCovMatrix->SetCovMatrix(covMatrix);}
217
cdd730d0 218 template <typename T> Bool_t GetCovMatrix(T *covMatrix) const {
df9db588 219 if(!fCovMatrix) return kFALSE;
220 fCovMatrix->GetCovMatrix(covMatrix); return kTRUE;}
221
892be05f 222 Bool_t GetXYZ(Double_t *p) const {
223 return GetPosition(p); }
086400fc 224
225 Bool_t GetXYZAt(Double_t x, Double_t b, Double_t *r) const;
c8253dd9 226 Bool_t GetXYZatR(Double_t xr,Double_t bz, Double_t *xyz=0, Double_t* alpSect=0) const;
227
4f6e22bd 228 Bool_t GetCovarianceXYZPxPyPz(Double_t cv[21]) const {
229 return GetCovMatrix(cv);}
230
df9db588 231 void RemoveCovMatrix() {delete fCovMatrix; fCovMatrix=NULL;}
232
6c954176 233 Double_t XAtDCA() const { return fPositionAtDCA[0]; }
234 Double_t YAtDCA() const { return fPositionAtDCA[1]; }
235 Double_t ZAtDCA() const {
236 if (IsMuonTrack()) return fPosition[2];
237 else if (TestBit(kIsDCA)) return fPosition[1];
238 else return -999.; }
239 Bool_t XYZAtDCA(Double_t x[3]) const { x[0] = XAtDCA(); x[1] = YAtDCA(); x[2] = ZAtDCA(); return kTRUE; }
240
241 Double_t DCA() const {
242 if (IsMuonTrack()) return TMath::Sqrt(XAtDCA()*XAtDCA() + YAtDCA()*YAtDCA());
243 else if (TestBit(kIsDCA)) return fPosition[0];
244 else return -999.; }
245
246 Double_t PxAtDCA() const { return fMomentumAtDCA[0]; }
247 Double_t PyAtDCA() const { return fMomentumAtDCA[1]; }
248 Double_t PzAtDCA() const { return fMomentumAtDCA[2]; }
249 Double_t PAtDCA() const { return TMath::Sqrt(PxAtDCA()*PxAtDCA() + PyAtDCA()*PyAtDCA() + PzAtDCA()*PzAtDCA()); }
250 Bool_t PxPyPzAtDCA(Double_t p[3]) const { p[0] = PxAtDCA(); p[1] = PyAtDCA(); p[2] = PzAtDCA(); return kTRUE; }
251
f43586f0 252 Double_t GetRAtAbsorberEnd() const { return fRAtAbsorberEnd; }
253
6c954176 254 UChar_t GetITSClusterMap() const { return (UChar_t)(fITSMuonClusterMap&0xff); }
6dc40b1c 255 Int_t GetITSNcls() const;
256 Bool_t HasPointOnITSLayer(Int_t i) const { return TESTBIT(GetITSClusterMap(),i); }
6c954176 257 UShort_t GetHitsPatternInTrigCh() const { return (UShort_t)((fITSMuonClusterMap&0xff00)>>8); }
258 UInt_t GetMUONClusterMap() const { return (fITSMuonClusterMap&0x3ff0000)>>16; }
259 UInt_t GetITSMUONClusterMap() const { return fITSMuonClusterMap; }
260
8a1418dc 261 Bool_t TestFilterBit(UInt_t filterBit) const {return (Bool_t) ((filterBit & fFilterMap) != 0);}
6db112a4 262 Bool_t TestFilterMask(UInt_t filterMask) const {return (Bool_t) ((filterMask & fFilterMap) == filterMask);}
e4b91233 263 void SetFilterMap(UInt_t i){fFilterMap = i;}
681b1d8b 264 UInt_t GetFilterMap() const {return fFilterMap;}
df9db588 265
507ed024 266 const TBits& GetTPCClusterMap() const {return fTPCClusterMap;}
086400fc 267 const TBits* GetTPCClusterMapPtr() const {return &fTPCClusterMap;}
bcabd0e4 268 const TBits& GetTPCFitMap() const {return fTPCFitMap;}
74ca66e3 269 const TBits* GetTPCFitMapPtr() const {return &fTPCFitMap;}
25f906db 270 Float_t GetTPCClusterInfo(Int_t nNeighbours=3, Int_t type=0, Int_t row0=0, Int_t row1=159, Int_t /*type*/=0) const;
9006fe9c 271
507ed024 272 const TBits& GetTPCSharedMap() const {return fTPCSharedMap;}
74ca66e3 273 const TBits* GetTPCSharedMapPtr() const {return &fTPCSharedMap;}
507ed024 274 void SetTPCClusterMap(const TBits amap) {fTPCClusterMap = amap;}
275 void SetTPCSharedMap(const TBits amap) {fTPCSharedMap = amap;}
bcabd0e4 276 void SetTPCFitMap(const TBits amap) {fTPCFitMap = amap;}
3c01c166 277 void SetTPCPointsF(UShort_t findable){fTPCnclsF = findable;}
820214a7 278 void SetTPCNCrossedRows(UInt_t n) {fTPCNCrossedRows = n;}
3c01c166 279
280 UShort_t GetTPCNclsF() const { return fTPCnclsF;}
820214a7 281 UShort_t GetTPCNCrossedRows() const { return fTPCNCrossedRows;}
282 Float_t GetTPCFoundFraction() const { return fTPCNCrossedRows>0 ? float(GetTPCNcls())/fTPCNCrossedRows : 0;}
3c01c166 283
a7d9ab9e 284 // Calorimeter Cluster
285 Int_t GetEMCALcluster() const {return fCaloIndex;}
286 void SetEMCALcluster(Int_t index) {fCaloIndex=index;}
287 Bool_t IsEMCAL() const {return fFlags&kEMCALmatch;}
288
ed15417e 289 Double_t GetTrackPhiOnEMCal() const {return fTrackPhiOnEMCal;}
290 Double_t GetTrackEtaOnEMCal() const {return fTrackEtaOnEMCal;}
a29b2a8a 291 Double_t GetTrackPtOnEMCal() const {return fTrackPtOnEMCal;}
37cf883a 292 Double_t GetTrackPOnEMCal() const {return TMath::Abs(fTrackEtaOnEMCal) < 1 ? fTrackPtOnEMCal*TMath::CosH(fTrackEtaOnEMCal) : -999;}
a29b2a8a 293 void SetTrackPhiEtaPtOnEMCal(Double_t phi,Double_t eta,Double_t pt) {fTrackPhiOnEMCal=phi;fTrackEtaOnEMCal=eta;fTrackPtOnEMCal=pt;}
ed15417e 294
a7d9ab9e 295 Int_t GetPHOScluster() const {return fCaloIndex;}
296 void SetPHOScluster(Int_t index) {fCaloIndex=index;}
297 Bool_t IsPHOS() const {return fFlags&kPHOSmatch;}
298
9006fe9c 299 //pid signal interface
300 Double_t GetITSsignal() const { return fDetPid?fDetPid->GetITSsignal():0.; }
74ca66e3 301 void GetITSdEdxSamples(Double_t s[4]) const;
9006fe9c 302 Double_t GetTPCsignal() const { return fDetPid?fDetPid->GetTPCsignal():0.; }
539a5a59 303 Double_t GetTPCsignalTunedOnData() const { return fTPCsignalTuned;}
304 void SetTPCsignalTunedOnData(Double_t signal) {fTPCsignalTuned = signal;}
9006fe9c 305 UShort_t GetTPCsignalN() const { return fDetPid?fDetPid->GetTPCsignalN():0; }
de26d2c7 306 virtual AliTPCdEdxInfo* GetTPCdEdxInfo() const {return fDetPid?fDetPid->GetTPCdEdxInfo():0;}
9006fe9c 307 Double_t GetTPCmomentum() const { return fDetPid?fDetPid->GetTPCmomentum():0.; }
ef7661fd 308 Double_t GetTPCTgl() const { return fDetPid?fDetPid->GetTPCTgl():0.; }
5839d3e1 309 Double_t GetTOFsignal() const { return fDetPid?fDetPid->GetTOFsignal():0.; }
9b5c8b95 310 Double_t GetIntegratedLength() const { return fTrackLength;}
311 void SetIntegratedLength(Double_t l) {fTrackLength = l;}
a2c30af1 312 Double_t GetTOFsignalTunedOnData() const { return fTOFsignalTuned;}
313 void SetTOFsignalTunedOnData(Double_t signal) {fTOFsignalTuned = signal;}
567624b5 314 Double_t GetHMPIDsignal() const;
315 Double_t GetHMPIDoccupancy() const;
316
317 Int_t GetHMPIDcluIdx() const;
318
319 void GetHMPIDtrk(Float_t &x, Float_t &y, Float_t &th, Float_t &ph) const;
320 void GetHMPIDmip(Float_t &x,Float_t &y,Int_t &q,Int_t &nph) const;
321
322 Bool_t GetOuterHmpPxPyPz(Double_t *p) const;
5839d3e1 323
ea235c90 324 void GetIntegratedTimes(Double_t *times) const {if (fDetPid) fDetPid->GetIntegratedTimes(times); }
fd21ec8d 325 Double_t GetTRDslice(Int_t plane, Int_t slice) const;
6736efd5 326 Double_t GetTRDsignal() const {return fDetPid ? fDetPid->GetTRDsignal() : 0;}
ea235c90 327 Double_t GetTRDmomentum(Int_t plane, Double_t */*sp*/=0x0) const;
643d59bf 328 Double_t GetTRDchi2() const {return fDetPid ? fDetPid->GetTRDChi2() : -1;}
74ca66e3 329 UChar_t GetTRDncls(Int_t layer) const;
330 UChar_t GetTRDncls() const {return GetTRDncls(-1);}
99e9d5ec 331 UChar_t GetTRDntrackletsPID() const;
73b4da68 332 Int_t GetNumberOfTRDslices() const { return fDetPid?fDetPid->GetTRDnSlices():0; }
c997f0f9 333 void GetHMPIDpid(Double_t */*p*/) const { return; } // TODO: To be implemented properly with the new HMPID object
fd21ec8d 334
539a5a59 335 const AliAODEvent* GetAODEvent() const {return fAODEvent;}
aab77ed0 336 void SetAODEvent(const AliAODEvent* ptr){fAODEvent = ptr;}
42fcc729 337 const AliTOFHeader* GetTOFHeader() const;
aab77ed0 338
7be1db84 339 AliAODPid *GetDetPid() const { return fDetPid; }
df9db588 340 AliAODVertex *GetProdVertex() const { return (AliAODVertex*)fProdVertex.GetObject(); }
341
342 // print
343 void Print(const Option_t *opt = "") const;
344
345 // setters
6efb741f 346 void SetFlags(ULong_t flags) { fFlags = flags; }
347 void SetStatus(ULong_t flags) { fFlags|=flags; }
348 void ResetStatus(ULong_t flags) { fFlags&=~flags; }
349
02153d58 350 void SetID(Short_t id) { fID = id; }
6efb741f 351 void SetLabel(Int_t label) { fLabel = label; }
a2c30af1 352 void SetTOFLabel(const Int_t* p);
cdd730d0 353 template <typename T> void SetPosition(const T *x, Bool_t isDCA = kFALSE);
df9db588 354 void SetDCA(Double_t d, Double_t z);
1912763f 355 void SetUsedForVtxFit(Bool_t used = kTRUE) { used ? SetBit(kUsedForVtxFit) : ResetBit(kUsedForVtxFit); }
dc825b15 356 void SetUsedForPrimVtxFit(Bool_t used = kTRUE) { used ? SetBit(kUsedForPrimVtxFit) : ResetBit(kUsedForPrimVtxFit); }
9e3e4265 357
358 void SetIsTPCOnly(Bool_t b = kTRUE) { SetIsTPCConstrained(b); }// obsolete bad naming
041743e4 359
9e3e4265 360 void SetIsTPCConstrained(Bool_t b = kTRUE) { b ? SetBit(kIsTPCConstrained) : ResetBit(kIsTPCConstrained); }
041743e4 361 void SetIsHybridTPCConstrainedGlobal(Bool_t hybrid = kTRUE) { hybrid ? SetBit(kIsHybridTPCCG) : ResetBit(kIsHybridTPCCG); }
362
9e3e4265 363 void SetIsGlobalConstrained(Bool_t b = kTRUE) { b ? SetBit(kIsGlobalConstrained) : ResetBit(kIsGlobalConstrained); }
364 void SetIsHybridGlobalConstrainedGlobal(Bool_t hybrid = kTRUE) { hybrid ? SetBit(kIsHybridGCG) : ResetBit(kIsHybridGCG); }
365
366
df9db588 367
f4ad422f 368 void SetOneOverPt(Double_t oneOverPt) { fMomentum[0] = 1. / oneOverPt; }
16b65f2a 369 void SetPt(Double_t pt) { fMomentum[0] = pt; };
14b34be5 370 void SetPhi(Double_t phi) { fMomentum[1] = phi; }
371 void SetTheta(Double_t theta) { fMomentum[2] = theta; }
cdd730d0 372 template <typename T> void SetP(const T *p, Bool_t cartesian = kTRUE);
df9db588 373 void SetP() {fMomentum[0]=fMomentum[1]=fMomentum[2]=-999.;}
374
6c954176 375 void SetXYAtDCA(Double_t x, Double_t y) {fPositionAtDCA[0] = x; fPositionAtDCA[1] = y;}
376 void SetPxPyPzAtDCA(Double_t pX, Double_t pY, Double_t pZ) {fMomentumAtDCA[0] = pX; fMomentumAtDCA[1] = pY; fMomentumAtDCA[2] = pZ;}
377
f43586f0 378 void SetRAtAbsorberEnd(Double_t r) { fRAtAbsorberEnd = r; }
379
14b34be5 380 void SetCharge(Short_t q) { fCharge = q; }
1912763f 381 void SetChi2perNDF(Double_t chi2perNDF) { fChi2perNDF = chi2perNDF; }
df9db588 382
6c954176 383 void SetITSClusterMap(UChar_t itsClusMap) { fITSMuonClusterMap = (fITSMuonClusterMap&0xffffff00)|(((UInt_t)itsClusMap)&0xff); }
384 void SetHitsPatternInTrigCh(UShort_t hitsPatternInTrigCh) { fITSMuonClusterMap = (fITSMuonClusterMap&0xffff00ff)|((((UInt_t)hitsPatternInTrigCh)&0xff)<<8); }
385 void SetMuonClusterMap(UInt_t muonClusMap) { fITSMuonClusterMap = (fITSMuonClusterMap&0xfc00ffff)|((muonClusMap&0x3ff)<<16); }
386 void SetITSMuonClusterMap(UInt_t itsMuonClusMap) { fITSMuonClusterMap = itsMuonClusMap; }
0a2dcc83 387 void SetMUONtrigHitsMapTrg(UInt_t muonTrigHitsMap) { fMUONtrigHitsMapTrg = muonTrigHitsMap; }
388 UInt_t GetMUONTrigHitsMapTrg() { return fMUONtrigHitsMapTrg; }
389 void SetMUONtrigHitsMapTrk(UInt_t muonTrigHitsMap) { fMUONtrigHitsMapTrk = muonTrigHitsMap; }
390 UInt_t GetMUONTrigHitsMapTrk() { return fMUONtrigHitsMapTrk; }
df9db588 391
8a1418dc 392 Int_t GetMatchTrigger() const {return fITSMuonClusterMap>>30;}
e1c744ca 393 // 0 Muon track does not match trigger
394 // 1 Muon track match but does not pass pt cut
395 // 2 Muon track match Low pt cut
396 // 3 Muon track match High pt cut
397 void SetMatchTrigger(Int_t MatchTrigger);
2200238e 398 Bool_t MatchTrigger() const { return (GetMatchTrigger()>0); } // Muon track matches trigger track
399 Bool_t MatchTriggerLowPt() const { return (GetMatchTrigger()>1); } // Muon track matches trigger track and passes Low pt cut
400 Bool_t MatchTriggerHighPt() const { return (GetMatchTrigger()>2); } // Muon track matches trigger track and passes High pt cut
401 Bool_t MatchTriggerDigits() const; // Muon track matches trigger digits
8a1418dc 402 Double_t GetChi2MatchTrigger() const { return fChi2MatchTrigger;}
6c954176 403 void SetChi2MatchTrigger(Double_t Chi2MatchTrigger) {fChi2MatchTrigger = Chi2MatchTrigger; }
2200238e 404 Bool_t HitsMuonChamber(Int_t MuonChamber, Int_t cathode = -1) const; // Check if track hits Muon chambers
6c954176 405 Bool_t IsMuonTrack() const { return (GetMUONClusterMap()>0) ? kTRUE : kFALSE; }
5c15a68b 406
407 void Connected(Bool_t flag) {flag ? SETBIT(fITSMuonClusterMap,26) : CLRBIT(fITSMuonClusterMap,26);}
408 Bool_t IsConnected() const {return TESTBIT(fITSMuonClusterMap,26);}
e1c744ca 409
c683ddc2 410 void SetProdVertex(TObject *vertex) { fProdVertex = vertex; }
411 void SetType(AODTrk_t ttype) { fType=ttype; }
412
00a38d07 413 // Trasient PID object, is owned by the track
414 virtual void SetDetectorPID(const AliDetectorPID *pid);
415 virtual const AliDetectorPID* GetDetectorPID() const { return fDetectorPID; }
6dc40b1c 416
6a8e543a 417 // Dummy
418 Int_t PdgCode() const {return 0;}
419
df9db588 420 private :
421
422 // Momentum & position
1912763f 423 Double32_t fMomentum[3]; // momemtum stored in pt, phi, theta
424 Double32_t fPosition[3]; // position of first point on track or dca
6c954176 425
426 Double32_t fMomentumAtDCA[3]; // momentum (px,py,pz) at DCA
427 Double32_t fPositionAtDCA[2]; // trasverse position (x,y) at DCA
428
f43586f0 429 Double32_t fRAtAbsorberEnd; // transverse position r at the end of the muon absorber
430
862ce351 431 Double32_t fChi2perNDF; // chi2/NDF of momentum fit
9333290e 432 Double32_t fChi2MatchTrigger; // chi2 of trigger/track matching
76b98553 433 Double32_t* fPID; //! [0.,1.,8] pointer to PID object
df9db588 434
6efb741f 435 ULong_t fFlags; // reconstruction status flags
1912763f 436 Int_t fLabel; // track label, points back to MC track
9b5c8b95 437 Int_t fTOFLabel[3]; // TOF label
438 Double32_t fTrackLength; // Track length
6c954176 439 UInt_t fITSMuonClusterMap; // map of ITS and muon clusters, one bit per layer
440 // (ITS: bit 1-8, muon trigger: bit 9-16, muon tracker: bit 17-26, muon match trigger: bit 31-32)
0a2dcc83 441 UInt_t fMUONtrigHitsMapTrg; // Muon trigger hits map from trigger
442 UInt_t fMUONtrigHitsMapTrk; // Muon trigger hits map from tracker track extrapolation
9333290e 443 UInt_t fFilterMap; // filter information, one bit per set of cuts
df9db588 444
bcabd0e4 445 TBits fTPCFitMap; // Map of clusters, one bit per padrow; if has a cluster on given padrow which is used in the fit
507ed024 446 TBits fTPCClusterMap; // Map of clusters, one bit per padrow; 1 if has a cluster on given padrow
447 TBits fTPCSharedMap; // Map of clusters, one bit per padrow; 1 if has a shared cluster on given padrow
bcabd0e4 448
3c01c166 449 UShort_t fTPCnclsF; // findable clusters
820214a7 450 UShort_t fTPCNCrossedRows; // n crossed rows
507ed024 451
02153d58 452 Short_t fID; // unique track ID, points back to the ESD track
453
1912763f 454 Char_t fCharge; // particle charge
1912763f 455 Char_t fType; // Track Type
a7d9ab9e 456
76b98553 457 Char_t fPIDForTracking; // pid using for tracking of ESD track
458
a7d9ab9e 459 Int_t fCaloIndex; // index of associated EMCAL/PHOS cluster (AliAODCaloCluster)
460
507ed024 461
9333290e 462 AliAODRedCov<6> *fCovMatrix; // covariance matrix (x, y, z, px, py, pz)
00a38d07 463 AliAODPid *fDetPid; // more detailed or detector specific raw pid information
464 mutable const AliDetectorPID* fDetectorPID; //! transient object to cache calibrated PID information
9333290e 465 TRef fProdVertex; // vertex of origin
df9db588 466
a29b2a8a 467 Double_t fTrackPhiOnEMCal; // phi of track after being propagated to the EMCal surface (default r = 440 cm)
468 Double_t fTrackEtaOnEMCal; // eta of track after being propagated to the EMCal surface (default r = 440 cm)
469 Double_t fTrackPtOnEMCal; // pt of track after being propagated to the EMCal surface (default r = 440 cm)
ed15417e 470
539a5a59 471 Double_t fTPCsignalTuned; //! TPC signal tuned on data when using MC
a2c30af1 472 Double_t fTOFsignalTuned; //! TOF signal tuned on data when using MC
539a5a59 473
aab77ed0 474 const AliAODEvent* fAODEvent; //!
475
76b98553 476 ClassDef(AliAODTrack, 23);
df9db588 477};
478
862ce351 479inline Bool_t AliAODTrack::IsPrimaryCandidate() const
480{
481 // True of track passes primary particle selection (independent of type)
482 //
483 if (fFilterMap) {
484 return kTRUE;
485 } else {
486 return kFALSE;
487 }
488}
489
6dc40b1c 490inline Int_t AliAODTrack::GetITSNcls() const
491{
492 // Number of points in ITS
493 Int_t n=0;
494 for(Int_t i=0;i<6;i++) if(HasPointOnITSLayer(i)) n++;
495 return n;
496}
497
6e78367a 498//______________________________________________________________________________
499template <typename T>
500void AliAODTrack::SetPosition(const T *x, const Bool_t dca)
501{
502 // set the position
503
504 if (x) {
505 if (!dca) {
506 ResetBit(kIsDCA);
507
508 fPosition[0] = x[0];
509 fPosition[1] = x[1];
510 fPosition[2] = x[2];
511 } else {
512 SetBit(kIsDCA);
513 // don't know any better yet
514 fPosition[0] = -999.;
515 fPosition[1] = -999.;
516 fPosition[2] = -999.;
517 }
518 } else {
519 ResetBit(kIsDCA);
520
521 fPosition[0] = -999.;
522 fPosition[1] = -999.;
523 fPosition[2] = -999.;
524 }
525}
526
527//template<> void AliAODTrack::SetPosition(const double *, Bool_t);
fe7d86eb 528
df9db588 529#endif