]>
Commit | Line | Data |
---|---|---|
0421c3d1 | 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 | ||
0421c3d1 | 6 | struct AliRawDataHeader { |
7 | AliRawDataHeader() : | |
8 | fSize(0xFFFFFFFF), | |
4e99539f | 9 | fWord2(2<<24), |
0421c3d1 | 10 | fEventID2(0), |
11 | fAttributesSubDetectors(0), | |
3a4565aa | 12 | fStatusMiniEventID(0x1000), // status bit 4: no L1/L2 trigger information |
0421c3d1 | 13 | fTriggerClassLow(0), |
14 | fROILowTriggerClassHigh(0), | |
15 | fROIHigh(0) | |
16 | {} | |
17 | ||
2972d4eb | 18 | virtual ~AliRawDataHeader() {} |
19 | ||
b3560413 | 20 | UShort_t GetEventID1() const |
4e99539f | 21 | { |
22 | return (UShort_t)( fWord2 & 0xFFF ); | |
23 | }; | |
24 | ||
25 | UInt_t GetEventID2() const | |
26 | { | |
27 | return fEventID2; | |
28 | }; | |
b3560413 | 29 | |
30 | UChar_t GetL1TriggerMessage() const | |
4e99539f | 31 | { |
32 | return (UChar_t)( (fWord2 >> 14) & 0x3FF ); | |
33 | }; | |
b3560413 | 34 | |
35 | UChar_t GetVersion() const | |
4e99539f | 36 | { |
37 | return (UChar_t)( (fWord2 >> 24) & 0xFF ); | |
38 | }; | |
b3560413 | 39 | |
0421c3d1 | 40 | UChar_t GetAttributes() const |
41 | {return (fAttributesSubDetectors >> 24) & 0xFF;}; | |
42 | Bool_t TestAttribute(Int_t index) const | |
43 | {return (fAttributesSubDetectors >> (24 + index)) & 1;}; | |
44 | void SetAttribute(Int_t index) | |
45 | {fAttributesSubDetectors |= (1 << (24 + index));}; | |
46 | void ResetAttribute(Int_t index) | |
47 | {fAttributesSubDetectors &= (0xFFFFFFFF ^ (1 << (24 + index)));}; | |
48 | UInt_t GetSubDetectors() const | |
49 | {return fAttributesSubDetectors & 0xFFFFFF;}; | |
50 | ||
51 | UInt_t GetStatus() const | |
52 | {return (fStatusMiniEventID >> 12) & 0xFFFF;}; | |
53 | UInt_t GetMiniEventID() const | |
2bb1112f | 54 | {return fStatusMiniEventID & 0xFFF;}; |
0421c3d1 | 55 | |
56 | ULong64_t GetTriggerClasses() const | |
57 | {return ((ULong64_t) (fROILowTriggerClassHigh & 0x1FFFF)) << 32 + fTriggerClassLow;} | |
58 | ULong64_t GetROI() const | |
59 | {return ((ULong64_t) fROIHigh) << 32 + ((fROILowTriggerClassHigh >> 28) & 0xF);} | |
60 | ||
12885ca4 | 61 | void SetTriggerClass(ULong64_t mask) |
ebb92147 | 62 | {fTriggerClassLow = (UInt_t)(mask & 0xFFFFFFFF); // low bits of trigger class |
63 | fROILowTriggerClassHigh = (UInt_t)((mask >> 32) & 0x3FFFF); // low bits of ROI data (bits 28-31) and high bits of trigger class (bits 0-17) | |
12885ca4 | 64 | }; |
65 | ||
0421c3d1 | 66 | UInt_t fSize; // size of the raw data in bytes |
4e99539f | 67 | UInt_t fWord2; // bunch crossing, L1 trigger message and fomrat version |
0421c3d1 | 68 | UInt_t fEventID2; // orbit number |
69 | UInt_t fAttributesSubDetectors; // block attributes (bits 24-31) and participating sub detectors | |
70 | UInt_t fStatusMiniEventID; // status & error bits (bits 12-27) and mini event ID (bits 0-11) | |
71 | UInt_t fTriggerClassLow; // low bits of trigger class | |
72 | UInt_t fROILowTriggerClassHigh; // low bits of ROI data (bits 28-31) and high bits of trigger class (bits 0-17) | |
73 | UInt_t fROIHigh; // high bits of ROI data | |
74 | }; | |
75 | ||
76 | #endif |