]> git.uio.no Git - u/mrichter/AliRoot.git/blame - RAW/AliRawDataHeader.h
Method to set the equipment id in case of memory raw data reading. It is needed in...
[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),
11 fVersion(1),
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
20 UChar_t GetAttributes() const
21 {return (fAttributesSubDetectors >> 24) & 0xFF;};
22 Bool_t TestAttribute(Int_t index) const
23 {return (fAttributesSubDetectors >> (24 + index)) & 1;};
24 void SetAttribute(Int_t index)
25 {fAttributesSubDetectors |= (1 << (24 + index));};
26 void ResetAttribute(Int_t index)
27 {fAttributesSubDetectors &= (0xFFFFFFFF ^ (1 << (24 + index)));};
28 UInt_t GetSubDetectors() const
29 {return fAttributesSubDetectors & 0xFFFFFF;};
30
31 UInt_t GetStatus() const
32 {return (fStatusMiniEventID >> 12) & 0xFFFF;};
33 UInt_t GetMiniEventID() const
34 {return fStatusMiniEventID & 0x7FF;};
35
36 ULong64_t GetTriggerClasses() const
37 {return ((ULong64_t) (fROILowTriggerClassHigh & 0x1FFFF)) << 32 + fTriggerClassLow;}
38 ULong64_t GetROI() const
39 {return ((ULong64_t) fROIHigh) << 32 + ((fROILowTriggerClassHigh >> 28) & 0xF);}
40
12885ca4 41 void SetTriggerClass(ULong64_t mask)
42 {fTriggerClassLow = (mask & 0xFFFFFFFF); // low bits of trigger class
43 fROILowTriggerClassHigh = ((mask >> 32) & 0x3FFFF); // low bits of ROI data (bits 28-31) and high bits of trigger class (bits 0-17)
44 };
45
0421c3d1 46 UInt_t fSize; // size of the raw data in bytes
47 UShort_t fEventID1; // bunch crossing number
48 UChar_t fL1TriggerType; // level 1 trigger type
49 UChar_t fVersion; // version of the data header format
50 UInt_t fEventID2; // orbit number
51 UInt_t fAttributesSubDetectors; // block attributes (bits 24-31) and participating sub detectors
52 UInt_t fStatusMiniEventID; // status & error bits (bits 12-27) and mini event ID (bits 0-11)
53 UInt_t fTriggerClassLow; // low bits of trigger class
54 UInt_t fROILowTriggerClassHigh; // low bits of ROI data (bits 28-31) and high bits of trigger class (bits 0-17)
55 UInt_t fROIHigh; // high bits of ROI data
56};
57
58#endif