+//_________________________________________________________________________
+Bool_t AliTOFtracker::GetTrackPoint(Int_t index, AliTrackPoint& p) const
+{
+ // Get track space point with index i
+ // Coordinates are in the global system
+ AliTOFcluster *cl = fClusters[index];
+ Float_t xyz[3];
+ xyz[0] = cl->GetR()*TMath::Cos(cl->GetPhi());
+ xyz[1] = cl->GetR()*TMath::Sin(cl->GetPhi());
+ xyz[2] = cl->GetZ();
+ Float_t phiangle = (Int_t(cl->GetPhi()*TMath::RadToDeg()/20.)+0.5)*20.*TMath::DegToRad();
+ Float_t sinphi = TMath::Sin(phiangle), cosphi = TMath::Cos(phiangle);
+ Float_t tiltangle = fGeom->GetAngles(cl->GetDetInd(1),cl->GetDetInd(2))*TMath::DegToRad();
+ Float_t sinth = TMath::Sin(tiltangle), costh = TMath::Cos(tiltangle);
+ Float_t sigmay2 = fGeom->XPad()*fGeom->XPad()/12.;
+ Float_t sigmaz2 = fGeom->ZPad()*fGeom->ZPad()/12.;
+ Float_t cov[6];
+ cov[0] = sinphi*sinphi*sigmay2 + cosphi*cosphi*sinth*sinth*sigmaz2;
+ cov[1] = -sinphi*cosphi*sigmay2 + sinphi*cosphi*sinth*sinth*sigmaz2;
+ cov[2] = -cosphi*sinth*costh*sigmaz2;
+ cov[3] = cosphi*cosphi*sigmay2 + sinphi*sinphi*sinth*sinth*sigmaz2;
+ cov[4] = -sinphi*sinth*costh*sigmaz2;
+ cov[5] = costh*costh*sigmaz2;
+ p.SetXYZ(xyz[0],xyz[1],xyz[2],cov);
+
+ // Detector numbering scheme
+ Int_t nSector = fGeom->NSectors();
+ Int_t nPlate = fGeom->NPlates();
+ Int_t nStripA = fGeom->NStripA();
+ Int_t nStripB = fGeom->NStripB();
+ Int_t nStripC = fGeom->NStripC();
+
+ Int_t isector = cl->GetDetInd(0);
+ if (isector >= nSector)
+ AliError(Form("Wrong sector number in TOF (%d) !",isector));
+ Int_t iplate = cl->GetDetInd(1);
+ if (iplate >= nPlate)
+ AliError(Form("Wrong plate number in TOF (%d) !",iplate));
+ Int_t istrip = cl->GetDetInd(2);
+
+ Int_t stripOffset = 0;
+ switch (iplate) {
+ case 0:
+ stripOffset = 0;
+ break;
+ case 1:
+ stripOffset = nStripC;
+ break;
+ case 2:
+ stripOffset = nStripC+nStripB;
+ break;
+ case 3:
+ stripOffset = nStripC+nStripB+nStripA;
+ break;
+ case 4:
+ stripOffset = nStripC+nStripB+nStripA+nStripB;
+ break;
+ default:
+ AliError(Form("Wrong plate number in TOF (%d) !",iplate));
+ break;
+ };
+
+ Int_t idet = (2*(nStripC+nStripB)+nStripA)*isector +
+ stripOffset +
+ istrip;
+ UShort_t volid = AliAlignObj::LayerToVolUID(AliAlignObj::kTOF,idet);
+ p.SetVolumeID((UShort_t)volid);
+ return kTRUE;
+}