X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=RAW%2FAliRawEventHeaderBase.h;h=966a5da78929f7706e41f465e67f4d1dd81d68cc;hb=9778caa8eb3343cd46a061d633c36770fc0737d8;hp=956e6f5ccc4f34beab95d87986d1aaf84d0a9f2f;hpb=3a27fc42120be0f46c946bb45becca24df64df3b;p=u%2Fmrichter%2FAliRoot.git diff --git a/RAW/AliRawEventHeaderBase.h b/RAW/AliRawEventHeaderBase.h index 956e6f5ccc4..966a5da7892 100644 --- a/RAW/AliRawEventHeaderBase.h +++ b/RAW/AliRawEventHeaderBase.h @@ -19,7 +19,7 @@ class AliRawEventHeaderBase : public TObject { public: - AliRawEventHeaderBase() { fSize=fMagic=fHeadSize=fVersion=fExtendedDataSize=0; fExtendedData = 0x0; fIsSwapped = kFALSE; } + AliRawEventHeaderBase(); virtual ~AliRawEventHeaderBase() { if (fExtendedData) delete [] fExtendedData; } void *HeaderBaseBegin() { return (void *) &fSize; } @@ -30,6 +30,8 @@ public: Bool_t IsSwapped() const { return (fMagic == fgkEventMagicNumberSwapped) ? kTRUE : kFALSE; } Bool_t IsValid() const { return IsSwapped() ? kTRUE : ((fMagic == fgkEventMagicNumber) ? kTRUE : kFALSE); } void Swap(); + UInt_t SwapWord(UInt_t x) const; + void SwapData(const void* data, const void* buf, UInt_t size); UInt_t GetEventSize() const { return fSize; } UInt_t GetMagic() const { return fMagic; } @@ -40,14 +42,17 @@ public: UInt_t GetExtendedDataSize() const { return fExtendedDataSize; } char* GetExtendedData() const { return fExtendedData; } - void SetExtendedDataSize(Int_t size) { fExtendedDataSize = size; } - void SetExtendedData(char *data) { fExtendedData = data; } - const char * GetTypeName(); + const char * GetTypeName() const; + static const char * GetTypeName(UInt_t eventType); static AliRawEventHeaderBase* Create(char*& data); + void AllocateExtendedData(Int_t extsize); Int_t ReadHeader(char*& data); - UInt_t Get(const char *datamember); - const UInt_t* GetP(const char *datamember); + Int_t ReadExtendedData(char*& data); + UInt_t Get(const char *datamember) const; + const UInt_t* GetP(const char *datamember) const; + + void Print( const Option_t* opt ="" ) const; // The following enumeration can be used once the kEventTypeMask has been // applied to the raw event type @@ -60,24 +65,33 @@ public: kEndOfBurst = 6, // END_OF_BURST kPhysicsEvent = 7, // PHYSICS_EVENT kCalibrationEvent = 8, // CALIBRATION_EVENT - kFormatError = 9 // EVENT_FORMAT_ERROR + kFormatError = 9, // EVENT_FORMAT_ERROR + kStartOfData = 10, // START_OF_DATA + kEndOfData = 11, // END_OF_DATA + kSystemSoftwareTriggerEvent = 12, // SYSTEM_SOFTWARE_TRIGGER_EVENT + kDetectorSoftwareTriggerEvent = 13 // DETECTOR_SOFTWARE_TRIGGER_EVENT }; private: + AliRawEventHeaderBase(const AliRawEventHeaderBase&); + AliRawEventHeaderBase& operator=(const AliRawEventHeaderBase&); + UInt_t fSize; // size of event in bytes UInt_t fMagic; // magic number used for consistency check UInt_t fHeadSize; // size of header in bytes UInt_t fVersion; // unique version identifier UInt_t fExtendedDataSize; // size of header extension data + UInt_t fExtendedAllocSize;//! size of allocated memory for header extension data char *fExtendedData; //[fExtendedDataSize] pointer to header extension data Bool_t fIsSwapped; // is data swapped + Int_t fHeaderSize; //! cache for the header size estimate static const UInt_t fgkEventMagicNumber = 0xDA1E5AFE; // magic word static const UInt_t fgkEventMagicNumberSwapped = 0xFE5A1EDA; // swapped magic word - ClassDef(AliRawEventHeaderBase,1) // Alice raw event header base class + ClassDef(AliRawEventHeaderBase,3) // Alice raw event header base class }; #define EVENT_HEADER_VERSION(AA,BB) AliRawEventHeaderV##AA##_##BB