]>
Commit | Line | Data |
---|---|---|
ae982df3 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
ae982df3 | 15 | //----------------------------------------------------------------- |
16 | // Implementation of the ESD track class | |
4427806c | 17 | // ESD = Event Summary Data |
15614b8b | 18 | // This is the class to deal with during the phisics analysis of data |
4427806c | 19 | // Origin: Iouri Belikov, CERN |
20 | // e-mail: Jouri.Belikov@cern.ch | |
ae982df3 | 21 | //----------------------------------------------------------------- |
22 | ||
23 | #include "TMath.h" | |
24 | ||
25 | #include "AliESDtrack.h" | |
26 | #include "AliKalmanTrack.h" | |
98937d93 | 27 | #include "AliTrackPointArray.h" |
5f7789fc | 28 | #include "AliLog.h" |
ae982df3 | 29 | |
30 | ClassImp(AliESDtrack) | |
31 | ||
d27bbc79 | 32 | void SetPIDValues(Float_t * dest, const Double_t * src, Int_t n) { |
33 | // This function copies "n" PID weights from "scr" to "dest" | |
34 | // and normalizes their sum to 1 thus producing conditional probabilities. | |
35 | // The negative weights are set to 0. | |
36 | // In case all the weights are non-positive they are replaced by | |
37 | // uniform probabilities | |
38 | ||
39 | if (n<=0) return; | |
40 | ||
41 | Float_t uniform = 1./(Float_t)n; | |
42 | ||
43 | Float_t sum = 0; | |
44 | for (Int_t i=0; i<n; i++) | |
45 | if (src[i]>=0) { | |
46 | sum+=src[i]; | |
47 | dest[i] = src[i]; | |
48 | } | |
49 | else { | |
50 | dest[i] = 0; | |
51 | } | |
52 | ||
53 | if(sum>0) | |
54 | for (Int_t i=0; i<n; i++) dest[i] /= sum; | |
55 | else | |
56 | for (Int_t i=0; i<n; i++) dest[i] = uniform; | |
57 | } | |
58 | ||
ae982df3 | 59 | //_______________________________________________________________________ |
60 | AliESDtrack::AliESDtrack() : | |
90e48c0c | 61 | TObject(), |
62 | fFlags(0), | |
63 | fLabel(0), | |
64 | fID(0), | |
65 | fTrackLength(0), | |
66 | fD(0), | |
67 | fZ(0), | |
68 | fStopVertex(0), | |
69 | fRalpha(0), | |
70 | fRx(0), | |
71 | fCalpha(0), | |
72 | fCx(0), | |
73 | fCchi2(1e10), | |
74 | fIalpha(0), | |
75 | fIx(0), | |
76 | fTalpha(0), | |
77 | fTx(0), | |
78 | fITSchi2(0), | |
79 | fITSncls(0), | |
80 | fITSsignal(0), | |
81 | fITSLabel(0), | |
82 | fITSFakeRatio(0), | |
83 | fITStrack(0), | |
84 | fTPCchi2(0), | |
85 | fTPCncls(0), | |
86 | fTPCClusterMap(159),//number of padrows | |
87 | fTPCsignal(0), | |
88 | fTPCLabel(0), | |
89 | fTRDchi2(0), | |
90 | fTRDncls(0), | |
91 | fTRDncls0(0), | |
92 | fTRDsignal(0), | |
93 | fTRDLabel(0), | |
94 | fTRDQuality(0), | |
23d49657 | 95 | fTRDBudget(0), |
90e48c0c | 96 | fTRDtrack(0), |
97 | fTOFchi2(0), | |
98 | fTOFindex(0), | |
99 | fTOFsignal(-1), | |
100 | fPHOSsignal(-1), | |
101 | fEMCALsignal(-1), | |
102 | fRICHchi2(1e10), | |
103 | fRICHncls(0), | |
104 | fRICHindex(0), | |
105 | fRICHsignal(-1), | |
106 | fRICHtheta(0), | |
107 | fRICHphi(0), | |
108 | fRICHdx(0), | |
98937d93 | 109 | fRICHdy(0), |
110 | fPoints(0) | |
ae982df3 | 111 | { |
112 | // | |
113 | // The default ESD constructor | |
114 | // | |
304864ab | 115 | for (Int_t i=0; i<AliPID::kSPECIES; i++) { |
4a78b8c5 | 116 | fTrackTime[i]=0.; |
117 | fR[i]=1.; | |
118 | fITSr[i]=1.; | |
119 | fTPCr[i]=1.; | |
120 | fTRDr[i]=1.; | |
121 | fTOFr[i]=1.; | |
4a78b8c5 | 122 | fRICHr[i]=1.; |
2bad268c | 123 | } |
ac2f7574 | 124 | |
304864ab | 125 | for (Int_t i=0; i<AliPID::kSPECIESN; i++) { |
704be597 | 126 | fPHOSr[i] = 1.; |
127 | fEMCALr[i] = 1.; | |
128 | } | |
129 | ||
ac2f7574 | 130 | |
4a78b8c5 | 131 | fPHOSpos[0]=fPHOSpos[1]=fPHOSpos[2]=0.; |
704be597 | 132 | fEMCALpos[0]=fEMCALpos[1]=fEMCALpos[2]=0.; |
bb2ceb1f | 133 | Int_t i; |
15614b8b | 134 | for (i=0; i<5; i++) { |
23904d16 | 135 | fRp[i]=fCp[i]=fIp[i]=fTp[i]=0.; |
15614b8b | 136 | } |
137 | for (i=0; i<15; i++) { | |
23904d16 | 138 | fRc[i]=fCc[i]=fIc[i]=fTc[i]=0.; |
15614b8b | 139 | } |
a866ac60 | 140 | for (i=0; i<6; i++) { fITSindex[i]=0; } |
141 | for (i=0; i<180; i++){ fTPCindex[i]=0; } | |
51ad6848 | 142 | for (i=0; i<3;i++) { fKinkIndexes[i]=0;} |
143 | for (i=0; i<3;i++) { fV0Indexes[i]=-1;} | |
c4d11b15 | 144 | for (i=0; i<130; i++) { fTRDindex[i]=0; } |
eab5961e | 145 | for (i=0;i<kNPlane;i++) {fTRDsignals[i]=0.; fTRDTimBin[i]=-1;} |
51ad6848 | 146 | for (Int_t i=0;i<4;i++) {fTPCPoints[i]=-1;} |
147 | for (Int_t i=0;i<3;i++) {fTOFLabel[i]=-1;} | |
148 | for (Int_t i=0;i<10;i++) {fTOFInfo[i]=-1;} | |
6e5b1b04 | 149 | fTPCLabel = 0; |
150 | fTRDLabel = 0; | |
7c97ee80 | 151 | fTRDQuality =0; |
23d49657 | 152 | fTRDBudget =0; |
6e5b1b04 | 153 | fITSLabel = 0; |
c4d11b15 | 154 | fITStrack = 0; |
155 | fTRDtrack = 0; | |
156 | } | |
157 | ||
158 | //_______________________________________________________________________ | |
90e48c0c | 159 | AliESDtrack::AliESDtrack(const AliESDtrack& track): |
160 | TObject(track), | |
161 | fFlags(track.fFlags), | |
162 | fLabel(track.fLabel), | |
163 | fID(track.fID), | |
164 | fTrackLength(track.fTrackLength), | |
165 | fD(track.fD), | |
166 | fZ(track.fZ), | |
167 | fStopVertex(track.fStopVertex), | |
168 | fRalpha(track.fRalpha), | |
169 | fRx(track.fRx), | |
170 | fCalpha(track.fCalpha), | |
171 | fCx(track.fCx), | |
172 | fCchi2(track.fCchi2), | |
173 | fIalpha(track.fIalpha), | |
174 | fIx(track.fIx), | |
175 | fTalpha(track.fTalpha), | |
176 | fTx(track.fTx), | |
177 | fITSchi2(track.fITSchi2), | |
178 | fITSncls(track.fITSncls), | |
179 | fITSsignal(track.fITSsignal), | |
180 | fITSLabel(track.fITSLabel), | |
181 | fITSFakeRatio(track.fITSFakeRatio), | |
182 | fITStrack(0), //coping separatelly - in user code | |
183 | fTPCchi2(track.fTPCchi2), | |
184 | fTPCncls(track.fTPCncls), | |
185 | fTPCClusterMap(track.fTPCClusterMap), | |
186 | fTPCsignal(track.fTPCsignal), | |
187 | fTPCLabel(track.fTPCLabel), | |
188 | fTRDchi2(track.fTRDchi2), | |
189 | fTRDncls(track.fTRDncls), | |
190 | fTRDncls0(track.fTRDncls0), | |
191 | fTRDsignal(track.fTRDsignal), | |
192 | fTRDLabel(track.fTRDLabel), | |
193 | fTRDQuality(track.fTRDQuality), | |
23d49657 | 194 | fTRDBudget(track.fTRDBudget), |
90e48c0c | 195 | fTRDtrack(0), |
196 | fTOFchi2(track.fTOFchi2), | |
197 | fTOFindex(track.fTOFindex), | |
198 | fTOFsignal(track.fTOFsignal), | |
199 | fPHOSsignal(track.fPHOSsignal), | |
200 | fEMCALsignal(track.fEMCALsignal), | |
201 | fRICHchi2(track.fRICHchi2), | |
202 | fRICHncls(track.fRICHncls), | |
203 | fRICHindex(track.fRICHindex), | |
204 | fRICHsignal(track.fRICHsignal), | |
205 | fRICHtheta(track.fRICHtheta), | |
206 | fRICHphi(track.fRICHphi), | |
207 | fRICHdx(track.fRICHdx), | |
98937d93 | 208 | fRICHdy(track.fRICHdy), |
209 | fPoints(track.fPoints) | |
90e48c0c | 210 | { |
c4d11b15 | 211 | // |
212 | //copy constructor | |
213 | // | |
304864ab | 214 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i] =track.fTrackTime[i]; |
215 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fR[i] =track.fR[i]; | |
c4d11b15 | 216 | // |
c4d11b15 | 217 | for (Int_t i=0;i<5;i++) fRp[i] =track.fRp[i]; |
218 | for (Int_t i=0;i<15;i++) fRc[i] =track.fRc[i]; | |
219 | // | |
c4d11b15 | 220 | for (Int_t i=0;i<5;i++) fCp[i] =track.fCp[i]; |
221 | for (Int_t i=0;i<15;i++) fCc[i] =track.fCc[i]; | |
c4d11b15 | 222 | // |
c4d11b15 | 223 | for (Int_t i=0;i<5;i++) fIp[i] =track.fIp[i]; |
224 | for (Int_t i=0;i<15;i++) fIc[i] =track.fIc[i]; | |
225 | // | |
c4d11b15 | 226 | for (Int_t i=0;i<5;i++) fTp[i] =track.fTp[i]; |
227 | for (Int_t i=0;i<15;i++) fTc[i] =track.fTc[i]; | |
228 | // | |
c4d11b15 | 229 | for (Int_t i=0;i<12;i++) fITSchi2MIP[i] =track.fITSchi2MIP[i]; |
c4d11b15 | 230 | for (Int_t i=0;i<6;i++) fITSindex[i]=track.fITSindex[i]; |
304864ab | 231 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fITSr[i]=track.fITSr[i]; |
c4d11b15 | 232 | // |
c4d11b15 | 233 | for (Int_t i=0;i<180;i++) fTPCindex[i]=track.fTPCindex[i]; |
304864ab | 234 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=track.fTPCr[i]; |
51ad6848 | 235 | for (Int_t i=0;i<4;i++) {fTPCPoints[i]=track.fTPCPoints[i];} |
236 | for (Int_t i=0; i<3;i++) { fKinkIndexes[i]=track.fKinkIndexes[i];} | |
237 | for (Int_t i=0; i<3;i++) { fV0Indexes[i]=track.fV0Indexes[i];} | |
c4d11b15 | 238 | // |
c4d11b15 | 239 | for (Int_t i=0;i<130;i++) fTRDindex[i]=track.fTRDindex[i]; |
eab5961e | 240 | for (Int_t i=0;i<kNPlane;i++) { |
241 | fTRDsignals[i]=track.fTRDsignals[i]; | |
242 | fTRDTimBin[i]=track.fTRDTimBin[i]; | |
243 | } | |
304864ab | 244 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTRDr[i]=track.fTRDr[i]; |
c4d11b15 | 245 | // |
304864ab | 246 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTOFr[i]=track.fTOFr[i]; |
51ad6848 | 247 | for (Int_t i=0;i<3;i++) fTOFLabel[i]=track.fTOFLabel[i]; |
248 | for (Int_t i=0;i<10;i++) fTOFInfo[i]=track.fTOFInfo[i]; | |
c4d11b15 | 249 | // |
250 | for (Int_t i=0;i<3;i++) fPHOSpos[i]=track.fPHOSpos[i]; | |
304864ab | 251 | for (Int_t i=0;i<AliPID::kSPECIESN;i++) fPHOSr[i]=track.fPHOSr[i]; |
c4d11b15 | 252 | // |
253 | for (Int_t i=0;i<3;i++) fEMCALpos[i]=track.fEMCALpos[i]; | |
304864ab | 254 | for (Int_t i=0;i<AliPID::kSPECIESN;i++) fEMCALr[i]=track.fEMCALr[i]; |
c4d11b15 | 255 | // |
304864ab | 256 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fRICHr[i]=track.fRICHr[i]; |
ae982df3 | 257 | } |
c4d11b15 | 258 | //_______________________________________________________________________ |
259 | AliESDtrack::~AliESDtrack(){ | |
260 | // | |
261 | // This is destructor according Coding Conventrions | |
262 | // | |
263 | //printf("Delete track\n"); | |
3fd96ae3 | 264 | delete fITStrack; |
98937d93 | 265 | delete fTRDtrack; |
266 | delete fPoints; | |
c4d11b15 | 267 | } |
ae982df3 | 268 | |
9559cbc4 | 269 | //_______________________________________________________________________ |
270 | void AliESDtrack::MakeMiniESDtrack(){ | |
271 | // Resets everything except | |
272 | // fFlags: Reconstruction status flags | |
273 | // fLabel: Track label | |
274 | // fID: Unique ID of the track | |
275 | // fD: Impact parameter in XY-plane | |
276 | // fZ: Impact parameter in Z | |
277 | // fR[AliPID::kSPECIES]: combined "detector response probability" | |
278 | // Running track parameters | |
279 | // fRalpha: track rotation angle | |
280 | // fRx: X-coordinate of the track reference plane | |
281 | // fRp[5]: external track parameters | |
282 | // fRc[15]: external cov. matrix of the track parameters | |
283 | ||
284 | fTrackLength = 0; | |
285 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i] = 0; | |
286 | fStopVertex = 0; | |
287 | ||
288 | // Reset track parameters constrained to the primary vertex | |
289 | fCalpha = 0; | |
290 | fCx = 0; | |
291 | for (Int_t i=0;i<5;i++) fCp[i] = 0; | |
292 | for (Int_t i=0;i<15;i++) fCc[i] = 0; | |
293 | fCchi2 = 0; | |
294 | ||
295 | // Reset track parameters at the inner wall of TPC | |
296 | fIalpha = 0; | |
297 | fIx = 0; | |
298 | for (Int_t i=0;i<5;i++) fIp[i] = 0; | |
299 | for (Int_t i=0;i<15;i++) fIc[i] = 0; | |
300 | ||
301 | // Reset track parameters at the inner wall of the TRD | |
302 | fTalpha = 0; | |
303 | fTx = 0; | |
304 | for (Int_t i=0;i<5;i++) fTp[i] = 0; | |
305 | for (Int_t i=0;i<15;i++) fTc[i] = 0; | |
306 | ||
307 | // Reset ITS track related information | |
308 | fITSchi2 = 0; | |
309 | for (Int_t i=0;i<12;i++) fITSchi2MIP[i] = 0; | |
310 | fITSncls = 0; | |
311 | for (Int_t i=0;i<6;i++) fITSindex[i]= 0; | |
312 | fITSsignal = 0; | |
313 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fITSr[i]= 0; | |
314 | fITSLabel = 0; | |
315 | fITSFakeRatio = 0; | |
316 | fITStrack =0; | |
317 | ||
318 | // Reset TPC related track information | |
319 | fTPCchi2 = 0; | |
320 | fTPCncls = 0; | |
321 | for (Int_t i=0;i<180;i++) fTPCindex[i] = 0; | |
322 | fTPCClusterMap = 0; | |
323 | fTPCsignal= 0; | |
324 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=0; | |
325 | fTPCLabel=0; | |
326 | for (Int_t i=0;i<4;i++) fTPCPoints[i] = 0; | |
327 | for (Int_t i=0; i<3;i++) fKinkIndexes[i] = 0; | |
328 | for (Int_t i=0; i<3;i++) fV0Indexes[i] = 0; | |
329 | ||
330 | // Reset TRD related track information | |
331 | fTRDchi2 = 0; | |
332 | fTRDncls = 0; | |
333 | fTRDncls0 = 0; | |
334 | for (Int_t i=0;i<130;i++) fTRDindex[i] = 0; | |
335 | fTRDsignal = 0; | |
336 | for (Int_t i=0;i<kNPlane;i++) { | |
337 | fTRDsignals[i] = 0; | |
338 | fTRDTimBin[i] = 0; | |
339 | } | |
340 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTRDr[i] = 0; | |
341 | fTRDLabel = 0; | |
342 | fTRDtrack = 0; | |
343 | fTRDQuality = 0; | |
23d49657 | 344 | fTRDBudget = 0; |
9559cbc4 | 345 | |
346 | // Reset TOF related track information | |
347 | fTOFchi2 = 0; | |
348 | fTOFindex = 0; | |
349 | fTOFsignal = 0; | |
350 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTOFr[i] = 0; | |
351 | for (Int_t i=0;i<3;i++) fTOFLabel[i] = 0; | |
352 | for (Int_t i=0;i<10;i++) fTOFInfo[i] = 0; | |
353 | ||
354 | // Reset PHOS related track information | |
355 | for (Int_t i=0;i<3;i++) fPHOSpos[i] = 0; | |
356 | fPHOSsignal = 0; | |
357 | for (Int_t i=0;i<AliPID::kSPECIESN;i++) fPHOSr[i] = 0; | |
358 | ||
359 | // Reset EMCAL related track information | |
360 | for (Int_t i=0;i<3;i++) fEMCALpos[i] = 0; | |
361 | fEMCALsignal = 0; | |
362 | for (Int_t i=0;i<AliPID::kSPECIESN;i++) fEMCALr[i] = 0; | |
363 | ||
364 | // Reset RICH related track information | |
365 | fRICHchi2 = 0; | |
366 | fRICHncls = 0; | |
367 | fRICHindex = 0; | |
368 | fRICHsignal = 0; | |
369 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fRICHr[i] = 0; | |
370 | fRICHtheta = 0; | |
371 | fRICHphi = 0; | |
372 | fRICHdx = 0; | |
373 | fRICHdy = 0; | |
374 | ||
98937d93 | 375 | fPoints = 0; |
9559cbc4 | 376 | } |
ae982df3 | 377 | //_______________________________________________________________________ |
4a78b8c5 | 378 | Double_t AliESDtrack::GetMass() const { |
4427806c | 379 | // Returns the mass of the most probable particle type |
ae982df3 | 380 | Float_t max=0.; |
381 | Int_t k=-1; | |
304864ab | 382 | for (Int_t i=0; i<AliPID::kSPECIES; i++) { |
ae982df3 | 383 | if (fR[i]>max) {k=i; max=fR[i];} |
384 | } | |
db3989b3 | 385 | if (k==0) { // dE/dx "crossing points" in the TPC |
386 | Double_t p=GetP(); | |
387 | if ((p>0.38)&&(p<0.48)) | |
304864ab | 388 | if (fR[0]<fR[3]*10.) return AliPID::ParticleMass(AliPID::kKaon); |
db3989b3 | 389 | if ((p>0.75)&&(p<0.85)) |
304864ab | 390 | if (fR[0]<fR[4]*10.) return AliPID::ParticleMass(AliPID::kProton); |
db3989b3 | 391 | return 0.00051; |
392 | } | |
304864ab | 393 | if (k==1) return AliPID::ParticleMass(AliPID::kMuon); |
394 | if (k==2||k==-1) return AliPID::ParticleMass(AliPID::kPion); | |
395 | if (k==3) return AliPID::ParticleMass(AliPID::kKaon); | |
396 | if (k==4) return AliPID::ParticleMass(AliPID::kProton); | |
5f7789fc | 397 | AliWarning("Undefined mass !"); |
304864ab | 398 | return AliPID::ParticleMass(AliPID::kPion); |
ae982df3 | 399 | } |
400 | ||
401 | //_______________________________________________________________________ | |
15614b8b | 402 | Bool_t AliESDtrack::UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags) { |
ae982df3 | 403 | // |
404 | // This function updates track's running parameters | |
405 | // | |
15614b8b | 406 | Bool_t rc=kTRUE; |
407 | ||
9b859005 | 408 | SetStatus(flags); |
409 | fLabel=t->GetLabel(); | |
410 | ||
411 | if (t->IsStartedTimeIntegral()) { | |
412 | SetStatus(kTIME); | |
413 | Double_t times[10];t->GetIntegratedTimes(times); SetIntegratedTimes(times); | |
414 | SetIntegratedLength(t->GetIntegratedLength()); | |
415 | } | |
416 | ||
417 | fRalpha=t->GetAlpha(); | |
418 | t->GetExternalParameters(fRx,fRp); | |
419 | t->GetExternalCovariance(fRc); | |
420 | ||
ae982df3 | 421 | switch (flags) { |
ad2f1f2b | 422 | |
9b859005 | 423 | case kITSin: case kITSout: case kITSrefit: |
ae982df3 | 424 | fITSncls=t->GetNumberOfClusters(); |
425 | fITSchi2=t->GetChi2(); | |
426 | for (Int_t i=0;i<fITSncls;i++) fITSindex[i]=t->GetClusterIndex(i); | |
427 | fITSsignal=t->GetPIDsignal(); | |
6e5b1b04 | 428 | fITSLabel = t->GetLabel(); |
babd135a | 429 | fITSFakeRatio = t->GetFakeRatio(); |
ae982df3 | 430 | break; |
ad2f1f2b | 431 | |
9b859005 | 432 | case kTPCin: case kTPCrefit: |
6e5b1b04 | 433 | fTPCLabel = t->GetLabel(); |
9b859005 | 434 | fIalpha=fRalpha; |
51ad6848 | 435 | fIx=fRx; |
9b859005 | 436 | { |
437 | Int_t i; | |
438 | for (i=0; i<5; i++) fIp[i]=fRp[i]; | |
439 | for (i=0; i<15;i++) fIc[i]=fRc[i]; | |
440 | } | |
441 | case kTPCout: | |
a866ac60 | 442 | |
ae982df3 | 443 | fTPCncls=t->GetNumberOfClusters(); |
444 | fTPCchi2=t->GetChi2(); | |
a866ac60 | 445 | |
446 | {//prevrow must be declared in separate namespace, otherwise compiler cries: | |
447 | //"jump to case label crosses initialization of `Int_t prevrow'" | |
448 | Int_t prevrow = -1; | |
6e5b1b04 | 449 | // for (Int_t i=0;i<fTPCncls;i++) |
450 | for (Int_t i=0;i<160;i++) | |
a866ac60 | 451 | { |
452 | fTPCindex[i]=t->GetClusterIndex(i); | |
453 | ||
454 | // Piotr's Cluster Map for HBT | |
455 | // ### please change accordingly if cluster array is changing | |
456 | // to "New TPC Tracking" style (with gaps in array) | |
457 | Int_t idx = fTPCindex[i]; | |
458 | Int_t sect = (idx&0xff000000)>>24; | |
459 | Int_t row = (idx&0x00ff0000)>>16; | |
460 | if (sect > 18) row +=63; //if it is outer sector, add number of inner sectors | |
461 | ||
462 | fTPCClusterMap.SetBitNumber(row,kTRUE); | |
463 | ||
464 | //Fill the gap between previous row and this row with 0 bits | |
465 | //In case ### pleas change it as well - just set bit 0 in case there | |
466 | //is no associated clusters for current "i" | |
467 | if (prevrow < 0) | |
468 | { | |
469 | prevrow = row;//if previous bit was not assigned yet == this is the first one | |
470 | } | |
471 | else | |
472 | { //we don't know the order (inner to outer or reverse) | |
473 | //just to be save in case it is going to change | |
474 | Int_t n = 0, m = 0; | |
475 | if (prevrow < row) | |
476 | { | |
477 | n = prevrow; | |
478 | m = row; | |
479 | } | |
480 | else | |
481 | { | |
482 | n = row; | |
483 | m = prevrow; | |
484 | } | |
485 | ||
486 | for (Int_t j = n+1; j < m; j++) | |
487 | { | |
488 | fTPCClusterMap.SetBitNumber(j,kFALSE); | |
489 | } | |
490 | prevrow = row; | |
491 | } | |
492 | // End Of Piotr's Cluster Map for HBT | |
493 | } | |
494 | } | |
ae982df3 | 495 | fTPCsignal=t->GetPIDsignal(); |
496 | {Double_t mass=t->GetMass(); // preliminary mass setting | |
497 | if (mass>0.5) fR[4]=1.; // used by | |
498 | else if (mass<0.4) fR[2]=1.; // the ITS reconstruction | |
a866ac60 | 499 | else fR[3]=1.;} |
500 | // | |
ae982df3 | 501 | break; |
9b859005 | 502 | |
23904d16 | 503 | case kTRDout: case kTRDin: case kTRDrefit: |
51ad6848 | 504 | fTRDLabel = t->GetLabel(); |
79e94bf8 | 505 | fTRDncls=t->GetNumberOfClusters(); |
506 | fTRDchi2=t->GetChi2(); | |
bb2ceb1f | 507 | for (Int_t i=0;i<fTRDncls;i++) fTRDindex[i]=t->GetClusterIndex(i); |
79e94bf8 | 508 | fTRDsignal=t->GetPIDsignal(); |
509 | break; | |
c4d11b15 | 510 | case kTRDbackup: |
511 | t->GetExternalParameters(fTx,fTp); | |
512 | t->GetExternalCovariance(fTc); | |
35f4ab61 | 513 | fTalpha = t->GetAlpha(); |
c4d11b15 | 514 | fTRDncls0 = t->GetNumberOfClusters(); |
515 | break; | |
516 | case kTOFin: | |
517 | break; | |
518 | case kTOFout: | |
519 | break; | |
d0862fea | 520 | case kTRDStop: |
521 | break; | |
ae982df3 | 522 | default: |
5f7789fc | 523 | AliError("Wrong flag !"); |
ae982df3 | 524 | return kFALSE; |
525 | } | |
526 | ||
15614b8b | 527 | return rc; |
ae982df3 | 528 | } |
529 | ||
67c3dcbe | 530 | //_______________________________________________________________________ |
531 | void | |
5ccd1720 | 532 | AliESDtrack::SetConstrainedTrackParams(const AliKalmanTrack *t, Double_t chi2) { |
67c3dcbe | 533 | // |
534 | // This function sets the constrained track parameters | |
535 | // | |
db3989b3 | 536 | Int_t i; |
537 | Double_t x,buf[15]; | |
67c3dcbe | 538 | fCalpha=t->GetAlpha(); |
db3989b3 | 539 | t->GetExternalParameters(x,buf); fCx=x; |
540 | for (i=0; i<5; i++) fCp[i]=buf[i]; | |
541 | t->GetExternalCovariance(buf); | |
542 | for (i=0; i<15; i++) fCc[i]=buf[i]; | |
67c3dcbe | 543 | fCchi2=chi2; |
544 | } | |
545 | ||
546 | ||
ae982df3 | 547 | //_______________________________________________________________________ |
548 | void AliESDtrack::GetExternalParameters(Double_t &x, Double_t p[5]) const { | |
549 | //--------------------------------------------------------------------- | |
550 | // This function returns external representation of the track parameters | |
551 | //--------------------------------------------------------------------- | |
552 | x=fRx; | |
553 | for (Int_t i=0; i<5; i++) p[i]=fRp[i]; | |
554 | } | |
15614b8b | 555 | |
556 | //_______________________________________________________________________ | |
c84a5e9e | 557 | Bool_t AliESDtrack:: |
558 | GetExternalParametersAt(Double_t x, Double_t b, Double_t p[5]) const { | |
15614b8b | 559 | //--------------------------------------------------------------------- |
c84a5e9e | 560 | // This function returns external track parameters extrapolated to |
561 | // the radial position "x" (cm) in the magnetic field "b" (kG) | |
15614b8b | 562 | //--------------------------------------------------------------------- |
c84a5e9e | 563 | Double_t convconst=0.299792458*b/1000.; |
15614b8b | 564 | Double_t dx=x-fRx; |
c84a5e9e | 565 | Double_t f1=fRp[2], f2=f1 + dx*fRp[4]*convconst; |
15614b8b | 566 | |
567 | if (TMath::Abs(f2) >= 0.9999) return kFALSE; | |
568 | ||
569 | Double_t r1=TMath::Sqrt(1.- f1*f1), r2=TMath::Sqrt(1.- f2*f2); | |
570 | p[0] = fRp[0] + dx*(f1+f2)/(r1+r2); | |
571 | p[1] = fRp[1] + dx*(f1+f2)/(f1*r2 + f2*r1)*fRp[3]; | |
572 | p[2] = f2; | |
573 | p[3] = fRp[3]; | |
574 | p[4] = fRp[4]; | |
575 | ||
576 | return kTRUE; | |
577 | } | |
578 | ||
67c3dcbe | 579 | //_______________________________________________________________________ |
a866ac60 | 580 | void AliESDtrack::GetExternalCovariance(Double_t cov[15]) const { |
67c3dcbe | 581 | //--------------------------------------------------------------------- |
582 | // This function returns external representation of the cov. matrix | |
583 | //--------------------------------------------------------------------- | |
a866ac60 | 584 | for (Int_t i=0; i<15; i++) cov[i]=fRc[i]; |
67c3dcbe | 585 | } |
586 | ||
587 | ||
588 | //_______________________________________________________________________ | |
589 | void | |
590 | AliESDtrack::GetConstrainedExternalParameters(Double_t &x, Double_t p[5])const{ | |
591 | //--------------------------------------------------------------------- | |
592 | // This function returns the constrained external track parameters | |
593 | //--------------------------------------------------------------------- | |
594 | x=fCx; | |
595 | for (Int_t i=0; i<5; i++) p[i]=fCp[i]; | |
596 | } | |
597 | //_______________________________________________________________________ | |
598 | void | |
599 | AliESDtrack::GetConstrainedExternalCovariance(Double_t c[15]) const { | |
600 | //--------------------------------------------------------------------- | |
601 | // This function returns the constrained external cov. matrix | |
602 | //--------------------------------------------------------------------- | |
603 | for (Int_t i=0; i<15; i++) c[i]=fCc[i]; | |
604 | } | |
605 | ||
ae982df3 | 606 | |
607 | Double_t AliESDtrack::GetP() const { | |
608 | //--------------------------------------------------------------------- | |
609 | // This function returns the track momentum | |
b322ab2f | 610 | // Results for (nearly) straight tracks are meaningless ! |
ae982df3 | 611 | //--------------------------------------------------------------------- |
2157f4f2 | 612 | if (TMath::Abs(fRp[4])<=0) return 0; |
ae982df3 | 613 | Double_t pt=1./TMath::Abs(fRp[4]); |
5bc70ad8 | 614 | return pt*TMath::Sqrt(1.+ fRp[3]*fRp[3]); |
ae982df3 | 615 | } |
616 | ||
038834e7 | 617 | //_______________________________________________________________________ |
c84a5e9e | 618 | Double_t AliESDtrack::GetD(Double_t b, Double_t x, Double_t y) const { |
038834e7 | 619 | //------------------------------------------------------------------ |
620 | // This function calculates the transverse impact parameter | |
621 | // with respect to a point with global coordinates (x,y) | |
c84a5e9e | 622 | // in the magnetic field "b" (kG) |
038834e7 | 623 | //------------------------------------------------------------------ |
c84a5e9e | 624 | Double_t convconst=0.299792458*b/1000.; |
625 | Double_t rp4=fRp[4]*convconst; | |
038834e7 | 626 | |
627 | Double_t xt=fRx, yt=fRp[0]; | |
628 | ||
629 | Double_t sn=TMath::Sin(fRalpha), cs=TMath::Cos(fRalpha); | |
630 | Double_t a = x*cs + y*sn; | |
631 | y = -x*sn + y*cs; x=a; | |
632 | xt-=x; yt-=y; | |
633 | ||
634 | sn=rp4*xt - fRp[2]; cs=rp4*yt + TMath::Sqrt(1.- fRp[2]*fRp[2]); | |
635 | a=2*(xt*fRp[2] - yt*TMath::Sqrt(1.- fRp[2]*fRp[2]))-rp4*(xt*xt + yt*yt); | |
636 | if (rp4<0) a=-a; | |
637 | return a/(1 + TMath::Sqrt(sn*sn + cs*cs)); | |
638 | } | |
639 | ||
09c96efc | 640 | Bool_t Local2GlobalMomentum(Double_t p[3],Double_t alpha) { |
641 | //---------------------------------------------------------------- | |
642 | // This function performs local->global transformation of the | |
643 | // track momentum. | |
644 | // When called, the arguments are: | |
645 | // p[0] = 1/pt of the track; | |
646 | // p[1] = sine of local azim. angle of the track momentum; | |
647 | // p[2] = tangent of the track momentum dip angle; | |
648 | // alpha - rotation angle. | |
649 | // The result is returned as: | |
650 | // p[0] = px | |
651 | // p[1] = py | |
652 | // p[2] = pz | |
653 | // Results for (nearly) straight tracks are meaningless ! | |
654 | //---------------------------------------------------------------- | |
655 | if (TMath::Abs(p[0])<=0) return kFALSE; | |
656 | if (TMath::Abs(p[1])> 0.999999) return kFALSE; | |
657 | ||
658 | Double_t pt=1./TMath::Abs(p[0]); | |
659 | Double_t cs=TMath::Cos(alpha), sn=TMath::Sin(alpha); | |
660 | Double_t r=TMath::Sqrt(1 - p[1]*p[1]); | |
661 | p[0]=pt*(r*cs - p[1]*sn); p[1]=pt*(p[1]*cs + r*sn); p[2]=pt*p[2]; | |
662 | ||
663 | return kTRUE; | |
664 | } | |
665 | ||
666 | Bool_t Local2GlobalPosition(Double_t r[3],Double_t alpha) { | |
667 | //---------------------------------------------------------------- | |
668 | // This function performs local->global transformation of the | |
669 | // track position. | |
670 | // When called, the arguments are: | |
671 | // r[0] = local x | |
672 | // r[1] = local y | |
673 | // r[2] = local z | |
674 | // alpha - rotation angle. | |
675 | // The result is returned as: | |
676 | // r[0] = global x | |
677 | // r[1] = global y | |
678 | // r[2] = global z | |
679 | //---------------------------------------------------------------- | |
680 | Double_t cs=TMath::Cos(alpha), sn=TMath::Sin(alpha), x=r[0]; | |
681 | r[0]=x*cs - r[1]*sn; r[1]=x*sn + r[1]*cs; | |
682 | ||
683 | return kTRUE; | |
684 | } | |
685 | ||
686 | Bool_t AliESDtrack::GetConstrainedPxPyPz(Double_t *p) const { | |
67c3dcbe | 687 | //--------------------------------------------------------------------- |
688 | // This function returns the constrained global track momentum components | |
b322ab2f | 689 | // Results for (nearly) straight tracks are meaningless ! |
67c3dcbe | 690 | //--------------------------------------------------------------------- |
09c96efc | 691 | p[0]=fCp[4]; p[1]=fCp[2]; p[2]=fCp[3]; |
692 | return Local2GlobalMomentum(p,fCalpha); | |
693 | } | |
b322ab2f | 694 | |
09c96efc | 695 | Bool_t AliESDtrack::GetConstrainedXYZ(Double_t *r) const { |
67c3dcbe | 696 | //--------------------------------------------------------------------- |
09c96efc | 697 | // This function returns the constrained global track position |
67c3dcbe | 698 | //--------------------------------------------------------------------- |
09c96efc | 699 | r[0]=fCx; r[1]=fCp[0]; r[2]=fCp[1]; |
700 | return Local2GlobalPosition(r,fCalpha); | |
67c3dcbe | 701 | } |
702 | ||
09c96efc | 703 | Bool_t AliESDtrack::GetPxPyPz(Double_t *p) const { |
ae982df3 | 704 | //--------------------------------------------------------------------- |
705 | // This function returns the global track momentum components | |
b322ab2f | 706 | // Results for (nearly) straight tracks are meaningless ! |
ae982df3 | 707 | //--------------------------------------------------------------------- |
09c96efc | 708 | p[0]=fRp[4]; p[1]=fRp[2]; p[2]=fRp[3]; |
709 | return Local2GlobalMomentum(p,fRalpha); | |
ae982df3 | 710 | } |
b322ab2f | 711 | |
09c96efc | 712 | Bool_t AliESDtrack::GetXYZ(Double_t *r) const { |
ae982df3 | 713 | //--------------------------------------------------------------------- |
714 | // This function returns the global track position | |
715 | //--------------------------------------------------------------------- | |
09c96efc | 716 | r[0]=fRx; r[1]=fRp[0]; r[2]=fRp[1]; |
717 | return Local2GlobalPosition(r,fRalpha); | |
ae982df3 | 718 | } |
719 | ||
b322ab2f | 720 | void AliESDtrack::GetCovariance(Double_t cv[21]) const { |
721 | //--------------------------------------------------------------------- | |
722 | // This function returns the global covariance matrix of the track params | |
723 | // | |
724 | // Cov(x,x) ... : cv[0] | |
725 | // Cov(y,x) ... : cv[1] cv[2] | |
726 | // Cov(z,x) ... : cv[3] cv[4] cv[5] | |
727 | // Cov(px,x)... : cv[6] cv[7] cv[8] cv[9] | |
23904d16 | 728 | // Cov(py,x)... : cv[10] cv[11] cv[12] cv[13] cv[14] |
729 | // Cov(pz,x)... : cv[15] cv[16] cv[17] cv[18] cv[19] cv[20] | |
b322ab2f | 730 | // |
731 | // Results for (nearly) straight tracks are meaningless ! | |
732 | //--------------------------------------------------------------------- | |
733 | if (TMath::Abs(fRp[4])<=0) { | |
734 | for (Int_t i=0; i<21; i++) cv[i]=0.; | |
735 | return; | |
736 | } | |
737 | if (TMath::Abs(fRp[2]) > 0.999999) { | |
738 | for (Int_t i=0; i<21; i++) cv[i]=0.; | |
739 | return; | |
740 | } | |
741 | Double_t pt=1./TMath::Abs(fRp[4]); | |
742 | Double_t cs=TMath::Cos(fRalpha), sn=TMath::Sin(fRalpha); | |
743 | Double_t r=TMath::Sqrt(1-fRp[2]*fRp[2]); | |
744 | ||
745 | Double_t m00=-sn, m10=cs; | |
746 | Double_t m23=-pt*(sn + fRp[2]*cs/r), m43=-pt*pt*(r*cs - fRp[2]*sn); | |
747 | Double_t m24= pt*(cs - fRp[2]*sn/r), m44=-pt*pt*(r*sn + fRp[2]*cs); | |
748 | Double_t m35=pt, m45=-pt*pt*fRp[3]; | |
749 | ||
750 | cv[0]=fRc[0]*m00*m00; | |
751 | cv[1]=fRc[0]*m00*m10; | |
752 | cv[2]=fRc[0]*m10*m10; | |
753 | cv[3]=fRc[1]*m00; | |
754 | cv[4]=fRc[1]*m10; | |
755 | cv[5]=fRc[2]; | |
756 | cv[6]=m00*(fRc[3]*m23+fRc[10]*m43); | |
757 | cv[7]=m10*(fRc[3]*m23+fRc[10]*m43); | |
758 | cv[8]=fRc[4]*m23+fRc[11]*m43; | |
759 | cv[9]=m23*(fRc[5]*m23+fRc[12]*m43)+m43*(fRc[12]*m23+fRc[14]*m43); | |
760 | cv[10]=m00*(fRc[3]*m24+fRc[10]*m44); | |
761 | cv[11]=m10*(fRc[3]*m24+fRc[10]*m44); | |
762 | cv[12]=fRc[4]*m24+fRc[11]*m44; | |
763 | cv[13]=m23*(fRc[5]*m24+fRc[12]*m44)+m43*(fRc[12]*m24+fRc[14]*m44); | |
764 | cv[14]=m24*(fRc[5]*m24+fRc[12]*m44)+m44*(fRc[12]*m24+fRc[14]*m44); | |
765 | cv[15]=m00*(fRc[6]*m35+fRc[10]*m45); | |
766 | cv[16]=m10*(fRc[6]*m35+fRc[10]*m45); | |
767 | cv[17]=fRc[7]*m35+fRc[11]*m45; | |
768 | cv[18]=m23*(fRc[8]*m35+fRc[12]*m45)+m43*(fRc[13]*m35+fRc[14]*m45); | |
769 | cv[19]=m24*(fRc[8]*m35+fRc[12]*m45)+m44*(fRc[13]*m35+fRc[14]*m45); | |
770 | cv[20]=m35*(fRc[9]*m35+fRc[13]*m45)+m45*(fRc[13]*m35+fRc[14]*m45); | |
771 | } | |
67c3dcbe | 772 | |
09c96efc | 773 | Bool_t AliESDtrack::GetInnerPxPyPz(Double_t *p) const { |
9b859005 | 774 | //--------------------------------------------------------------------- |
775 | // This function returns the global track momentum components | |
776 | // af the entrance of the TPC | |
777 | //--------------------------------------------------------------------- | |
09c96efc | 778 | p[0]=fIp[4]; p[1]=fIp[2]; p[2]=fIp[3]; |
779 | return Local2GlobalMomentum(p,fIalpha); | |
9b859005 | 780 | } |
781 | ||
09c96efc | 782 | Bool_t AliESDtrack::GetInnerXYZ(Double_t *r) const { |
9b859005 | 783 | //--------------------------------------------------------------------- |
784 | // This function returns the global track position | |
785 | // af the entrance of the TPC | |
786 | //--------------------------------------------------------------------- | |
09c96efc | 787 | if (fIx==0) return kFALSE; |
788 | r[0]=fIx; r[1]=fIp[0]; r[2]=fIp[1]; | |
789 | return Local2GlobalPosition(r,fIalpha); | |
9b859005 | 790 | } |
791 | ||
a866ac60 | 792 | void AliESDtrack::GetInnerExternalParameters(Double_t &x, Double_t p[5]) const |
793 | { | |
794 | //skowron | |
795 | //--------------------------------------------------------------------- | |
796 | // This function returns external representation of the track parameters at Inner Layer of TPC | |
797 | //--------------------------------------------------------------------- | |
798 | x=fIx; | |
799 | for (Int_t i=0; i<5; i++) p[i]=fIp[i]; | |
800 | } | |
801 | void AliESDtrack::GetInnerExternalCovariance(Double_t cov[15]) const | |
802 | { | |
803 | //skowron | |
804 | //--------------------------------------------------------------------- | |
805 | // This function returns external representation of the cov. matrix at Inner Layer of TPC | |
806 | //--------------------------------------------------------------------- | |
807 | for (Int_t i=0; i<15; i++) cov[i]=fIc[i]; | |
808 | ||
809 | } | |
810 | ||
98937d93 | 811 | Int_t AliESDtrack::GetNcls(Int_t idet) const |
812 | { | |
813 | // Get number of clusters by subdetector index | |
814 | // | |
815 | Int_t ncls = 0; | |
816 | switch(idet){ | |
817 | case 0: | |
818 | ncls = fITSncls; | |
819 | break; | |
820 | case 1: | |
821 | ncls = fTPCncls; | |
822 | break; | |
823 | case 2: | |
824 | ncls = fTRDncls; | |
825 | break; | |
826 | case 3: | |
827 | if (fTOFindex != 0) | |
828 | ncls = 1; | |
829 | break; | |
830 | default: | |
831 | break; | |
832 | } | |
833 | return ncls; | |
834 | } | |
835 | ||
836 | Int_t AliESDtrack::GetClusters(Int_t idet, UInt_t *idx) const | |
837 | { | |
838 | // Get cluster index array by subdetector index | |
839 | // | |
840 | Int_t ncls = 0; | |
841 | switch(idet){ | |
842 | case 0: | |
843 | ncls = GetITSclusters(idx); | |
844 | break; | |
845 | case 1: | |
846 | ncls = GetTPCclusters((Int_t *)idx); | |
847 | break; | |
848 | case 2: | |
849 | ncls = GetTRDclusters(idx); | |
850 | break; | |
851 | case 3: | |
852 | if (fTOFindex != 0) { | |
853 | idx[0] = GetTOFcluster(); | |
854 | ncls = 1; | |
855 | } | |
856 | break; | |
857 | default: | |
858 | break; | |
859 | } | |
860 | return ncls; | |
861 | } | |
862 | ||
35f4ab61 | 863 | void AliESDtrack::GetTRDExternalParameters(Double_t &x, Double_t&alpha, Double_t p[5], Double_t cov[15]) const |
c4d11b15 | 864 | { |
865 | // | |
866 | //this function returns TRD parameters | |
867 | // | |
868 | x=fTx; | |
35f4ab61 | 869 | alpha = fTalpha; |
c4d11b15 | 870 | for (Int_t i=0; i<5; i++) p[i]=fTp[i]; |
871 | for (Int_t i=0; i<15; i++) cov[i]=fTc[i]; | |
872 | } | |
873 | ||
c84a5e9e | 874 | Bool_t AliESDtrack::GetPxPyPzAt(Double_t x, Double_t b, Double_t *p) const { |
672b5f43 | 875 | //--------------------------------------------------------------------- |
c84a5e9e | 876 | // This function returns the global track momentum extrapolated to |
877 | // the radial position "x" (cm) in the magnetic field "b" (kG) | |
672b5f43 | 878 | //--------------------------------------------------------------------- |
c84a5e9e | 879 | Double_t convconst=0.299792458*b/1000.; |
09c96efc | 880 | p[0]=fRp[4]; |
c84a5e9e | 881 | p[1]=fRp[2]+(x-fRx)*fRp[4]*convconst; |
09c96efc | 882 | p[2]=fRp[3]; |
883 | return Local2GlobalMomentum(p,fRalpha); | |
672b5f43 | 884 | } |
885 | ||
c84a5e9e | 886 | Bool_t AliESDtrack::GetXYZAt(Double_t x, Double_t b, Double_t *r) const { |
3fd96ae3 | 887 | //--------------------------------------------------------------------- |
c84a5e9e | 888 | // This function returns the global track position extrapolated to |
889 | // the radial position "x" (cm) in the magnetic field "b" (kG) | |
3fd96ae3 | 890 | //--------------------------------------------------------------------- |
c84a5e9e | 891 | Double_t convconst=0.299792458*b/1000.; |
23904d16 | 892 | Double_t dx=x-fRx; |
c84a5e9e | 893 | Double_t f1=fRp[2], f2=f1 + dx*fRp[4]*convconst; |
23904d16 | 894 | |
895 | if (TMath::Abs(f2) >= 0.9999) return kFALSE; | |
896 | ||
897 | Double_t r1=TMath::Sqrt(1.- f1*f1), r2=TMath::Sqrt(1.- f2*f2); | |
09c96efc | 898 | r[0] = x; |
899 | r[1] = fRp[0] + dx*(f1+f2)/(r1+r2); | |
900 | r[2] = fRp[1] + dx*(f1+f2)/(f1*r2 + f2*r1)*fRp[3]; | |
901 | return Local2GlobalPosition(r,fRalpha); | |
23904d16 | 902 | } |
672b5f43 | 903 | |
ae982df3 | 904 | //_______________________________________________________________________ |
905 | void AliESDtrack::GetIntegratedTimes(Double_t *times) const { | |
4427806c | 906 | // Returns the array with integrated times for each particle hypothesis |
304864ab | 907 | for (Int_t i=0; i<AliPID::kSPECIES; i++) times[i]=fTrackTime[i]; |
ae982df3 | 908 | } |
909 | ||
910 | //_______________________________________________________________________ | |
911 | void AliESDtrack::SetIntegratedTimes(const Double_t *times) { | |
4427806c | 912 | // Sets the array with integrated times for each particle hypotesis |
304864ab | 913 | for (Int_t i=0; i<AliPID::kSPECIES; i++) fTrackTime[i]=times[i]; |
ae982df3 | 914 | } |
915 | ||
c630aafd | 916 | //_______________________________________________________________________ |
4427806c | 917 | void AliESDtrack::SetITSpid(const Double_t *p) { |
918 | // Sets values for the probability of each particle type (in ITS) | |
d27bbc79 | 919 | SetPIDValues(fITSr,p,AliPID::kSPECIES); |
c630aafd | 920 | SetStatus(AliESDtrack::kITSpid); |
921 | } | |
922 | ||
babd135a | 923 | void AliESDtrack::SetITSChi2MIP(const Float_t *chi2mip){ |
c4d11b15 | 924 | for (Int_t i=0; i<12; i++) fITSchi2MIP[i]=chi2mip[i]; |
babd135a | 925 | } |
c630aafd | 926 | //_______________________________________________________________________ |
927 | void AliESDtrack::GetITSpid(Double_t *p) const { | |
4427806c | 928 | // Gets the probability of each particle type (in ITS) |
304864ab | 929 | for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fITSr[i]; |
c630aafd | 930 | } |
931 | ||
ae982df3 | 932 | //_______________________________________________________________________ |
933 | Int_t AliESDtrack::GetITSclusters(UInt_t *idx) const { | |
934 | //--------------------------------------------------------------------- | |
935 | // This function returns indices of the assgined ITS clusters | |
936 | //--------------------------------------------------------------------- | |
937 | for (Int_t i=0; i<fITSncls; i++) idx[i]=fITSindex[i]; | |
938 | return fITSncls; | |
939 | } | |
940 | ||
941 | //_______________________________________________________________________ | |
05e445cd | 942 | Int_t AliESDtrack::GetTPCclusters(Int_t *idx) const { |
ae982df3 | 943 | //--------------------------------------------------------------------- |
944 | // This function returns indices of the assgined ITS clusters | |
945 | //--------------------------------------------------------------------- | |
d1420ddf | 946 | if (idx!=0) |
947 | for (Int_t i=0; i<180; i++) idx[i]=fTPCindex[i]; // MI I prefer some constant | |
ae982df3 | 948 | return fTPCncls; |
949 | } | |
8c6a71ab | 950 | |
81e97e0d | 951 | Float_t AliESDtrack::GetTPCdensity(Int_t row0, Int_t row1) const{ |
952 | // | |
953 | // GetDensity of the clusters on given region between row0 and row1 | |
954 | // Dead zone effect takin into acoount | |
955 | // | |
956 | Int_t good = 0; | |
957 | Int_t found = 0; | |
958 | // | |
959 | for (Int_t i=row0;i<=row1;i++){ | |
960 | Int_t index = fTPCindex[i]; | |
961 | if (index!=-1) good++; // track outside of dead zone | |
962 | if (index>0) found++; | |
963 | } | |
964 | Float_t density=0.5; | |
965 | if (good>(row1-row0)*0.5) density = Float_t(found)/Float_t(good); | |
966 | return density; | |
967 | } | |
c84a5e9e | 968 | |
8c6a71ab | 969 | //_______________________________________________________________________ |
970 | void AliESDtrack::SetTPCpid(const Double_t *p) { | |
4427806c | 971 | // Sets values for the probability of each particle type (in TPC) |
d27bbc79 | 972 | SetPIDValues(fTPCr,p,AliPID::kSPECIES); |
8c6a71ab | 973 | SetStatus(AliESDtrack::kTPCpid); |
974 | } | |
975 | ||
976 | //_______________________________________________________________________ | |
977 | void AliESDtrack::GetTPCpid(Double_t *p) const { | |
4427806c | 978 | // Gets the probability of each particle type (in TPC) |
304864ab | 979 | for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTPCr[i]; |
8c6a71ab | 980 | } |
981 | ||
bb2ceb1f | 982 | //_______________________________________________________________________ |
983 | Int_t AliESDtrack::GetTRDclusters(UInt_t *idx) const { | |
984 | //--------------------------------------------------------------------- | |
985 | // This function returns indices of the assgined TRD clusters | |
986 | //--------------------------------------------------------------------- | |
d1420ddf | 987 | if (idx!=0) |
c4d11b15 | 988 | for (Int_t i=0; i<130; i++) idx[i]=fTRDindex[i]; // MI I prefer some constant |
bb2ceb1f | 989 | return fTRDncls; |
990 | } | |
991 | ||
c630aafd | 992 | //_______________________________________________________________________ |
993 | void AliESDtrack::SetTRDpid(const Double_t *p) { | |
4427806c | 994 | // Sets values for the probability of each particle type (in TRD) |
d27bbc79 | 995 | SetPIDValues(fTRDr,p,AliPID::kSPECIES); |
c630aafd | 996 | SetStatus(AliESDtrack::kTRDpid); |
997 | } | |
998 | ||
999 | //_______________________________________________________________________ | |
1000 | void AliESDtrack::GetTRDpid(Double_t *p) const { | |
4427806c | 1001 | // Gets the probability of each particle type (in TRD) |
304864ab | 1002 | for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTRDr[i]; |
c630aafd | 1003 | } |
1004 | ||
79e94bf8 | 1005 | //_______________________________________________________________________ |
1006 | void AliESDtrack::SetTRDpid(Int_t iSpecies, Float_t p) | |
1007 | { | |
4427806c | 1008 | // Sets the probability of particle type iSpecies to p (in TRD) |
79e94bf8 | 1009 | fTRDr[iSpecies] = p; |
1010 | } | |
1011 | ||
1012 | Float_t AliESDtrack::GetTRDpid(Int_t iSpecies) const | |
1013 | { | |
4427806c | 1014 | // Returns the probability of particle type iSpecies (in TRD) |
79e94bf8 | 1015 | return fTRDr[iSpecies]; |
1016 | } | |
1017 | ||
c630aafd | 1018 | //_______________________________________________________________________ |
1019 | void AliESDtrack::SetTOFpid(const Double_t *p) { | |
4427806c | 1020 | // Sets the probability of each particle type (in TOF) |
d27bbc79 | 1021 | SetPIDValues(fTOFr,p,AliPID::kSPECIES); |
c630aafd | 1022 | SetStatus(AliESDtrack::kTOFpid); |
1023 | } | |
1024 | ||
51ad6848 | 1025 | //_______________________________________________________________________ |
1026 | void AliESDtrack::SetTOFLabel(const Int_t *p) { | |
1027 | // Sets (in TOF) | |
1028 | for (Int_t i=0; i<3; i++) fTOFLabel[i]=p[i]; | |
1029 | } | |
1030 | ||
c630aafd | 1031 | //_______________________________________________________________________ |
1032 | void AliESDtrack::GetTOFpid(Double_t *p) const { | |
4427806c | 1033 | // Gets probabilities of each particle type (in TOF) |
304864ab | 1034 | for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTOFr[i]; |
c630aafd | 1035 | } |
1036 | ||
51ad6848 | 1037 | //_______________________________________________________________________ |
1038 | void AliESDtrack::GetTOFLabel(Int_t *p) const { | |
1039 | // Gets (in TOF) | |
1040 | for (Int_t i=0; i<3; i++) p[i]=fTOFLabel[i]; | |
1041 | } | |
1042 | ||
1043 | //_______________________________________________________________________ | |
1044 | void AliESDtrack::GetTOFInfo(Float_t *info) const { | |
1045 | // Gets (in TOF) | |
1046 | for (Int_t i=0; i<10; i++) info[i]=fTOFInfo[i]; | |
1047 | } | |
1048 | ||
1049 | //_______________________________________________________________________ | |
1050 | void AliESDtrack::SetTOFInfo(Float_t*info) { | |
1051 | // Gets (in TOF) | |
1052 | for (Int_t i=0; i<10; i++) fTOFInfo[i]=info[i]; | |
1053 | } | |
1054 | ||
4a78b8c5 | 1055 | |
1056 | ||
1057 | //_______________________________________________________________________ | |
1058 | void AliESDtrack::SetPHOSpid(const Double_t *p) { | |
1059 | // Sets the probability of each particle type (in PHOS) | |
d27bbc79 | 1060 | SetPIDValues(fPHOSr,p,AliPID::kSPECIESN); |
4a78b8c5 | 1061 | SetStatus(AliESDtrack::kPHOSpid); |
1062 | } | |
1063 | ||
1064 | //_______________________________________________________________________ | |
1065 | void AliESDtrack::GetPHOSpid(Double_t *p) const { | |
1066 | // Gets probabilities of each particle type (in PHOS) | |
304864ab | 1067 | for (Int_t i=0; i<AliPID::kSPECIESN; i++) p[i]=fPHOSr[i]; |
4a78b8c5 | 1068 | } |
1069 | ||
704be597 | 1070 | //_______________________________________________________________________ |
1071 | void AliESDtrack::SetEMCALpid(const Double_t *p) { | |
1072 | // Sets the probability of each particle type (in EMCAL) | |
d27bbc79 | 1073 | SetPIDValues(fEMCALr,p,AliPID::kSPECIESN); |
704be597 | 1074 | SetStatus(AliESDtrack::kEMCALpid); |
1075 | } | |
1076 | ||
1077 | //_______________________________________________________________________ | |
1078 | void AliESDtrack::GetEMCALpid(Double_t *p) const { | |
1079 | // Gets probabilities of each particle type (in EMCAL) | |
304864ab | 1080 | for (Int_t i=0; i<AliPID::kSPECIESN; i++) p[i]=fEMCALr[i]; |
704be597 | 1081 | } |
4a78b8c5 | 1082 | |
1083 | //_______________________________________________________________________ | |
1084 | void AliESDtrack::SetRICHpid(const Double_t *p) { | |
1085 | // Sets the probability of each particle type (in RICH) | |
d27bbc79 | 1086 | SetPIDValues(fRICHr,p,AliPID::kSPECIES); |
4a78b8c5 | 1087 | SetStatus(AliESDtrack::kRICHpid); |
1088 | } | |
1089 | ||
1090 | //_______________________________________________________________________ | |
1091 | void AliESDtrack::GetRICHpid(Double_t *p) const { | |
1092 | // Gets probabilities of each particle type (in RICH) | |
304864ab | 1093 | for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fRICHr[i]; |
4a78b8c5 | 1094 | } |
1095 | ||
1096 | ||
1097 | ||
8c6a71ab | 1098 | //_______________________________________________________________________ |
1099 | void AliESDtrack::SetESDpid(const Double_t *p) { | |
4427806c | 1100 | // Sets the probability of each particle type for the ESD track |
d27bbc79 | 1101 | SetPIDValues(fR,p,AliPID::kSPECIES); |
8c6a71ab | 1102 | SetStatus(AliESDtrack::kESDpid); |
1103 | } | |
1104 | ||
1105 | //_______________________________________________________________________ | |
1106 | void AliESDtrack::GetESDpid(Double_t *p) const { | |
4427806c | 1107 | // Gets probability of each particle type for the ESD track |
304864ab | 1108 | for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fR[i]; |
8c6a71ab | 1109 | } |
1110 | ||
ac2f7574 | 1111 | //_______________________________________________________________________ |
1112 | void AliESDtrack::Print(Option_t *) const { | |
1113 | // Prints info on the track | |
1114 | ||
5f7789fc | 1115 | printf("ESD track info\n") ; |
304864ab | 1116 | Double_t p[AliPID::kSPECIESN] ; |
ac2f7574 | 1117 | Int_t index = 0 ; |
1118 | if( IsOn(kITSpid) ){ | |
1119 | printf("From ITS: ") ; | |
1120 | GetITSpid(p) ; | |
304864ab | 1121 | for(index = 0 ; index < AliPID::kSPECIES; index++) |
ac2f7574 | 1122 | printf("%f, ", p[index]) ; |
1123 | printf("\n signal = %f\n", GetITSsignal()) ; | |
1124 | } | |
1125 | if( IsOn(kTPCpid) ){ | |
1126 | printf("From TPC: ") ; | |
1127 | GetTPCpid(p) ; | |
304864ab | 1128 | for(index = 0 ; index < AliPID::kSPECIES; index++) |
ac2f7574 | 1129 | printf("%f, ", p[index]) ; |
1130 | printf("\n signal = %f\n", GetTPCsignal()) ; | |
1131 | } | |
1132 | if( IsOn(kTRDpid) ){ | |
1133 | printf("From TRD: ") ; | |
1134 | GetTRDpid(p) ; | |
304864ab | 1135 | for(index = 0 ; index < AliPID::kSPECIES; index++) |
ac2f7574 | 1136 | printf("%f, ", p[index]) ; |
1137 | printf("\n signal = %f\n", GetTRDsignal()) ; | |
1138 | } | |
1139 | if( IsOn(kTOFpid) ){ | |
1140 | printf("From TOF: ") ; | |
1141 | GetTOFpid(p) ; | |
304864ab | 1142 | for(index = 0 ; index < AliPID::kSPECIES; index++) |
ac2f7574 | 1143 | printf("%f, ", p[index]) ; |
1144 | printf("\n signal = %f\n", GetTOFsignal()) ; | |
1145 | } | |
1146 | if( IsOn(kRICHpid) ){ | |
038834e7 | 1147 | printf("From RICH: ") ; |
ac2f7574 | 1148 | GetRICHpid(p) ; |
304864ab | 1149 | for(index = 0 ; index < AliPID::kSPECIES; index++) |
ac2f7574 | 1150 | printf("%f, ", p[index]) ; |
1151 | printf("\n signal = %f\n", GetRICHsignal()) ; | |
1152 | } | |
1153 | if( IsOn(kPHOSpid) ){ | |
1154 | printf("From PHOS: ") ; | |
1155 | GetPHOSpid(p) ; | |
304864ab | 1156 | for(index = 0 ; index < AliPID::kSPECIESN; index++) |
ac2f7574 | 1157 | printf("%f, ", p[index]) ; |
1158 | printf("\n signal = %f\n", GetPHOSsignal()) ; | |
1159 | } | |
704be597 | 1160 | if( IsOn(kEMCALpid) ){ |
1161 | printf("From EMCAL: ") ; | |
1162 | GetEMCALpid(p) ; | |
304864ab | 1163 | for(index = 0 ; index < AliPID::kSPECIESN; index++) |
704be597 | 1164 | printf("%f, ", p[index]) ; |
1165 | printf("\n signal = %f\n", GetEMCALsignal()) ; | |
1166 | } | |
ac2f7574 | 1167 | } |