]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RAW/AliRawDataHeader.h
Introduction of the online monitoring code into the alimdc package. Fixed some memory...
[u/mrichter/AliRoot.git] / RAW / AliRawDataHeader.h
1 #ifndef ALIRAWDATAHEADER_H
2 #define ALIRAWDATAHEADER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6
7 struct AliRawDataHeader {
8   AliRawDataHeader() :
9     fSize(0xFFFFFFFF), 
10     fEventID1(0),
11     fL1TriggerType(0),
12     fVersion(1),
13     fEventID2(0),
14     fAttributesSubDetectors(0),
15     fStatusMiniEventID(0x1000),  // status bit 4: no L1/L2 trigger information
16     fTriggerClassLow(0),
17     fROILowTriggerClassHigh(0),
18     fROIHigh(0)
19   {}
20
21   UChar_t   GetAttributes() const 
22     {return (fAttributesSubDetectors >> 24) & 0xFF;};
23   Bool_t    TestAttribute(Int_t index) const
24     {return (fAttributesSubDetectors >> (24 + index)) & 1;};
25   void      SetAttribute(Int_t index)
26     {fAttributesSubDetectors |= (1 << (24 + index));};
27   void      ResetAttribute(Int_t index)
28     {fAttributesSubDetectors &= (0xFFFFFFFF ^ (1 << (24 + index)));};
29   UInt_t    GetSubDetectors() const
30     {return fAttributesSubDetectors & 0xFFFFFF;};
31
32   UInt_t    GetStatus() const
33     {return (fStatusMiniEventID >> 12) & 0xFFFF;};
34   UInt_t    GetMiniEventID() const
35     {return fStatusMiniEventID & 0x7FF;};
36
37   ULong64_t GetTriggerClasses() const
38     {return ((ULong64_t) (fROILowTriggerClassHigh & 0x1FFFF)) << 32 + fTriggerClassLow;}
39   ULong64_t GetROI() const
40     {return ((ULong64_t) fROIHigh) << 32 + ((fROILowTriggerClassHigh >> 28) & 0xF);}
41
42   UInt_t    fSize;              // size of the raw data in bytes
43   UShort_t  fEventID1;          // bunch crossing number
44   UChar_t   fL1TriggerType;     // level 1 trigger type
45   UChar_t   fVersion;           // version of the data header format
46   UInt_t    fEventID2;          // orbit number
47   UInt_t    fAttributesSubDetectors; // block attributes (bits 24-31) and participating sub detectors
48   UInt_t    fStatusMiniEventID; // status & error bits (bits 12-27) and mini event ID (bits 0-11)
49   UInt_t    fTriggerClassLow;   // low bits of trigger class
50   UInt_t    fROILowTriggerClassHigh; // low bits of ROI data (bits 28-31) and high bits of trigger class (bits 0-17)
51   UInt_t    fROIHigh;           // high bits of ROI data
52 };
53
54 #endif