]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawReaderRoot.cxx
Interface to the new class for storing and retrieving of the raw-data decoding errors...
[u/mrichter/AliRoot.git] / RAW / AliRawReaderRoot.cxx
index 6d1799f77fbc15f3e310849d46cc826567712d90..c1252ef055018ea18ed3a76a571a699247790a98 100644 (file)
@@ -186,6 +186,13 @@ AliRawReaderRoot::~AliRawReaderRoot()
   }
 }
 
+const AliRawEventHeaderBase* AliRawReaderRoot::GetEventHeader() const
+{
+  // Get the even header
+  // Return NULL in case of failure
+  if (!fEvent) return NULL;
+  return fEvent->GetHeader();
+}
 
 UInt_t AliRawReaderRoot::GetType() const
 {
@@ -463,14 +470,14 @@ Bool_t AliRawReaderRoot::NextEvent()
   if (!fFile) return kFALSE;
 
   do {
-    if (fBranch->GetEntry(fEventIndex+1) <= 0) {
-      delete fEvent;
-      fEvent = new AliRawEvent;
-      fBranch->SetAddress(&fEvent);
+    delete fEvent;
+    fEvent = new AliRawEvent;
+    fBranch->SetAddress(&fEvent);
+    if (fBranch->GetEntry(fEventIndex+1) <= 0)
       return kFALSE;
-    }
     fEventIndex++;
   } while (!IsEventSelected());
+  fEventNumber++;
   return Reset();
 }
 
@@ -484,6 +491,7 @@ Bool_t AliRawReaderRoot::RewindEvents()
   delete fEvent;
   fEvent = new AliRawEvent;
   fBranch->SetAddress(&fEvent);
+  fEventNumber = -1;
   return Reset();
 }