+ }
+
+ return kTRUE;
+}
+
+//_____________________________________________________________________________
+Int_t AliTRDtrackV1::PropagateToR(Double_t r,Double_t step)
+{
+ //
+ // Propagate track to the radial position
+ // Rotation always connected to the last track position
+ //
+
+ Double_t xyz0[3];
+ Double_t xyz1[3];
+ Double_t y;
+ Double_t z;
+
+ Double_t radius = TMath::Sqrt(GetX()*GetX() + GetY()*GetY());
+ // Direction +-
+ Double_t dir = (radius > r) ? -1.0 : 1.0;
+
+ for (Double_t x = radius+dir*step; dir*x < dir*r; x += dir*step) {
+
+ GetXYZ(xyz0);
+ Double_t alpha = TMath::ATan2(xyz0[1],xyz0[0]);
+ Rotate(alpha,kTRUE);
+ GetXYZ(xyz0);
+ if(GetProlongation(x,y,z)<0) return -1;
+ xyz1[0] = x * TMath::Cos(alpha) + y * TMath::Sin(alpha);
+ xyz1[1] = x * TMath::Sin(alpha) - y * TMath::Cos(alpha);
+ xyz1[2] = z;
+ Double_t param[7];
+ if(AliTracker::MeanMaterialBudget(xyz0,xyz1,param)<=0.) return -1;
+ if (param[1] <= 0) {
+ param[1] = 100000000;
+ }
+ PropagateTo(x,param[1],param[0]*param[4]);
+
+ }
+
+ GetXYZ(xyz0);
+ Double_t alpha = TMath::ATan2(xyz0[1],xyz0[0]);
+ Rotate(alpha,kTRUE);
+ GetXYZ(xyz0);
+ if(GetProlongation(r,y,z)<0) return -1;
+ xyz1[0] = r * TMath::Cos(alpha) + y * TMath::Sin(alpha);
+ xyz1[1] = r * TMath::Sin(alpha) - y * TMath::Cos(alpha);
+ xyz1[2] = z;
+ Double_t param[7];
+ if(AliTracker::MeanMaterialBudget(xyz0,xyz1,param) <= 0.) return -1;
+
+ if (param[1] <= 0) {
+ param[1] = 100000000;
+ }
+ PropagateTo(r,param[1],param[0]*param[4]);
+
+ return 0;
+
+}
+
+//_____________________________________________________________________________
+void AliTRDtrackV1::Print(Option_t *o) const
+{
+ // Print track status
+ AliInfo(Form("PID [%4.1f %4.1f %4.1f %4.1f %4.1f]", 1.E2*fPID[0], 1.E2*fPID[1], 1.E2*fPID[2], 1.E2*fPID[3], 1.E2*fPID[4]));
+ AliInfo(Form("Material[%5.2f %5.2f %5.2f]", fBudget[0], fBudget[1], fBudget[2]));
+
+ AliInfo(Form("x[%7.2f] t[%7.4f] alpha[%f] mass[%f]", GetX(), GetIntegratedLength(), GetAlpha(), fMass));
+ AliInfo(Form("Ntr[%1d] NtrPID[%1d] Ncl[%3d] lab[%3d]", GetNumberOfTracklets(), GetNumberOfTrackletsPID(), fN, fLab));
+
+ printf("|X| = (");
+ const Double_t *curP = GetParameter();
+ for (Int_t i = 0; i < 5; i++) printf("%7.2f ", curP[i]);
+ printf(")\n");
+
+ printf("|V| = \n");
+ const Double_t *curC = GetCovariance();
+ for (Int_t i = 0, j=4, k=0; i<15; i++, k++){
+ printf("%7.2f ", curC[i]);
+ if(k==j){
+ printf("\n");
+ k=-1; j--;
+ }
+ }
+ if(strcmp(o, "a")!=0) return;
+
+ for(Int_t ip=0; ip<kNplane; ip++){
+ if(!fTracklet[ip]) continue;
+ fTracklet[ip]->Print(o);
+ }
+}
+
+
+//_____________________________________________________________________________
+Bool_t AliTRDtrackV1::Rotate(Double_t alpha, Bool_t absolute)
+{
+ //
+ // Rotates track parameters in R*phi plane
+ // if absolute rotation alpha is in global system
+ // otherwise alpha rotation is relative to the current rotation angle
+ //
+
+ if (absolute) alpha -= GetAlpha();
+ //else fNRotate++;