]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawReaderDateV3.cxx
Bugfix in raw data reader classes. The bug affected the determination of the raw...
[u/mrichter/AliRoot.git] / RAW / AliRawReaderDateV3.cxx
index 1efebe320aded7d4cc2a37fbdd8ac4bb5d351a74..3bc53c8560794b739baf7a2589d1eea67cd5fade 100644 (file)
@@ -236,6 +236,12 @@ Int_t AliRawReaderDateV3::GetEquipmentElementSize() const
   return 0;
 }
 
+Int_t AliRawReaderDateV3::GetEquipmentHeaderSize() const
+{
+// get the size of the equipment header
+
+  return 0;
+}
 
 Bool_t AliRawReaderDateV3::ReadHeader()
 {
@@ -303,6 +309,12 @@ Bool_t AliRawReaderDateV3::ReadHeader()
 
       // "read" the data header
       fHeader = (AliRawDataHeader*) fPosition;
+      if ((fPosition + fHeader->fSize) != fEnd) {
+       Warning("ReadHeader",
+               "raw data size found in the header is wrong (%d != %d)! Using the equipment size instead !",
+               fHeader->fSize, fEnd - fPosition);
+       fHeader->fSize = fEnd - fPosition;
+      }
       fPosition += sizeof(AliRawDataHeader);
     }
 
@@ -465,8 +477,12 @@ Int_t AliRawReaderDateV3::CheckData() const
 
       // check consistency of data size in the data header and in the sub event
       AliRawDataHeader* header = (AliRawDataHeader*) position;
-      if (header->fSize != 0xFFFFFFFF) {
-       if (position + header->fSize > end) result |= kErrSize;
+      if ((position + header->fSize) != end) {
+       Warning("ReadHeader",
+               "raw data size found in the header is wrong (%d != %d)! Using the equipment size instead !",
+               header->fSize, end - position);
+       header->fSize = end - position;
+       result |= kErrSize;
       }
     }
     position = end;