- Float_t g[3]; //global coordinates
- c->GetGlobalXYZ(g);
- clusters->SetNextPoint(g[0], g[1], g[2]);
+ //Float_t g[3]; //global coordinates
+ //c->GetGlobalXYZ(g);
+
+ Int_t fVolumeId = c->GetVolumeId();
+ const TGeoHMatrix *mt =AliGeomManager::GetTracking2LocalMatrix(fVolumeId);;
+ Double_t txyz[3] = {c->GetX(), c->GetY(), c->GetZ()};
+ Double_t lxyz[3] = {0, 0, 0};
+ mt->LocalToMaster(txyz,lxyz);
+
+ TGeoHMatrix *mlIdeal = AliGeomManager::GetOrigGlobalMatrix(fVolumeId);
+ Double_t gxyzIdeal[3] = {0, 0, 0};
+ mlIdeal->LocalToMaster(lxyz,gxyzIdeal);
+
+ clusters->SetNextPoint(gxyzIdeal[0], gxyzIdeal[1], gxyzIdeal[2]);
+