- AliTRDrecPoint *rp = (AliTRDrecPoint *) RecPointsArray->UncheckedAt(index);
- local[0]=rp->GetLocalRow();
- local[1]=rp->GetLocalCol();
- local[2]=rp->GetLocalTime();
- det=rp->GetDetector();
-
- if(fGeom->Local2Global(det,local,global)) {
- x=global[0]; y=global[1]; z=global[2];
- pm->SetPoint(j,x,y,z);
- }
+ AliTRDcluster *rp = (AliTRDcluster *) RecPointsArray->UncheckedAt(index);
+
+ Int_t idet=rp->GetDetector();
+ Int_t iplan = fGeom->GetPlane(idet);
+ Int_t itt=rp->GetLocalTimeBin();
+ Float_t timeSlice = itt+0.5;
+ Float_t time0 = par->GetTime0(iplan);
+
+
+ // calculate (x,y,z) position in rotated chamber
+ local[0] = time0 - (timeSlice - par->GetTimeBefore())
+ * par->GetTimeBinSize();
+ local[1]=rp->GetY();
+ local[2]=rp->GetZ();
+
+ if(fGeom->RotateBack(idet,local,global)) {
+ x=global[0]; y=global[1]; z=global[2];
+ pm->SetPoint(j,x,y,z);
+ }