* add tuned on data functionality for TOF (non-gaussian tails)
[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;
6dc40b1c 26
4f6e22bd 27class AliAODTrack : public AliVTrack {
df9db588 28
29 public:
30
1912763f 31 enum AODTrk_t {kUndef = -1,
32 kPrimary,
33 kSecondary,
34 kOrphan};
df9db588 35
36 enum AODTrkBits_t {
dc825b15 37 kIsDCA=BIT(14), // set if fPosition is the DCA and not the position of the first point
1912763f 38 kUsedForVtxFit=BIT(15), // set if this track was used to fit the vertex it is attached to
ed47dd92 39 kUsedForPrimVtxFit=BIT(16), // set if this track was used to fit the primary vertex
9e3e4265 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
df9db588 44 };
45
0e31a30a 46
47 enum AODTrkFilterBits_t {
ba54e4d4 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
0e31a30a 56 };
57
58
4697e4fb 59 enum AODTrkPID_t {
1912763f 60 kElectron = 0,
61 kMuon = 1,
62 kPion = 2,
63 kKaon = 3,
64 kProton = 4,
4697e4fb 65 kDeuteron = 5,
66 kTriton = 6,
67 kHelium3 = 7,
68 kAlpha = 8,
69 kUnknown = 9,
70 kMostProbable = -1
71 };
df9db588 72
73 AliAODTrack();
02153d58 74 AliAODTrack(Short_t id,
df9db588 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,
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
02153d58 91 AliAODTrack(Short_t id,
df9db588 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,
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
cdd730d0 166 template <typename T> void GetPID(T *pid) const {
df9db588 167 for(Int_t i=0; i<10; ++i) pid[i]=fPID[i];}
168
cdd730d0 169 template <typename T> void SetPID(const T *pid) {
df9db588 170 if(pid) for(Int_t i=0; i<10; ++i) fPID[i]=pid[i];
720fe7d7 171 else { for(Int_t i=0; i<10; i++) fPID[i]=0.; fPID[AliAODTrack::kUnknown]=1.;}}
df9db588 172
6efb741f 173 Bool_t IsOn(Int_t mask) const {return (fFlags&mask)>0;}
174 ULong_t GetStatus() const { return GetFlags(); }
175 ULong_t GetFlags() const { return fFlags; }
176
4f6e22bd 177 Int_t GetID() const { return (Int_t)fID; }
02153d58 178 Int_t GetLabel() const { return fLabel; }
a2c30af1 179 void GetTOFLabel(Int_t *p) const;
180
181
02153d58 182 Char_t GetType() const { return fType;}
862ce351 183 Bool_t IsPrimaryCandidate() const;
02153d58 184 Bool_t GetUsedForVtxFit() const { return TestBit(kUsedForVtxFit); }
185 Bool_t GetUsedForPrimVtxFit() const { return TestBit(kUsedForPrimVtxFit); }
9e3e4265 186
187 Bool_t IsHybridGlobalConstrainedGlobal() const { return TestBit(kIsHybridGCG); }
188 Bool_t IsHybridTPCConstrainedGlobal() const { return TestBit(kIsHybridTPCCG); }
189 Bool_t IsTPCOnly() const { return IsTPCConstrained(); } // obsolete bad naming
190 Bool_t IsTPCConstrained() const { return TestBit(kIsTPCConstrained); }
191 Bool_t IsGlobalConstrained() const { return TestBit(kIsGlobalConstrained); }
76e6ee6a 192 //
1cecd6e3 193 Int_t GetTOFBunchCrossing(Double_t b=0, Bool_t tpcPIDonly=kFALSE) const;
76e6ee6a 194 //
cdd730d0 195 template <typename T> void GetP(T *p) const {
df9db588 196 p[0]=fMomentum[0]; p[1]=fMomentum[1]; p[2]=fMomentum[2];}
197
cdd730d0 198// template <typename T> void GetPxPyPz(T *p) const {
c8fe2783 199// p[0] = Px(); p[1] = Py(); p[2] = Pz();}
200 Bool_t GetPxPyPz(Double_t *p) const;
df9db588 201
cdd730d0 202 template <typename T> Bool_t GetPosition(T *x) const {
df9db588 203 x[0]=fPosition[0]; x[1]=fPosition[1]; x[2]=fPosition[2];
204 return TestBit(kIsDCA);}
205
cdd730d0 206 template <typename T> void SetCovMatrix(const T *covMatrix) {
5d62ce04 207 if(!fCovMatrix) fCovMatrix=new AliAODRedCov<6>();
df9db588 208 fCovMatrix->SetCovMatrix(covMatrix);}
209
cdd730d0 210 template <typename T> Bool_t GetCovMatrix(T *covMatrix) const {
df9db588 211 if(!fCovMatrix) return kFALSE;
212 fCovMatrix->GetCovMatrix(covMatrix); return kTRUE;}
213
892be05f 214 Bool_t GetXYZ(Double_t *p) const {
215 return GetPosition(p); }
086400fc 216
217 Bool_t GetXYZAt(Double_t x, Double_t b, Double_t *r) const;
218
4f6e22bd 219 Bool_t GetCovarianceXYZPxPyPz(Double_t cv[21]) const {
220 return GetCovMatrix(cv);}
221
df9db588 222 void RemoveCovMatrix() {delete fCovMatrix; fCovMatrix=NULL;}
223
6c954176 224 Double_t XAtDCA() const { return fPositionAtDCA[0]; }
225 Double_t YAtDCA() const { return fPositionAtDCA[1]; }
226 Double_t ZAtDCA() const {
227 if (IsMuonTrack()) return fPosition[2];
228 else if (TestBit(kIsDCA)) return fPosition[1];
229 else return -999.; }
230 Bool_t XYZAtDCA(Double_t x[3]) const { x[0] = XAtDCA(); x[1] = YAtDCA(); x[2] = ZAtDCA(); return kTRUE; }
231
232 Double_t DCA() const {
233 if (IsMuonTrack()) return TMath::Sqrt(XAtDCA()*XAtDCA() + YAtDCA()*YAtDCA());
234 else if (TestBit(kIsDCA)) return fPosition[0];
235 else return -999.; }
236
237 Double_t PxAtDCA() const { return fMomentumAtDCA[0]; }
238 Double_t PyAtDCA() const { return fMomentumAtDCA[1]; }
239 Double_t PzAtDCA() const { return fMomentumAtDCA[2]; }
240 Double_t PAtDCA() const { return TMath::Sqrt(PxAtDCA()*PxAtDCA() + PyAtDCA()*PyAtDCA() + PzAtDCA()*PzAtDCA()); }
241 Bool_t PxPyPzAtDCA(Double_t p[3]) const { p[0] = PxAtDCA(); p[1] = PyAtDCA(); p[2] = PzAtDCA(); return kTRUE; }
242
f43586f0 243 Double_t GetRAtAbsorberEnd() const { return fRAtAbsorberEnd; }
244
6c954176 245 UChar_t GetITSClusterMap() const { return (UChar_t)(fITSMuonClusterMap&0xff); }
6dc40b1c 246 Int_t GetITSNcls() const;
247 Bool_t HasPointOnITSLayer(Int_t i) const { return TESTBIT(GetITSClusterMap(),i); }
6c954176 248 UShort_t GetHitsPatternInTrigCh() const { return (UShort_t)((fITSMuonClusterMap&0xff00)>>8); }
249 UInt_t GetMUONClusterMap() const { return (fITSMuonClusterMap&0x3ff0000)>>16; }
250 UInt_t GetITSMUONClusterMap() const { return fITSMuonClusterMap; }
251
8a1418dc 252 Bool_t TestFilterBit(UInt_t filterBit) const {return (Bool_t) ((filterBit & fFilterMap) != 0);}
6db112a4 253 Bool_t TestFilterMask(UInt_t filterMask) const {return (Bool_t) ((filterMask & fFilterMap) == filterMask);}
e4b91233 254 void SetFilterMap(UInt_t i){fFilterMap = i;}
681b1d8b 255 UInt_t GetFilterMap() const {return fFilterMap;}
df9db588 256
507ed024 257 const TBits& GetTPCClusterMap() const {return fTPCClusterMap;}
086400fc 258 const TBits* GetTPCClusterMapPtr() const {return &fTPCClusterMap;}
bcabd0e4 259 const TBits& GetTPCFitMap() const {return fTPCFitMap;}
74ca66e3 260 const TBits* GetTPCFitMapPtr() const {return &fTPCFitMap;}
25f906db 261 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 262
507ed024 263 const TBits& GetTPCSharedMap() const {return fTPCSharedMap;}
74ca66e3 264 const TBits* GetTPCSharedMapPtr() const {return &fTPCSharedMap;}
507ed024 265 void SetTPCClusterMap(const TBits amap) {fTPCClusterMap = amap;}
266 void SetTPCSharedMap(const TBits amap) {fTPCSharedMap = amap;}
bcabd0e4 267 void SetTPCFitMap(const TBits amap) {fTPCFitMap = amap;}
3c01c166 268 void SetTPCPointsF(UShort_t findable){fTPCnclsF = findable;}
820214a7 269 void SetTPCNCrossedRows(UInt_t n) {fTPCNCrossedRows = n;}
3c01c166 270
271 UShort_t GetTPCNclsF() const { return fTPCnclsF;}
820214a7 272 UShort_t GetTPCNCrossedRows() const { return fTPCNCrossedRows;}
273 Float_t GetTPCFoundFraction() const { return fTPCNCrossedRows>0 ? float(GetTPCNcls())/fTPCNCrossedRows : 0;}
3c01c166 274
a7d9ab9e 275 // Calorimeter Cluster
276 Int_t GetEMCALcluster() const {return fCaloIndex;}
277 void SetEMCALcluster(Int_t index) {fCaloIndex=index;}
278 Bool_t IsEMCAL() const {return fFlags&kEMCALmatch;}
279
ed15417e 280 Double_t GetTrackPhiOnEMCal() const {return fTrackPhiOnEMCal;}
281 Double_t GetTrackEtaOnEMCal() const {return fTrackEtaOnEMCal;}
282 void SetTrackPhiEtaOnEMCal(Double_t phi,Double_t eta) {fTrackPhiOnEMCal=phi;fTrackEtaOnEMCal=eta;}
283
a7d9ab9e 284 Int_t GetPHOScluster() const {return fCaloIndex;}
285 void SetPHOScluster(Int_t index) {fCaloIndex=index;}
286 Bool_t IsPHOS() const {return fFlags&kPHOSmatch;}
287
9006fe9c 288 //pid signal interface
289 Double_t GetITSsignal() const { return fDetPid?fDetPid->GetITSsignal():0.; }
74ca66e3 290 void GetITSdEdxSamples(Double_t s[4]) const;
9006fe9c 291 Double_t GetTPCsignal() const { return fDetPid?fDetPid->GetTPCsignal():0.; }
539a5a59 292 Double_t GetTPCsignalTunedOnData() const { return fTPCsignalTuned;}
293 void SetTPCsignalTunedOnData(Double_t signal) {fTPCsignalTuned = signal;}
9006fe9c 294 UShort_t GetTPCsignalN() const { return fDetPid?fDetPid->GetTPCsignalN():0; }
de26d2c7 295 virtual AliTPCdEdxInfo* GetTPCdEdxInfo() const {return fDetPid?fDetPid->GetTPCdEdxInfo():0;}
9006fe9c 296 Double_t GetTPCmomentum() const { return fDetPid?fDetPid->GetTPCmomentum():0.; }
5839d3e1 297 Double_t GetTOFsignal() const { return fDetPid?fDetPid->GetTOFsignal():0.; }
a2c30af1 298 Double_t GetTOFsignalTunedOnData() const { return fTOFsignalTuned;}
299 void SetTOFsignalTunedOnData(Double_t signal) {fTOFsignalTuned = signal;}
567624b5 300 Double_t GetHMPIDsignal() const;
301 Double_t GetHMPIDoccupancy() const;
302
303 Int_t GetHMPIDcluIdx() const;
304
305 void GetHMPIDtrk(Float_t &x, Float_t &y, Float_t &th, Float_t &ph) const;
306 void GetHMPIDmip(Float_t &x,Float_t &y,Int_t &q,Int_t &nph) const;
307
308 Bool_t GetOuterHmpPxPyPz(Double_t *p) const;
5839d3e1 309
ea235c90 310 void GetIntegratedTimes(Double_t *times) const {if (fDetPid) fDetPid->GetIntegratedTimes(times); }
fd21ec8d 311 Double_t GetTRDslice(Int_t plane, Int_t slice) const;
6736efd5 312 Double_t GetTRDsignal() const {return fDetPid ? fDetPid->GetTRDsignal() : 0;}
ea235c90 313 Double_t GetTRDmomentum(Int_t plane, Double_t */*sp*/=0x0) const;
643d59bf 314 Double_t GetTRDchi2() const {return fDetPid ? fDetPid->GetTRDChi2() : -1;}
74ca66e3 315 UChar_t GetTRDncls(Int_t layer) const;
316 UChar_t GetTRDncls() const {return GetTRDncls(-1);}
99e9d5ec 317 UChar_t GetTRDntrackletsPID() const;
73b4da68 318 Int_t GetNumberOfTRDslices() const { return fDetPid?fDetPid->GetTRDnSlices():0; }
c997f0f9 319 void GetHMPIDpid(Double_t */*p*/) const { return; } // TODO: To be implemented properly with the new HMPID object
fd21ec8d 320
539a5a59 321 const AliAODEvent* GetAODEvent() const {return fAODEvent;}
aab77ed0 322 void SetAODEvent(const AliAODEvent* ptr){fAODEvent = ptr;}
323
7be1db84 324 AliAODPid *GetDetPid() const { return fDetPid; }
df9db588 325 AliAODVertex *GetProdVertex() const { return (AliAODVertex*)fProdVertex.GetObject(); }
326
327 // print
328 void Print(const Option_t *opt = "") const;
329
330 // setters
6efb741f 331 void SetFlags(ULong_t flags) { fFlags = flags; }
332 void SetStatus(ULong_t flags) { fFlags|=flags; }
333 void ResetStatus(ULong_t flags) { fFlags&=~flags; }
334
02153d58 335 void SetID(Short_t id) { fID = id; }
6efb741f 336 void SetLabel(Int_t label) { fLabel = label; }
a2c30af1 337 void SetTOFLabel(const Int_t* p);
cdd730d0 338 template <typename T> void SetPosition(const T *x, Bool_t isDCA = kFALSE);
df9db588 339 void SetDCA(Double_t d, Double_t z);
1912763f 340 void SetUsedForVtxFit(Bool_t used = kTRUE) { used ? SetBit(kUsedForVtxFit) : ResetBit(kUsedForVtxFit); }
dc825b15 341 void SetUsedForPrimVtxFit(Bool_t used = kTRUE) { used ? SetBit(kUsedForPrimVtxFit) : ResetBit(kUsedForPrimVtxFit); }
9e3e4265 342
343 void SetIsTPCOnly(Bool_t b = kTRUE) { SetIsTPCConstrained(b); }// obsolete bad naming
041743e4 344
9e3e4265 345 void SetIsTPCConstrained(Bool_t b = kTRUE) { b ? SetBit(kIsTPCConstrained) : ResetBit(kIsTPCConstrained); }
041743e4 346 void SetIsHybridTPCConstrainedGlobal(Bool_t hybrid = kTRUE) { hybrid ? SetBit(kIsHybridTPCCG) : ResetBit(kIsHybridTPCCG); }
347
9e3e4265 348 void SetIsGlobalConstrained(Bool_t b = kTRUE) { b ? SetBit(kIsGlobalConstrained) : ResetBit(kIsGlobalConstrained); }
349 void SetIsHybridGlobalConstrainedGlobal(Bool_t hybrid = kTRUE) { hybrid ? SetBit(kIsHybridGCG) : ResetBit(kIsHybridGCG); }
350
351
df9db588 352
f4ad422f 353 void SetOneOverPt(Double_t oneOverPt) { fMomentum[0] = 1. / oneOverPt; }
16b65f2a 354 void SetPt(Double_t pt) { fMomentum[0] = pt; };
14b34be5 355 void SetPhi(Double_t phi) { fMomentum[1] = phi; }
356 void SetTheta(Double_t theta) { fMomentum[2] = theta; }
cdd730d0 357 template <typename T> void SetP(const T *p, Bool_t cartesian = kTRUE);
df9db588 358 void SetP() {fMomentum[0]=fMomentum[1]=fMomentum[2]=-999.;}
359
6c954176 360 void SetXYAtDCA(Double_t x, Double_t y) {fPositionAtDCA[0] = x; fPositionAtDCA[1] = y;}
361 void SetPxPyPzAtDCA(Double_t pX, Double_t pY, Double_t pZ) {fMomentumAtDCA[0] = pX; fMomentumAtDCA[1] = pY; fMomentumAtDCA[2] = pZ;}
362
f43586f0 363 void SetRAtAbsorberEnd(Double_t r) { fRAtAbsorberEnd = r; }
364
14b34be5 365 void SetCharge(Short_t q) { fCharge = q; }
1912763f 366 void SetChi2perNDF(Double_t chi2perNDF) { fChi2perNDF = chi2perNDF; }
df9db588 367
6c954176 368 void SetITSClusterMap(UChar_t itsClusMap) { fITSMuonClusterMap = (fITSMuonClusterMap&0xffffff00)|(((UInt_t)itsClusMap)&0xff); }
369 void SetHitsPatternInTrigCh(UShort_t hitsPatternInTrigCh) { fITSMuonClusterMap = (fITSMuonClusterMap&0xffff00ff)|((((UInt_t)hitsPatternInTrigCh)&0xff)<<8); }
370 void SetMuonClusterMap(UInt_t muonClusMap) { fITSMuonClusterMap = (fITSMuonClusterMap&0xfc00ffff)|((muonClusMap&0x3ff)<<16); }
371 void SetITSMuonClusterMap(UInt_t itsMuonClusMap) { fITSMuonClusterMap = itsMuonClusMap; }
0a2dcc83 372 void SetMUONtrigHitsMapTrg(UInt_t muonTrigHitsMap) { fMUONtrigHitsMapTrg = muonTrigHitsMap; }
373 UInt_t GetMUONTrigHitsMapTrg() { return fMUONtrigHitsMapTrg; }
374 void SetMUONtrigHitsMapTrk(UInt_t muonTrigHitsMap) { fMUONtrigHitsMapTrk = muonTrigHitsMap; }
375 UInt_t GetMUONTrigHitsMapTrk() { return fMUONtrigHitsMapTrk; }
df9db588 376
8a1418dc 377 Int_t GetMatchTrigger() const {return fITSMuonClusterMap>>30;}
e1c744ca 378 // 0 Muon track does not match trigger
379 // 1 Muon track match but does not pass pt cut
380 // 2 Muon track match Low pt cut
381 // 3 Muon track match High pt cut
382 void SetMatchTrigger(Int_t MatchTrigger);
2200238e 383 Bool_t MatchTrigger() const { return (GetMatchTrigger()>0); } // Muon track matches trigger track
384 Bool_t MatchTriggerLowPt() const { return (GetMatchTrigger()>1); } // Muon track matches trigger track and passes Low pt cut
385 Bool_t MatchTriggerHighPt() const { return (GetMatchTrigger()>2); } // Muon track matches trigger track and passes High pt cut
386 Bool_t MatchTriggerDigits() const; // Muon track matches trigger digits
8a1418dc 387 Double_t GetChi2MatchTrigger() const { return fChi2MatchTrigger;}
6c954176 388 void SetChi2MatchTrigger(Double_t Chi2MatchTrigger) {fChi2MatchTrigger = Chi2MatchTrigger; }
2200238e 389 Bool_t HitsMuonChamber(Int_t MuonChamber, Int_t cathode = -1) const; // Check if track hits Muon chambers
6c954176 390 Bool_t IsMuonTrack() const { return (GetMUONClusterMap()>0) ? kTRUE : kFALSE; }
5c15a68b 391
392 void Connected(Bool_t flag) {flag ? SETBIT(fITSMuonClusterMap,26) : CLRBIT(fITSMuonClusterMap,26);}
393 Bool_t IsConnected() const {return TESTBIT(fITSMuonClusterMap,26);}
e1c744ca 394
c683ddc2 395 void SetProdVertex(TObject *vertex) { fProdVertex = vertex; }
396 void SetType(AODTrk_t ttype) { fType=ttype; }
397
00a38d07 398 // Trasient PID object, is owned by the track
399 virtual void SetDetectorPID(const AliDetectorPID *pid);
400 virtual const AliDetectorPID* GetDetectorPID() const { return fDetectorPID; }
6dc40b1c 401
6a8e543a 402 // Dummy
403 Int_t PdgCode() const {return 0;}
404
df9db588 405 private :
406
407 // Momentum & position
1912763f 408 Double32_t fMomentum[3]; // momemtum stored in pt, phi, theta
409 Double32_t fPosition[3]; // position of first point on track or dca
6c954176 410
411 Double32_t fMomentumAtDCA[3]; // momentum (px,py,pz) at DCA
412 Double32_t fPositionAtDCA[2]; // trasverse position (x,y) at DCA
413
f43586f0 414 Double32_t fRAtAbsorberEnd; // transverse position r at the end of the muon absorber
415
862ce351 416 Double32_t fChi2perNDF; // chi2/NDF of momentum fit
9333290e 417 Double32_t fChi2MatchTrigger; // chi2 of trigger/track matching
418 Double32_t fPID[10]; // [0.,1.,8] pointer to PID object
df9db588 419
6efb741f 420 ULong_t fFlags; // reconstruction status flags
1912763f 421 Int_t fLabel; // track label, points back to MC track
a2c30af1 422 Int_t fTOFLabel[3]; // TOF label
6c954176 423 UInt_t fITSMuonClusterMap; // map of ITS and muon clusters, one bit per layer
424 // (ITS: bit 1-8, muon trigger: bit 9-16, muon tracker: bit 17-26, muon match trigger: bit 31-32)
0a2dcc83 425 UInt_t fMUONtrigHitsMapTrg; // Muon trigger hits map from trigger
426 UInt_t fMUONtrigHitsMapTrk; // Muon trigger hits map from tracker track extrapolation
9333290e 427 UInt_t fFilterMap; // filter information, one bit per set of cuts
df9db588 428
bcabd0e4 429 TBits fTPCFitMap; // Map of clusters, one bit per padrow; if has a cluster on given padrow which is used in the fit
507ed024 430 TBits fTPCClusterMap; // Map of clusters, one bit per padrow; 1 if has a cluster on given padrow
431 TBits fTPCSharedMap; // Map of clusters, one bit per padrow; 1 if has a shared cluster on given padrow
bcabd0e4 432
3c01c166 433 UShort_t fTPCnclsF; // findable clusters
820214a7 434 UShort_t fTPCNCrossedRows; // n crossed rows
507ed024 435
02153d58 436 Short_t fID; // unique track ID, points back to the ESD track
437
1912763f 438 Char_t fCharge; // particle charge
1912763f 439 Char_t fType; // Track Type
a7d9ab9e 440
441 Int_t fCaloIndex; // index of associated EMCAL/PHOS cluster (AliAODCaloCluster)
442
507ed024 443
9333290e 444 AliAODRedCov<6> *fCovMatrix; // covariance matrix (x, y, z, px, py, pz)
00a38d07 445 AliAODPid *fDetPid; // more detailed or detector specific raw pid information
446 mutable const AliDetectorPID* fDetectorPID; //! transient object to cache calibrated PID information
9333290e 447 TRef fProdVertex; // vertex of origin
df9db588 448
ed15417e 449 Double_t fTrackPhiOnEMCal; // phi of track after being propagated to 430cm
450 Double_t fTrackEtaOnEMCal; // eta of track after being propagated to 430cm
451
539a5a59 452 Double_t fTPCsignalTuned; //! TPC signal tuned on data when using MC
a2c30af1 453 Double_t fTOFsignalTuned; //! TOF signal tuned on data when using MC
539a5a59 454
aab77ed0 455 const AliAODEvent* fAODEvent; //!
456
a2c30af1 457 ClassDef(AliAODTrack, 20);
df9db588 458};
459
862ce351 460inline Bool_t AliAODTrack::IsPrimaryCandidate() const
461{
462 // True of track passes primary particle selection (independent of type)
463 //
464 if (fFilterMap) {
465 return kTRUE;
466 } else {
467 return kFALSE;
468 }
469}
470
6dc40b1c 471inline Int_t AliAODTrack::GetITSNcls() const
472{
473 // Number of points in ITS
474 Int_t n=0;
475 for(Int_t i=0;i<6;i++) if(HasPointOnITSLayer(i)) n++;
476 return n;
477}
478
6e78367a 479//______________________________________________________________________________
480template <typename T>
481void AliAODTrack::SetPosition(const T *x, const Bool_t dca)
482{
483 // set the position
484
485 if (x) {
486 if (!dca) {
487 ResetBit(kIsDCA);
488
489 fPosition[0] = x[0];
490 fPosition[1] = x[1];
491 fPosition[2] = x[2];
492 } else {
493 SetBit(kIsDCA);
494 // don't know any better yet
495 fPosition[0] = -999.;
496 fPosition[1] = -999.;
497 fPosition[2] = -999.;
498 }
499 } else {
500 ResetBit(kIsDCA);
501
502 fPosition[0] = -999.;
503 fPosition[1] = -999.;
504 fPosition[2] = -999.;
505 }
506}
507
508//template<> void AliAODTrack::SetPosition(const double *, Bool_t);
fe7d86eb 509
df9db588 510#endif