+ Int_t nentr=event->GetNumberOfTracks();
+ Info("PropagateBack", "Number of ESD tracks: %d\n", nentr);
+
+ Int_t ntrk=0;
+ for (Int_t i=0; i<nentr; i++) {
+ AliESDtrack *esd=event->GetTrack(i);
+ ULong_t status=esd->GetStatus();
+
+ if ( (status & AliESDtrack::kTPCin ) == 0 ) continue;
+ if ( (status & AliESDtrack::kTPCout) != 0 ) continue;
+
+ const AliTPCtrack t(*esd);
+ AliTPCseed s(t,t.GetAlpha());
+
+ if ( (status & AliESDtrack::kITSout) == 0 ) s.ResetCovariance();
+
+ s.ResetNWrong();
+ s.ResetNRotation();
+
+ Int_t nc=t.GetNumberOfClusters();
+ s.SetNumber(nc); //set number of the cluster to start with
+
+ //inner sectors
+ fSectors=fInnerSec; fN=fkNIS;
+
+ Double_t alpha=s.GetAlpha() - fSectors->GetAlphaShift();
+ if (alpha > 2.*TMath::Pi()) alpha -= 2.*TMath::Pi();
+ if (alpha < 0. ) alpha += 2.*TMath::Pi();
+ Int_t ns=Int_t(alpha/fSectors->GetAlpha())%fN;
+ alpha =ns*fSectors->GetAlpha() + fSectors->GetAlphaShift();
+ alpha-=s.GetAlpha();
+
+ if (!s.Rotate(alpha)) continue;
+ if (!FollowBackProlongation(s,t)) continue;
+
+ UseClusters(&s);
+
+ //outer sectors
+ fSectors=fOuterSec; fN=fkNOS;
+
+ nc=s.GetNumberOfClusters();
+
+ alpha=s.GetAlpha() - fSectors->GetAlphaShift();
+ if (alpha > 2.*TMath::Pi()) alpha -= 2.*TMath::Pi();
+ if (alpha < 0. ) alpha += 2.*TMath::Pi();
+ ns=Int_t(alpha/fSectors->GetAlpha())%fN;
+
+ alpha =ns*fSectors->GetAlpha() + fSectors->GetAlphaShift();
+ alpha-=s.GetAlpha();
+
+ if (!s.Rotate(alpha)) continue;
+ if (!FollowBackProlongation(s,t)) continue;
+ {
+ Int_t nrows=fOuterSec->GetNRows()+fInnerSec->GetNRows();
+ if (s.GetNumberOfClusters() < Int_t(0.4*nrows)) continue;
+ }
+ s.PropagateTo(fParam->GetOuterRadiusUp());
+ s.CookdEdx();
+ CookLabel(&s,0.1); //For comparison only
+ UseClusters(&s,nc);
+ esd->UpdateTrackParams(&s,AliESDtrack::kTPCout);
+ ntrk++;
+ }
+ Info("PropagateBack","Number of back propagated tracks: %d",ntrk);
+
+ return 0;