]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawReaderRoot.cxx
Updates for PDC06
[u/mrichter/AliRoot.git] / RAW / AliRawReaderRoot.cxx
index ed16d4b8191fbfa395e50a5c812dad0480c90515..5d9dc16d61c46049cf0d6e6c612b8ee2aa8eabd5 100644 (file)
@@ -32,7 +32,7 @@
 #include <TTree.h>
 #include "AliRawReaderRoot.h"
 #include "AliRawEvent.h"
-#include "AliRawEventHeader.h"
+#include "AliRawEventHeaderBase.h"
 #include "AliRawEquipment.h"
 #include "AliRawEquipmentHeader.h"
 #include "AliRawData.h"
@@ -192,7 +192,7 @@ UInt_t AliRawReaderRoot::GetType() const
 // get the type from the event header
 
   if (!fEvent) return 0;
-  return fEvent->GetHeader()->GetType();
+  return fEvent->GetHeader()->Get("Type");
 }
 
 UInt_t AliRawReaderRoot::GetRunNumber() const
@@ -200,7 +200,7 @@ UInt_t AliRawReaderRoot::GetRunNumber() const
 // get the run number from the event header
 
   if (!fEvent) return 0;
-  return fEvent->GetHeader()->GetRunNumber();
+  return fEvent->GetHeader()->Get("RunNb");
 }
 
 const UInt_t* AliRawReaderRoot::GetEventId() const
@@ -208,7 +208,7 @@ const UInt_t* AliRawReaderRoot::GetEventId() const
 // get the event id from the event header
 
   if (!fEvent) return NULL;
-  return fEvent->GetHeader()->GetId();
+  return fEvent->GetHeader()->GetP("Id");
 }
 
 const UInt_t* AliRawReaderRoot::GetTriggerPattern() const
@@ -216,7 +216,7 @@ const UInt_t* AliRawReaderRoot::GetTriggerPattern() const
 // get the trigger pattern from the event header
 
   if (!fEvent) return NULL;
-  return fEvent->GetHeader()->GetTriggerPattern();
+  return fEvent->GetHeader()->GetP("TriggerPattern");
 }
 
 const UInt_t* AliRawReaderRoot::GetDetectorPattern() const
@@ -224,7 +224,7 @@ const UInt_t* AliRawReaderRoot::GetDetectorPattern() const
 // get the detector pattern from the event header
 
   if (!fEvent) return NULL;
-  return fEvent->GetHeader()->GetDetectorPattern();
+  return fEvent->GetHeader()->GetP("DetectorPattern");
 }
 
 const UInt_t* AliRawReaderRoot::GetAttributes() const
@@ -232,7 +232,7 @@ const UInt_t* AliRawReaderRoot::GetAttributes() const
 // get the type attributes from the event header
 
   if (!fEvent) return NULL;
-  return fEvent->GetHeader()->GetTypeAttribute();
+  return fEvent->GetHeader()->GetP("TypeAttribute");
 }
 
 const UInt_t* AliRawReaderRoot::GetSubEventAttributes() const
@@ -240,7 +240,7 @@ const UInt_t* AliRawReaderRoot::GetSubEventAttributes() const
 // get the type attributes from the sub event header
 
   if (!fSubEvent) return NULL;
-  return fSubEvent->GetHeader()->GetTypeAttribute();
+  return fSubEvent->GetHeader()->GetP("TypeAttribute");
 }
 
 UInt_t AliRawReaderRoot::GetLDCId() const
@@ -248,7 +248,7 @@ UInt_t AliRawReaderRoot::GetLDCId() const
 // get the LDC Id from the event header
 
   if (!fEvent || !fSubEvent) return 0;
-  return fSubEvent->GetHeader()->GetLDCId();
+  return fSubEvent->GetHeader()->Get("LdcId");
 }
 
 UInt_t AliRawReaderRoot::GetGDCId() const
@@ -256,7 +256,7 @@ UInt_t AliRawReaderRoot::GetGDCId() const
 // get the GDC Id from the event header
 
   if (!fEvent) return 0;
-  return fEvent->GetHeader()->GetGDCId();
+  return fEvent->GetHeader()->Get("GdcId");
 }
 
 
@@ -352,20 +352,23 @@ Bool_t AliRawReaderRoot::ReadHeader()
     // continue with the next equipment if no data left in the payload
     if (fPosition >= fEnd) continue;
 
-    // check that there are enough bytes left for the data header
-    if (fPosition + sizeof(AliRawDataHeader) > fEnd) {
-      Error("ReadHeader", "could not read data header!");
-      Warning("ReadHeader", "skipping %d bytes", fEnd - fPosition);
-      fEquipment->GetEquipmentHeader()->Dump();
-      fCount = 0;
-      fPosition = fEnd;
-      fErrorCode = kErrNoDataHeader;
-      continue;
+    if (fRequireHeader) {
+      // check that there are enough bytes left for the data header
+      if (fPosition + sizeof(AliRawDataHeader) > fEnd) {
+       Error("ReadHeader", "could not read data header!");
+       Warning("ReadHeader", "skipping %d bytes", fEnd - fPosition);
+       fEquipment->GetEquipmentHeader()->Dump();
+       fCount = 0;
+       fPosition = fEnd;
+       fErrorCode = kErrNoDataHeader;
+       continue;
+      }
+
+      // "read" the data header
+      fHeader = (AliRawDataHeader*) fPosition;
+      fPosition += sizeof(AliRawDataHeader);
     }
 
-    // "read" the data header
-    fHeader = (AliRawDataHeader*) fPosition;
-    fPosition += sizeof(AliRawDataHeader);
     if (fHeader->fSize != 0xFFFFFFFF) {
       fCount = fHeader->fSize - sizeof(AliRawDataHeader);
     } else {
@@ -512,17 +515,19 @@ Int_t AliRawReaderRoot::CheckData() const
     // continue with the next sub event if no data left in the payload
     if (position >= end) continue;
 
+    if (fRequireHeader) {
     // check that there are enough bytes left for the data header
-    if (position + sizeof(AliRawDataHeader) > end) {
-      result |= kErrNoDataHeader;
-      continue;
-    }
+      if (position + sizeof(AliRawDataHeader) > end) {
+       result |= kErrNoDataHeader;
+       continue;
+      }
 
-    // check consistency of data size in the header and in the equipment
-    AliRawDataHeader* header = (AliRawDataHeader*) position;
-    if (header->fSize != 0xFFFFFFFF) {
-      if (position + header->fSize > end) {
-       result |= kErrSize;
+      // check consistency of data size in the header and in the equipment
+      AliRawDataHeader* header = (AliRawDataHeader*) position;
+      if (header->fSize != 0xFFFFFFFF) {
+       if (position + header->fSize > end) {
+         result |= kErrSize;
+       }
       }
     }
   };