]>
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 | ||
e1e6896f | 23 | #include <TMath.h> |
ae982df3 | 24 | |
49d13e89 | 25 | #include "AliESDVertex.h" |
ae982df3 | 26 | #include "AliESDtrack.h" |
27 | #include "AliKalmanTrack.h" | |
5f7789fc | 28 | #include "AliLog.h" |
15e85efa | 29 | #include "AliTrackPointArray.h" |
ae982df3 | 30 | |
31 | ClassImp(AliESDtrack) | |
32 | ||
d27bbc79 | 33 | void SetPIDValues(Float_t * dest, const Double_t * src, Int_t n) { |
34 | // This function copies "n" PID weights from "scr" to "dest" | |
35 | // and normalizes their sum to 1 thus producing conditional probabilities. | |
36 | // The negative weights are set to 0. | |
37 | // In case all the weights are non-positive they are replaced by | |
38 | // uniform probabilities | |
39 | ||
40 | if (n<=0) return; | |
41 | ||
42 | Float_t uniform = 1./(Float_t)n; | |
43 | ||
44 | Float_t sum = 0; | |
45 | for (Int_t i=0; i<n; i++) | |
46 | if (src[i]>=0) { | |
47 | sum+=src[i]; | |
48 | dest[i] = src[i]; | |
49 | } | |
50 | else { | |
51 | dest[i] = 0; | |
52 | } | |
53 | ||
54 | if(sum>0) | |
55 | for (Int_t i=0; i<n; i++) dest[i] /= sum; | |
56 | else | |
57 | for (Int_t i=0; i<n; i++) dest[i] = uniform; | |
58 | } | |
59 | ||
ae982df3 | 60 | //_______________________________________________________________________ |
61 | AliESDtrack::AliESDtrack() : | |
c9ec41e8 | 62 | AliExternalTrackParam(), |
90e48c0c | 63 | fFlags(0), |
64 | fLabel(0), | |
65 | fID(0), | |
66 | fTrackLength(0), | |
49d13e89 | 67 | fD(0),fZ(0), |
68 | fCdd(0),fCdz(0),fCzz(0), | |
90e48c0c | 69 | fStopVertex(0), |
c9ec41e8 | 70 | fCp(0), |
90e48c0c | 71 | fCchi2(1e10), |
c9ec41e8 | 72 | fIp(0), |
73 | fOp(0), | |
90e48c0c | 74 | fITSchi2(0), |
75 | fITSncls(0), | |
76 | fITSsignal(0), | |
77 | fITSLabel(0), | |
90e48c0c | 78 | fTPCchi2(0), |
79 | fTPCncls(0), | |
e1d4c1b5 | 80 | fTPCnclsF(0), |
90e48c0c | 81 | fTPCClusterMap(159),//number of padrows |
82 | fTPCsignal(0), | |
e1d4c1b5 | 83 | fTPCsignalN(0), |
84 | fTPCsignalS(0), | |
90e48c0c | 85 | fTPCLabel(0), |
86 | fTRDchi2(0), | |
87 | fTRDncls(0), | |
88 | fTRDncls0(0), | |
89 | fTRDsignal(0), | |
90 | fTRDLabel(0), | |
91 | fTRDQuality(0), | |
23d49657 | 92 | fTRDBudget(0), |
90e48c0c | 93 | fTOFchi2(0), |
94 | fTOFindex(0), | |
85324138 | 95 | fTOFCalChannel(-1), |
90e48c0c | 96 | fTOFsignal(-1), |
85324138 | 97 | fTOFsignalToT(0), |
90e48c0c | 98 | fRICHchi2(1e10), |
99 | fRICHncls(0), | |
100 | fRICHindex(0), | |
101 | fRICHsignal(-1), | |
2714766e | 102 | fRICHtheta(-1), |
103 | fRICHphi(-1), | |
104 | fRICHdx(-1), | |
105 | fRICHdy(-1), | |
106 | fRICHmipX(-1), | |
107 | fRICHmipY(-1), | |
2e1dcd14 | 108 | fEMCALindex(kEMCALNoMatch), |
15e85efa | 109 | fPoints(0), |
110 | fFriendTrack(new AliESDfriendTrack()) | |
ae982df3 | 111 | { |
112 | // | |
113 | // The default ESD constructor | |
114 | // | |
6d45eaef | 115 | Int_t i, j; |
6238d7a9 | 116 | for (i=0; i<AliPID::kSPECIES; i++) { |
4a78b8c5 | 117 | fTrackTime[i]=0.; |
118 | fR[i]=1.; | |
119 | fITSr[i]=1.; | |
120 | fTPCr[i]=1.; | |
121 | fTRDr[i]=1.; | |
122 | fTOFr[i]=1.; | |
4a78b8c5 | 123 | fRICHr[i]=1.; |
2bad268c | 124 | } |
ac2f7574 | 125 | |
ef7253ac | 126 | for (i=0; i<3; i++) { fKinkIndexes[i]=0;} |
127 | for (i=0; i<3; i++) { fV0Indexes[i]=-1;} | |
6d45eaef | 128 | for (i=0;i<kNPlane;i++) { |
129 | for (j=0;j<kNSlice;j++) { | |
130 | fTRDsignals[i][j]=0.; | |
131 | } | |
132 | fTRDTimBin[i]=-1; | |
133 | } | |
c9ec41e8 | 134 | for (i=0;i<4;i++) {fTPCPoints[i]=-1;} |
135 | for (i=0;i<3;i++) {fTOFLabel[i]=-1;} | |
136 | for (i=0;i<10;i++) {fTOFInfo[i]=-1;} | |
c4d11b15 | 137 | } |
138 | ||
139 | //_______________________________________________________________________ | |
90e48c0c | 140 | AliESDtrack::AliESDtrack(const AliESDtrack& track): |
c9ec41e8 | 141 | AliExternalTrackParam(track), |
90e48c0c | 142 | fFlags(track.fFlags), |
143 | fLabel(track.fLabel), | |
144 | fID(track.fID), | |
145 | fTrackLength(track.fTrackLength), | |
49d13e89 | 146 | fD(track.fD),fZ(track.fZ), |
147 | fCdd(track.fCdd),fCdz(track.fCdz),fCzz(track.fCzz), | |
90e48c0c | 148 | fStopVertex(track.fStopVertex), |
c9ec41e8 | 149 | fCp(0), |
90e48c0c | 150 | fCchi2(track.fCchi2), |
c9ec41e8 | 151 | fIp(0), |
152 | fOp(0), | |
90e48c0c | 153 | fITSchi2(track.fITSchi2), |
154 | fITSncls(track.fITSncls), | |
155 | fITSsignal(track.fITSsignal), | |
156 | fITSLabel(track.fITSLabel), | |
90e48c0c | 157 | fTPCchi2(track.fTPCchi2), |
158 | fTPCncls(track.fTPCncls), | |
e1d4c1b5 | 159 | fTPCnclsF(track.fTPCnclsF), |
90e48c0c | 160 | fTPCClusterMap(track.fTPCClusterMap), |
161 | fTPCsignal(track.fTPCsignal), | |
e1d4c1b5 | 162 | fTPCsignalN(track.fTPCsignalN), |
163 | fTPCsignalS(track.fTPCsignalS), | |
90e48c0c | 164 | fTPCLabel(track.fTPCLabel), |
165 | fTRDchi2(track.fTRDchi2), | |
166 | fTRDncls(track.fTRDncls), | |
167 | fTRDncls0(track.fTRDncls0), | |
168 | fTRDsignal(track.fTRDsignal), | |
169 | fTRDLabel(track.fTRDLabel), | |
170 | fTRDQuality(track.fTRDQuality), | |
23d49657 | 171 | fTRDBudget(track.fTRDBudget), |
90e48c0c | 172 | fTOFchi2(track.fTOFchi2), |
173 | fTOFindex(track.fTOFindex), | |
85324138 | 174 | fTOFCalChannel(track.fTOFCalChannel), |
90e48c0c | 175 | fTOFsignal(track.fTOFsignal), |
85324138 | 176 | fTOFsignalToT(track.fTOFsignalToT), |
90e48c0c | 177 | fRICHchi2(track.fRICHchi2), |
178 | fRICHncls(track.fRICHncls), | |
179 | fRICHindex(track.fRICHindex), | |
180 | fRICHsignal(track.fRICHsignal), | |
181 | fRICHtheta(track.fRICHtheta), | |
182 | fRICHphi(track.fRICHphi), | |
183 | fRICHdx(track.fRICHdx), | |
6238d7a9 | 184 | fRICHdy(track.fRICHdy), |
185 | fRICHmipX(track.fRICHmipX), | |
15e85efa | 186 | fRICHmipY(track.fRICHmipY), |
2e1dcd14 | 187 | fEMCALindex(track.fEMCALindex), |
15e85efa | 188 | fPoints(0), |
8497bca0 | 189 | fFriendTrack(0) |
90e48c0c | 190 | { |
c4d11b15 | 191 | // |
192 | //copy constructor | |
193 | // | |
ef7253ac | 194 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i]=track.fTrackTime[i]; |
195 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fR[i]=track.fR[i]; | |
c4d11b15 | 196 | // |
304864ab | 197 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fITSr[i]=track.fITSr[i]; |
c4d11b15 | 198 | // |
304864ab | 199 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=track.fTPCr[i]; |
51ad6848 | 200 | for (Int_t i=0;i<4;i++) {fTPCPoints[i]=track.fTPCPoints[i];} |
201 | for (Int_t i=0; i<3;i++) { fKinkIndexes[i]=track.fKinkIndexes[i];} | |
202 | for (Int_t i=0; i<3;i++) { fV0Indexes[i]=track.fV0Indexes[i];} | |
c4d11b15 | 203 | // |
eab5961e | 204 | for (Int_t i=0;i<kNPlane;i++) { |
6d45eaef | 205 | for (Int_t j=0;j<kNSlice;j++) { |
206 | fTRDsignals[i][j]=track.fTRDsignals[i][j]; | |
207 | } | |
208 | fTRDTimBin[i]=track.fTRDTimBin[i]; | |
eab5961e | 209 | } |
304864ab | 210 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTRDr[i]=track.fTRDr[i]; |
304864ab | 211 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTOFr[i]=track.fTOFr[i]; |
51ad6848 | 212 | for (Int_t i=0;i<3;i++) fTOFLabel[i]=track.fTOFLabel[i]; |
213 | for (Int_t i=0;i<10;i++) fTOFInfo[i]=track.fTOFInfo[i]; | |
304864ab | 214 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fRICHr[i]=track.fRICHr[i]; |
c9ec41e8 | 215 | |
216 | if (track.fCp) fCp=new AliExternalTrackParam(*track.fCp); | |
217 | if (track.fIp) fIp=new AliExternalTrackParam(*track.fIp); | |
218 | if (track.fOp) fOp=new AliExternalTrackParam(*track.fOp); | |
15e85efa | 219 | |
220 | if (track.fPoints) fPoints=new AliTrackPointArray(*(track.fPoints)); | |
8497bca0 | 221 | if (track.fFriendTrack) fFriendTrack=new AliESDfriendTrack(*(track.fFriendTrack)); |
ae982df3 | 222 | } |
15e85efa | 223 | |
c4d11b15 | 224 | //_______________________________________________________________________ |
225 | AliESDtrack::~AliESDtrack(){ | |
226 | // | |
227 | // This is destructor according Coding Conventrions | |
228 | // | |
229 | //printf("Delete track\n"); | |
c9ec41e8 | 230 | delete fIp; |
231 | delete fOp; | |
232 | delete fCp; | |
15e85efa | 233 | delete fFriendTrack; |
98937d93 | 234 | delete fPoints; |
c4d11b15 | 235 | } |
ae982df3 | 236 | |
00dce61a | 237 | void AliESDtrack::AddCalibObject(TObject * object){ |
238 | // | |
239 | // add calib object to the list | |
240 | // | |
241 | if (!fFriendTrack) fFriendTrack = new AliESDfriendTrack; | |
242 | fFriendTrack->AddCalibObject(object); | |
243 | } | |
244 | ||
245 | TObject * AliESDtrack::GetCalibObject(Int_t index){ | |
246 | // | |
247 | // return calib objct at given position | |
248 | // | |
249 | if (!fFriendTrack) return 0; | |
250 | return fFriendTrack->GetCalibObject(index); | |
251 | } | |
252 | ||
253 | ||
9559cbc4 | 254 | //_______________________________________________________________________ |
255 | void AliESDtrack::MakeMiniESDtrack(){ | |
256 | // Resets everything except | |
257 | // fFlags: Reconstruction status flags | |
258 | // fLabel: Track label | |
259 | // fID: Unique ID of the track | |
260 | // fD: Impact parameter in XY-plane | |
261 | // fZ: Impact parameter in Z | |
262 | // fR[AliPID::kSPECIES]: combined "detector response probability" | |
8497bca0 | 263 | // Running track parameters in the base class (AliExternalTrackParam) |
9559cbc4 | 264 | |
265 | fTrackLength = 0; | |
266 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTrackTime[i] = 0; | |
267 | fStopVertex = 0; | |
268 | ||
269 | // Reset track parameters constrained to the primary vertex | |
c9ec41e8 | 270 | fCp = 0; |
9559cbc4 | 271 | fCchi2 = 0; |
272 | ||
273 | // Reset track parameters at the inner wall of TPC | |
c9ec41e8 | 274 | fIp = 0; |
9559cbc4 | 275 | |
276 | // Reset track parameters at the inner wall of the TRD | |
c9ec41e8 | 277 | fOp = 0; |
9559cbc4 | 278 | |
279 | // Reset ITS track related information | |
280 | fITSchi2 = 0; | |
9559cbc4 | 281 | fITSncls = 0; |
9559cbc4 | 282 | fITSsignal = 0; |
ef7253ac | 283 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fITSr[i]=0; |
9559cbc4 | 284 | fITSLabel = 0; |
9559cbc4 | 285 | |
286 | // Reset TPC related track information | |
287 | fTPCchi2 = 0; | |
288 | fTPCncls = 0; | |
e1d4c1b5 | 289 | fTPCnclsF = 0; |
9559cbc4 | 290 | fTPCClusterMap = 0; |
291 | fTPCsignal= 0; | |
e1d4c1b5 | 292 | fTPCsignalS= 0; |
293 | fTPCsignalN= 0; | |
9559cbc4 | 294 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTPCr[i]=0; |
295 | fTPCLabel=0; | |
296 | for (Int_t i=0;i<4;i++) fTPCPoints[i] = 0; | |
297 | for (Int_t i=0; i<3;i++) fKinkIndexes[i] = 0; | |
298 | for (Int_t i=0; i<3;i++) fV0Indexes[i] = 0; | |
299 | ||
300 | // Reset TRD related track information | |
301 | fTRDchi2 = 0; | |
302 | fTRDncls = 0; | |
303 | fTRDncls0 = 0; | |
9559cbc4 | 304 | fTRDsignal = 0; |
305 | for (Int_t i=0;i<kNPlane;i++) { | |
6d45eaef | 306 | for (Int_t j=0;j<kNSlice;j++) { |
307 | fTRDsignals[i][j] = 0; | |
308 | } | |
309 | fTRDTimBin[i] = 0; | |
9559cbc4 | 310 | } |
311 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTRDr[i] = 0; | |
312 | fTRDLabel = 0; | |
9559cbc4 | 313 | fTRDQuality = 0; |
23d49657 | 314 | fTRDBudget = 0; |
9559cbc4 | 315 | |
316 | // Reset TOF related track information | |
317 | fTOFchi2 = 0; | |
318 | fTOFindex = 0; | |
319 | fTOFsignal = 0; | |
85324138 | 320 | fTOFCalChannel = -1; |
321 | fTOFsignalToT = 0; | |
9559cbc4 | 322 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fTOFr[i] = 0; |
323 | for (Int_t i=0;i<3;i++) fTOFLabel[i] = 0; | |
324 | for (Int_t i=0;i<10;i++) fTOFInfo[i] = 0; | |
325 | ||
9559cbc4 | 326 | // Reset RICH related track information |
327 | fRICHchi2 = 0; | |
328 | fRICHncls = 0; | |
329 | fRICHindex = 0; | |
330 | fRICHsignal = 0; | |
331 | for (Int_t i=0;i<AliPID::kSPECIES;i++) fRICHr[i] = 0; | |
332 | fRICHtheta = 0; | |
333 | fRICHphi = 0; | |
334 | fRICHdx = 0; | |
335 | fRICHdy = 0; | |
8497bca0 | 336 | fRICHmipX = 0; |
337 | fRICHmipY = 0; | |
2e1dcd14 | 338 | fEMCALindex = kEMCALNoMatch; |
9559cbc4 | 339 | |
15e85efa | 340 | delete fFriendTrack; fFriendTrack = 0; |
341 | delete fPoints; fPoints = 0; | |
9559cbc4 | 342 | } |
ae982df3 | 343 | //_______________________________________________________________________ |
4a78b8c5 | 344 | Double_t AliESDtrack::GetMass() const { |
4427806c | 345 | // Returns the mass of the most probable particle type |
ae982df3 | 346 | Float_t max=0.; |
347 | Int_t k=-1; | |
304864ab | 348 | for (Int_t i=0; i<AliPID::kSPECIES; i++) { |
ae982df3 | 349 | if (fR[i]>max) {k=i; max=fR[i];} |
350 | } | |
db3989b3 | 351 | if (k==0) { // dE/dx "crossing points" in the TPC |
352 | Double_t p=GetP(); | |
353 | if ((p>0.38)&&(p<0.48)) | |
304864ab | 354 | if (fR[0]<fR[3]*10.) return AliPID::ParticleMass(AliPID::kKaon); |
db3989b3 | 355 | if ((p>0.75)&&(p<0.85)) |
304864ab | 356 | if (fR[0]<fR[4]*10.) return AliPID::ParticleMass(AliPID::kProton); |
db3989b3 | 357 | return 0.00051; |
358 | } | |
304864ab | 359 | if (k==1) return AliPID::ParticleMass(AliPID::kMuon); |
360 | if (k==2||k==-1) return AliPID::ParticleMass(AliPID::kPion); | |
361 | if (k==3) return AliPID::ParticleMass(AliPID::kKaon); | |
362 | if (k==4) return AliPID::ParticleMass(AliPID::kProton); | |
5f7789fc | 363 | AliWarning("Undefined mass !"); |
304864ab | 364 | return AliPID::ParticleMass(AliPID::kPion); |
ae982df3 | 365 | } |
366 | ||
367 | //_______________________________________________________________________ | |
c9ec41e8 | 368 | Bool_t AliESDtrack::UpdateTrackParams(const AliKalmanTrack *t, ULong_t flags){ |
ae982df3 | 369 | // |
370 | // This function updates track's running parameters | |
371 | // | |
15e85efa | 372 | Int_t *index=0; |
15614b8b | 373 | Bool_t rc=kTRUE; |
374 | ||
9b859005 | 375 | SetStatus(flags); |
376 | fLabel=t->GetLabel(); | |
377 | ||
378 | if (t->IsStartedTimeIntegral()) { | |
379 | SetStatus(kTIME); | |
380 | Double_t times[10];t->GetIntegratedTimes(times); SetIntegratedTimes(times); | |
381 | SetIntegratedLength(t->GetIntegratedLength()); | |
382 | } | |
383 | ||
6c94f330 | 384 | Set(t->GetX(),t->GetAlpha(),t->GetParameter(),t->GetCovariance()); |
e1d4c1b5 | 385 | |
ae982df3 | 386 | switch (flags) { |
ad2f1f2b | 387 | |
9b859005 | 388 | case kITSin: case kITSout: case kITSrefit: |
15e85efa | 389 | index=fFriendTrack->GetITSindices(); |
390 | for (Int_t i=0;i<AliESDfriendTrack::kMaxITScluster;i++) | |
391 | index[i]=t->GetClusterIndex(i); | |
ae982df3 | 392 | fITSncls=t->GetNumberOfClusters(); |
393 | fITSchi2=t->GetChi2(); | |
ae982df3 | 394 | fITSsignal=t->GetPIDsignal(); |
6e5b1b04 | 395 | fITSLabel = t->GetLabel(); |
ae982df3 | 396 | break; |
ad2f1f2b | 397 | |
9b859005 | 398 | case kTPCin: case kTPCrefit: |
6e5b1b04 | 399 | fTPCLabel = t->GetLabel(); |
c9ec41e8 | 400 | if (!fIp) fIp=new AliExternalTrackParam(*t); |
6c94f330 | 401 | else |
402 | fIp->Set(t->GetX(),t->GetAlpha(),t->GetParameter(),t->GetCovariance()); | |
9b859005 | 403 | case kTPCout: |
15e85efa | 404 | index=fFriendTrack->GetTPCindices(); |
1d303a24 | 405 | if (flags & kTPCout){ |
406 | if (!fOp) fOp=new AliExternalTrackParam(*t); | |
6c94f330 | 407 | else |
408 | fOp->Set(t->GetX(),t->GetAlpha(),t->GetParameter(),t->GetCovariance()); | |
1d303a24 | 409 | } |
e1d4c1b5 | 410 | fTPCncls=t->GetNumberOfClusters(); |
ae982df3 | 411 | fTPCchi2=t->GetChi2(); |
a866ac60 | 412 | |
413 | {//prevrow must be declared in separate namespace, otherwise compiler cries: | |
414 | //"jump to case label crosses initialization of `Int_t prevrow'" | |
415 | Int_t prevrow = -1; | |
6e5b1b04 | 416 | // for (Int_t i=0;i<fTPCncls;i++) |
15e85efa | 417 | for (Int_t i=0;i<AliESDfriendTrack::kMaxTPCcluster;i++) |
a866ac60 | 418 | { |
15e85efa | 419 | index[i]=t->GetClusterIndex(i); |
420 | Int_t idx = index[i]; | |
a866ac60 | 421 | |
15e85efa | 422 | if (idx<0) continue; |
9fe5b2ff | 423 | |
a866ac60 | 424 | // Piotr's Cluster Map for HBT |
425 | // ### please change accordingly if cluster array is changing | |
426 | // to "New TPC Tracking" style (with gaps in array) | |
a866ac60 | 427 | Int_t sect = (idx&0xff000000)>>24; |
428 | Int_t row = (idx&0x00ff0000)>>16; | |
429 | if (sect > 18) row +=63; //if it is outer sector, add number of inner sectors | |
430 | ||
431 | fTPCClusterMap.SetBitNumber(row,kTRUE); | |
432 | ||
433 | //Fill the gap between previous row and this row with 0 bits | |
434 | //In case ### pleas change it as well - just set bit 0 in case there | |
435 | //is no associated clusters for current "i" | |
436 | if (prevrow < 0) | |
437 | { | |
438 | prevrow = row;//if previous bit was not assigned yet == this is the first one | |
439 | } | |
440 | else | |
441 | { //we don't know the order (inner to outer or reverse) | |
442 | //just to be save in case it is going to change | |
443 | Int_t n = 0, m = 0; | |
444 | if (prevrow < row) | |
445 | { | |
446 | n = prevrow; | |
447 | m = row; | |
448 | } | |
449 | else | |
450 | { | |
451 | n = row; | |
452 | m = prevrow; | |
453 | } | |
454 | ||
455 | for (Int_t j = n+1; j < m; j++) | |
456 | { | |
457 | fTPCClusterMap.SetBitNumber(j,kFALSE); | |
458 | } | |
459 | prevrow = row; | |
460 | } | |
461 | // End Of Piotr's Cluster Map for HBT | |
462 | } | |
463 | } | |
ae982df3 | 464 | fTPCsignal=t->GetPIDsignal(); |
ae982df3 | 465 | break; |
9b859005 | 466 | |
23904d16 | 467 | case kTRDout: case kTRDin: case kTRDrefit: |
15e85efa | 468 | index=fFriendTrack->GetTRDindices(); |
51ad6848 | 469 | fTRDLabel = t->GetLabel(); |
79e94bf8 | 470 | fTRDncls=t->GetNumberOfClusters(); |
471 | fTRDchi2=t->GetChi2(); | |
15e85efa | 472 | for (Int_t i=0;i<fTRDncls;i++) index[i]=t->GetClusterIndex(i); |
79e94bf8 | 473 | fTRDsignal=t->GetPIDsignal(); |
474 | break; | |
c4d11b15 | 475 | case kTRDbackup: |
c9ec41e8 | 476 | if (!fOp) fOp=new AliExternalTrackParam(*t); |
6c94f330 | 477 | else |
478 | fOp->Set(t->GetX(),t->GetAlpha(),t->GetParameter(),t->GetCovariance()); | |
c4d11b15 | 479 | fTRDncls0 = t->GetNumberOfClusters(); |
480 | break; | |
481 | case kTOFin: | |
482 | break; | |
483 | case kTOFout: | |
484 | break; | |
d0862fea | 485 | case kTRDStop: |
486 | break; | |
ae982df3 | 487 | default: |
5f7789fc | 488 | AliError("Wrong flag !"); |
ae982df3 | 489 | return kFALSE; |
490 | } | |
491 | ||
15614b8b | 492 | return rc; |
ae982df3 | 493 | } |
494 | ||
495 | //_______________________________________________________________________ | |
496 | void AliESDtrack::GetExternalParameters(Double_t &x, Double_t p[5]) const { | |
497 | //--------------------------------------------------------------------- | |
498 | // This function returns external representation of the track parameters | |
499 | //--------------------------------------------------------------------- | |
c9ec41e8 | 500 | x=GetX(); |
501 | for (Int_t i=0; i<5; i++) p[i]=GetParameter()[i]; | |
15614b8b | 502 | } |
503 | ||
67c3dcbe | 504 | //_______________________________________________________________________ |
a866ac60 | 505 | void AliESDtrack::GetExternalCovariance(Double_t cov[15]) const { |
67c3dcbe | 506 | //--------------------------------------------------------------------- |
507 | // This function returns external representation of the cov. matrix | |
508 | //--------------------------------------------------------------------- | |
c9ec41e8 | 509 | for (Int_t i=0; i<15; i++) cov[i]=AliExternalTrackParam::GetCovariance()[i]; |
67c3dcbe | 510 | } |
511 | ||
67c3dcbe | 512 | //_______________________________________________________________________ |
c0b978f0 | 513 | Bool_t AliESDtrack::GetConstrainedExternalParameters |
514 | (Double_t &alpha, Double_t &x, Double_t p[5]) const { | |
67c3dcbe | 515 | //--------------------------------------------------------------------- |
516 | // This function returns the constrained external track parameters | |
517 | //--------------------------------------------------------------------- | |
c0b978f0 | 518 | if (!fCp) return kFALSE; |
519 | alpha=fCp->GetAlpha(); | |
c9ec41e8 | 520 | x=fCp->GetX(); |
521 | for (Int_t i=0; i<5; i++) p[i]=fCp->GetParameter()[i]; | |
c0b978f0 | 522 | return kTRUE; |
67c3dcbe | 523 | } |
c9ec41e8 | 524 | |
67c3dcbe | 525 | //_______________________________________________________________________ |
c0b978f0 | 526 | Bool_t |
67c3dcbe | 527 | AliESDtrack::GetConstrainedExternalCovariance(Double_t c[15]) const { |
528 | //--------------------------------------------------------------------- | |
529 | // This function returns the constrained external cov. matrix | |
530 | //--------------------------------------------------------------------- | |
c0b978f0 | 531 | if (!fCp) return kFALSE; |
c9ec41e8 | 532 | for (Int_t i=0; i<15; i++) c[i]=fCp->GetCovariance()[i]; |
c0b978f0 | 533 | return kTRUE; |
67c3dcbe | 534 | } |
535 | ||
c0b978f0 | 536 | Bool_t |
537 | AliESDtrack::GetInnerExternalParameters | |
538 | (Double_t &alpha, Double_t &x, Double_t p[5]) const { | |
539 | //--------------------------------------------------------------------- | |
c9ec41e8 | 540 | // This function returns external representation of the track parameters |
541 | // at the inner layer of TPC | |
9b859005 | 542 | //--------------------------------------------------------------------- |
c0b978f0 | 543 | if (!fIp) return kFALSE; |
544 | alpha=fIp->GetAlpha(); | |
c9ec41e8 | 545 | x=fIp->GetX(); |
546 | for (Int_t i=0; i<5; i++) p[i]=fIp->GetParameter()[i]; | |
c0b978f0 | 547 | return kTRUE; |
9b859005 | 548 | } |
549 | ||
c0b978f0 | 550 | Bool_t |
551 | AliESDtrack::GetInnerExternalCovariance(Double_t cov[15]) const { | |
c9ec41e8 | 552 | //--------------------------------------------------------------------- |
553 | // This function returns external representation of the cov. matrix | |
554 | // at the inner layer of TPC | |
555 | //--------------------------------------------------------------------- | |
c0b978f0 | 556 | if (!fIp) return kFALSE; |
c9ec41e8 | 557 | for (Int_t i=0; i<15; i++) cov[i]=fIp->GetCovariance()[i]; |
c0b978f0 | 558 | return kTRUE; |
9b859005 | 559 | } |
560 | ||
c0b978f0 | 561 | Bool_t |
562 | AliESDtrack::GetOuterExternalParameters | |
563 | (Double_t &alpha, Double_t &x, Double_t p[5]) const { | |
564 | //--------------------------------------------------------------------- | |
c9ec41e8 | 565 | // This function returns external representation of the track parameters |
566 | // at the inner layer of TRD | |
a866ac60 | 567 | //--------------------------------------------------------------------- |
c0b978f0 | 568 | if (!fOp) return kFALSE; |
569 | alpha=fOp->GetAlpha(); | |
c9ec41e8 | 570 | x=fOp->GetX(); |
571 | for (Int_t i=0; i<5; i++) p[i]=fOp->GetParameter()[i]; | |
c0b978f0 | 572 | return kTRUE; |
a866ac60 | 573 | } |
c9ec41e8 | 574 | |
c0b978f0 | 575 | Bool_t |
576 | AliESDtrack::GetOuterExternalCovariance(Double_t cov[15]) const { | |
a866ac60 | 577 | //--------------------------------------------------------------------- |
c9ec41e8 | 578 | // This function returns external representation of the cov. matrix |
579 | // at the inner layer of TRD | |
a866ac60 | 580 | //--------------------------------------------------------------------- |
c0b978f0 | 581 | if (!fOp) return kFALSE; |
c9ec41e8 | 582 | for (Int_t i=0; i<15; i++) cov[i]=fOp->GetCovariance()[i]; |
c0b978f0 | 583 | return kTRUE; |
a866ac60 | 584 | } |
585 | ||
98937d93 | 586 | Int_t AliESDtrack::GetNcls(Int_t idet) const |
587 | { | |
588 | // Get number of clusters by subdetector index | |
589 | // | |
590 | Int_t ncls = 0; | |
591 | switch(idet){ | |
592 | case 0: | |
593 | ncls = fITSncls; | |
594 | break; | |
595 | case 1: | |
596 | ncls = fTPCncls; | |
597 | break; | |
598 | case 2: | |
599 | ncls = fTRDncls; | |
600 | break; | |
601 | case 3: | |
602 | if (fTOFindex != 0) | |
603 | ncls = 1; | |
604 | break; | |
605 | default: | |
606 | break; | |
607 | } | |
608 | return ncls; | |
609 | } | |
610 | ||
ef7253ac | 611 | Int_t AliESDtrack::GetClusters(Int_t idet, Int_t *idx) const |
98937d93 | 612 | { |
613 | // Get cluster index array by subdetector index | |
614 | // | |
615 | Int_t ncls = 0; | |
616 | switch(idet){ | |
617 | case 0: | |
618 | ncls = GetITSclusters(idx); | |
619 | break; | |
620 | case 1: | |
ef7253ac | 621 | ncls = GetTPCclusters(idx); |
98937d93 | 622 | break; |
623 | case 2: | |
624 | ncls = GetTRDclusters(idx); | |
625 | break; | |
626 | case 3: | |
627 | if (fTOFindex != 0) { | |
628 | idx[0] = GetTOFcluster(); | |
629 | ncls = 1; | |
630 | } | |
631 | break; | |
632 | default: | |
633 | break; | |
634 | } | |
635 | return ncls; | |
636 | } | |
637 | ||
ae982df3 | 638 | //_______________________________________________________________________ |
639 | void AliESDtrack::GetIntegratedTimes(Double_t *times) const { | |
4427806c | 640 | // Returns the array with integrated times for each particle hypothesis |
304864ab | 641 | for (Int_t i=0; i<AliPID::kSPECIES; i++) times[i]=fTrackTime[i]; |
ae982df3 | 642 | } |
643 | ||
644 | //_______________________________________________________________________ | |
645 | void AliESDtrack::SetIntegratedTimes(const Double_t *times) { | |
4427806c | 646 | // Sets the array with integrated times for each particle hypotesis |
304864ab | 647 | for (Int_t i=0; i<AliPID::kSPECIES; i++) fTrackTime[i]=times[i]; |
ae982df3 | 648 | } |
649 | ||
c630aafd | 650 | //_______________________________________________________________________ |
4427806c | 651 | void AliESDtrack::SetITSpid(const Double_t *p) { |
652 | // Sets values for the probability of each particle type (in ITS) | |
d27bbc79 | 653 | SetPIDValues(fITSr,p,AliPID::kSPECIES); |
c630aafd | 654 | SetStatus(AliESDtrack::kITSpid); |
655 | } | |
656 | ||
657 | //_______________________________________________________________________ | |
658 | void AliESDtrack::GetITSpid(Double_t *p) const { | |
4427806c | 659 | // Gets the probability of each particle type (in ITS) |
304864ab | 660 | for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fITSr[i]; |
c630aafd | 661 | } |
662 | ||
ae982df3 | 663 | //_______________________________________________________________________ |
ef7253ac | 664 | Int_t AliESDtrack::GetITSclusters(Int_t *idx) const { |
ae982df3 | 665 | //--------------------------------------------------------------------- |
666 | // This function returns indices of the assgined ITS clusters | |
667 | //--------------------------------------------------------------------- | |
15e85efa | 668 | if (idx!=0) { |
669 | Int_t *index=fFriendTrack->GetITSindices(); | |
670 | for (Int_t i=0; i<AliESDfriendTrack::kMaxITScluster; i++) idx[i]=index[i]; | |
671 | } | |
ae982df3 | 672 | return fITSncls; |
673 | } | |
674 | ||
675 | //_______________________________________________________________________ | |
05e445cd | 676 | Int_t AliESDtrack::GetTPCclusters(Int_t *idx) const { |
ae982df3 | 677 | //--------------------------------------------------------------------- |
678 | // This function returns indices of the assgined ITS clusters | |
679 | //--------------------------------------------------------------------- | |
15e85efa | 680 | if (idx!=0) { |
681 | Int_t *index=fFriendTrack->GetTPCindices(); | |
682 | for (Int_t i=0; i<AliESDfriendTrack::kMaxTPCcluster; i++) idx[i]=index[i]; | |
683 | } | |
ae982df3 | 684 | return fTPCncls; |
685 | } | |
8c6a71ab | 686 | |
81e97e0d | 687 | Float_t AliESDtrack::GetTPCdensity(Int_t row0, Int_t row1) const{ |
688 | // | |
689 | // GetDensity of the clusters on given region between row0 and row1 | |
690 | // Dead zone effect takin into acoount | |
691 | // | |
692 | Int_t good = 0; | |
693 | Int_t found = 0; | |
694 | // | |
15e85efa | 695 | Int_t *index=fFriendTrack->GetTPCindices(); |
81e97e0d | 696 | for (Int_t i=row0;i<=row1;i++){ |
15e85efa | 697 | Int_t idx = index[i]; |
698 | if (idx!=-1) good++; // track outside of dead zone | |
699 | if (idx>0) found++; | |
81e97e0d | 700 | } |
701 | Float_t density=0.5; | |
702 | if (good>(row1-row0)*0.5) density = Float_t(found)/Float_t(good); | |
703 | return density; | |
704 | } | |
c84a5e9e | 705 | |
8c6a71ab | 706 | //_______________________________________________________________________ |
707 | void AliESDtrack::SetTPCpid(const Double_t *p) { | |
4427806c | 708 | // Sets values for the probability of each particle type (in TPC) |
d27bbc79 | 709 | SetPIDValues(fTPCr,p,AliPID::kSPECIES); |
8c6a71ab | 710 | SetStatus(AliESDtrack::kTPCpid); |
711 | } | |
712 | ||
713 | //_______________________________________________________________________ | |
714 | void AliESDtrack::GetTPCpid(Double_t *p) const { | |
4427806c | 715 | // Gets the probability of each particle type (in TPC) |
304864ab | 716 | for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTPCr[i]; |
8c6a71ab | 717 | } |
718 | ||
bb2ceb1f | 719 | //_______________________________________________________________________ |
ef7253ac | 720 | Int_t AliESDtrack::GetTRDclusters(Int_t *idx) const { |
bb2ceb1f | 721 | //--------------------------------------------------------------------- |
722 | // This function returns indices of the assgined TRD clusters | |
723 | //--------------------------------------------------------------------- | |
15e85efa | 724 | if (idx!=0) { |
725 | Int_t *index=fFriendTrack->GetTRDindices(); | |
726 | for (Int_t i=0; i<AliESDfriendTrack::kMaxTRDcluster; i++) idx[i]=index[i]; | |
727 | } | |
bb2ceb1f | 728 | return fTRDncls; |
729 | } | |
730 | ||
c630aafd | 731 | //_______________________________________________________________________ |
732 | void AliESDtrack::SetTRDpid(const Double_t *p) { | |
4427806c | 733 | // Sets values for the probability of each particle type (in TRD) |
d27bbc79 | 734 | SetPIDValues(fTRDr,p,AliPID::kSPECIES); |
c630aafd | 735 | SetStatus(AliESDtrack::kTRDpid); |
736 | } | |
737 | ||
738 | //_______________________________________________________________________ | |
739 | void AliESDtrack::GetTRDpid(Double_t *p) const { | |
4427806c | 740 | // Gets the probability of each particle type (in TRD) |
304864ab | 741 | for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTRDr[i]; |
c630aafd | 742 | } |
743 | ||
79e94bf8 | 744 | //_______________________________________________________________________ |
745 | void AliESDtrack::SetTRDpid(Int_t iSpecies, Float_t p) | |
746 | { | |
4427806c | 747 | // Sets the probability of particle type iSpecies to p (in TRD) |
79e94bf8 | 748 | fTRDr[iSpecies] = p; |
749 | } | |
750 | ||
751 | Float_t AliESDtrack::GetTRDpid(Int_t iSpecies) const | |
752 | { | |
4427806c | 753 | // Returns the probability of particle type iSpecies (in TRD) |
79e94bf8 | 754 | return fTRDr[iSpecies]; |
755 | } | |
756 | ||
c630aafd | 757 | //_______________________________________________________________________ |
758 | void AliESDtrack::SetTOFpid(const Double_t *p) { | |
4427806c | 759 | // Sets the probability of each particle type (in TOF) |
d27bbc79 | 760 | SetPIDValues(fTOFr,p,AliPID::kSPECIES); |
c630aafd | 761 | SetStatus(AliESDtrack::kTOFpid); |
762 | } | |
763 | ||
51ad6848 | 764 | //_______________________________________________________________________ |
765 | void AliESDtrack::SetTOFLabel(const Int_t *p) { | |
766 | // Sets (in TOF) | |
767 | for (Int_t i=0; i<3; i++) fTOFLabel[i]=p[i]; | |
768 | } | |
769 | ||
c630aafd | 770 | //_______________________________________________________________________ |
771 | void AliESDtrack::GetTOFpid(Double_t *p) const { | |
4427806c | 772 | // Gets probabilities of each particle type (in TOF) |
304864ab | 773 | for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fTOFr[i]; |
c630aafd | 774 | } |
775 | ||
51ad6848 | 776 | //_______________________________________________________________________ |
777 | void AliESDtrack::GetTOFLabel(Int_t *p) const { | |
778 | // Gets (in TOF) | |
779 | for (Int_t i=0; i<3; i++) p[i]=fTOFLabel[i]; | |
780 | } | |
781 | ||
782 | //_______________________________________________________________________ | |
783 | void AliESDtrack::GetTOFInfo(Float_t *info) const { | |
784 | // Gets (in TOF) | |
785 | for (Int_t i=0; i<10; i++) info[i]=fTOFInfo[i]; | |
786 | } | |
787 | ||
788 | //_______________________________________________________________________ | |
789 | void AliESDtrack::SetTOFInfo(Float_t*info) { | |
790 | // Gets (in TOF) | |
791 | for (Int_t i=0; i<10; i++) fTOFInfo[i]=info[i]; | |
792 | } | |
793 | ||
4a78b8c5 | 794 | |
795 | ||
4a78b8c5 | 796 | //_______________________________________________________________________ |
797 | void AliESDtrack::SetRICHpid(const Double_t *p) { | |
798 | // Sets the probability of each particle type (in RICH) | |
d27bbc79 | 799 | SetPIDValues(fRICHr,p,AliPID::kSPECIES); |
4a78b8c5 | 800 | SetStatus(AliESDtrack::kRICHpid); |
801 | } | |
802 | ||
803 | //_______________________________________________________________________ | |
804 | void AliESDtrack::GetRICHpid(Double_t *p) const { | |
805 | // Gets probabilities of each particle type (in RICH) | |
304864ab | 806 | for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fRICHr[i]; |
4a78b8c5 | 807 | } |
808 | ||
809 | ||
810 | ||
8c6a71ab | 811 | //_______________________________________________________________________ |
812 | void AliESDtrack::SetESDpid(const Double_t *p) { | |
4427806c | 813 | // Sets the probability of each particle type for the ESD track |
d27bbc79 | 814 | SetPIDValues(fR,p,AliPID::kSPECIES); |
8c6a71ab | 815 | SetStatus(AliESDtrack::kESDpid); |
816 | } | |
817 | ||
818 | //_______________________________________________________________________ | |
819 | void AliESDtrack::GetESDpid(Double_t *p) const { | |
4427806c | 820 | // Gets probability of each particle type for the ESD track |
304864ab | 821 | for (Int_t i=0; i<AliPID::kSPECIES; i++) p[i]=fR[i]; |
8c6a71ab | 822 | } |
823 | ||
49d13e89 | 824 | //_______________________________________________________________________ |
825 | Bool_t AliESDtrack::RelateToVertex | |
826 | (const AliESDVertex *vtx, Double_t b, Double_t maxd) { | |
827 | // | |
828 | // Try to relate this track to the vertex "vtx", | |
829 | // if the (rough) transverse impact parameter is not bigger then "maxd". | |
830 | // Magnetic field is "b" (kG). | |
831 | // | |
832 | // a) The track gets extapolated to the DCA to the vertex. | |
833 | // b) The impact parameters and their covariance matrix are calculated. | |
834 | // c) An attempt to constrain this track to the vertex is done. | |
835 | // | |
836 | // In the case of success, the returned value is kTRUE | |
837 | // (otherwise, it's kFALSE) | |
838 | // | |
b5d34a4c | 839 | |
840 | if (!vtx) return kFALSE; | |
841 | ||
49d13e89 | 842 | Double_t alpha=GetAlpha(); |
843 | Double_t sn=TMath::Sin(alpha), cs=TMath::Cos(alpha); | |
844 | Double_t x=GetX(), y=GetParameter()[0], snp=GetParameter()[2]; | |
845 | Double_t xv= vtx->GetXv()*cs + vtx->GetYv()*sn; | |
846 | Double_t yv=-vtx->GetXv()*sn + vtx->GetYv()*cs, zv=vtx->GetZv(); | |
847 | x-=xv; y-=yv; | |
848 | ||
849 | //Estimate the impact parameter neglecting the track curvature | |
850 | Double_t d=TMath::Abs(x*snp - y*TMath::Sqrt(1.- snp*snp)); | |
851 | if (d > maxd) return kFALSE; | |
852 | ||
853 | //Propagate to the DCA | |
5773defd | 854 | Double_t crv=kB2C*b*GetParameter()[4]; |
855 | if (TMath::Abs(b) < kAlmost0Field) crv=0.; | |
856 | ||
49d13e89 | 857 | Double_t tgfv=-(crv*x - snp)/(crv*y + TMath::Sqrt(1.-snp*snp)); |
f54395bf | 858 | sn=tgfv/TMath::Sqrt(1.+ tgfv*tgfv); |
859 | if (TMath::Abs(tgfv)>0.) cs = sn/tgfv; | |
860 | else cs=1.; | |
49d13e89 | 861 | |
862 | x = xv*cs + yv*sn; | |
863 | yv=-xv*sn + yv*cs; xv=x; | |
864 | ||
865 | if (!Propagate(alpha+TMath::ASin(sn),xv,b)) return kFALSE; | |
866 | ||
867 | fD = GetParameter()[0] - yv; | |
868 | fZ = GetParameter()[1] - zv; | |
869 | ||
870 | Double_t cov[6]; vtx->GetCovMatrix(cov); | |
871 | fCdd = GetCovariance()[0] + cov[2]; // neglecting non-diagonals | |
872 | fCdz = GetCovariance()[1]; // in the vertex's | |
873 | fCzz = GetCovariance()[2] + cov[5]; // covariance matrix | |
874 | ||
875 | {//Try to constrain | |
876 | Double_t p[2]={yv,zv}, c[3]={cov[2],0.,cov[5]}; | |
877 | Double_t chi2=GetPredictedChi2(p,c); | |
878 | ||
879 | if (chi2>77.) return kFALSE; | |
880 | ||
881 | AliExternalTrackParam tmp(*this); | |
882 | if (!tmp.Update(p,c)) return kFALSE; | |
883 | ||
884 | fCchi2=chi2; | |
885 | if (!fCp) fCp=new AliExternalTrackParam(); | |
886 | new (fCp) AliExternalTrackParam(tmp); | |
887 | } | |
888 | ||
889 | return kTRUE; | |
890 | } | |
891 | ||
15e85efa | 892 | void AliESDtrack::SetTrackPointArray(AliTrackPointArray *points) { |
893 | fPoints=points; | |
894 | //fFriendTrack->SetTrackPointArray(points); | |
895 | } | |
896 | const AliTrackPointArray *AliESDtrack::GetTrackPointArray() const { | |
897 | return fPoints; | |
898 | //return fFriendTrack->GetTrackPointArray(); | |
899 | } | |
900 | ||
ac2f7574 | 901 | //_______________________________________________________________________ |
902 | void AliESDtrack::Print(Option_t *) const { | |
903 | // Prints info on the track | |
904 | ||
5f7789fc | 905 | printf("ESD track info\n") ; |
304864ab | 906 | Double_t p[AliPID::kSPECIESN] ; |
ac2f7574 | 907 | Int_t index = 0 ; |
908 | if( IsOn(kITSpid) ){ | |
909 | printf("From ITS: ") ; | |
910 | GetITSpid(p) ; | |
304864ab | 911 | for(index = 0 ; index < AliPID::kSPECIES; index++) |
ac2f7574 | 912 | printf("%f, ", p[index]) ; |
913 | printf("\n signal = %f\n", GetITSsignal()) ; | |
914 | } | |
915 | if( IsOn(kTPCpid) ){ | |
916 | printf("From TPC: ") ; | |
917 | GetTPCpid(p) ; | |
304864ab | 918 | for(index = 0 ; index < AliPID::kSPECIES; index++) |
ac2f7574 | 919 | printf("%f, ", p[index]) ; |
920 | printf("\n signal = %f\n", GetTPCsignal()) ; | |
921 | } | |
922 | if( IsOn(kTRDpid) ){ | |
923 | printf("From TRD: ") ; | |
924 | GetTRDpid(p) ; | |
304864ab | 925 | for(index = 0 ; index < AliPID::kSPECIES; index++) |
ac2f7574 | 926 | printf("%f, ", p[index]) ; |
927 | printf("\n signal = %f\n", GetTRDsignal()) ; | |
928 | } | |
929 | if( IsOn(kTOFpid) ){ | |
930 | printf("From TOF: ") ; | |
931 | GetTOFpid(p) ; | |
304864ab | 932 | for(index = 0 ; index < AliPID::kSPECIES; index++) |
ac2f7574 | 933 | printf("%f, ", p[index]) ; |
934 | printf("\n signal = %f\n", GetTOFsignal()) ; | |
935 | } | |
936 | if( IsOn(kRICHpid) ){ | |
038834e7 | 937 | printf("From RICH: ") ; |
ac2f7574 | 938 | GetRICHpid(p) ; |
304864ab | 939 | for(index = 0 ; index < AliPID::kSPECIES; index++) |
ac2f7574 | 940 | printf("%f, ", p[index]) ; |
941 | printf("\n signal = %f\n", GetRICHsignal()) ; | |
942 | } | |
ac2f7574 | 943 | } |
6c94f330 | 944 | |
945 | Bool_t AliESDtrack::PropagateTo(Double_t xToGo, Double_t b, Double_t mass, | |
946 | Double_t maxStep, Bool_t rotateTo, Double_t maxSnp){ | |
947 | //---------------------------------------------------------------- | |
948 | // | |
949 | // MI's function | |
950 | // | |
951 | // Propagates this track to the plane X=xk (cm) | |
952 | // in the magnetic field "b" (kG), | |
953 | // the correction for the material is included | |
954 | // | |
955 | // mass - mass used in propagation - used for energy loss correction | |
956 | // maxStep - maximal step for propagation | |
957 | //---------------------------------------------------------------- | |
958 | const Double_t kEpsilon = 0.00001; | |
959 | Double_t xpos = GetX(); | |
960 | Double_t dir = (xpos<xToGo) ? 1.:-1.; | |
961 | // | |
962 | while ( (xToGo-xpos)*dir > kEpsilon){ | |
963 | Double_t step = dir*TMath::Min(TMath::Abs(xToGo-xpos), maxStep); | |
964 | Double_t x = xpos+step; | |
965 | Double_t xyz0[3],xyz1[3],param[7]; | |
966 | GetXYZ(xyz0); //starting global position | |
967 | if (!GetXYZAt(x,b,xyz1)) return kFALSE; // no prolongation | |
968 | xyz1[2]+=kEpsilon; // waiting for bug correction in geo | |
969 | AliKalmanTrack::MeanMaterialBudget(xyz0,xyz1,param); | |
970 | if (TMath::Abs(GetSnpAt(x,b)) >= maxSnp) return kFALSE; | |
971 | if (!AliExternalTrackParam::PropagateTo(x,b)) return kFALSE; | |
972 | ||
973 | Double_t rho=param[0],x0=param[1],distance=param[4]; | |
974 | Double_t d=distance*rho/x0; | |
975 | ||
976 | if (!CorrectForMaterial(d,x0,mass)) return kFALSE; | |
977 | if (rotateTo){ | |
978 | if (TMath::Abs(GetSnp()) >= maxSnp) return kFALSE; | |
979 | GetXYZ(xyz0); // global position | |
980 | Double_t alphan = TMath::ATan2(xyz0[1], xyz0[0]); | |
981 | // | |
982 | Double_t ca=TMath::Cos(alphan-GetAlpha()), | |
983 | sa=TMath::Sin(alphan-GetAlpha()); | |
984 | Double_t sf=GetSnp(), cf=TMath::Sqrt(1.- sf*sf); | |
985 | Double_t sinNew = sf*ca - cf*sa; | |
986 | if (TMath::Abs(sinNew) >= maxSnp) return kFALSE; | |
987 | if (!Rotate(alphan)) return kFALSE; | |
988 | } | |
989 | xpos = GetX(); | |
990 | } | |
991 | return kTRUE; | |
992 | } |