+//----------------------------------------------------------------------
+Int_t AliITSsegmentationSSD::GetChipFromChannel(Int_t ix, Int_t iz) const {
+ // returns chip number (in range 0-11) starting from channel number
+
+ if( (iz>=fgkNstripsDefault) || (iz<0) || (ix<0) || (ix>1) ) {
+ AliError("Bad cell number");
+ return -1;
+ }
+
+ if(ix==1) iz = 1535-iz;
+ Int_t theChip =iz/fgkNstripsPerChip;
+ return theChip;
+
+}
+//----------------------------------------------------------------------
+Int_t AliITSsegmentationSSD::GetChipFromLocal(Float_t xloc, Float_t zloc) const
+{
+ // returns chip numbers starting from local coordinates
+ // The two Nside chip number and Pside chip number are
+ // coded as chip=Nchip*10+Pchip
+
+ Int_t iP=0;
+ Int_t iN=0;
+ if (!LocalToDet(xloc,zloc,iP,iN) ||
+ (iP<0) || (iP>=fNstrips) || (iN<0) || (iN>=fNstrips) ) {
+ AliWarning("Bad local coordinate");
+ return -1;
+ }
+
+ Int_t iChip = GetChipFromChannel(0,iP);
+ iChip += 10*GetChipFromChannel(1,iN); // add Nside
+
+ return iChip;
+
+}
+//
+