]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RAW/AliRawEventHeaderBase.h
consolidate zero-length arrays (aka struct hack)
[u/mrichter/AliRoot.git] / RAW / AliRawEventHeaderBase.h
index 97d6536e7c426970a7e772bb414a36b070766691..57c554df711b4a12022f6f2f4b144036006648b3 100644 (file)
@@ -12,9 +12,7 @@
 //                                                                      //
 //////////////////////////////////////////////////////////////////////////
 
-//#ifndef ROOT_TObject
-//#include <TObject.h>
-//#endif
+#include <TObject.h>
 
 class AliRawEventHeaderBase : public TObject {
 
@@ -22,9 +20,9 @@ public:
    AliRawEventHeaderBase();
    virtual ~AliRawEventHeaderBase() { if (fExtendedData) delete [] fExtendedData; }
 
-   void         *HeaderBaseBegin() { return (void *) &fSize; }
+   void         *HeaderBaseBegin() const { return (void *) &fSize; }
    Int_t         HeaderBaseSize() const { return (Long_t) &fVersion - (Long_t) &fSize + sizeof(fVersion); }
-   void         *HeaderBegin();
+   void         *HeaderBegin() const;
    Int_t         HeaderSize() const;
    Bool_t        DataIsSwapped() const { return fIsSwapped; }
    Bool_t        IsSwapped() const { return (fMagic == fgkEventMagicNumberSwapped) ? kTRUE : kFALSE; }
@@ -54,6 +52,11 @@ public:
 
    void          Print( const Option_t* opt ="" ) const;
 
+   Int_t         GetFirstEqIndex() const { return fFirstEqIndex; }
+   Int_t         GetLastEqIndex() const { return fLastEqIndex; }
+   void          AddEqIndex(Int_t index);
+   void          Reset();
+
    // The following enumeration can be used once the kEventTypeMask has been
    // applied to the raw event type
    enum EAliRawEventType {
@@ -69,7 +72,8 @@ public:
      kStartOfData =      10,   // START_OF_DATA
      kEndOfData =        11,   // END_OF_DATA
      kSystemSoftwareTriggerEvent   = 12, // SYSTEM_SOFTWARE_TRIGGER_EVENT
-     kDetectorSoftwareTriggerEvent = 13  // DETECTOR_SOFTWARE_TRIGGER_EVENT
+     kDetectorSoftwareTriggerEvent = 13, // DETECTOR_SOFTWARE_TRIGGER_EVENT
+     kSyncEvent = 14  // SYNC_EVENT
    };
 
 private:
@@ -86,25 +90,31 @@ private:
    char  *fExtendedData;  //[fExtendedDataSize] pointer to header extension data 
 
    Bool_t fIsSwapped;     // is data swapped
+   Int_t  fHeaderSize;    //! cache for the header size estimate
+   void  *fHeaderBegin;   //! cache for the header begin pointer
+
+   Int_t  fFirstEqIndex;  // index of the first equipment
+   Int_t  fLastEqIndex;   // index of the last equipment
 
    static const UInt_t fgkEventMagicNumber        = 0xDA1E5AFE; // magic word
    static const UInt_t fgkEventMagicNumberSwapped = 0xFE5A1EDA; // swapped magic word
 
-   ClassDef(AliRawEventHeaderBase,2)  // Alice raw event header base class
+   ClassDef(AliRawEventHeaderBase,4)  // Alice raw event header base class
 };
 
 #define EVENT_HEADER_VERSION(AA,BB) AliRawEventHeaderV##AA##_##BB
+#define INIT_HEADER_VARS
 
 #define START_EVENT_HEADER(AA,BB) \
 class AliRawEventHeaderV##AA##_##BB:public AliRawEventHeaderBase { \
 public: \
-   AliRawEventHeaderV##AA##_##BB():AliRawEventHeaderBase() {}; \
+ AliRawEventHeaderV##AA##_##BB():AliRawEventHeaderBase(),              \
+   INIT_HEADER_VARS {};        \
    virtual ~AliRawEventHeaderV##AA##_##BB() {}; \
 private:
 
 #define END_EVENT_HEADER(AA,BB) \
 ClassDef(AliRawEventHeaderV##AA##_##BB,1) \
-}; \
-ClassImp(AliRawEventHeaderV##AA##_##BB)
+};
 
 #endif