32def6aa |
1 | #ifndef ALIMUONLOCALSTRUCT_H |
2 | #define ALIMUONLOCALSTRUCT_H |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
4 | * See cxx source for full Copyright notice */ |
5 | |
6 | /*$Id$*/ |
7 | |
8 | /// \ingroup raw |
9 | /// \class AliMUONLocalStruct |
10 | /// \brief rawdata local card structure for trigger |
11 | /// |
12 | /// \author Christian Finck |
13 | |
14 | #include <TObject.h> |
15 | |
16 | class AliMUONLocalStruct : public TObject{ |
17 | |
18 | public: |
19 | AliMUONLocalStruct(); |
20 | AliMUONLocalStruct(const AliMUONLocalStruct& event); |
21 | AliMUONLocalStruct& operator=(const AliMUONLocalStruct& event); |
22 | |
23 | |
24 | virtual ~AliMUONLocalStruct(){;} |
25 | |
26 | // local board info |
27 | UInt_t GetData(Int_t n) const {return fData[n];} |
28 | |
29 | UShort_t GetX2() const {return (fData[0] >> 16) & 0xFFFF;} |
30 | UShort_t GetX1() const {return (fData[0]) & 0xFFFF;} |
31 | UShort_t GetX4() const {return (fData[1] >> 16) & 0xFFFF;} |
32 | UShort_t GetX3() const {return (fData[1]) & 0xFFFF;} |
33 | |
34 | UShort_t GetY2() const {return (fData[2] >> 16) & 0xFFFF;} |
35 | UShort_t GetY1() const {return (fData[2]) & 0xFFFF;} |
36 | UShort_t GetY4() const {return (fData[3] >> 16) & 0xFFFF;} |
37 | UShort_t GetY3() const {return (fData[3]) & 0xFFFF;} |
38 | |
39 | Char_t GetId() const {return fData[4] >> 19 & 0xF;} |
40 | Char_t GetDec() const {return fData[4] >> 15 & 0xF;} |
41 | Char_t GetTriggerY() const {return fData[4] >> 14 & 0x1;} |
42 | Char_t GetYPos() const {return fData[4] >> 10 & 0xF;} |
43 | Char_t GetXDev() const {return fData[4] >> 5 & 0x1F;} |
44 | Char_t GetXPos() const {return fData[4] & 0x1F;} |
45 | |
46 | Int_t GetLpt() const {return (GetDec() & 0x3);} |
47 | Int_t GetHpt() const {return (GetDec() >> 2) & 0x3;} |
48 | |
49 | void SetData(UInt_t d, Int_t n) {fData[n] = d;} |
50 | |
51 | UInt_t* GetData() {return &fData[0];} |
52 | |
53 | // Scaler methods |
54 | UInt_t GetL0() const {return fL0;} |
55 | UInt_t GetHold() const {return fHold;} |
56 | UInt_t GetClock() const {return fClk;} |
57 | UChar_t GetSwitch() const {return (fEOS >> 2) & 0x3FF;} |
58 | UChar_t GetComptXY() const {return fEOS & 3;} |
59 | |
60 | UShort_t GetXY1(Int_t n) const {return (n % 2 == 0) ? |
61 | (fScaler[n] & 0xFFFF) : (fScaler[n] >> 16) & 0xFFFF;} |
62 | UShort_t GetXY2(Int_t n) const {return (n % 2 == 0) ? |
63 | (fScaler[8 + n] & 0xFFFF) : (fScaler[8 + n] >> 16) & 0xFFFF;} |
64 | UShort_t GetXY3(Int_t n) const {return (n % 2 == 0) ? |
65 | (fScaler[8*2 + n] & 0xFFFF) : (fScaler[8*2 + n] >> 16) & 0xFFFF;} |
66 | UShort_t GetXY4(Int_t n) const {return (n % 2 == 0) ? |
67 | (fScaler[8*3 + n] & 0xFFFF) : (fScaler[8*3 + n] >> 16) & 0xFFFF;} |
68 | |
69 | UInt_t* GetScalers() {return &fL0;} |
70 | |
71 | // get length |
72 | Int_t GetScalerLength() const {return fgkScalerLength;} |
73 | Int_t GetLength() const {return fgkLength;} |
74 | UInt_t GetEndOfLocal() const {return fgkEndOfLocal;} |
b2e46925 |
75 | UInt_t GetDisableWord() const {return fgkDisableWord;} |
32def6aa |
76 | |
77 | // set random numbers to fill variable |
78 | void SetScalersNumbers(); |
79 | |
80 | private: |
81 | |
82 | // local info |
829425a5 |
83 | UInt_t fData[5]; ///< local data |
32def6aa |
84 | |
85 | // local card scalers |
829425a5 |
86 | UInt_t fL0; ///< local L0 |
87 | UInt_t fHold; ///< local hold (dead time) |
88 | UInt_t fClk; ///< local clock |
32def6aa |
89 | |
829425a5 |
90 | UInt_t fLPtNTrig; ///< local low Pt no trigger |
91 | UInt_t fHPtNTrig; ///< local high Pt no trigger |
32def6aa |
92 | |
829425a5 |
93 | UInt_t fLPtRTrig; ///< local low Pt right trigger |
94 | UInt_t fHPtRTrig; ///< local high Pt right trigger |
32def6aa |
95 | |
829425a5 |
96 | UInt_t fLPtLTrig; ///< local low Pt left trigger |
97 | UInt_t fHPtLTrig; ///< local high Pt left trigger |
32def6aa |
98 | |
829425a5 |
99 | UInt_t fLPtSTrig; ///< local low Pt straight trigger |
100 | UInt_t fHPtSTrig; ///< local high Pt straight trigger |
32def6aa |
101 | |
829425a5 |
102 | UInt_t fScaler[8*4]; ///< local data |
103 | UInt_t fEOS; ///< contains switches conf. & flag for reading X (0) or Y (1) in fScaler |
104 | UInt_t fReset; ///< reset signal |
32def6aa |
105 | |
829425a5 |
106 | static const Int_t fgkLength; ///< local info length in word |
107 | static const Int_t fgkScalerLength; ///< scaler length in word |
108 | static const UInt_t fgkEndOfLocal; ///< end of local info word |
b2e46925 |
109 | static const UInt_t fgkDisableWord; ///< Word for "empty" slots |
32def6aa |
110 | |
111 | ClassDef(AliMUONLocalStruct,3) |
112 | }; |
113 | #endif |