]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawReaderDate.cxx
Fix for possible use of AliCFManager without containers, just cuts.
[u/mrichter/AliRoot.git] / RAW / AliRawReaderDate.cxx
index 0f72d48e766140099470d3794890d74efd0ccdaa..fa0ef4c6a39af68681a251af4833d6abd05c24ca 100644 (file)
@@ -76,6 +76,7 @@ AliRawReaderDate::AliRawReaderDate(
   fFile = fopen(fileName, "rb");
   if (!fFile) {
     Error("AliRawReaderDate", "could not open file %s", fileName);
+    fIsValid = kFALSE;
     return;
   }
   if (eventNumber < 0) return;
@@ -424,7 +425,8 @@ Bool_t AliRawReaderDate::ReadHeader()
       // "read" the data header
       fHeader = (AliRawDataHeader*) fPosition;
       if ((fPosition + fHeader->fSize) != fEnd) {
-       if (fHeader->fSize != 0xFFFFFFFF)
+       if ((fHeader->fSize != 0xFFFFFFFF) &&
+           (fEquipment->equipmentId != 4352))
          Warning("ReadHeader",
                  "raw data size found in the header is wrong (%d != %d)! Using the equipment size instead !",
                  fHeader->fSize, fEnd - fPosition);
@@ -514,7 +516,14 @@ Bool_t AliRawReaderDate::NextEvent()
 // go to the next event in the date file
 
 #ifdef ALI_DATE
-  if (!fFile) return kFALSE;
+  if (!fFile) {
+    if (fEventNumber < 0 && fEvent) {
+      fEventNumber++;
+      return kTRUE;
+    }
+    else
+      return kFALSE;
+  }
 
   Reset();
   eventHeaderStruct header;
@@ -549,9 +558,9 @@ Bool_t AliRawReaderDate::RewindEvents()
 {
 // go back to the beginning of the date file
 
-  if (!fFile) return kFALSE;
+  if (fFile)
+    fseek(fFile, 0, SEEK_SET);
 
-  fseek(fFile, 0, SEEK_SET);
   fEventNumber = -1;
   return Reset();
 }