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