]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/TPCLib/AliHLTTPCDigitReaderUnpacked.cxx
minor update of documentation
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCDigitReaderUnpacked.cxx
index f434ae859d61e2912dc8dee14c21b1c4d7553800..45aaa767de796013d8fe47087af60fe44c2f792b 100644 (file)
@@ -197,10 +197,10 @@ bool AliHLTTPCDigitReaderUnpacked::NextSignal(){
 
   fBin++;
 
-  if ( fBin >= (Int_t)fActRowData->fNDigit ){
+  while ( fBin >= (Int_t)fActRowData->fNDigit ){
     fRow++;
     if ((fRow >= fFirstRow) && (fRow <= fLastRow)){
-
+      
       //new row 
       if (GetNextRowData(fActRowData)<0) {
        rreadvalue = false;
@@ -212,14 +212,14 @@ bool AliHLTTPCDigitReaderUnpacked::NextSignal(){
       rreadvalue = false;
       return rreadvalue;
     }
-  if(!fActRowData){
-    return false;
-  }
+    if(!fActRowData){
+      return false;
+    }
     if ((Int_t)fActRowData->fRow != fRow){
       HLTWarning("Row number should match! fActRowData->fRow=%d fRow=%d", fActRowData->fRow, fRow);
     }
   }
-
+  
   fData = fActRowData->fDigitData;
 
   if(fBin==0){
@@ -292,6 +292,13 @@ AliHLTUInt32_t AliHLTTPCDigitReaderUnpacked::GetAltroBlockHWaddr() const
   return (AliHLTUInt32_t)(fMapping->GetHwAddress((UInt_t)GetSortedRow(),(UInt_t)GetSortedPad()));//fTPCRawStream->GetHWAddress();
 }
 
+AliHLTTPCDigitData AliHLTTPCDigitReaderUnpacked::GetSortedDigit(){
+  // see header file for class documentation
+  assert(fData);
+  if (!fData) return AliHLTTPCDigitData();
+  return fData[fBinRowPositionSorted.at(fBin)];
+}
+
 Int_t AliHLTTPCDigitReaderUnpacked::GetSortedTime(){
   // see header file for class documentation
   assert(fData);
@@ -389,7 +396,7 @@ int AliHLTTPCDigitReaderUnpacked::NextBunch()
   fPrevPad = GetSortedPad();
   fPrevRow = GetSortedRow();
   fDataBunch.push_back(GetSortedSignal());
-  fDigitsVector.push_back(fData[fBin]);
+  fDigitsVector.push_back(GetSortedDigit());
 
   do{
     if(NextSignal()){
@@ -398,7 +405,7 @@ int AliHLTTPCDigitReaderUnpacked::NextBunch()
            fPrevTime = GetSortedTime();
            //fDataBunch.insert(fDataBunch.begin(), GetSortedSignal());// add the signal to the beginning of the buffer     
            fDataBunch.push_back(GetSortedSignal());// add the signal to the beginning of the buffer
-           fDigitsVector.push_back(fData[fBin]);
+           fDigitsVector.push_back(GetSortedDigit());
          }
          else{//end of bunch but not of channel
            break;