Line data Source code
1 : #ifndef ALIESDTRACK_H
2 : #define ALIESDTRACK_H
3 : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 : * See cxx source for full Copyright notice */
5 :
6 : /* $Id: AliESDtrack.h 64153 2013-09-09 09:33:47Z akalweit $ */
7 :
8 : //-------------------------------------------------------------------------
9 : // Class AliESDtrack
10 : // This is the class to deal with during the physics analysis of data
11 : //
12 : // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
13 : //-------------------------------------------------------------------------
14 : /*****************************************************************************
15 : * Use GetExternalParameters() and GetExternalCovariance() to access the *
16 : * track information regardless of its internal representation. *
17 : * This formation is now fixed in the following way: *
18 : * external param0: local Y-coordinate of a track (cm) *
19 : * external param1: local Z-coordinate of a track (cm) *
20 : * external param2: local sine of the track momentum azimuthal angle *
21 : * external param3: tangent of the track momentum dip angle *
22 : * external param4: 1/pt (1/(GeV/c)) *
23 : * *
24 : * The Get*Label() getters return the label of the associated MC particle. *
25 : * The absolute value of this label is the index of the particle within the *
26 : * MC stack. If the label is negative, this track was assigned a certain *
27 : * number of clusters that did not in fact belong to this track. *
28 : *****************************************************************************/
29 :
30 : #include <TBits.h>
31 : #include "AliExternalTrackParam.h"
32 : #include "AliVTrack.h"
33 : #include "AliESDTOFCluster.h"
34 : #include "AliPID.h"
35 : #include "AliESDfriendTrack.h"
36 : #include "AliTPCdEdxInfo.h"
37 :
38 : class TParticle;
39 : class AliESDVertex;
40 : class AliKalmanTrack;
41 : class AliTrackPointArray;
42 : class TPolyMarker3D;
43 : class AliDetectorPID;
44 : class TTreeSRedirector;
45 : class AliESDEvent;
46 :
47 : class AliESDtrack : public AliExternalTrackParam {
48 : public:
49 : //
50 : enum {kSkipFriend=BIT(14)};
51 : enum {kNITSchi2Std=3};
52 : //
53 : AliESDtrack();
54 : AliESDtrack(const AliESDtrack& track);
55 : AliESDtrack(const AliVTrack* track);
56 : AliESDtrack(TParticle * part);
57 : virtual ~AliESDtrack();
58 : virtual void Copy(TObject &obj) const;
59 3474 : const AliESDfriendTrack *GetFriendTrack() const {return fFriendTrack;}
60 : void SetFriendTrack(const AliESDfriendTrack *t) {
61 0 : delete fFriendTrack; fFriendTrack=new AliESDfriendTrack(*t);
62 0 : }
63 40 : void ReleaseESDfriendTrack() { /*delete fFriendTrack;*/ fFriendTrack=0; }
64 20 : void SetFriendTrackPointer(AliESDfriendTrack *t) { fFriendTrack=t; }
65 : void AddCalibObject(TObject * object); // add calib object to the list
66 : TObject * GetCalibObject(Int_t index); // return calib objct at given position
67 : void MakeMiniESDtrack();
68 : void SetID(Short_t id);
69 10122 : Int_t GetID() const { return fID;}
70 176 : void SetVertexID(Char_t id) { fVertexID=id;}
71 0 : Char_t GetVertexID() const { return fVertexID;}
72 5696 : void SetStatus(ULong_t flags) {fFlags|=flags;}
73 484 : void ResetStatus(ULong_t flags) {fFlags&=~flags;}
74 : Bool_t UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags);
75 2332 : void SetIntegratedLength(Double_t l) {fTrackLength=l;}
76 : void SetIntegratedTimes(const Double_t *times);
77 : void SetESDpid(const Double_t *p);
78 : void GetESDpid(Double_t *p) const;
79 0 : virtual const Double_t *PID() const { return fR; }
80 :
81 19348 : Bool_t IsOn(Int_t mask) const {return (fFlags&mask)>0;}
82 57850 : ULong_t GetStatus() const {return fFlags;}
83 2948 : Int_t GetLabel() const {return fLabel;}
84 1048 : void SetLabel(Int_t label) {fLabel = label;}
85 :
86 : void GetExternalParameters(Double_t &x, Double_t p[5]) const;
87 : void GetExternalCovariance(Double_t cov[15]) const;
88 :
89 : Double_t GetIntegratedLength() const;
90 594 : Double_t GetIntegratedLengthOld() const {return fTrackLength;}
91 : void GetIntegratedTimes(Double_t *times, Int_t nspec=AliPID::kSPECIES) const;
92 21312 : Double_t GetIntegratedTimesOld(Int_t i) const {if(fTrackTime) return fTrackTime[i]; else return 0;};
93 : Int_t GetPID(Bool_t tpcOnly=kFALSE) const;
94 : Int_t GetTOFBunchCrossing(Double_t b=0, Bool_t pidTPConly=kTRUE) const;
95 : Double_t GetTOFExpTDiff(Double_t b=0, Bool_t pidTPConly=kTRUE) const;
96 : Double_t GetTOFExpTDiffSpec(AliPID::EParticleType specie=AliPID::kPion,Double_t b=0) const;
97 : //
98 1236 : Double_t GetMass(Bool_t tpcOnly=kFALSE) const {return AliPID::ParticleMass(GetPID(tpcOnly));}
99 : Double_t GetMassForTracking() const;
100 576 : void SetPIDForTracking(Int_t pid) {fPIDForTracking = pid;}
101 2832 : Int_t GetPIDForTracking() const {return fPIDForTracking;}
102 : Double_t M() const;
103 : Double_t E() const;
104 : Double_t Y() const;
105 :
106 : Bool_t GetConstrainedPxPyPz(Double_t *p) const {
107 0 : if (!fCp) return kFALSE;
108 0 : return fCp->GetPxPyPz(p);
109 0 : }
110 : Bool_t GetConstrainedXYZ(Double_t *r) const {
111 0 : if (!fCp) return kFALSE;
112 0 : return fCp->GetXYZ(r);
113 0 : }
114 0 : const AliExternalTrackParam *GetConstrainedParam() const {return fCp;}
115 : Bool_t GetConstrainedExternalParameters
116 : (Double_t &alpha, Double_t &x, Double_t p[5]) const;
117 : Bool_t GetConstrainedExternalCovariance(Double_t cov[15]) const;
118 0 : Double_t GetConstrainedChi2() const {return fCchi2;}
119 : Double_t GetChi2TPCConstrainedVsGlobal(const AliESDVertex* vtx) const;
120 : //
121 :
122 : // global track chi2
123 0 : void SetGlobalChi2(Double_t chi2) {fGlobalChi2 = chi2;}
124 0 : Double_t GetGlobalChi2() const {return fGlobalChi2;}
125 :
126 : Bool_t GetInnerPxPyPz(Double_t *p) const {
127 0 : if (!fIp) return kFALSE;
128 0 : return fIp->GetPxPyPz(p);
129 0 : }
130 764 : const AliExternalTrackParam * GetInnerParam() const { return fIp;}
131 304 : const AliExternalTrackParam * GetTPCInnerParam() const {return fTPCInner;}
132 : Bool_t FillTPCOnlyTrack(AliESDtrack &track);
133 : Bool_t GetInnerXYZ(Double_t *r) const {
134 0 : if (!fIp) return kFALSE;
135 0 : return fIp->GetXYZ(r);
136 0 : }
137 : Bool_t GetInnerExternalParameters
138 : (Double_t &alpha, Double_t &x, Double_t p[5]) const;
139 : Bool_t GetInnerExternalCovariance(Double_t cov[15]) const;
140 :
141 : void SetOuterParam(const AliExternalTrackParam *p, ULong_t flags);
142 :
143 : void SetOuterHmpParam(const AliExternalTrackParam *p, ULong_t flags);
144 :
145 1744 : const AliExternalTrackParam * GetOuterParam() const { return fOp;}
146 :
147 66 : const AliExternalTrackParam * GetOuterHmpParam() const { return fHMPIDp;}
148 :
149 : Bool_t GetOuterPxPyPz(Double_t *p) const {
150 0 : if (!fOp) return kFALSE;
151 0 : return fOp->GetPxPyPz(p);
152 0 : }
153 : Bool_t GetOuterHmpPxPyPz(Double_t *p) const {
154 32 : if (!fHMPIDp) return kFALSE;
155 16 : return fHMPIDp->GetPxPyPz(p);
156 16 : }
157 :
158 : Bool_t GetOuterXYZ(Double_t *r) const {
159 0 : if (!fOp) return kFALSE;
160 0 : return fOp->GetXYZ(r);
161 0 : }
162 : Bool_t GetOuterHmpXYZ(Double_t *r) const {
163 0 : if (!fHMPIDp) return kFALSE;
164 0 : return fHMPIDp->GetXYZ(r);
165 0 : }
166 :
167 : Bool_t GetOuterExternalParameters
168 : (Double_t &alpha, Double_t &x, Double_t p[5]) const;
169 : Bool_t GetOuterExternalCovariance(Double_t cov[15]) const;
170 :
171 : Bool_t GetOuterHmpExternalParameters
172 : (Double_t &alpha, Double_t &x, Double_t p[5]) const;
173 : Bool_t GetOuterHmpExternalCovariance(Double_t cov[15]) const;
174 :
175 : Int_t GetNcls(Int_t idet) const;
176 : Int_t GetClusters(Int_t idet, Int_t *idx) const;
177 :
178 : void SetITSpid(const Double_t *p);
179 : void GetITSpid(Double_t *p) const;
180 :
181 1112 : Double_t GetITSsignal() const {return fITSsignal;}
182 : void SetITSdEdxSamples(const Double_t s[4]);
183 : void GetITSdEdxSamples(Double_t s[4]) const;
184 :
185 0 : Double_t GetITSsignalTunedOnData() const {return fITSsignalTuned;}
186 0 : void SetITSsignalTunedOnData(Double_t signal) { fITSsignalTuned=signal; }
187 :
188 0 : void SetITSchi2(Double_t ITSchi2){fITSchi2 = ITSchi2;}
189 0 : void SetITSNcls(Char_t ITSncls){fITSncls = ITSncls;}
190 :
191 2210 : Double_t GetITSchi2() const {return fITSchi2;}
192 0 : Double_t GetITSchi2Std(Int_t step) const {return (step>-1&&step<kNITSchi2Std) ? fITSchi2Std[step] : -1;}
193 0 : void SetITSchi2Std(Double_t chi2, Int_t step) { if (step>-1&&step<kNITSchi2Std) fITSchi2Std[step] = chi2;}
194 : Char_t GetITSclusters(Int_t *idx) const;
195 2330 : UChar_t GetITSClusterMap() const {return fITSClusterMap;}
196 0 : void SetITSClusterMap(UChar_t amap) {fITSClusterMap = amap;}
197 :
198 0 : Char_t GetITSNcls() const { return fITSncls;}
199 242 : UChar_t GetITSSharedMap() const {return fITSSharedMap;}
200 0 : void SetITSSharedFlag(int lr) {fITSSharedMap |= 0x1<<lr;}
201 0 : Bool_t GetITSFakeFlag() const {return (fITSSharedMap&BIT(7))!=0;}
202 0 : void SetITSFakeFlag(Bool_t v=kTRUE) {if (v) fITSSharedMap|=BIT(7); else fITSSharedMap&=~BIT(7);}
203 732 : void SetITSSharedMap(UChar_t map) {fITSSharedMap=map;}
204 13728 : void SetITSModuleIndex(Int_t ilayer,Int_t idx) {fITSModule[ilayer]=idx;}
205 0 : Int_t GetITSModuleIndex(Int_t ilayer) const {return fITSModule[ilayer];}
206 : Bool_t GetITSModuleIndexInfo(Int_t ilayer,Int_t &idet,Int_t &status,
207 : Float_t &xloc,Float_t &zloc) const;
208 872 : Int_t GetITSLabel() const {return fITSLabel;}
209 0 : void SetITSLabel(Int_t label) {fITSLabel = label;}
210 : void SetITStrack(AliKalmanTrack * track){
211 1098 : if (fFriendTrack) fFriendTrack->SetITStrack(track);
212 366 : }
213 : AliKalmanTrack *GetITStrack(){
214 1464 : return fFriendTrack!=NULL?fFriendTrack->GetITStrack():NULL;
215 : }
216 14328 : Bool_t HasPointOnITSLayer(Int_t i) const {return TESTBIT(fITSClusterMap,i);}
217 0 : Bool_t HasSharedPointOnITSLayer(Int_t i) const {return TESTBIT(fITSSharedMap,i);}
218 :
219 : void SetTPCpid(const Double_t *p);
220 : void GetTPCpid(Double_t *p) const;
221 : void SetTPCPoints(Float_t points[4]){
222 4466 : for (Int_t i=0;i<4;i++) fTPCPoints[i]=points[i];
223 406 : }
224 0 : void SetTPCNcls(UChar_t assigned){fTPCncls = assigned;}
225 0 : void SetTPCchi2(Double_t TPCchi2){fTPCchi2 = TPCchi2;}
226 540 : void SetTPCPointsF(UChar_t findable){fTPCnclsF = findable;}
227 0 : void SetTPCPointsFIter1(UChar_t findable){fTPCnclsFIter1 = findable;}
228 1630 : UShort_t GetTPCNcls() const { return fTPCncls;}
229 7446 : UShort_t GetTPCNclsF() const { return fTPCnclsF;}
230 0 : UShort_t GetTPCNclsIter1() const { return fTPCnclsIter1;}
231 0 : UShort_t GetTPCNclsFIter1() const { return fTPCnclsFIter1;}
232 : UShort_t GetTPCnclsS(Int_t i0=0,Int_t i1=159) const;
233 : UShort_t GetTPCncls(Int_t row0=0,Int_t row1=159) const;
234 0 : Double_t GetTPCPoints(Int_t i) const {return fTPCPoints[i];}
235 : void SetKinkIndexes(Int_t points[3]) {
236 1224 : for (Int_t i=0;i<3;i++) fKinkIndexes[i] = points[i];
237 136 : }
238 : void SetV0Indexes(Int_t points[3]) {
239 1224 : for (Int_t i=0;i<3;i++) fV0Indexes[i] = points[i];
240 136 : }
241 : void SetTPCsignal(Float_t signal, Float_t sigma, UChar_t npoints){
242 812 : fTPCsignal = signal; fTPCsignalS = sigma; fTPCsignalN = npoints;
243 406 : }
244 : void SetTPCsignalTunedOnData(Double_t signal){
245 0 : fTPCsignalTuned = signal;
246 0 : }
247 : void SetTPCdEdxInfo(AliTPCdEdxInfo * dEdxInfo);
248 : Double_t GetdEdxInfo(Int_t regionID, Int_t calibID, Int_t qID,Int_t valueID);
249 : Double_t GetdEdxInfoTRD(Int_t method, Double_t p0, Double_t p1, Double_t p2);
250 :
251 448 : AliTPCdEdxInfo * GetTPCdEdxInfo() const {return fTPCdEdxInfo;}
252 15300 : Double_t GetTPCsignal() const {return fTPCsignal;}
253 2412 : Double_t GetTPCsignalTunedOnData() const {return fTPCsignalTuned;}
254 0 : Double_t GetTPCsignalSigma() const {return fTPCsignalS;}
255 3196 : UShort_t GetTPCsignalN() const {return fTPCsignalN;}
256 10128 : Double_t GetTPCmomentum() const {return fIp?fIp->GetP():GetP();}
257 480 : Double_t GetTPCTgl() const {return fIp?fIp->GetTgl():GetTgl();}
258 3696 : Double_t GetTPCchi2() const {return fTPCchi2;}
259 0 : Double_t GetTPCchi2Iter1() const {return fTPCchi2Iter1;}
260 : UShort_t GetTPCclusters(Int_t *idx) const;
261 : Double_t GetTPCdensity(Int_t row0, Int_t row1) const;
262 28834 : Int_t GetTPCLabel() const {return fTPCLabel;}
263 8442 : Int_t GetKinkIndex(Int_t i) const { return fKinkIndexes[i];}
264 1088 : Int_t GetV0Index(Int_t i) const { return fV0Indexes[i];}
265 242 : const TBits& GetTPCFitMap() const {return fTPCFitMap;}
266 0 : const TBits* GetTPCFitMapPtr() const {return &fTPCFitMap;}
267 242 : const TBits& GetTPCClusterMap() const {return fTPCClusterMap;}
268 0 : const TBits* GetTPCClusterMapPtr() const {return &fTPCClusterMap;}
269 242 : const TBits& GetTPCSharedMap() const {return fTPCSharedMap;}
270 0 : const TBits* GetTPCSharedMapPtr() const {return &fTPCSharedMap;}
271 544 : void SetTPCFitMap(const TBits &amap) {fTPCFitMap = amap;}
272 544 : void SetTPCClusterMap(const TBits &amap) {fTPCClusterMap = amap;}
273 544 : void SetTPCSharedMap(const TBits &amap) {fTPCSharedMap = amap;}
274 : Float_t GetTPCClusterInfo(Int_t nNeighbours=3, Int_t type=0, Int_t row0=0, Int_t row1=159, Int_t bitType=0 ) const;
275 : Float_t GetTPCClusterDensity(Int_t nNeighbours=3, Int_t type=0, Int_t row0=0, Int_t row1=159, Int_t bitType=0 ) const;
276 : Float_t GetTPCCrossedRows() const;
277 :
278 : void SetTRDpid(const Double_t *p);
279 208 : void SetTRDsignal(Double_t sig) {fTRDsignal = sig;}
280 208 : void SetTRDNchamberdEdx(UChar_t nch) {fTRDNchamberdEdx = nch;}
281 208 : void SetTRDNclusterdEdx(UChar_t ncls){fTRDNclusterdEdx = ncls;}
282 :
283 : // A.Bercuci
284 208 : void SetTRDntracklets(UChar_t q){fTRDntracklets = q;}
285 152 : UChar_t GetTRDntracklets() const {return (fTRDntracklets>>3)&7;}
286 240 : UChar_t GetTRDntrackletsPID() const {return fTRDntracklets&7;}
287 : // TEMPORARY alias asked by the HFE group to allow
288 : // reading of the v4-16-Release data with TRUNK related software (A.Bercuci@Apr 30th 09)
289 0 : UChar_t GetTRDpidQuality() const {return GetTRDntrackletsPID();}
290 0 : UChar_t GetTRDtrkltOccupancy(Int_t ly) const { return ly<kTRDnPlanes && ly>=0 ? fTRDTimBin[ly] & 0x1F : 0; }
291 0 : UChar_t GetTRDtrkltClCross(Int_t ly) const { return ly<kTRDnPlanes && ly>=0 ? (fTRDTimBin[ly] >> 5) & 0x03 : 0; }
292 0 : Bool_t IsTRDtrkltChmbGood(Int_t ly) const { return ly<kTRDnPlanes && ly>=0 ? ((fTRDTimBin[ly] >> 7) & 0x01) == 1 : kFALSE;}
293 : // end A.Bercuci
294 :
295 : void SetNumberOfTRDslices(Int_t n);
296 : Int_t GetNumberOfTRDslices() const;
297 : void SetTRDslice(Double_t q, Int_t plane, Int_t slice);
298 : void SetTRDmomentum(Double_t p, Int_t plane, Double_t *sp=0x0);
299 : Double_t GetTRDslice(Int_t plane, Int_t slice=-1) const;
300 : Double_t GetTRDmomentum(Int_t plane, Double_t *sp=0x0) const;
301 :
302 204 : void SetTRDQuality(Float_t quality){fTRDQuality=quality;}
303 0 : Double_t GetTRDQuality()const {return fTRDQuality;}
304 204 : void SetTRDBudget(Float_t budget){fTRDBudget=budget;}
305 0 : Double_t GetTRDBudget()const {return fTRDBudget;}
306 :
307 412 : void SetTRDTimBin(Int_t timbin, Int_t i) {fTRDTimBin[i]=timbin;}
308 : void GetTRDpid(Double_t *p) const;
309 240 : Double_t GetTRDsignal() const {return fTRDsignal;}
310 0 : UChar_t GetTRDNchamberdEdx() const {return fTRDNchamberdEdx;}
311 0 : UChar_t GetTRDNclusterdEdx() const {return fTRDNclusterdEdx;}
312 0 : Char_t GetTRDTimBin(Int_t i) const {return fTRDTimBin[i];}
313 240 : Double_t GetTRDchi2() const {return fTRDchi2;}
314 : UChar_t GetTRDclusters(Int_t *idx) const;
315 812 : UChar_t GetTRDncls() const {return fTRDncls;}
316 0 : UChar_t GetTRDncls0() const {return fTRDncls0;}
317 : UChar_t GetTRDtracklets(Int_t *idx) const;
318 : void SetTRDpid(Int_t iSpecies, Float_t p);
319 : Double_t GetTRDpid(Int_t iSpecies) const;
320 0 : Int_t GetTRDLabel() const {return fTRDLabel;}
321 :
322 : void SetTRDtrack(AliKalmanTrack * track){
323 0 : if (fFriendTrack) fFriendTrack->SetTRDtrack(track);
324 0 : }
325 : AliKalmanTrack *GetTRDtrack(){
326 0 : return fFriendTrack!=NULL?fFriendTrack->GetTRDtrack():NULL;
327 : }
328 :
329 : // this are methods for manipulating with TOF clusters/matches
330 : void SetTOFclusterArray(Int_t ncluster,Int_t *TOFcluster);
331 0 : Int_t *GetTOFclusterArray() const {return fTOFcluster;}
332 0 : Int_t GetNTOFclusters() const {return fNtofClusters;}
333 : void SuppressTOFMatches();
334 : void ReplaceTOFTrackID(int oldID, int newID);
335 : void ReplaceTOFClusterID(int oldID, int newID);
336 : void ReplaceTOFMatchID(int oldID, int newID);
337 : void AddTOFcluster(Int_t icl);
338 : void SortTOFcluster(); // RS? Not to be used?
339 : void ReMapTOFcluster(Int_t ncl,Int_t *mapping); // RS? Not to be used?
340 :
341 : void SetTOFsignal(Double_t tof);
342 : Double_t GetTOFsignal() const;
343 : void SetTOFsignalToT(Double_t ToT);
344 : Double_t GetTOFsignalToT() const;
345 : void SetTOFsignalRaw(Double_t tof);
346 : Double_t GetTOFsignalRaw() const;
347 : void SetTOFsignalDz(Double_t dz);
348 : Double_t GetTOFsignalDz() const;
349 : void SetTOFsignalDx(Double_t dx);
350 : Double_t GetTOFsignalDx() const;
351 : void SetTOFDeltaBC(Short_t deltaBC);
352 : Short_t GetTOFDeltaBC() const;
353 : void SetTOFL0L1(Short_t l0l1);
354 : Short_t GetTOFL0L1() const;
355 0 : Double_t GetTOFchi2() const {return fTOFchi2;};
356 : void SetTOFpid(const Double_t *p);
357 : void SetTOFLabel(const Int_t *p);
358 : void GetTOFpid(Double_t *p) const;
359 : void GetTOFLabel(Int_t *p) const;
360 : void GetTOFInfo(Float_t *info) const;
361 : void SetTOFInfo(Float_t *info);
362 : Int_t GetTOFCalChannel() const;
363 : Int_t GetTOFcluster() const;
364 326 : void SetTOFcluster(Int_t index) {fTOFindex=index;}
365 : void SetTOFCalChannel(Int_t index);
366 : Int_t GetTOFclusterN() const;
367 : Bool_t IsTOFHitAlreadyMatched() const;
368 0 : void SetTOFsignalTunedOnData(Double_t signal){fTOFsignalTuned=signal;}
369 0 : Double_t GetTOFsignalTunedOnData() const {return fTOFsignalTuned;}
370 :
371 : // HMPID methodes +++++++++++++++++++++++++++++++++ (kir)
372 298 : void SetHMPIDsignal(Double_t theta) {fHMPIDsignal=theta;}
373 920 : Double_t GetHMPIDsignal() const {if(fHMPIDsignal>0) return fHMPIDsignal - (Int_t)fHMPIDsignal; else return fHMPIDsignal;}
374 102 : Double_t GetHMPIDoccupancy() const {return (Int_t)fHMPIDsignal/10.0;}
375 : void SetHMPIDpid(const Double_t *p);
376 : void GetHMPIDpid(Double_t *p) const;
377 16 : void SetHMPIDchi2(Double_t chi2) {fHMPIDchi2=chi2;}
378 30 : Double_t GetHMPIDchi2() const {return fHMPIDchi2;}
379 346 : void SetHMPIDcluIdx(Int_t ch,Int_t idx) {fHMPIDcluIdx=ch*1000000+idx;}
380 46 : Int_t GetHMPIDcluIdx() const {return fHMPIDcluIdx;}
381 : void SetHMPIDtrk(Float_t x, Float_t y, Float_t th, Float_t ph) {
382 330 : fHMPIDtrkX=x; fHMPIDtrkY=y; fHMPIDtrkTheta=th; fHMPIDtrkPhi=ph;
383 165 : }
384 : void GetHMPIDtrk(Float_t &x, Float_t &y, Float_t &th, Float_t &ph) const {
385 154 : x=fHMPIDtrkX; y=fHMPIDtrkY; th=fHMPIDtrkTheta; ph=fHMPIDtrkPhi;
386 77 : }
387 : void SetHMPIDmip(Float_t x, Float_t y, Int_t q, Int_t nph=0) {
388 330 : fHMPIDmipX=x; fHMPIDmipY=y; fHMPIDqn=1000000*nph+q;
389 165 : }
390 : void GetHMPIDmip(Float_t &x,Float_t &y,Int_t &q,Int_t &nph) const {
391 138 : x=fHMPIDmipX; y=fHMPIDmipY; q=fHMPIDqn%1000000; nph=fHMPIDqn/1000000;
392 69 : }
393 0 : Bool_t IsHMPID() const {return fFlags&kHMPIDpid;}
394 1336 : Bool_t IsPureITSStandalone() const {return fFlags&kITSpureSA;}
395 0 : Bool_t IsMultPrimary() const {return !(fFlags&kMultSec);}
396 0 : Bool_t IsMultSecondary() const {return (fFlags&kMultSec);}
397 :
398 1246 : Int_t GetEMCALcluster() const {return fCaloIndex;}
399 376 : void SetEMCALcluster(Int_t index) {fCaloIndex=index;}
400 242 : Bool_t IsEMCAL() const {return fFlags&kEMCALmatch;}
401 :
402 242 : Double_t GetTrackPhiOnEMCal() const {return fTrackPhiOnEMCal;}
403 242 : Double_t GetTrackEtaOnEMCal() const {return fTrackEtaOnEMCal;}
404 242 : Double_t GetTrackPtOnEMCal() const {return fTrackPtOnEMCal;}
405 0 : Double_t GetTrackPOnEMCal() const {return TMath::Abs(fTrackEtaOnEMCal) < 1 ? fTrackPtOnEMCal*TMath::CosH(fTrackEtaOnEMCal) : -999;}
406 498 : void SetTrackPhiEtaPtOnEMCal(Double_t phi,Double_t eta,Double_t pt) {fTrackPhiOnEMCal=phi;fTrackEtaOnEMCal=eta;fTrackPtOnEMCal=pt;}
407 :
408 24 : Int_t GetPHOScluster() const {return fCaloIndex;}
409 8 : void SetPHOScluster(Int_t index) {fCaloIndex=index;}
410 458 : Bool_t IsPHOS() const {return fFlags&kPHOSmatch;}
411 0 : Double_t GetPHOSdx()const{return fCaloDx ;}
412 0 : Double_t GetPHOSdz()const{return fCaloDz ;}
413 8 : void SetPHOSdxdz(Double_t dx, Double_t dz){fCaloDx=dx,fCaloDz=dz;}
414 :
415 :
416 : void SetTrackPointArray(AliTrackPointArray *points) {
417 228 : if (fFriendTrack) fFriendTrack->SetTrackPointArray(points);
418 76 : }
419 : const AliTrackPointArray *GetTrackPointArray() const {
420 0 : return fFriendTrack!=NULL?fFriendTrack->GetTrackPointArray():NULL;
421 : }
422 : Bool_t RelateToVertexTPC(const AliESDVertex *vtx, Double_t b, Double_t maxd,
423 : AliExternalTrackParam *cParam=0);
424 : Bool_t
425 : RelateToVertexTPCBxByBz(const AliESDVertex *vtx, Double_t b[3],Double_t maxd,
426 : AliExternalTrackParam *cParam=0);
427 0 : void GetImpactParametersTPC(Float_t &xy,Float_t &z) const {xy=fdTPC; z=fzTPC;}
428 : void GetImpactParametersTPC(Float_t p[2], Float_t cov[3]) const {
429 0 : p[0]=fdTPC; p[1]=fzTPC; cov[0]=fCddTPC; cov[1]=fCdzTPC; cov[2]=fCzzTPC;
430 0 : }
431 0 : Double_t GetConstrainedChi2TPC() const {return fCchi2TPC;}
432 :
433 : Bool_t RelateToVertex(const AliESDVertex *vtx, Double_t b, Double_t maxd,
434 : AliExternalTrackParam *cParam=0);
435 : Bool_t
436 : RelateToVertexBxByBz(const AliESDVertex *vtx, Double_t b[3], Double_t maxd,
437 : AliExternalTrackParam *cParam=0);
438 408 : virtual void GetImpactParameters(Float_t &xy,Float_t &z) const {xy=fD; z=fZ;}
439 : void GetImpactParameters(Float_t p[2], Float_t cov[3]) const {
440 5094 : p[0]=fD; p[1]=fZ; cov[0]=fCdd; cov[1]=fCdz; cov[2]=fCzz;
441 2547 : }
442 :
443 : Bool_t RelateToVVertexTPC(const AliVVertex *vtx, Double_t b, Double_t maxd,
444 : AliExternalTrackParam *cParam=0);
445 : Bool_t
446 : RelateToVVertexTPCBxByBz(const AliVVertex *vtx, Double_t b[3],Double_t maxd,
447 : AliExternalTrackParam *cParam=0);
448 : Bool_t RelateToVVertex(const AliVVertex *vtx, Double_t b, Double_t maxd,
449 : AliExternalTrackParam *cParam=0);
450 : Bool_t
451 : RelateToVVertexBxByBz(const AliVVertex *vtx, Double_t b[3], Double_t maxd,
452 : AliExternalTrackParam *cParam=0);
453 :
454 : void SetImpactParameters( const Float_t p[2], const Float_t cov[3], const Float_t chi2, const AliExternalTrackParam *cParam );
455 : void SetImpactParametersTPC( const Float_t p[2], const Float_t cov[3], const Float_t chi2);
456 :
457 : virtual void Print(Option_t * opt) const ;
458 19070 : const AliESDEvent* GetESDEvent() const {return fESDEvent;}
459 : const AliTOFHeader* GetTOFHeader() const;
460 0 : const AliVEvent* GetEvent() const {return (AliVEvent*)fESDEvent;}
461 588 : void SetESDEvent(const AliESDEvent* evt) {fESDEvent = evt;}
462 :
463 : // Trasient PID object, is owned by the track
464 : virtual void SetDetectorPID(const AliDetectorPID *pid);
465 576 : virtual const AliDetectorPID* GetDetectorPID() const { return fDetectorPID; }
466 :
467 : //
468 : // visualization (M. Ivanov)
469 : //
470 : void FillPolymarker(TPolyMarker3D *pol, Float_t magf, Float_t minR, Float_t maxR, Float_t stepR);
471 :
472 : //
473 : // online mode Matthias.Richter@cern.ch
474 : // in order to optimize AliESDtrack for usage in the online HLT,
475 : // some functionality is disabled
476 : // - creation of AliESDfriendTrack
477 : // - set lengt of bit fields fTPCClusterMap and fTPCSharedMap to 0
478 0 : static void OnlineMode(bool mode) {fgkOnlineMode=mode;}
479 720 : static bool OnlineMode() {return fgkOnlineMode;}
480 : static Double_t GetLengthInActiveZone(const AliExternalTrackParam *paramT, Double_t deltaY, Double_t deltaZ, Double_t bz, Double_t exbPhi =0 , TTreeSRedirector * pcstream =0 );
481 : Double_t GetLengthInActiveZone( Int_t mode, Double_t deltaY, Double_t deltaZ, Double_t bz, Double_t exbPhi =0 , TTreeSRedirector * pcstream =0 ) const;
482 :
483 : //---------------------------------------------------------------------------
484 : //--the calibration interface--
485 : //--to be used in online calibration/QA
486 : //--should also be implemented in ESD so it works offline as well
487 : //-----------
488 : virtual Int_t GetTrackParam ( AliExternalTrackParam &p ) const {
489 0 : p=*(AliExternalTrackParam*)this;
490 0 : return 0;}
491 :
492 0 : virtual Int_t GetTrackParamRefitted ( AliExternalTrackParam & ) const {return 0;}
493 0 : virtual Int_t GetTrackParamITSOut ( AliExternalTrackParam & ) const {return 0;}
494 :
495 : Int_t GetTrackParamIp ( AliExternalTrackParam &p ) const {
496 0 : if(!GetInnerParam()) return -1;
497 0 : p=*GetInnerParam();
498 0 : return 0;}
499 :
500 : Int_t GetTrackParamOp ( AliExternalTrackParam &p ) const {
501 0 : if(!GetOuterParam()) return -1;
502 0 : p=*GetOuterParam();
503 0 : return 0;}
504 :
505 : Int_t GetTrackParamTPCInner ( AliExternalTrackParam &p ) const {
506 0 : if(!GetTPCInnerParam()) return -1;
507 0 : p=*GetTPCInnerParam();
508 0 : return 0;}
509 :
510 : Int_t GetTrackParamCp ( AliExternalTrackParam &p ) const {
511 0 : if(!GetConstrainedParam()) return -1;
512 0 : p=*GetConstrainedParam();
513 0 : return 0;}
514 :
515 : void ResetTrackParamIp ( const AliExternalTrackParam *p ) {
516 0 : if (fIp) delete fIp;
517 0 : fIp=new AliExternalTrackParam(*p);
518 0 : }
519 :
520 : void ResetTrackParamOp ( const AliExternalTrackParam *p ) {
521 0 : if (fOp) delete fOp;
522 0 : fOp=new AliExternalTrackParam(*p);
523 0 : }
524 :
525 : void ResetTrackParamTPCInner ( const AliExternalTrackParam *p ) {
526 0 : if (fTPCInner) delete fTPCInner;
527 0 : fTPCInner=new AliExternalTrackParam(*p);
528 0 : }
529 0 : Int_t GetNumberOfITSClusters() const { return fITSncls;}
530 0 : Int_t GetNumberOfTPCClusters() const { return fTPCncls;}
531 0 : Int_t GetNumberOfTRDClusters() const { return fTRDncls;}
532 : //
533 30 : void SetFriendNotStored(Bool_t v) {v ? (fFlags|=AliVTrack::kSkipFriend) : (fFlags&=(~AliVTrack::kSkipFriend));}
534 430 : Bool_t GetFriendNotStored() const {return IsOn(AliVTrack::kSkipFriend);}
535 162 : void SetFriendTrackID(int id) {fFrTrackID = UShort_t(id+1);}
536 20 : Int_t GetFriendTrackID() const {return Int_t(fFrTrackID)-1;}
537 :
538 : protected:
539 :
540 : AliExternalTrackParam *fCp; // Track parameters constrained to the primary vertex
541 : AliExternalTrackParam *fIp; // Track parameters estimated at the inner wall of TPC
542 : AliExternalTrackParam *fTPCInner; // Track parameters estimated at the inner wall of TPC using the TPC stand-alone
543 : AliExternalTrackParam *fOp; // Track parameters estimated at the point of maximal radial coordinate reached during the tracking
544 : AliExternalTrackParam *fHMPIDp; // Track parameters at HMPID
545 : AliESDfriendTrack *fFriendTrack; //! All the complementary information
546 :
547 : TBits fTPCFitMap; // Map of clusters, one bit per padrow; 1 if has a cluster on given padrow which is used in the fit
548 : TBits fTPCClusterMap; // Map of clusters, one bit per padrow; 1 if has a cluster on given padrow
549 : TBits fTPCSharedMap; // Map of clusters, one bit per padrow; 1 if has a shared cluster on given padrow
550 :
551 : UShort_t fFrTrackID; // id of friend in the ESDfriend
552 :
553 : ULong_t fFlags; // Reconstruction status flags
554 : Int_t fID; // Unique ID of the track
555 : Int_t fLabel; // Track label
556 : Int_t fITSLabel; // label according ITS
557 : Int_t fITSModule[12]; // modules crossed by the track in the ITS
558 : Int_t fTPCLabel; // label according TPC
559 : Int_t fTRDLabel; // label according TRD
560 : Int_t *fTOFLabel; //! TOF label
561 : Int_t fTOFCalChannel; //! Channel Index of the TOF Signal
562 : Int_t fTOFindex; // index of the assigned TOF cluster
563 : Int_t fHMPIDqn; // 1000000*number of photon clusters + QDC
564 : Int_t fHMPIDcluIdx; // 1000000*chamber id + cluster idx of the assigned MIP cluster
565 : Int_t fCaloIndex; // index of associated EMCAL/PHOS cluster (AliESDCaloCluster)
566 :
567 :
568 : Int_t fKinkIndexes[3]; // array of indexes of posible kink candidates
569 : Int_t fV0Indexes[3]; // array of indexes of posible kink candidates
570 :
571 : Double32_t *fR; //! [0.,0.,8] combined "detector response probability"
572 : Double32_t *fITSr; //! [0.,0.,8] "detector response probabilities" (for the PID)
573 : Double32_t *fTPCr; //! [0.,0.,8] "detector response probabilities" (for the PID)
574 : Double32_t *fTRDr; //! [0.,0.,8] "detector response probabilities" (for the PID)
575 : Double32_t *fTOFr; //! [0.,0.,8] "detector response probabilities" (for the PID)
576 : Double32_t *fHMPIDr; //! [0.,0.,8] "detector response probabilities" (for the PID)
577 :
578 : Double32_t fHMPIDtrkTheta;//[-2*pi,2*pi,16] theta of the track extrapolated to the HMPID, LORS
579 : // how much of this is needed?
580 : Double32_t fHMPIDtrkPhi; //[-2*pi,2*pi,16] phi of the track extrapolated to the HMPID, LORS
581 : Double32_t fHMPIDsignal; // HMPID PID signal (Theta ckov, rad)
582 :
583 : Double32_t *fTrackTime; //! TOFs estimated by the tracking
584 : Double32_t fTrackLength; //! Track length
585 :
586 : Double32_t fdTPC; // TPC-only impact parameter in XY plane
587 : Double32_t fzTPC; // TPC-only impact parameter in Z
588 : Double32_t fCddTPC,fCdzTPC,fCzzTPC; // Covariance matrix of the TPC-only impact parameters
589 : Double32_t fCchi2TPC; // [0.,0.,8] TPC-only chi2 at the primary vertex
590 :
591 : Double32_t fD; // Impact parameter in XY plane
592 : Double32_t fZ; // Impact parameter in Z
593 : Double32_t fCdd,fCdz,fCzz; // Covariance matrix of the impact parameters
594 : Double32_t fCchi2; // [0.,0.,8] chi2 at the primary vertex
595 :
596 : Double32_t fITSchi2Std[kNITSchi2Std]; // [0.,0.,8] standard chi2 in the ITS (with standard errors)
597 : Double32_t fITSchi2; // [0.,0.,8] chi2 in the ITS
598 : Double32_t fTPCchi2; // [0.,0.,8] chi2 in the TPC
599 : Double32_t fTPCchi2Iter1; // [0.,0.,8] chi2 in the TPC
600 : Double32_t fTRDchi2; // [0.,0.,8] chi2 in the TRD
601 : Double32_t fTOFchi2; // [0.,0.,8] chi2 in the TOF
602 : Double32_t fHMPIDchi2; // [0.,0.,8] chi2 in the HMPID
603 :
604 : Double32_t fGlobalChi2; // [0.,0.,8] chi2 of the global track
605 :
606 : Double32_t fITSsignal; // [0.,0.,10] detector's PID signal
607 : Double32_t fITSsignalTuned; //! [0.,0.,10] detector's PID signal
608 : Double32_t fITSdEdxSamples[4]; // [0.,0.,10] ITS dE/dx samples
609 :
610 : Double32_t fTPCsignal; // [0.,0.,10] detector's PID signal
611 : Double32_t fTPCsignalTuned; //! [0.,0.,10] detector's PID signal tuned on data when using MC
612 : Double32_t fTPCsignalS; // [0.,0.,10] RMS of dEdx measurement
613 : AliTPCdEdxInfo * fTPCdEdxInfo; // object containing dE/dx information for different pad regions
614 : Double32_t fTPCPoints[4]; // [0.,0.,10] TPC points -first, max. dens, last and max density
615 :
616 : Double32_t fTRDsignal; // detector's PID signal
617 : Double32_t fTRDQuality; // trd quality factor for TOF
618 : Double32_t fTRDBudget; // trd material budget
619 :
620 : Double32_t fTOFsignal; //! detector's PID signal [ps]
621 : Double32_t fTOFsignalTuned; //! detector's PID signal tuned on data when using MC
622 : Double32_t fTOFsignalToT; //! detector's ToT signal [ns]
623 : Double32_t fTOFsignalRaw; //! detector's uncorrected time signal [ps]
624 : Double32_t fTOFsignalDz; //! local z of track's impact on the TOF pad [cm]
625 : Double32_t fTOFsignalDx; //! local x of track's impact on the TOF pad [cm]
626 : Double32_t fTOFInfo[10]; //! TOF informations
627 : Short_t fTOFdeltaBC; //! detector's Delta Bunch Crossing correction
628 : Short_t fTOFl0l1; //! detector's L0L1 latency correction
629 :
630 : Double32_t fCaloDx ; // [0.,0.,8] distance to calorimeter cluster in calo plain (phi direction)
631 : Double32_t fCaloDz ; // [0.,0.,8] distance to calorimeter cluster in calo plain (z direction)
632 :
633 : Double32_t fHMPIDtrkX; // x of the track impact, LORS
634 : Double32_t fHMPIDtrkY; // y of the track impact, LORS
635 : Double32_t fHMPIDmipX; // x of the MIP in LORS
636 : Double32_t fHMPIDmipY; // y of the MIP in LORS
637 :
638 :
639 : UShort_t fTPCncls; // number of clusters assigned in the TPC
640 : UShort_t fTPCnclsF; // number of findable clusters in the TPC
641 : UShort_t fTPCsignalN; // number of points used for dEdx
642 : UShort_t fTPCnclsIter1; // number of clusters assigned in the TPC - iteration 1
643 : UShort_t fTPCnclsFIter1; // number of findable clusters in the TPC - iteration 1
644 :
645 : Char_t fITSncls; // number of clusters assigned in the ITS
646 : UChar_t fITSClusterMap; // map of clusters, one bit per a layer
647 : UChar_t fITSSharedMap; // map of shared clusters, one bit per a layer
648 : UChar_t fTRDncls; // number of clusters assigned in the TRD
649 : UChar_t fTRDncls0; // number of clusters assigned in the TRD before first material cross
650 : UChar_t fTRDntracklets; // number of TRD tracklets used for tracking/PID
651 : UChar_t fTRDNchamberdEdx; // number of chambers used to calculated the TRD truncated mean
652 : UChar_t fTRDNclusterdEdx; // number of clusters used to calculated the TRD truncated mean
653 :
654 : Int_t fTRDnSlices; // number of slices used for PID in the TRD
655 : Double32_t *fTRDslices; //[fTRDnSlices]
656 :
657 : Char_t fTRDTimBin[kTRDnPlanes]; // Time bin of Max cluster from all six planes
658 : Char_t fVertexID; // ID of the primary vertex this track belongs to
659 : Char_t fPIDForTracking; // mass used for tracking
660 :
661 : mutable const AliESDEvent* fESDEvent; //!Pointer back to event to which the track belongs
662 :
663 : mutable Float_t fCacheNCrossedRows; //! Cache for the number of crossed rows
664 : mutable Float_t fCacheChi2TPCConstrainedVsGlobal; //! Cache for the chi2 of constrained TPC vs global track
665 : mutable const AliESDVertex* fCacheChi2TPCConstrainedVsGlobalVertex; //! Vertex for which the cache is valid
666 :
667 : mutable const AliDetectorPID* fDetectorPID; //! transient object to cache PID information
668 :
669 : Double_t fTrackPhiOnEMCal; // phi of track after being propagated to the EMCal surface (default r = 440 cm)
670 : Double_t fTrackEtaOnEMCal; // eta of track after being propagated to the EMCal surface (default r = 440 cm)
671 : Double_t fTrackPtOnEMCal; // pt of track after being propagated to the EMCal surface (default r = 440 cm)
672 :
673 :
674 : // new TOF data structure
675 : Int_t fNtofClusters; // number of matchable TOF clusters
676 : Int_t *fTOFcluster; //[fNtofClusters]
677 : // TOF clusters matchable with the track
678 :
679 : //
680 : private:
681 : static bool fgkOnlineMode; //! indicate the online mode to skip some of the functionality
682 :
683 : AliESDtrack & operator=(const AliESDtrack & );
684 500 : ClassDef(AliESDtrack,72) //ESDtrack
685 : };
686 :
687 :
688 :
689 : #endif
690 :
|