- for (Int_t i=0; i<nc; i++){
- Int_t cind[5];
- cind[0]= clind[0][i];
- cind[1]= clind[1][i];
- cind[2]= clind[2][i];
- cind[3]= clind[3][i];
- cind[4]= clind[4][i];
- Bool_t accept = kFALSE;
- if( mLastStep)accept = (fGeom->DistanceToPad(cind,global[i],ctrackPos)<dCut);
- if(!mLastStep)accept = (fGeom->IsInsideThePad(cind,global[i],ctrackPos));
- if(accept){
- if(!mLastStep)isInside=kTRUE;
- Float_t dist3d[3];
- dist[nfound]=fGeom->DistanceToPad(cind,global[i],ctrackPos,dist3d);
- distZ[nfound]=dist3d[2];
- crecL[nfound]=trackPos[3][istep];
- index[nfound]=clind[5][i]; // store cluster id
- cxpos[nfound]=fGeom->RinTOF()+istep*0.1; //store prop.radius
+ Float_t dist3d[3];
+ accept = kFALSE;
+ for (Int_t i=0; i<nc; i++) {
+ isInside = fGeom->IsInsideThePad(global[i],ctrackPos,dist3d);
+
+ if ( mLastStep ) {
+ Float_t yLoc = dist3d[1];
+ Float_t rLoc = TMath::Sqrt(dist3d[0]*dist3d[0]+dist3d[2]*dist3d[2]);
+ accept = (TMath::Abs(yLoc)<padDepth*0.5 && rLoc<dCut);
+ AliDebug(2," I am in the case mLastStep==kTRUE ");
+ }
+ else {
+ accept = isInside;
+ }
+ if (accept) {
+
+ dist[nfound] = TMath::Sqrt(dist3d[0]*dist3d[0] +
+ dist3d[1]*dist3d[1] +
+ dist3d[2]*dist3d[2]);
+ AliDebug(1,Form(" dist3dLoc[0] = %f, dist3dLoc[1] = %f, dist3dLoc[2] = %f ",
+ dist3d[0],dist3d[1],dist3d[2]));
+ distZ[nfound] = dist3d[2]; // Z distance in the RF of the
+ // hit pad closest to the
+ // reconstructed track
+
+ AliDebug(1,Form(" dist3dLoc[2] = %f --- distZ[%d] = %f",
+ dist3d[2],nfound,distZ[nfound]));
+
+ crecL[nfound] = trackPos[3][istep];
+ index[nfound] = clind[i]; // store cluster id
+ cxpos[nfound] = AliTOFGeometry::RinTOF()+istep*0.1; //store prop.radius