]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TRD/AliTRDtrackV1.cxx
corrected CDB and run number initialization for usage from external interface, AliHLT...
[u/mrichter/AliRoot.git] / TRD / AliTRDtrackV1.cxx
CommitLineData
d9950a5a 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 **************************************************************************/
15
16/* $Id$ */
17
eb38ed55 18#include "AliESDtrack.h"
41880fac 19#include "AliTracker.h"
eb38ed55 20
d9950a5a 21#include "AliTRDtrackV1.h"
22#include "AliTRDcluster.h"
23#include "AliTRDcalibDB.h"
3afdab72 24#include "AliTRDReconstructor.h"
d9950a5a 25#include "AliTRDrecoParam.h"
26
d9950a5a 27ClassImp(AliTRDtrackV1)
28
0906e73e 29///////////////////////////////////////////////////////////////////////////////
30// //
31// Represents a reconstructed TRD track //
32// Local TRD Kalman track //
33// //
34// Authors: //
35// Alex Bercuci <A.Bercuci@gsi.de> //
36// Markus Fasel <M.Fasel@gsi.de> //
37// //
38///////////////////////////////////////////////////////////////////////////////
d9950a5a 39
40//_______________________________________________________________
3b57a3f7 41AliTRDtrackV1::AliTRDtrackV1() : AliKalmanTrack()
42 ,fPIDquality(0)
43 ,fDE(0.)
44 ,fBackupTrack(0x0)
0906e73e 45{
d9950a5a 46 //
47 // Default constructor
48 //
3b57a3f7 49 for(int i =0; i<3; i++) fBudget[i] = 0.;
50
51 Float_t pid = 1./AliPID::kSPECIES;
52 for(int is =0; is<AliPID::kSPECIES; is++) fPID[is] = pid;
53
54 for(int ip=0; ip<kNplane; ip++){
55 fTrackletIndex[ip] = 0xffff;
56 fTracklet[ip] = 0x0;
57 }
d9950a5a 58}
59
60//_______________________________________________________________
3b57a3f7 61AliTRDtrackV1::AliTRDtrackV1(const AliTRDtrackV1 &ref) : AliKalmanTrack(ref)
62 ,fPIDquality(ref.fPIDquality)
63 ,fDE(ref.fDE)
64 ,fBackupTrack(0x0)
d9950a5a 65{
66 //
3b57a3f7 67 // Copy constructor
d9950a5a 68 //
69
3b57a3f7 70 for(int ip=0; ip<kNplane; ip++){
71 fTrackletIndex[ip] = ref.fTrackletIndex[ip];
72 fTracklet[ip] = ref.fTracklet[ip];
73 }
74
75 for (Int_t i = 0; i < 3;i++) fBudget[i] = ref.fBudget[i];
76
77 for(Int_t is = 0; is<AliPID::kSPECIES; is++) fPID[is] = ref.fPID[is];
78
79 AliKalmanTrack::SetNumberOfClusters(ref.GetNumberOfClusters());
d9950a5a 80}
81
82//_______________________________________________________________
3b57a3f7 83AliTRDtrackV1::AliTRDtrackV1(const AliESDtrack &t) : AliKalmanTrack()
84 ,fPIDquality(0)
85 ,fDE(0.)
86 ,fBackupTrack(0x0)
d9950a5a 87{
88 //
3b57a3f7 89 // Constructor from AliESDtrack
d9950a5a 90 //
91
3b57a3f7 92 SetLabel(t.GetLabel());
93 SetChi2(0.0);
94 SetMass(t.GetMass());
95 AliKalmanTrack::SetNumberOfClusters(t.GetTRDncls());
96 Int_t ti[kNplane]; t.GetTRDtracklets(&ti[0]);
97 for(int ip=0; ip<kNplane; ip++){
98 fTrackletIndex[ip] = ti[ip] < 0 ? 0xffff : ti[ip];
99 fTracklet[ip] = 0x0;
100 }
101 for(int i =0; i<3; i++) fBudget[i] = 0.;
102
103 Float_t pid = 1./AliPID::kSPECIES;
104 for(int is =0; is<AliPID::kSPECIES; is++) fPID[is] = pid;
105
106 const AliExternalTrackParam *par = &t;
107 if (t.GetStatus() & AliESDtrack::kTRDbackup) {
108 par = t.GetOuterParam();
109 if (!par) {
110 AliError("No backup info!");
111 par = &t;
112 }
113 }
114 Set(par->GetX()
115 ,par->GetAlpha()
116 ,par->GetParameter()
117 ,par->GetCovariance());
118
119 if(t.GetStatus() & AliESDtrack::kTIME) {
120 StartTimeIntegral();
121 Double_t times[10];
122 t.GetIntegratedTimes(times);
123 SetIntegratedTimes(times);
124 SetIntegratedLength(t.GetIntegratedLength());
125 }
d9950a5a 126}
127
d9950a5a 128//_______________________________________________________________
eb38ed55 129AliTRDtrackV1::AliTRDtrackV1(AliTRDseedV1 *trklts, const Double_t p[5], const Double_t cov[15]
3b57a3f7 130 , Double_t x, Double_t alpha) : AliKalmanTrack()
131 ,fPIDquality(0)
132 ,fDE(0.)
133 ,fBackupTrack(0x0)
d9950a5a 134{
0906e73e 135 //
136 // The stand alone tracking constructor
137 // TEMPORARY !!!!!!!!!!!
138 // to check :
139 // 1. covariance matrix
140 // 2. dQdl calculation
141 //
d9950a5a 142
fb17de1f 143 Double_t cnv = GetBz() < 1.e-5 ? 1.e5 : 1.0 / (GetBz() * kB2C);
144 // Double_t cnv = 1.0 / (GetBz() * kB2C);
d9950a5a 145
146 Double_t pp[5] = { p[0]
147 , p[1]
148 , x*p[4] - p[2]
149 , p[3]
150 , p[4]*cnv };
151
152 Double_t c22 = x*x*cov[14] - 2*x*cov[12] + cov[ 5];
153 Double_t c32 = x*cov[13] - cov[ 8];
154 Double_t c20 = x*cov[10] - cov[ 3];
155 Double_t c21 = x*cov[11] - cov[ 4];
156 Double_t c42 = x*cov[14] - cov[12];
157
158 Double_t cc[15] = { cov[ 0]
159 , cov[ 1], cov[ 2]
160 , c20, c21, c22
161 , cov[ 6], cov[ 7], c32, cov[ 9]
162 , cov[10]*cnv, cov[11]*cnv, c42*cnv, cov[13]*cnv, cov[14]*cnv*cnv };
163
164 Set(x,alpha,pp,cc);
41702fec 165 Int_t ncls = 0;
3b57a3f7 166 for(int iplane=0; iplane<kNplane; iplane++){
41702fec 167 fTrackletIndex[iplane] = 0xffff;
168 if(!trklts[iplane].IsOK()) fTracklet[iplane] = 0x0;
169 else{
170 fTracklet[iplane] = new AliTRDseedV1(trklts[iplane]);
171 ncls += fTracklet[iplane]->GetN();
172 }
d9950a5a 173 }
41702fec 174 AliKalmanTrack::SetNumberOfClusters(ncls);
175 for(int i =0; i<3; i++) fBudget[i] = 0.;
176
177 Float_t pid = 1./AliPID::kSPECIES;
178 for(int is =0; is<AliPID::kSPECIES; is++) fPID[is] = pid;
179
d9950a5a 180}
181
bb56afff 182//_______________________________________________________________
3b57a3f7 183AliTRDtrackV1::~AliTRDtrackV1()
bb56afff 184{
3b57a3f7 185 if(fBackupTrack) {
186 delete fBackupTrack;
187 }
188 fBackupTrack = 0x0;
bb56afff 189
3b57a3f7 190 if(TestBit(1)){
191 for(Int_t ip=0; ip<kNplane; ip++){
192 if(fTracklet[ip]) delete fTracklet[ip];
193 fTracklet[ip] = 0x0;
194 }
195 }
196}
197
198//_______________________________________________________________
199Bool_t AliTRDtrackV1::CookLabel(Float_t wrong)
200{
201 // set MC label for this track
202
bb56afff 203 Int_t s[kMAXCLUSTERSPERTRACK][2];
204 for (Int_t i = 0; i < kMAXCLUSTERSPERTRACK; i++) {
205 s[i][0] = -1;
206 s[i][1] = 0;
207 }
3b57a3f7 208
bb56afff 209 Bool_t labelAdded;
3b57a3f7 210 Int_t label;
211 AliTRDcluster *c = 0x0;
212 for (Int_t ip = 0; ip < kNplane; ip++) {
213 if(fTrackletIndex[ip] == 0xffff) continue;
214 for (Int_t ic = 0; ic < AliTRDseed::knTimebins; ic++) {
215 if(!(c = fTracklet[ip]->GetClusters(ic))) continue;
216 for (Int_t k = 0; k < 3; k++) {
217 label = c->GetLabel(k);
218 labelAdded = kFALSE;
219 Int_t j = 0;
220 if (label >= 0) {
221 while ((!labelAdded) && (j < kMAXCLUSTERSPERTRACK)) {
222 if ((s[j][0] == label) ||
223 (s[j][1] == 0)) {
224 s[j][0] = label;
225 s[j][1]++;
226 labelAdded = kTRUE;
227 }
228 j++;
229 }
230 }
231 }
232 }
233 }
234
bb56afff 235 Int_t max = 0;
236 label = -123456789;
237 for (Int_t i = 0; i < kMAXCLUSTERSPERTRACK; i++) {
238 if (s[i][1] <= max) continue;
3b57a3f7 239 max = s[i][1];
240 label = s[i][0];
bb56afff 241 }
3b57a3f7 242
bb56afff 243 if ((1. - Float_t(max)/GetNumberOfClusters()) > wrong) label = -label;
3b57a3f7 244
bb56afff 245 SetLabel(label);
3b57a3f7 246
247 return kTRUE;
bb56afff 248}
249
d9950a5a 250//_______________________________________________________________
251Bool_t AliTRDtrackV1::CookPID()
252{
0906e73e 253 //
254 // Cook the PID information
255 //
3b57a3f7 256
257 // Reset the a priori probabilities
258 Double_t pid = 1. / AliPID::kSPECIES;
0906e73e 259 for(int ispec=0; ispec<AliPID::kSPECIES; ispec++) {
3b57a3f7 260 fPID[ispec] = pid;
261 }
262 fPIDquality = 0;
263
264 // steer PID calculation @ tracklet level
265 Double_t *prob = 0x0;
266 for(int ip=0; ip<kNplane; ip++){
267 if(fTrackletIndex[ip] == 0xffff) continue;
268 if(!fTracklet[ip]->IsOK()) continue;
269 if(!(prob = fTracklet[ip]->GetProbability())) return kFALSE;
270
271 Int_t nspec = 0; // quality check of tracklet dEdx
272 for(int ispec=0; ispec<AliPID::kSPECIES; ispec++){
273 if(prob[ispec] < 0.) continue;
274 fPID[ispec] *= prob[ispec];
275 nspec++;
276 }
277 if(!nspec) continue;
278
279 fPIDquality++;
0906e73e 280 }
0906e73e 281
282 // no tracklet found for PID calculations
283 if(!fPIDquality) return kTRUE;
3b57a3f7 284
285 // slot for PID calculation @ track level
286
287
0906e73e 288 // normalize probabilities
289 Double_t probTotal = 0.0;
290 for (Int_t is = 0; is < AliPID::kSPECIES; is++) probTotal += fPID[is];
3b57a3f7 291
292
0906e73e 293 if (probTotal <= 0.0) {
294 AliWarning("The total probability over all species <= 0. This may be caused by some error in the reference data.");
d9950a5a 295 return kFALSE;
296 }
3b57a3f7 297
0906e73e 298 for (Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++) fPID[iSpecies] /= probTotal;
3b57a3f7 299
0906e73e 300 return kTRUE;
d9950a5a 301}
302
3b57a3f7 303//_____________________________________________________________________________
304Double_t AliTRDtrackV1::GetBz() const
0906e73e 305{
306 //
3b57a3f7 307 // Returns Bz component of the magnetic field (kG)
0906e73e 308 //
309
3b57a3f7 310 if (AliTracker::UniformField()) return AliTracker::GetBz();
311
312 Double_t r[3];
313 GetXYZ(r);
314 return AliTracker::GetBz(r);
315}
316
317//_______________________________________________________________
318Int_t AliTRDtrackV1::GetClusterIndex(Int_t id) const
319{
320 Int_t n = 0;
321 for(Int_t ip=0; ip<kNplane; ip++){
322 if(!fTracklet[ip]) continue;
323 if(n+fTracklet[ip]->GetN() < id){
324 n+=fTracklet[ip]->GetN();
325 continue;
326 }
327 for(Int_t ic=34; ic>=0; ic--){
328 if(!fTracklet[ip]->GetClusters(ic)) continue;
329 n++;
330 if(n<id) continue;
331 return fTracklet[ip]->GetIndexes(ic);
332 }
333 }
334 return -1;
0906e73e 335}
d9950a5a 336
337//_______________________________________________________________
338Double_t AliTRDtrackV1::GetPredictedChi2(const AliTRDseedV1 *trklt) const
339{
340 //
0906e73e 341 // Get the predicted chi2
d9950a5a 342 //
3b57a3f7 343
d9950a5a 344 Double_t x = trklt->GetX0();
345 Double_t p[2] = { trklt->GetYat(x)
346 , trklt->GetZat(x) };
347 Double_t cov[3];
3b57a3f7 348 trklt->GetCovAt(x, cov);
349
d9950a5a 350 return AliExternalTrackParam::GetPredictedChi2(p, cov);
3b57a3f7 351}
d9950a5a 352
3b57a3f7 353
354//_____________________________________________________________________________
355void AliTRDtrackV1::MakeBackupTrack()
356{
357 //
358 // Creates a backup track
359 //
360
361 if(fBackupTrack) {
362 fBackupTrack->~AliTRDtrackV1();
363 new(fBackupTrack) AliTRDtrackV1((AliTRDtrackV1&)(*this));
592fdd48 364 return;
3b57a3f7 365 }
366 fBackupTrack = new AliTRDtrackV1((AliTRDtrackV1&)(*this));
d9950a5a 367}
368
3b57a3f7 369//_____________________________________________________________________________
370Int_t AliTRDtrackV1::GetProlongation(Double_t xk, Double_t &y, Double_t &z)
371{
372 //
373 // Find a prolongation at given x
374 // Return 0 if it does not exist
375 //
376
377 Double_t bz = GetBz();
378 if (!AliExternalTrackParam::GetYAt(xk,bz,y)) return 0;
379 if (!AliExternalTrackParam::GetZAt(xk,bz,z)) return 0;
380
381 return 1;
382
383}
384
385//_____________________________________________________________________________
386Bool_t AliTRDtrackV1::PropagateTo(Double_t xk, Double_t xx0, Double_t xrho)
0906e73e 387{
388 //
3b57a3f7 389 // Propagates this track to a reference plane defined by "xk" [cm]
390 // correcting for the mean crossed material.
0906e73e 391 //
3b57a3f7 392 // "xx0" - thickness/rad.length [units of the radiation length]
393 // "xrho" - thickness*density [g/cm^2]
394 //
0906e73e 395
3b57a3f7 396 if (xk == GetX()) {
397 return kTRUE;
398 }
399
400 Double_t oldX = GetX();
401 Double_t oldY = GetY();
402 Double_t oldZ = GetZ();
403
404 Double_t bz = GetBz();
405
406 if (!AliExternalTrackParam::PropagateTo(xk,bz)) {
407 return kFALSE;
408 }
409
410 Double_t x = GetX();
411 Double_t y = GetY();
412 Double_t z = GetZ();
413
414 if (oldX < xk) {
415 xrho = -xrho;
416 if (IsStartedTimeIntegral()) {
417 Double_t l2 = TMath::Sqrt((x-oldX)*(x-oldX)
418 + (y-oldY)*(y-oldY)
419 + (z-oldZ)*(z-oldZ));
420 Double_t crv = AliExternalTrackParam::GetC(bz);
421 if (TMath::Abs(l2*crv) > 0.0001) {
422 // Make correction for curvature if neccesary
423 l2 = 0.5 * TMath::Sqrt((x-oldX)*(x-oldX)
424 + (y-oldY)*(y-oldY));
425 l2 = 2.0 * TMath::ASin(l2 * crv) / crv;
426 l2 = TMath::Sqrt(l2*l2 + (z-oldZ)*(z-oldZ));
427 }
428 AddTimeStep(l2);
429 }
430 }
431
432 if (!AliExternalTrackParam::CorrectForMeanMaterial(xx0,xrho,GetMass())) {
433 return kFALSE;
434 }
435
436 {
437
438 // Energy losses
439 Double_t p2 = (1.0 + GetTgl()*GetTgl()) / (GetSigned1Pt()*GetSigned1Pt());
440 Double_t beta2 = p2 / (p2 + GetMass()*GetMass());
441 if ((beta2 < 1.0e-10) ||
442 ((5940.0 * beta2/(1.0 - beta2 + 1.0e-10) - beta2) < 0.0)) {
443 return kFALSE;
444 }
445
446 Double_t dE = 0.153e-3 / beta2
447 * (TMath::Log(5940.0 * beta2/(1.0 - beta2 + 1.0e-10)) - beta2)
448 * xrho;
449 fBudget[0] += xrho;
450
451 /*
452 // Suspicious part - think about it ?
453 Double_t kinE = TMath::Sqrt(p2);
454 if (dE > 0.8*kinE) dE = 0.8 * kinE; //
455 if (dE < 0) dE = 0.0; // Not valid region for Bethe bloch
456 */
457
458 fDE += dE;
459
460 /*
461 // Suspicious ! I.B.
462 Double_t sigmade = 0.07 * TMath::Sqrt(TMath::Abs(dE)); // Energy loss fluctuation
463 Double_t sigmac2 = sigmade*sigmade*fC*fC*(p2+GetMass()*GetMass())/(p2*p2);
464 fCcc += sigmac2;
465 fCee += fX*fX * sigmac2;
466 */
467
468 }
469
470 return kTRUE;
0906e73e 471}
3b57a3f7 472
87a7fa94 473//_____________________________________________________________________________
3b57a3f7 474Int_t AliTRDtrackV1::PropagateToR(Double_t r,Double_t step)
87a7fa94 475{
476 //
3b57a3f7 477 // Propagate track to the radial position
478 // Rotation always connected to the last track position
87a7fa94 479 //
480
3b57a3f7 481 Double_t xyz0[3];
482 Double_t xyz1[3];
483 Double_t y;
484 Double_t z;
485
486 Double_t radius = TMath::Sqrt(GetX()*GetX() + GetY()*GetY());
487 // Direction +-
488 Double_t dir = (radius > r) ? -1.0 : 1.0;
489
490 for (Double_t x = radius+dir*step; dir*x < dir*r; x += dir*step) {
491
492 GetXYZ(xyz0);
493 Double_t alpha = TMath::ATan2(xyz0[1],xyz0[0]);
494 Rotate(alpha,kTRUE);
495 GetXYZ(xyz0);
496 GetProlongation(x,y,z);
497 xyz1[0] = x * TMath::Cos(alpha) + y * TMath::Sin(alpha);
498 xyz1[1] = x * TMath::Sin(alpha) - y * TMath::Cos(alpha);
499 xyz1[2] = z;
500 Double_t param[7];
501 AliTracker::MeanMaterialBudget(xyz0,xyz1,param);
502 if (param[1] <= 0) {
503 param[1] = 100000000;
504 }
505 PropagateTo(x,param[1],param[0]*param[4]);
506
507 }
508
509 GetXYZ(xyz0);
510 Double_t alpha = TMath::ATan2(xyz0[1],xyz0[0]);
511 Rotate(alpha,kTRUE);
512 GetXYZ(xyz0);
513 GetProlongation(r,y,z);
514 xyz1[0] = r * TMath::Cos(alpha) + y * TMath::Sin(alpha);
515 xyz1[1] = r * TMath::Sin(alpha) - y * TMath::Cos(alpha);
516 xyz1[2] = z;
517 Double_t param[7];
518 AliTracker::MeanMaterialBudget(xyz0,xyz1,param);
519
520 if (param[1] <= 0) {
521 param[1] = 100000000;
87a7fa94 522 }
3b57a3f7 523 PropagateTo(r,param[1],param[0]*param[4]);
524
525 return 0;
526
87a7fa94 527}
528
3b57a3f7 529//_____________________________________________________________________________
530Bool_t AliTRDtrackV1::Rotate(Double_t alpha, Bool_t absolute)
531{
532 //
533 // Rotates track parameters in R*phi plane
534 // if absolute rotation alpha is in global system
535 // otherwise alpha rotation is relative to the current rotation angle
536 //
537
538 if (absolute) alpha -= GetAlpha();
539 //else fNRotate++;
540
541 return AliExternalTrackParam::Rotate(GetAlpha()+alpha);
542}
87a7fa94 543
eb38ed55 544//___________________________________________________________
545void AliTRDtrackV1::SetNumberOfClusters()
546{
547// Calculate the number of clusters attached to this track
548
3b57a3f7 549 Int_t ncls = 0;
550 for(int ip=0; ip<kNplane; ip++){
551 if(fTracklet[ip] && fTrackletIndex[ip] != 0xffff) ncls += fTracklet[ip]->GetN();
552 }
553 AliKalmanTrack::SetNumberOfClusters(ncls);
eb38ed55 554}
555
556
0906e73e 557//_______________________________________________________________
3b57a3f7 558void AliTRDtrackV1::SetOwner()
0906e73e 559{
560 //
561 // Toggle ownership of tracklets
562 //
563
3b57a3f7 564 if(TestBit(1)) return;
565 for (Int_t ip = 0; ip < kNplane; ip++) {
566 if(fTrackletIndex[ip] == 0xffff) continue;
567 fTracklet[ip] = new AliTRDseedV1(*fTracklet[ip]);
568 fTracklet[ip]->SetOwner();
569 }
570 SetBit(1);
0906e73e 571}
572
d9950a5a 573//_______________________________________________________________
3b57a3f7 574void AliTRDtrackV1::SetTracklet(AliTRDseedV1 *trklt, Int_t index)
d9950a5a 575{
576 //
0906e73e 577 // Set the tracklets
d9950a5a 578 //
3b57a3f7 579 Int_t plane = trklt->GetPlane();
41702fec 580 if(fTrackletIndex[plane]==0xffff && fTracklet[plane]){
581 delete fTracklet[plane];
582 }
3b57a3f7 583 fTracklet[plane] = trklt;
584 fTrackletIndex[plane] = index;
d9950a5a 585}
586
587//_______________________________________________________________
0906e73e 588Bool_t AliTRDtrackV1::Update(AliTRDseedV1 *trklt, Double_t chisq)
d9950a5a 589{
590 //
3b57a3f7 591 // Update track and tracklet parameters
d9950a5a 592 //
3b57a3f7 593
0906e73e 594 Double_t x = trklt->GetX0();
d9950a5a 595 Double_t p[2] = { trklt->GetYat(x)
596 , trklt->GetZat(x) };
597 Double_t cov[3];
3b57a3f7 598 trklt->GetCovAt(x, cov);
599
3afdab72 600 // insert systematic uncertainties calibration and misalignment
601 Double_t sys[15];
602 AliTRDReconstructor::RecoParam()->GetSysCovMatrix(sys);
603 cov[0] += (sys[0]*sys[0]);
604 cov[2] += (sys[1]*sys[1]);
605
d9950a5a 606 if(!AliExternalTrackParam::Update(p, cov)) return kFALSE;
3b57a3f7 607
608 AliTRDcluster *c = 0x0;
609 Int_t ic = 0; while(!(c = trklt->GetClusters(ic))) ic++;
610 AliTracker::FillResiduals(this, p, cov, c->GetVolumeId());
611
612
d9950a5a 613 // Register info to track
3b57a3f7 614 SetNumberOfClusters();
d9950a5a 615 SetChi2(GetChi2() + chisq);
3b57a3f7 616
617 // update tracklet
618 trklt->SetMomentum(GetP());
619 trklt->SetSnp(GetSnp());
620 trklt->SetTgl(GetTgl());
621 return kTRUE;
d9950a5a 622}
623
624//_______________________________________________________________
0906e73e 625void AliTRDtrackV1::UpdateESDtrack(AliESDtrack *track)
d9950a5a 626{
627 //
6984f7c1 628 // Update the TRD PID information in the ESD track
d9950a5a 629 //
6984f7c1 630
631 track->SetNumberOfTRDslices(kNslice);
3b57a3f7 632
6984f7c1 633 for (Int_t ip = 0; ip < kNplane; ip++) {
3b57a3f7 634 if(fTrackletIndex[ip] == 0xffff) continue;
635 fTracklet[ip]->CookdEdx(kNslice);
636 Float_t *dedx = fTracklet[ip]->GetdEdx();
637 for (Int_t js = 0; js < kNslice; js++) track->SetTRDslice(dedx[js], ip, js);
6984f7c1 638 }
0906e73e 639
6984f7c1 640 // copy PID to ESD
641 track->SetTRDpid(fPID);
642 track->SetTRDpidQuality(fPIDquality);
d9950a5a 643}