if (xyz[2]<0) sector+=(fNOuterSector>>1);
}
else
- if (xyz[2]<0) sector+=(fNInnerSector>>1);
+ if (xyz[2]<0) sector+=(fNInnerSector>>1);
+ if (sector<0 || sector>=fNSector) AliError(Form("Wrong sector %d",sector));
index[1]=sector; // calculated sector number
index[0]=1; // indicates system after transformation
return sector;
//rotate to given sector
Double_t xyzmaster[3] = {xyz[0],xyz[1],xyz[2]};
Double_t xyzlocal[3];
- fGlobalMatrix[index[1]]->MasterToLocal(xyzmaster,xyzlocal);
+ if (index[1]>=0 && index[1]<fNSector)
+ fGlobalMatrix[index[1]]->MasterToLocal(xyzmaster,xyzlocal);
xyz[0] = xyzlocal[0];
xyz[1] = xyzlocal[1];
xyz[2] = xyzlocal[2];