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