Additional protection
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Sep 2008 21:13:35 +0000 (21:13 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 18 Sep 2008 21:13:35 +0000 (21:13 +0000)
TPC/AliTPCtrackerMI.cxx

index 0c28328..a5778f8 100644 (file)
@@ -1489,7 +1489,9 @@ AliTPCclusterMI *AliTPCtrackerMI::GetClusterMI(Int_t index) const {
   }
 
   if (sec<fkNIS*2){
-    tpcrow = &(fInnerSec[sec%fkNIS][row]);
+    AliTPCtrackerSector& tracksec = fInnerSec[sec%fkNIS];
+    if (tracksec.GetNRows()<=row) return 0;
+    tpcrow = &(tracksec[row]);
     if (tpcrow==0) return 0;
 
     if (sec<fkNIS) {
@@ -1502,7 +1504,9 @@ AliTPCclusterMI *AliTPCtrackerMI::GetClusterMI(Int_t index) const {
     }
   }
   else {
-    tpcrow = &(fOuterSec[(sec-fkNIS*2)%fkNOS][row]);
+    AliTPCtrackerSector& tracksec = fOuterSec[(sec-fkNIS*2)%fkNOS];
+    if (tracksec.GetNRows()<=row) return 0;
+    tpcrow = &(tracksec[row]);
     if (tpcrow==0) return 0;
 
     if (sec-2*fkNIS<fkNOS) {