]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HLT/TPCLib/AliHLTTPCDigitReaderRaw.cxx
robustness
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCDigitReaderRaw.cxx
index 1d89d0b3de823ad9bbb7b5d5092fc08302d5b335..fe661f597d183e3d97f8ed92a24107fdc7790085 100644 (file)
@@ -221,7 +221,7 @@ int AliHLTTPCDigitReaderRaw::InitBlock(void* ptr,unsigned long size, Int_t patch
     return 0;
 }
 
-bool AliHLTTPCDigitReaderRaw::Next()
+bool AliHLTTPCDigitReaderRaw::NextSignal()
 {
   // see header file for class documentation
 
@@ -307,6 +307,20 @@ int AliHLTTPCDigitReaderRaw::GetTime()
     return GetRealTime();
 }
 
+int AliHLTTPCDigitReaderRaw::GetAltroChannelRawData(void* &pTgt, AliHLTUInt16_t &hwAddress)
+{
+  int iResult=0;
+  if (fBuffer==NULL) return -ENODATA;
+  if (fAltroBlockPositionBytes-fAltroBlockLengthBytes>=GetCommonDataHeaderSize()) {
+    pTgt=fBuffer+(fAltroBlockPositionBytes-fAltroBlockLengthBytes);
+    iResult=fAltroBlockLengthBytes;
+    hwAddress=fAltroBlockHWAddress;
+  } else {
+    iResult=-ERANGE;
+  }
+  return iResult;
+}
+
 bool AliHLTTPCDigitReaderRaw::RealNext()
 {
   // see header file for class documentation
@@ -367,7 +381,7 @@ AliHLTUInt32_t AliHLTTPCDigitReaderRaw::GetRCUTrailer( unsigned offset ) const
 bool AliHLTTPCDigitReaderRaw::NextAltroBlock()
 {
   // see header file for class documentation
-    if (fBufferSize<=0) return 0;
+    if (fBufferSize<=32) return 0;
     bool first = false;
     if ( !fAltroBlockLengthBytes )
        {
@@ -590,13 +604,8 @@ Bool_t AliHLTTPCDigitReaderRaw::ApplyMapping()
            fPad = fgMapping0[(unsigned)fAltroBlockHWAddress][1];
            break;
         case 1:
-           fRow = AliHLTTPCDigitReaderRaw::fgMapping1[(unsigned)fAltroBlockHWAddress][0];
-           fPad = AliHLTTPCDigitReaderRaw::fgMapping1[(unsigned)fAltroBlockHWAddress][1];
-#if 0
-           printf ("pad %d # row %d (hwa: %u / 0x%08X\n", fgMapping1[(unsigned)fAltroBlockHWAddress][0],fgMapping1[(unsigned)fAltroBlockHWAddress][1], (unsigned)fAltroBlockHWAddress, (unsigned)fAltroBlockHWAddress);
-           printf ("pad %d # row %d (hwa: %u / 0x%08X\n", fgMapping1[(unsigned)fAltroBlockHWAddress-1][0],fgMapping1[(unsigned)fAltroBlockHWAddress-1][1], (unsigned)fAltroBlockHWAddress-1, (unsigned)fAltroBlockHWAddress-1);
-           printf ("pad %d # row %d (hwa: %u / 0x%08X\n", fgMapping1[(unsigned)fAltroBlockHWAddress+1][0],fgMapping1[(unsigned)fAltroBlockHWAddress+1][1], (unsigned)fAltroBlockHWAddress+1, (unsigned)fAltroBlockHWAddress+1);
-#endif
+           fRow = fgMapping1[(unsigned)fAltroBlockHWAddress][0];
+           fPad = fgMapping1[(unsigned)fAltroBlockHWAddress][1];
            break;
        case 2:
            fRow = fgMapping2[(unsigned)fAltroBlockHWAddress][0];
@@ -623,7 +632,7 @@ Bool_t AliHLTTPCDigitReaderRaw::ApplyMapping()
 }
 
 
-Int_t AliHLTTPCDigitReaderRaw::GetRow( unsigned patch, unsigned hwAddr )
+Int_t AliHLTTPCDigitReaderRaw::GetRow( unsigned /*patch*/, unsigned hwAddr )
 {
   // see header file for class documentation
 
@@ -655,7 +664,7 @@ Int_t AliHLTTPCDigitReaderRaw::GetRow( unsigned patch, unsigned hwAddr )
     }
 }
 
-Int_t AliHLTTPCDigitReaderRaw::GetPad( unsigned patch, unsigned hwAddr )
+Int_t AliHLTTPCDigitReaderRaw::GetPad( unsigned /*patch*/, unsigned hwAddr )
 {
   // see header file for class documentation