+//______________________________________________________________________________
+Bool_t AliITSUTrackerGlo::PropagateSeed(AliExternalTrackParam *seed, Double_t xToGo, Double_t mass, Double_t maxStep, Bool_t matCorr)
+{
+ // propagate seed to given x applying material correction if requested
+ const Double_t kEpsilon = 1e-5;
+ Double_t xpos = seed->GetX();
+ Int_t dir = (xpos<xToGo) ? 1:-1;
+ Double_t xyz0[3],xyz1[3],param[7];
+ //
+ Bool_t updTime = dir>0 && seed->IsStartedTimeIntegral();
+ if (matCorr || updTime) seed->GetXYZ(xyz1); //starting global position
+ while ( (xToGo-xpos)*dir > kEpsilon){
+ Double_t step = dir*TMath::Min(TMath::Abs(xToGo-xpos), maxStep);
+ Double_t x = xpos+step;
+ Double_t bz=GetBz(); // getting the local Bz
+ if (!seed->PropagateTo(x,bz)) return kFALSE;
+ double ds = 0;
+ if (matCorr || updTime) {
+ xyz0[0]=xyz1[0]; // global pos at the beginning of step
+ xyz0[1]=xyz1[1];
+ xyz0[2]=xyz1[2];
+ seed->GetXYZ(xyz1); // // global pos at the end of step
+ //
+ if (matCorr) {
+ MeanMaterialBudget(xyz0,xyz1,param);
+ Double_t xrho=param[0]*param[4], xx0=param[1];
+ if (dir>0) xrho = -xrho; // outward should be negative
+ if (!seed->CorrectForMeanMaterial(xx0,xrho,mass)) return kFALSE;
+ ds = param[4];
+ }
+ else { // matCorr is not requested but time integral is
+ double d0 = xyz1[0]-xyz0[0];
+ double d1 = xyz1[1]-xyz0[1];
+ double d2 = xyz1[2]-xyz0[2];
+ ds = TMath::Sqrt(d0*d0+d1*d1+d2*d2);
+ }
+ }
+ if (updTime) seed->AddTimeStep(ds);
+ //
+ xpos = seed->GetX();
+ }
+ return kTRUE;
+}
+