]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawReaderDateV3.cxx
In AliMUONQADataMakerRec:
[u/mrichter/AliRoot.git] / RAW / AliRawReaderDateV3.cxx
index 3bc53c8560794b739baf7a2589d1eea67cd5fade..de82a383a28e0bd0bab9bf80bf05835b8976ffa7 100644 (file)
@@ -86,7 +86,7 @@ AliRawReaderDateV3::AliRawReaderDateV3(const char* fileName,
   while (fread(&header, 1, headerSize, fFile) == headerSize) {
     if (eventNumber == 0) {
       UChar_t* buffer = new UChar_t[header.size];
-      fseek(fFile, -headerSize, SEEK_CUR);
+      fseek(fFile, -(long)headerSize, SEEK_CUR);
       if (Int_t(fread(buffer, 1, header.size, fFile)) != header.size) break;
       fEvent = (eventHeaderStruct*) buffer;
       break;
@@ -199,6 +199,13 @@ UInt_t AliRawReaderDateV3::GetGDCId() const
   return UInt_t(-1);
 }
 
+UInt_t AliRawReaderDateV3::GetTimestamp() const
+{
+// get the timestamp from the event header
+
+  if (!fEvent) return 0;
+  return fEvent->time;
+}
 
 Int_t AliRawReaderDateV3::GetEquipmentSize() const
 {
@@ -310,9 +317,10 @@ 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);
+       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);
@@ -404,13 +412,14 @@ Bool_t AliRawReaderDateV3::NextEvent()
       continue;
     }
     UChar_t* buffer = new UChar_t[header.size];
-    fseek(fFile, -headerSize, SEEK_CUR);
+    fseek(fFile, -(long)headerSize, SEEK_CUR);
     if (Int_t(fread(buffer, 1, header.size, fFile)) != header.size) {
       Error("NextEvent", "could not read event from file");
       delete[] buffer;
       break;
     }
     fEvent = (eventHeaderStruct*) buffer;
+    fEventNumber++;
     return kTRUE;
   };
 
@@ -425,6 +434,7 @@ Bool_t AliRawReaderDateV3::RewindEvents()
   if (!fFile) return kFALSE;
 
   fseek(fFile, 0, SEEK_SET);
+  fEventNumber = -1;
   return Reset();
 }
 
@@ -478,9 +488,10 @@ Int_t AliRawReaderDateV3::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;
       }