]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawReaderDate.cxx
reading RAW without data
[u/mrichter/AliRoot.git] / RAW / AliRawReaderDate.cxx
index 89732d1fe8c8c71942531c63def2a86b5ea32b87..0f72d48e766140099470d3794890d74efd0ccdaa 100644 (file)
@@ -85,7 +85,7 @@ AliRawReaderDate::AliRawReaderDate(
   while (fread(&header, 1, headerSize, fFile) == headerSize) {
     if (eventNumber == 0) {
       UChar_t* buffer = new UChar_t[header.eventSize];
-      fseek(fFile, -headerSize, SEEK_CUR);
+      fseek(fFile, -(long)headerSize, SEEK_CUR);
       if (fread(buffer, 1, header.eventSize, fFile) != header.eventSize) break;
       fEvent = (eventHeaderStruct*) buffer;
       break;
@@ -244,6 +244,17 @@ UInt_t AliRawReaderDate::GetGDCId() const
 #endif
 }
 
+UInt_t AliRawReaderDate::GetTimestamp() const
+{
+// get the timestamp from the event header
+
+#ifdef ALI_DATE
+  if (!fEvent) return 0;
+  return fEvent->eventTimestamp;
+#else
+  return 0;
+#endif
+}
 
 Int_t AliRawReaderDate::GetEquipmentSize() const
 {
@@ -413,9 +424,10 @@ Bool_t AliRawReaderDate::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);
+       if (fHeader->fSize != 0xFFFFFFFF)
+         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);
@@ -516,7 +528,7 @@ Bool_t AliRawReaderDate::NextEvent()
       continue;
     }
     UChar_t* buffer = new UChar_t[header.eventSize];
-    fseek(fFile, -headerSize, SEEK_CUR);
+    fseek(fFile, -(long)headerSize, SEEK_CUR);
     if (fread(buffer, 1, header.eventSize, fFile) != header.eventSize) {
       Error("NextEvent", "could not read event from file");
       delete[] buffer;
@@ -601,9 +613,10 @@ Int_t AliRawReaderDate::CheckData() const
       // check consistency of data size in the data header and in the sub event
       AliRawDataHeader* header = (AliRawDataHeader*) position;
       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);
+       if (header->fSize != 0xFFFFFFFF)
+         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;
       }