bugfixes by Kenneth:
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 27 Mar 2008 19:24:34 +0000 (19:24 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 27 Mar 2008 19:24:34 +0000 (19:24 +0000)
TPCClusterFinder: consider row offset correctly for stored clusters
     (rows had been numbered starting from 0 on all the patches)
PCMapping: correct initialization of array bounds in cause of multiple instances.

HLT/TPCLib/AliHLTTPCClusterFinder.cxx
HLT/TPCLib/AliHLTTPCMapping.cxx

index 4f4834c..ef3b266 100644 (file)
@@ -753,8 +753,30 @@ void AliHLTTPCClusterFinder::ReadDataUnsorted(void* ptr,unsigned long size)
     InitializePadArray();
   }
 
+  Int_t rowOffset=0;
+  switch(fCurrentPatch){
+  case 0:
+    rowOffset=AliHLTTPCTransform::GetFirstRow(0);
+    break;
+  case 1:
+    rowOffset=AliHLTTPCTransform::GetFirstRow(1);
+    break;
+  case 2:
+    rowOffset=AliHLTTPCTransform::GetFirstRow(2);
+    break;
+  case 3:
+    rowOffset=AliHLTTPCTransform::GetFirstRow(3);
+    break;
+  case 4:
+    rowOffset=AliHLTTPCTransform::GetFirstRow(4);
+    break;
+  case 5:
+    rowOffset=AliHLTTPCTransform::GetFirstRow(5);
+    break;
+  }
+  
   fDigitReader->InitBlock(fPtr,fSize,fFirstRow,fLastRow,fCurrentPatch,fCurrentSlice);
+  
   while(fDigitReader->NextChannel()){
     UInt_t row=fDigitReader->GetRow();
     UInt_t pad=fDigitReader->GetPad();
@@ -780,7 +802,7 @@ void AliHLTTPCClusterFinder::ReadDataUnsorted(void* ptr,unsigned long size)
          candidate.fPad=candidate.fTotalCharge*pad;
          candidate.fPad2=candidate.fPad*pad;
          candidate.fLastMergedPad=pad;
-         candidate.fRowNumber=row;
+         candidate.fRowNumber=row+rowOffset;
        }
        fRowPadVector[row][pad]->AddClusterCandidate(candidate);
       }
index 9056017..b3742e4 100644 (file)
@@ -57,6 +57,7 @@ AliHLTTPCMapping::AliHLTTPCMapping(UInt_t patch)
     }
     fCurrentRowMapping=fgRowMapping0;
     fCurrentPadMapping=fgPadMapping0;
+    fMaxHWAdd=fgkMapping0Size;
     break;
   case 1:
     if(!fgMapping1IsDone){
@@ -66,6 +67,7 @@ AliHLTTPCMapping::AliHLTTPCMapping(UInt_t patch)
     }
     fCurrentRowMapping=fgRowMapping1;
     fCurrentPadMapping=fgPadMapping1;
+    fMaxHWAdd=fgkMapping1Size;
     break;
   case 2:
     if(!fgMapping2IsDone){
@@ -75,6 +77,7 @@ AliHLTTPCMapping::AliHLTTPCMapping(UInt_t patch)
     }
     fCurrentRowMapping=fgRowMapping2;
     fCurrentPadMapping=fgPadMapping2;
+    fMaxHWAdd=fgkMapping2Size;
     break;
   case 3:
     if(!fgMapping3IsDone){
@@ -84,6 +87,7 @@ AliHLTTPCMapping::AliHLTTPCMapping(UInt_t patch)
     }
     fCurrentRowMapping=fgRowMapping3;
     fCurrentPadMapping=fgPadMapping3;
+    fMaxHWAdd=fgkMapping3Size;
     break;
   case 4:
     if(!fgMapping4IsDone){
@@ -93,6 +97,7 @@ AliHLTTPCMapping::AliHLTTPCMapping(UInt_t patch)
     }
     fCurrentRowMapping=fgRowMapping4;
     fCurrentPadMapping=fgPadMapping4;
+    fMaxHWAdd=fgkMapping4Size;
     break;
   case 5:
     if(!fgMapping5IsDone){
@@ -102,6 +107,7 @@ AliHLTTPCMapping::AliHLTTPCMapping(UInt_t patch)
     }
     fCurrentRowMapping=fgRowMapping5;
     fCurrentPadMapping=fgPadMapping5;
+    fMaxHWAdd=fgkMapping5Size;
     break;
   }
 }