1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
19 #include "AliESDtrack.h"
20 #include "AliTracker.h"
22 #include "AliTRDtrackV1.h"
23 #include "AliTRDcluster.h"
24 #include "AliTRDcalibDB.h"
25 #include "AliTRDReconstructor.h"
26 #include "AliTRDrecoParam.h"
28 ClassImp(AliTRDtrackV1)
30 ///////////////////////////////////////////////////////////////////////////////
32 // Represents a reconstructed TRD track //
33 // Local TRD Kalman track //
36 // Alex Bercuci <A.Bercuci@gsi.de> //
37 // Markus Fasel <M.Fasel@gsi.de> //
39 ///////////////////////////////////////////////////////////////////////////////
41 //_______________________________________________________________
42 AliTRDtrackV1::AliTRDtrackV1() : AliKalmanTrack()
51 // Default constructor
53 //printf("AliTRDtrackV1::AliTRDtrackV1()\n");
55 for(int i =0; i<3; i++) fBudget[i] = 0.;
57 Float_t pid = 1./AliPID::kSPECIES;
58 for(int is =0; is<AliPID::kSPECIES; is++) fPID[is] = pid;
60 for(int ip=0; ip<kNplane; ip++){
61 fTrackletIndex[ip] = 0xffff;
66 //_______________________________________________________________
67 AliTRDtrackV1::AliTRDtrackV1(const AliTRDtrackV1 &ref) : AliKalmanTrack(ref)
68 ,fPIDquality(ref.fPIDquality)
70 ,fReconstructor(ref.fReconstructor)
79 //printf("AliTRDtrackV1::AliTRDtrackV1(const AliTRDtrackV1 &)\n");
80 SetBit(kOwner, kFALSE);
81 for(int ip=0; ip<kNplane; ip++){
82 fTrackletIndex[ip] = ref.fTrackletIndex[ip];
83 fTracklet[ip] = ref.fTracklet[ip];
85 if(ref.fTrackLow) fTrackLow = new AliExternalTrackParam(*ref.fTrackLow);
86 if(ref.fTrackHigh) fTrackHigh = new AliExternalTrackParam(*ref.fTrackHigh);
88 for (Int_t i = 0; i < 3;i++) fBudget[i] = ref.fBudget[i];
90 for(Int_t is = 0; is<AliPID::kSPECIES; is++) fPID[is] = ref.fPID[is];
92 AliKalmanTrack::SetNumberOfClusters(ref.GetNumberOfClusters());
95 //_______________________________________________________________
96 AliTRDtrackV1::AliTRDtrackV1(const AliESDtrack &t) : AliKalmanTrack()
105 // Constructor from AliESDtrack
108 SetLabel(t.GetLabel());
110 SetMass(t.GetMass());
111 AliKalmanTrack::SetNumberOfClusters(t.GetTRDncls());
112 Int_t ti[kNplane]; t.GetTRDtracklets(&ti[0]);
113 for(int ip=0; ip<kNplane; ip++){
114 fTrackletIndex[ip] = ti[ip] < 0 ? 0xffff : ti[ip];
117 for(int i =0; i<3; i++) fBudget[i] = 0.;
119 Float_t pid = 1./AliPID::kSPECIES;
120 for(int is =0; is<AliPID::kSPECIES; is++) fPID[is] = pid;
122 const AliExternalTrackParam *par = &t;
123 if (t.GetStatus() & AliESDtrack::kTRDbackup) {
124 par = t.GetOuterParam();
126 AliError("No backup info!");
133 ,par->GetCovariance());
135 if(t.GetStatus() & AliESDtrack::kTIME) {
138 t.GetIntegratedTimes(times);
139 SetIntegratedTimes(times);
140 SetIntegratedLength(t.GetIntegratedLength());
144 //_______________________________________________________________
145 AliTRDtrackV1::AliTRDtrackV1(AliTRDseedV1 *trklts, const Double_t p[5], const Double_t cov[15]
146 , Double_t x, Double_t alpha) : AliKalmanTrack()
155 // The stand alone tracking constructor
156 // TEMPORARY !!!!!!!!!!!
158 // 1. covariance matrix
159 // 2. dQdl calculation
162 Double_t cnv = GetBz() < 1.e-5 ? 1.e5 : 1.0 / (GetBz() * kB2C);
163 // Double_t cnv = 1.0 / (GetBz() * kB2C);
165 Double_t pp[5] = { p[0]
171 Double_t c22 = x*x*cov[14] - 2*x*cov[12] + cov[ 5];
172 Double_t c32 = x*cov[13] - cov[ 8];
173 Double_t c20 = x*cov[10] - cov[ 3];
174 Double_t c21 = x*cov[11] - cov[ 4];
175 Double_t c42 = x*cov[14] - cov[12];
177 Double_t cc[15] = { cov[ 0]
180 , cov[ 6], cov[ 7], c32, cov[ 9]
181 , cov[10]*cnv, cov[11]*cnv, c42*cnv, cov[13]*cnv, cov[14]*cnv*cnv };
183 Double_t mostProbablePt=AliExternalTrackParam::GetMostProbablePt();
184 Double_t p0=TMath::Sign(1/mostProbablePt,pp[4]);
185 Double_t w0=cc[14]/(cc[14] + p0*p0), w1=p0*p0/(cc[14] + p0*p0);
186 pp[4] = w0*p0 + w1*pp[4];
187 cc[10]*=w1; cc[11]*=w1; cc[12]*=w1; cc[13]*=w1; cc[14]*=w1;
191 for(int iplane=0; iplane<kNplane; iplane++){
192 fTrackletIndex[iplane] = 0xffff;
193 if(!trklts[iplane].IsOK()) fTracklet[iplane] = 0x0;
195 fTracklet[iplane] = &trklts[iplane];
196 ncls += fTracklet[iplane]->GetN();
199 AliKalmanTrack::SetNumberOfClusters(ncls);
200 for(int i =0; i<3; i++) fBudget[i] = 0.;
202 Float_t pid = 1./AliPID::kSPECIES;
203 for(int is =0; is<AliPID::kSPECIES; is++) fPID[is] = pid;
207 //_______________________________________________________________
208 AliTRDtrackV1::~AliTRDtrackV1()
211 //printf("I-AliTRDtrackV1::~AliTRDtrackV1() : Owner[%s]\n", TestBit(kOwner)?"YES":"NO");
213 if(fBackupTrack) delete fBackupTrack; fBackupTrack = 0x0;
215 if(fTrackLow) delete fTrackLow; fTrackLow = 0x0;
216 if(fTrackHigh) delete fTrackHigh; fTrackHigh = 0x0;
218 for(Int_t ip=0; ip<kNplane; ip++){
219 if(TestBit(kOwner) && fTracklet[ip]) delete fTracklet[ip];
221 fTrackletIndex[ip] = 0xffff;
225 //_______________________________________________________________
226 Bool_t AliTRDtrackV1::CookLabel(Float_t wrong)
228 // set MC label for this track
230 Int_t s[kMAXCLUSTERSPERTRACK][2];
231 for (Int_t i = 0; i < kMAXCLUSTERSPERTRACK; i++) {
238 AliTRDcluster *c = 0x0;
239 for (Int_t ip = 0; ip < kNplane; ip++) {
240 if(fTrackletIndex[ip] == 0xffff) continue;
241 for (Int_t ic = 0; ic < AliTRDseedV1::kNTimeBins; ic++) {
242 if(!(c = fTracklet[ip]->GetClusters(ic))) continue;
243 for (Int_t k = 0; k < 3; k++) {
244 label = c->GetLabel(k);
248 while ((!labelAdded) && (j < kMAXCLUSTERSPERTRACK)) {
249 if ((s[j][0] == label) ||
264 for (Int_t i = 0; i < kMAXCLUSTERSPERTRACK; i++) {
265 if (s[i][1] <= max) continue;
270 if ((1. - Float_t(max)/GetNumberOfClusters()) > wrong) label = -label;
277 //_______________________________________________________________
278 Bool_t AliTRDtrackV1::CookPID()
281 // Cook the PID information
284 // Reset the a priori probabilities
285 Double_t pid = 1. / AliPID::kSPECIES;
286 for(int ispec=0; ispec<AliPID::kSPECIES; ispec++) {
291 // steer PID calculation @ tracklet level
293 for(int ip=0; ip<kNplane; ip++){
294 if(fTrackletIndex[ip] == 0xffff) continue;
295 if(!fTracklet[ip]->IsOK()) continue;
296 if(!(prob = fTracklet[ip]->GetProbability())) return kFALSE;
298 Int_t nspec = 0; // quality check of tracklet dEdx
299 for(int ispec=0; ispec<AliPID::kSPECIES; ispec++){
300 if(prob[ispec] < 0.) continue;
301 fPID[ispec] *= prob[ispec];
309 // no tracklet found for PID calculations
310 if(!fPIDquality) return kTRUE;
312 // slot for PID calculation @ track level
315 // normalize probabilities
316 Double_t probTotal = 0.0;
317 for (Int_t is = 0; is < AliPID::kSPECIES; is++) probTotal += fPID[is];
320 if (probTotal <= 0.0) {
321 AliWarning("The total probability over all species <= 0. This may be caused by some error in the reference data.");
325 for (Int_t iSpecies = 0; iSpecies < AliPID::kSPECIES; iSpecies++) fPID[iSpecies] /= probTotal;
330 //_______________________________________________________________
331 AliTRDcluster* AliTRDtrackV1::GetCluster(Int_t id)
334 for(Int_t ip=0; ip<kNplane; ip++){
335 if(!fTracklet[ip]) continue;
336 if(n+fTracklet[ip]->GetN() <= id){
337 n+=fTracklet[ip]->GetN();
340 AliTRDcluster *c = 0x0;
341 for(Int_t ic=AliTRDseedV1::kNTimeBins; ic--;){
342 if(!(c = fTracklet[ip]->GetClusters(ic))) continue;
344 if(n<id){n++; continue;}
351 //_______________________________________________________________
352 Int_t AliTRDtrackV1::GetClusterIndex(Int_t id) const
355 for(Int_t ip=0; ip<kNplane; ip++){
356 if(!fTracklet[ip]) continue;
357 if(n+fTracklet[ip]->GetN() <= id){
358 n+=fTracklet[ip]->GetN();
361 AliTRDcluster *c = 0x0;
362 for(Int_t ic=AliTRDseedV1::kNTimeBins; ic--;){
363 if(!(c = fTracklet[ip]->GetClusters(ic))) continue;
365 if(n<id){n++; continue;}
366 return fTracklet[ip]->GetIndexes(ic);
372 //_______________________________________________________________
373 Double_t AliTRDtrackV1::GetPredictedChi2(const AliTRDseedV1 *trklt) const
376 // Get the predicted chi2
379 Double_t x = trklt->GetX0();
380 Double_t p[2] = { trklt->GetYat(x)
381 , trklt->GetZat(x) };
383 trklt->GetCovAt(x, cov);
385 const Double_t *cc = GetCovariance();
386 Double_t dy = p[0]-GetY(); dy*=dy;
387 Double_t s2 = cov[0]+cc[0];
388 return s2 > 0. ? dy/s2 : 0.;
389 //return AliExternalTrackParam::GetPredictedChi2(p, cov);
392 //_______________________________________________________________
393 Bool_t AliTRDtrackV1::IsEqual(const TObject *o) const
395 if (!o) return kFALSE;
396 const AliTRDtrackV1 *inTrack = dynamic_cast<const AliTRDtrackV1*>(o);
397 if (!inTrack) return kFALSE;
399 if ( fPIDquality != inTrack->GetPIDquality() ) return kFALSE;
401 for(Int_t i = 0; i < AliPID::kSPECIES; i++){
402 if ( fPID[i] != inTrack->GetPID(i) ) return kFALSE;
405 for (Int_t i = 0; i < 3; i++){
406 if ( fBudget[i] != inTrack->GetBudget(i) ) return kFALSE;
408 if ( fDE != inTrack->GetEdep() ) return kFALSE;
409 if ( fFakeRatio != inTrack->GetFakeRatio() ) return kFALSE;
410 if ( fChi2 != inTrack->GetChi2() ) return kFALSE;
411 if ( fMass != inTrack->GetMass() ) return kFALSE;
412 if ( fLab != inTrack->GetLabel() ) return kFALSE;
413 if ( fN != inTrack->GetNumberOfClusters() ) return kFALSE;
414 if ( AliKalmanTrack::GetIntegratedLength() != inTrack->GetIntegratedLength() ) return kFALSE;
416 if ( GetX() != inTrack->GetX() ) return kFALSE;
417 if ( GetAlpha() != inTrack->GetAlpha() ) return kFALSE;
418 const Double_t *inP = inTrack->GetParameter();
419 const Double_t *curP = GetParameter();
420 for (Int_t i = 0; i < 5; i++){
421 if ( curP[i] != inP[i]) return kFALSE;
423 const Double_t *inC = inTrack->GetCovariance();
424 const Double_t *curC = GetCovariance();
425 for (Int_t i = 0; i < 15; i++){
426 if ( curC[i] != inC[i]) return kFALSE;
429 for (Int_t iTracklet = 0; iTracklet < kNplane; iTracklet++){
430 AliTRDseedV1 *curTracklet = fTracklet[iTracklet];
431 AliTRDseedV1 *inTracklet = inTrack->GetTracklet(iTracklet);
432 if (curTracklet && inTracklet){
433 if (! curTracklet->IsEqual(inTracklet) ) {
434 curTracklet->Print();
439 // if one tracklet exists, and corresponding
440 // in other track doesn't - return kFALSE
441 if(inTracklet || curTracklet) return kFALSE;
448 //_______________________________________________________________
449 Bool_t AliTRDtrackV1::IsElectron() const
451 if(GetPID(0) > fReconstructor->GetRecoParam()->GetPIDThreshold(GetP())) return kTRUE;
456 //_____________________________________________________________________________
457 void AliTRDtrackV1::MakeBackupTrack()
460 // Creates a backup track
464 fBackupTrack->~AliTRDtrackV1();
465 new(fBackupTrack) AliTRDtrackV1((AliTRDtrackV1&)(*this));
468 fBackupTrack = new AliTRDtrackV1((AliTRDtrackV1&)(*this));
471 //_____________________________________________________________________________
472 Int_t AliTRDtrackV1::GetProlongation(Double_t xk, Double_t &y, Double_t &z)
475 // Find a prolongation at given x
476 // Return 0 if it does not exist
479 Double_t bz = GetBz();
480 if (!AliExternalTrackParam::GetYAt(xk,bz,y)) return 0;
481 if (!AliExternalTrackParam::GetZAt(xk,bz,z)) return 0;
487 //_____________________________________________________________________________
488 Bool_t AliTRDtrackV1::PropagateTo(Double_t xk, Double_t xx0, Double_t xrho)
491 // Propagates this track to a reference plane defined by "xk" [cm]
492 // correcting for the mean crossed material.
494 // "xx0" - thickness/rad.length [units of the radiation length]
495 // "xrho" - thickness*density [g/cm^2]
502 Double_t oldX = GetX();
503 Double_t oldY = GetY();
504 Double_t oldZ = GetZ();
506 Double_t bz = GetBz();
508 if (!AliExternalTrackParam::PropagateTo(xk,bz)) {
518 if (IsStartedTimeIntegral()) {
519 Double_t l2 = TMath::Sqrt((x-oldX)*(x-oldX)
521 + (z-oldZ)*(z-oldZ));
522 Double_t crv = AliExternalTrackParam::GetC(bz);
523 if (TMath::Abs(l2*crv) > 0.0001) {
524 // Make correction for curvature if neccesary
525 l2 = 0.5 * TMath::Sqrt((x-oldX)*(x-oldX)
526 + (y-oldY)*(y-oldY));
527 l2 = 2.0 * TMath::ASin(l2 * crv) / crv;
528 l2 = TMath::Sqrt(l2*l2 + (z-oldZ)*(z-oldZ));
534 if (!AliExternalTrackParam::CorrectForMeanMaterial(xx0, xrho, GetMass())) return kFALSE;
540 Double_t p2 = (1.0 + GetTgl()*GetTgl()) / (GetSigned1Pt()*GetSigned1Pt());
541 Double_t beta2 = p2 / (p2 + GetMass()*GetMass());
542 if ((beta2 < 1.0e-10) ||
543 ((5940.0 * beta2/(1.0 - beta2 + 1.0e-10) - beta2) < 0.0)) {
547 Double_t dE = 0.153e-3 / beta2
548 * (TMath::Log(5940.0 * beta2/(1.0 - beta2 + 1.0e-10)) - beta2)
553 // Suspicious part - think about it ?
554 Double_t kinE = TMath::Sqrt(p2);
555 if (dE > 0.8*kinE) dE = 0.8 * kinE; //
556 if (dE < 0) dE = 0.0; // Not valid region for Bethe bloch
563 Double_t sigmade = 0.07 * TMath::Sqrt(TMath::Abs(dE)); // Energy loss fluctuation
564 Double_t sigmac2 = sigmade*sigmade*fC*fC*(p2+GetMass()*GetMass())/(p2*p2);
566 fCee += fX*fX * sigmac2;
574 //_____________________________________________________________________________
575 Int_t AliTRDtrackV1::PropagateToR(Double_t r,Double_t step)
578 // Propagate track to the radial position
579 // Rotation always connected to the last track position
587 Double_t radius = TMath::Sqrt(GetX()*GetX() + GetY()*GetY());
589 Double_t dir = (radius > r) ? -1.0 : 1.0;
591 for (Double_t x = radius+dir*step; dir*x < dir*r; x += dir*step) {
594 Double_t alpha = TMath::ATan2(xyz0[1],xyz0[0]);
597 GetProlongation(x,y,z);
598 xyz1[0] = x * TMath::Cos(alpha) + y * TMath::Sin(alpha);
599 xyz1[1] = x * TMath::Sin(alpha) - y * TMath::Cos(alpha);
602 if(AliTracker::MeanMaterialBudget(xyz0,xyz1,param)<=0.) return -1;
604 param[1] = 100000000;
606 PropagateTo(x,param[1],param[0]*param[4]);
611 Double_t alpha = TMath::ATan2(xyz0[1],xyz0[0]);
614 GetProlongation(r,y,z);
615 xyz1[0] = r * TMath::Cos(alpha) + y * TMath::Sin(alpha);
616 xyz1[1] = r * TMath::Sin(alpha) - y * TMath::Cos(alpha);
619 if(AliTracker::MeanMaterialBudget(xyz0,xyz1,param) <= 0.) return -1;
622 param[1] = 100000000;
624 PropagateTo(r,param[1],param[0]*param[4]);
630 //_____________________________________________________________________________
631 void AliTRDtrackV1::Print(Option_t *o) const
633 AliInfo(Form("PID q[%d] [%4.1f %4.1f %4.1f %4.1f %4.1f]", fPIDquality, 1.E2*fPID[0], 1.E2*fPID[1], 1.E2*fPID[2], 1.E2*fPID[3], 1.E2*fPID[4]));
634 AliInfo(Form("Material[%5.2f %5.2f %5.2f]", fBudget[0], fBudget[1], fBudget[2]));
636 AliInfo(Form("x[%7.2f] t[%7.4f] alpha[%f] mass[%f]", GetX(), GetIntegratedLength(), GetAlpha(), fMass));
637 AliInfo(Form("Ntr[%1d] Ncl[%3d] lab[%3d]", GetNumberOfTracklets(), fN, fLab));
639 if(strcmp(o, "a")!=0) return;
641 const Double_t *curP = GetParameter();
642 for (Int_t i = 0; i < 5; i++) printf("%7.2f ", curP[i]);
646 const Double_t *curC = GetCovariance();
647 for (Int_t i = 0, j=4, k=0; i<15; i++, k++){
648 printf("%7.2f ", curC[i]);
655 for(Int_t ip=0; ip<kNplane; ip++){
656 if(!fTracklet[ip]) continue;
657 fTracklet[ip]->Print(o);
662 //_____________________________________________________________________________
663 Bool_t AliTRDtrackV1::Rotate(Double_t alpha, Bool_t absolute)
666 // Rotates track parameters in R*phi plane
667 // if absolute rotation alpha is in global system
668 // otherwise alpha rotation is relative to the current rotation angle
671 if (absolute) alpha -= GetAlpha();
674 return AliExternalTrackParam::Rotate(GetAlpha()+alpha);
677 //___________________________________________________________
678 void AliTRDtrackV1::SetNumberOfClusters()
680 // Calculate the number of clusters attached to this track
683 for(int ip=0; ip<kNplane; ip++){
684 if(fTracklet[ip] && fTrackletIndex[ip] != 0xffff) ncls += fTracklet[ip]->GetN();
686 AliKalmanTrack::SetNumberOfClusters(ncls);
690 //_______________________________________________________________
691 void AliTRDtrackV1::SetOwner()
694 // Toggle ownership of tracklets
697 if(TestBit(kOwner)) return;
698 for (Int_t ip = 0; ip < kNplane; ip++) {
699 if(fTrackletIndex[ip] == 0xffff) continue;
700 fTracklet[ip] = new AliTRDseedV1(*fTracklet[ip]);
701 fTracklet[ip]->SetOwner();
706 //_______________________________________________________________
707 void AliTRDtrackV1::SetTracklet(AliTRDseedV1 *trklt, Int_t index)
712 Int_t plane = trklt->GetPlane();
714 fTracklet[plane] = trklt;
715 fTrackletIndex[plane] = index;
718 //_______________________________________________________________
719 void AliTRDtrackV1::SetTrackLow()
721 const AliExternalTrackParam *op = dynamic_cast<const AliExternalTrackParam*>(this);
722 fTrackLow = fTrackLow ? new(fTrackLow) AliExternalTrackParam(*op) : new AliExternalTrackParam(*op);
725 //_______________________________________________________________
726 void AliTRDtrackV1::SetTrackHigh(const AliExternalTrackParam *op)
728 if(!op) op = dynamic_cast<const AliExternalTrackParam*>(this);
729 fTrackHigh = fTrackHigh ? new(fTrackHigh) AliExternalTrackParam(*op) : new AliExternalTrackParam(*op);
732 //_______________________________________________________________
733 void AliTRDtrackV1::UnsetTracklet(Int_t plane)
735 if(plane<0 && plane >= kNplane) return;
736 fTrackletIndex[plane] = 0xffff;
737 fTracklet[plane] = 0x0;
741 //_______________________________________________________________
742 Bool_t AliTRDtrackV1::Update(AliTRDseedV1 *trklt, Double_t chisq)
745 // Update track and tracklet parameters
749 Double_t p[2] = { trklt->GetYat(x)
750 , trklt->GetZat(x) };
751 Double_t cov[3]/*, covR[3], cov0[3]*/;
753 // printf("\tD[%3d] Ly[%d] Trk: x[%f] y[%f] z[%f]\n", trklt->GetDetector(), trklt->GetPlane(), GetX(), GetY(), GetZ());
755 // Double_t xref = trklt->GetXref();
756 // trklt->GetCovAt(xref, covR);
757 // printf("xr=%5.3f y=%f+-%f z=%f+-%f (covYZ=%f)\n", xref, trklt->GetYat(xref), TMath::Sqrt(covR[0]), trklt->GetZat(xref), TMath::Sqrt(covR[2]), covR[1]);
759 // Double_t x0 = trklt->GetX0();
760 // trklt->GetCovAt(x0, cov0);
761 // printf("x0=%5.3f y=%f+-%f z=%f+-%f (covYZ=%f)\n", x0, trklt->GetYat(x0), TMath::Sqrt(cov0[0]), trklt->GetZat(x0), TMath::Sqrt(cov0[2]), cov0[1]);
763 // trklt->GetCovAt(x, cov);
764 // printf("x =%5.3f y=%f+-%f z=%f+-%f (covYZ=%f)\n", x, p[0], TMath::Sqrt(cov[0]), p[1], TMath::Sqrt(cov[2]), cov[1]);
766 // const Double_t *cc = GetCovariance();
767 // printf("yklm[0] = %f +- %f\n", GetY(), TMath::Sqrt(cc[0]));
769 trklt->GetCovAt(x, cov);
770 if(!AliExternalTrackParam::Update(p, cov)) return kFALSE;
771 // cc = GetCovariance();
772 // printf("yklm[1] = %f +- %f\n", GetY(), TMath::Sqrt(cc[0]));
774 AliTRDcluster *c = 0x0;
775 Int_t ic = 0; while(!(c = trklt->GetClusters(ic))) ic++;
776 AliTracker::FillResiduals(this, p, cov, c->GetVolumeId());
778 // Register info to track
779 SetNumberOfClusters();
780 SetChi2(GetChi2() + chisq);
784 //_______________________________________________________________
785 void AliTRDtrackV1::UpdateESDtrack(AliESDtrack *track)
788 // Update the TRD PID information in the ESD track
791 Int_t nslices = fReconstructor->IsEightSlices() ? (Int_t)AliTRDpidUtil::kNNslices : (Int_t)AliTRDpidUtil::kLQslices;
792 track->SetNumberOfTRDslices(nslices);
794 for (Int_t ip = 0; ip < kNplane; ip++) {
795 if(fTrackletIndex[ip] == 0xffff) continue;
796 if(!fTracklet[ip]->IsOK()) continue;
797 fTracklet[ip]->CookdEdx(nslices);
798 Float_t *dedx = fTracklet[ip]->GetdEdx();
799 for (Int_t js = 0; js < nslices; js++, dedx++) track->SetTRDslice(*dedx, ip, js);
803 if(!fPIDquality) return;
804 track->SetTRDpid(fPID);
805 track->SetTRDpidQuality(fPIDquality);