]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RAW/AliRawDataHeaderV3.h
added slewing correction by data
[u/mrichter/AliRoot.git] / RAW / AliRawDataHeaderV3.h
1 #ifndef ALIRAWDATAHEADERV3_H
2 #define ALIRAWDATAHEADERV3_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 struct AliRawDataHeaderV3 {
7   AliRawDataHeaderV3() :
8     fSize(0xFFFFFFFF), 
9     fWord2(3<<24),
10     fEventID2(0),
11     fAttributesSubDetectors(0),
12     fStatusMiniEventID(0x10000),  // status bit 4: no L1/L2 trigger information
13     fTriggerClassLow(0),
14     fTriggerClassesMiddleLow(0),
15     fTriggerClassesMiddleHigh(0),
16     fROILowTriggerClassHigh(0),
17     fROIHigh(0)
18   {}
19
20   // Adding virtual destructor breaks
21   // C++ struct backward compatibility
22   // Do not uncomment the line below!!!
23   //  virtual ~AliRawDataHeaderV3() {}
24
25   UShort_t  GetEventID1() const
26     {
27       return (UShort_t)( fWord2 & 0xFFF );
28     };
29
30   UInt_t  GetEventID2() const
31     {
32       return fEventID2;
33     };
34
35   UChar_t   GetL1TriggerMessage() const
36     {
37       return (UChar_t)( (fWord2 >> 14) & 0xFF );
38     };
39
40   UChar_t   GetVersion() const
41     {
42       return (UChar_t)( (fWord2 >> 24) & 0xFF );
43     };
44
45   UChar_t   GetAttributes() const 
46     {return (fAttributesSubDetectors >> 24) & 0xFF;};
47   Bool_t    TestAttribute(Int_t index) const
48     {return (fAttributesSubDetectors >> (24 + index)) & 1;};
49   void      SetAttribute(Int_t index)
50     {fAttributesSubDetectors |= (1 << (24 + index));};
51   void      ResetAttribute(Int_t index)
52     {fAttributesSubDetectors &= (0xFFFFFFFF ^ (1 << (24 + index)));};
53   UInt_t    GetSubDetectors() const
54     {return fAttributesSubDetectors & 0xFFFFFF;};
55
56   UInt_t    GetStatus() const
57     {return (fStatusMiniEventID >> 12) & 0xFFFF;};
58   UInt_t    GetMiniEventID() const
59     {return fStatusMiniEventID & 0xFFF;};
60
61   ULong64_t GetTriggerClasses() const
62   {return (((ULong64_t) (fTriggerClassesMiddleLow & 0x3FFFF)) << 32) | fTriggerClassLow;}
63   ULong64_t GetTriggerClassesNext50() const
64   {return (((ULong64_t) (fROILowTriggerClassHigh & 0x3FFFF)) << 32) | fTriggerClassesMiddleHigh;}
65   ULong64_t GetROI() const
66   {return (((ULong64_t) fROIHigh) << 4) | ((fROILowTriggerClassHigh >> 28) & 0xF);}
67
68   void      SetTriggerClass(ULong64_t mask)
69     {fTriggerClassLow = (UInt_t)(mask & 0xFFFFFFFF);  // low bits of trigger class
70      fTriggerClassesMiddleLow = (UInt_t)((mask >> 32) & 0x3FFFF); // low bits of ROI data (bits 28-31) and high bits of trigger class (bits 0-17)
71     };
72   void      SetTriggerClassNext50(ULong64_t mask)
73     {fTriggerClassesMiddleHigh = (UInt_t)(mask & 0xFFFFFFFF);  // low bits of trigger class
74      fROILowTriggerClassHigh = (UInt_t)((mask >> 32) & 0x3FFFF); // low bits of ROI data (bits 28-31) and high bits of trigger class (bits 0-17)
75     };
76
77   UInt_t    fSize;              // size of the raw data in bytes
78   UInt_t    fWord2;             // bunch crossing, L1 trigger message and fomrat version
79   UInt_t    fEventID2;          // orbit number
80   UInt_t    fAttributesSubDetectors; // block attributes (bits 24-31) and participating sub detectors
81   UInt_t    fStatusMiniEventID; // status & error bits (bits 12-27) and mini event ID (bits 0-11)
82   UInt_t    fTriggerClassLow;   // low bits of trigger class
83   UInt_t    fTriggerClassesMiddleLow; // 18 bits go into eventTriggerPattern[1] (low), 14 bits are zeroes (cdhMBZ2)
84   UInt_t    fTriggerClassesMiddleHigh; // Goes into eventTriggerPattern[1] (high) and [2] (low)
85   UInt_t    fROILowTriggerClassHigh; // low bits of ROI data (bits 28-31) and high bits of trigger class (bits 0-17)
86   UInt_t    fROIHigh;           // high bits of ROI data
87 };
88
89 #endif