]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AOD/AliAODTrack.h
ESD and AOD tracks contain a transient pointer to the event to which they belong...
[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;}
d38034b8 336 virtual const AliVEvent* GetEvent() const {return (AliVEvent*)fAODEvent;}
aab77ed0 337 void SetAODEvent(const AliAODEvent* ptr){fAODEvent = ptr;}
42fcc729 338 const AliTOFHeader* GetTOFHeader() const;
aab77ed0 339
7be1db84 340 AliAODPid *GetDetPid() const { return fDetPid; }
df9db588 341 AliAODVertex *GetProdVertex() const { return (AliAODVertex*)fProdVertex.GetObject(); }
342
343 // print
344 void Print(const Option_t *opt = "") const;
345
346 // setters
6efb741f 347 void SetFlags(ULong_t flags) { fFlags = flags; }
348 void SetStatus(ULong_t flags) { fFlags|=flags; }
349 void ResetStatus(ULong_t flags) { fFlags&=~flags; }
350
02153d58 351 void SetID(Short_t id) { fID = id; }
6efb741f 352 void SetLabel(Int_t label) { fLabel = label; }
a2c30af1 353 void SetTOFLabel(const Int_t* p);
cdd730d0 354 template <typename T> void SetPosition(const T *x, Bool_t isDCA = kFALSE);
df9db588 355 void SetDCA(Double_t d, Double_t z);
1912763f 356 void SetUsedForVtxFit(Bool_t used = kTRUE) { used ? SetBit(kUsedForVtxFit) : ResetBit(kUsedForVtxFit); }
dc825b15 357 void SetUsedForPrimVtxFit(Bool_t used = kTRUE) { used ? SetBit(kUsedForPrimVtxFit) : ResetBit(kUsedForPrimVtxFit); }
9e3e4265 358
359 void SetIsTPCOnly(Bool_t b = kTRUE) { SetIsTPCConstrained(b); }// obsolete bad naming
041743e4 360
9e3e4265 361 void SetIsTPCConstrained(Bool_t b = kTRUE) { b ? SetBit(kIsTPCConstrained) : ResetBit(kIsTPCConstrained); }
041743e4 362 void SetIsHybridTPCConstrainedGlobal(Bool_t hybrid = kTRUE) { hybrid ? SetBit(kIsHybridTPCCG) : ResetBit(kIsHybridTPCCG); }
363
9e3e4265 364 void SetIsGlobalConstrained(Bool_t b = kTRUE) { b ? SetBit(kIsGlobalConstrained) : ResetBit(kIsGlobalConstrained); }
365 void SetIsHybridGlobalConstrainedGlobal(Bool_t hybrid = kTRUE) { hybrid ? SetBit(kIsHybridGCG) : ResetBit(kIsHybridGCG); }
366
367
df9db588 368
f4ad422f 369 void SetOneOverPt(Double_t oneOverPt) { fMomentum[0] = 1. / oneOverPt; }
16b65f2a 370 void SetPt(Double_t pt) { fMomentum[0] = pt; };
14b34be5 371 void SetPhi(Double_t phi) { fMomentum[1] = phi; }
372 void SetTheta(Double_t theta) { fMomentum[2] = theta; }
cdd730d0 373 template <typename T> void SetP(const T *p, Bool_t cartesian = kTRUE);
df9db588 374 void SetP() {fMomentum[0]=fMomentum[1]=fMomentum[2]=-999.;}
375
6c954176 376 void SetXYAtDCA(Double_t x, Double_t y) {fPositionAtDCA[0] = x; fPositionAtDCA[1] = y;}
377 void SetPxPyPzAtDCA(Double_t pX, Double_t pY, Double_t pZ) {fMomentumAtDCA[0] = pX; fMomentumAtDCA[1] = pY; fMomentumAtDCA[2] = pZ;}
378
f43586f0 379 void SetRAtAbsorberEnd(Double_t r) { fRAtAbsorberEnd = r; }
380
14b34be5 381 void SetCharge(Short_t q) { fCharge = q; }
1912763f 382 void SetChi2perNDF(Double_t chi2perNDF) { fChi2perNDF = chi2perNDF; }
df9db588 383
6c954176 384 void SetITSClusterMap(UChar_t itsClusMap) { fITSMuonClusterMap = (fITSMuonClusterMap&0xffffff00)|(((UInt_t)itsClusMap)&0xff); }
385 void SetHitsPatternInTrigCh(UShort_t hitsPatternInTrigCh) { fITSMuonClusterMap = (fITSMuonClusterMap&0xffff00ff)|((((UInt_t)hitsPatternInTrigCh)&0xff)<<8); }
386 void SetMuonClusterMap(UInt_t muonClusMap) { fITSMuonClusterMap = (fITSMuonClusterMap&0xfc00ffff)|((muonClusMap&0x3ff)<<16); }
387 void SetITSMuonClusterMap(UInt_t itsMuonClusMap) { fITSMuonClusterMap = itsMuonClusMap; }
0a2dcc83 388 void SetMUONtrigHitsMapTrg(UInt_t muonTrigHitsMap) { fMUONtrigHitsMapTrg = muonTrigHitsMap; }
389 UInt_t GetMUONTrigHitsMapTrg() { return fMUONtrigHitsMapTrg; }
390 void SetMUONtrigHitsMapTrk(UInt_t muonTrigHitsMap) { fMUONtrigHitsMapTrk = muonTrigHitsMap; }
391 UInt_t GetMUONTrigHitsMapTrk() { return fMUONtrigHitsMapTrk; }
df9db588 392
8a1418dc 393 Int_t GetMatchTrigger() const {return fITSMuonClusterMap>>30;}
e1c744ca 394 // 0 Muon track does not match trigger
395 // 1 Muon track match but does not pass pt cut
396 // 2 Muon track match Low pt cut
397 // 3 Muon track match High pt cut
398 void SetMatchTrigger(Int_t MatchTrigger);
2200238e 399 Bool_t MatchTrigger() const { return (GetMatchTrigger()>0); } // Muon track matches trigger track
400 Bool_t MatchTriggerLowPt() const { return (GetMatchTrigger()>1); } // Muon track matches trigger track and passes Low pt cut
401 Bool_t MatchTriggerHighPt() const { return (GetMatchTrigger()>2); } // Muon track matches trigger track and passes High pt cut
402 Bool_t MatchTriggerDigits() const; // Muon track matches trigger digits
8a1418dc 403 Double_t GetChi2MatchTrigger() const { return fChi2MatchTrigger;}
6c954176 404 void SetChi2MatchTrigger(Double_t Chi2MatchTrigger) {fChi2MatchTrigger = Chi2MatchTrigger; }
2200238e 405 Bool_t HitsMuonChamber(Int_t MuonChamber, Int_t cathode = -1) const; // Check if track hits Muon chambers
6c954176 406 Bool_t IsMuonTrack() const { return (GetMUONClusterMap()>0) ? kTRUE : kFALSE; }
5c15a68b 407
408 void Connected(Bool_t flag) {flag ? SETBIT(fITSMuonClusterMap,26) : CLRBIT(fITSMuonClusterMap,26);}
409 Bool_t IsConnected() const {return TESTBIT(fITSMuonClusterMap,26);}
e1c744ca 410
c683ddc2 411 void SetProdVertex(TObject *vertex) { fProdVertex = vertex; }
412 void SetType(AODTrk_t ttype) { fType=ttype; }
413
00a38d07 414 // Trasient PID object, is owned by the track
415 virtual void SetDetectorPID(const AliDetectorPID *pid);
416 virtual const AliDetectorPID* GetDetectorPID() const { return fDetectorPID; }
6dc40b1c 417
6a8e543a 418 // Dummy
419 Int_t PdgCode() const {return 0;}
420
df9db588 421 private :
422
423 // Momentum & position
1912763f 424 Double32_t fMomentum[3]; // momemtum stored in pt, phi, theta
425 Double32_t fPosition[3]; // position of first point on track or dca
6c954176 426
427 Double32_t fMomentumAtDCA[3]; // momentum (px,py,pz) at DCA
428 Double32_t fPositionAtDCA[2]; // trasverse position (x,y) at DCA
429
f43586f0 430 Double32_t fRAtAbsorberEnd; // transverse position r at the end of the muon absorber
431
862ce351 432 Double32_t fChi2perNDF; // chi2/NDF of momentum fit
9333290e 433 Double32_t fChi2MatchTrigger; // chi2 of trigger/track matching
76b98553 434 Double32_t* fPID; //! [0.,1.,8] pointer to PID object
df9db588 435
6efb741f 436 ULong_t fFlags; // reconstruction status flags
1912763f 437 Int_t fLabel; // track label, points back to MC track
9b5c8b95 438 Int_t fTOFLabel[3]; // TOF label
439 Double32_t fTrackLength; // Track length
6c954176 440 UInt_t fITSMuonClusterMap; // map of ITS and muon clusters, one bit per layer
441 // (ITS: bit 1-8, muon trigger: bit 9-16, muon tracker: bit 17-26, muon match trigger: bit 31-32)
0a2dcc83 442 UInt_t fMUONtrigHitsMapTrg; // Muon trigger hits map from trigger
443 UInt_t fMUONtrigHitsMapTrk; // Muon trigger hits map from tracker track extrapolation
9333290e 444 UInt_t fFilterMap; // filter information, one bit per set of cuts
df9db588 445
bcabd0e4 446 TBits fTPCFitMap; // Map of clusters, one bit per padrow; if has a cluster on given padrow which is used in the fit
507ed024 447 TBits fTPCClusterMap; // Map of clusters, one bit per padrow; 1 if has a cluster on given padrow
448 TBits fTPCSharedMap; // Map of clusters, one bit per padrow; 1 if has a shared cluster on given padrow
bcabd0e4 449
3c01c166 450 UShort_t fTPCnclsF; // findable clusters
820214a7 451 UShort_t fTPCNCrossedRows; // n crossed rows
507ed024 452
02153d58 453 Short_t fID; // unique track ID, points back to the ESD track
454
1912763f 455 Char_t fCharge; // particle charge
1912763f 456 Char_t fType; // Track Type
a7d9ab9e 457
76b98553 458 Char_t fPIDForTracking; // pid using for tracking of ESD track
459
a7d9ab9e 460 Int_t fCaloIndex; // index of associated EMCAL/PHOS cluster (AliAODCaloCluster)
461
507ed024 462
9333290e 463 AliAODRedCov<6> *fCovMatrix; // covariance matrix (x, y, z, px, py, pz)
00a38d07 464 AliAODPid *fDetPid; // more detailed or detector specific raw pid information
465 mutable const AliDetectorPID* fDetectorPID; //! transient object to cache calibrated PID information
9333290e 466 TRef fProdVertex; // vertex of origin
df9db588 467
a29b2a8a 468 Double_t fTrackPhiOnEMCal; // phi of track after being propagated to the EMCal surface (default r = 440 cm)
469 Double_t fTrackEtaOnEMCal; // eta of track after being propagated to the EMCal surface (default r = 440 cm)
470 Double_t fTrackPtOnEMCal; // pt of track after being propagated to the EMCal surface (default r = 440 cm)
ed15417e 471
539a5a59 472 Double_t fTPCsignalTuned; //! TPC signal tuned on data when using MC
a2c30af1 473 Double_t fTOFsignalTuned; //! TOF signal tuned on data when using MC
539a5a59 474
d38034b8 475 const AliAODEvent* fAODEvent; //! pointer back to the event the track belongs to
aab77ed0 476
76b98553 477 ClassDef(AliAODTrack, 23);
df9db588 478};
479
862ce351 480inline Bool_t AliAODTrack::IsPrimaryCandidate() const
481{
482 // True of track passes primary particle selection (independent of type)
483 //
484 if (fFilterMap) {
485 return kTRUE;
486 } else {
487 return kFALSE;
488 }
489}
490
6dc40b1c 491inline Int_t AliAODTrack::GetITSNcls() const
492{
493 // Number of points in ITS
494 Int_t n=0;
495 for(Int_t i=0;i<6;i++) if(HasPointOnITSLayer(i)) n++;
496 return n;
497}
498
6e78367a 499//______________________________________________________________________________
500template <typename T>
501void AliAODTrack::SetPosition(const T *x, const Bool_t dca)
502{
503 // set the position
504
505 if (x) {
506 if (!dca) {
507 ResetBit(kIsDCA);
508
509 fPosition[0] = x[0];
510 fPosition[1] = x[1];
511 fPosition[2] = x[2];
512 } else {
513 SetBit(kIsDCA);
514 // don't know any better yet
515 fPosition[0] = -999.;
516 fPosition[1] = -999.;
517 fPosition[2] = -999.;
518 }
519 } else {
520 ResetBit(kIsDCA);
521
522 fPosition[0] = -999.;
523 fPosition[1] = -999.;
524 fPosition[2] = -999.;
525 }
526}
527
528//template<> void AliAODTrack::SetPosition(const double *, Bool_t);
fe7d86eb 529
df9db588 530#endif