]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Error message in case of negative segment number and additional protection
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 May 2008 20:37:03 +0000 (20:37 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 6 May 2008 20:37:03 +0000 (20:37 +0000)
TPC/AliTPCParam.cxx
TPC/AliTPCParam.h

index ff15faf3143444b283c9ec804a8548999b49fdd9..c7e055574b077a8e0d4d195d6a20c751cbace7c6 100644 (file)
@@ -196,7 +196,8 @@ Int_t  AliTPCParam::Transform0to1(Float_t *xyz, Int_t * index)  const
       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;
index ac07af7584c9279f81d6d4a317e2f7a1648faed7..99cb88a45939f4270de9bff66859ec61e9d53722 100644 (file)
@@ -521,7 +521,8 @@ inline void AliTPCParam::Transform1to2(Float_t *xyz, Int_t *index) const
   //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];