]>
Commit | Line | Data |
---|---|---|
32def6aa | 1 | #ifndef ALIMUONREGHEADER_H |
2 | #define ALIMUONREGHEADER_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 AliMUONRegHeader | |
10 | /// \brief MUON regional header for trigger | |
11 | /// | |
12 | /// \author Christian Finck | |
13 | ||
14 | #include <TObject.h> | |
32def6aa | 15 | |
00e86732 | 16 | class TClonesArray; |
32def6aa | 17 | class AliMUONLocalStruct; |
18 | ||
19 | class AliMUONRegHeader : public TObject{ | |
20 | ||
21 | public: | |
22 | AliMUONRegHeader(); | |
23 | AliMUONRegHeader(const AliMUONRegHeader& event); | |
24 | AliMUONRegHeader& operator=(const AliMUONRegHeader& event); | |
25 | ||
26 | virtual ~AliMUONRegHeader(); | |
27 | ||
bebe0279 | 28 | UInt_t GetDarcWord() const {return fDarcWord;} |
29 | UInt_t GetWord() const {return fWord;} | |
30 | UInt_t GetInput(Int_t n) const {return fInput[n];} | |
31 | UShort_t GetL0() const {return fL0 & 0xFFFF;} | |
32 | UShort_t GetMask() const {return fMask & 0xFFFF;} | |
32def6aa | 33 | |
d622a0ec | 34 | //word: phys type:1, reset: 6, serialNb:5, Id:4, version: 8, regional output:8 |
251b70b4 | 35 | //true for phys, false for soft |
bebe0279 | 36 | Bool_t GetRegPhysFlag() const {return (fWord & 0x80000000);} |
b6ab2009 | 37 | UChar_t GetResetNb() const {return (UChar_t)(fWord >> 25) & 0x20;} |
38 | UChar_t GetSerialNb() const {return (UChar_t)(fWord >> 20) & 0x1F;} | |
39 | UChar_t GetId() const {return (UChar_t)(fWord >> 16) & 0x0F;} | |
40 | UChar_t GetVersion() const {return (UChar_t)(fWord >> 8) & 0xFF;} | |
41 | UChar_t GetOutput() const {return (UChar_t)(fWord & 0xFF);} | |
251b70b4 | 42 | |
43 | //Darc Status: error:10, #fpag:3, MBZ:3, phys type:1, present:1, not_full:1 | |
44 | // not_empty:1, L2Rej:1, L2Acc:1, L1:1, L0:1, #evt:4, busy:4 | |
45 | UShort_t GetErrorBits() const {return (UShort_t)(fDarcWord >> 21) & 0x3FF;} | |
b6ab2009 | 46 | UChar_t GetFPGANumber() const {return (UChar_t) (fDarcWord >> 18) & 0x7;} |
251b70b4 | 47 | Bool_t GetDarcPhysFlag() const {return (fDarcWord & 0x1000);} |
48 | Bool_t GetPresentFlag() const {return (fDarcWord & 0x800);} | |
49 | Bool_t GetRamNotFullFlag() const {return (fDarcWord & 0x400);} | |
50 | Bool_t GetRamNotEmptyFlag() const {return (fDarcWord & 0x200);} | |
51 | Bool_t GetL2RejStatus() const {return (fDarcWord & 0x100);} | |
52 | Bool_t GetL2AccStatus() const {return (fDarcWord & 0x80);} | |
53 | Bool_t GetL1Status() const {return (fDarcWord & 0x40);} | |
54 | Bool_t GetL0Status() const {return (fDarcWord & 0x20);} | |
b6ab2009 | 55 | UChar_t GetEventInRam() const {return (UChar_t) (fDarcWord >> 4) & 0x4;} |
56 | UChar_t GetBusy() const {return (UChar_t) (fDarcWord) & 0x4;} | |
32def6aa | 57 | |
00f56161 | 58 | void SetDarcWord(UInt_t w) {fDarcWord = w;} |
bebe0279 | 59 | void SetWord(UInt_t w) {fWord = w;} |
60 | void SetMask(UShort_t m) {fMask = m;} | |
61 | void SetL0(UShort_t l) {fL0 = (l & 0xFFFF);} | |
32def6aa | 62 | void SetInput(UInt_t in, Int_t n) {fInput[n] = in;} |
bebe0279 | 63 | |
64 | ||
32def6aa | 65 | Int_t GetHeaderLength() const {return fgkHeaderLength;} |
66 | UInt_t GetEndOfReg() const {return fgkEndOfReg;} | |
67 | ||
68 | ||
00f56161 | 69 | UInt_t* GetHeader() {return &fDarcWord;} |
32def6aa | 70 | |
71 | // scalar methods | |
32def6aa | 72 | UInt_t GetClock() const {return fClk;} |
73 | const UInt_t* GetScaler() const {return fScaler;} | |
74 | UInt_t GetHold() const {return fHold;} | |
75 | ||
d622a0ec | 76 | UInt_t* GetScalers() {return &fClk;} |
32def6aa | 77 | |
78 | // get scaler length | |
79 | Int_t GetScalerLength() const {return fgkScalerLength;} | |
80 | ||
81 | // set random numbers to fill variable | |
82 | void SetScalersNumbers(); | |
83 | ||
84 | // get TClonesArray | |
85 | TClonesArray* GetLocalArray() const {return fLocalArray;} | |
86 | ||
87 | // get entries | |
88 | Int_t GetLocalEntries() const {return fLocalArray->GetEntriesFast();} | |
89 | ||
90 | // get entry | |
91 | AliMUONLocalStruct* GetLocalEntry(Int_t i) const { | |
92 | return (AliMUONLocalStruct*)fLocalArray->At(i);} | |
93 | ||
94 | // clear | |
95 | void Clear(Option_t* opt); | |
96 | ||
97 | private: | |
98 | ||
99 | // regional header | |
00f56161 | 100 | UInt_t fDarcWord; ///< darc word |
101 | UInt_t fWord; ///< first reg word | |
829425a5 | 102 | UInt_t fInput[2]; ///< regional input |
bebe0279 | 103 | UShort_t fMask; ///< local mask ("poids faible" 16 bits) |
104 | UShort_t fL0; ///< L0 counter (16 bits) | |
32def6aa | 105 | |
106 | // regional card scalers | |
829425a5 | 107 | UInt_t fClk; ///< regional clock |
108 | UInt_t fScaler[8]; ///< regional ouput | |
109 | UInt_t fHold; ///< regional hold (dead time) | |
32def6aa | 110 | |
829425a5 | 111 | static const Int_t fgkScalerLength; ///< length of regional scaler in word |
112 | static const Int_t fgkHeaderLength; ///< header length in word | |
113 | static const UInt_t fgkEndOfReg; ///< end of regional info word | |
32def6aa | 114 | |
829425a5 | 115 | TClonesArray* fLocalArray; ///< array of local structure |
32def6aa | 116 | |
117 | ClassDef(AliMUONRegHeader,3) | |
118 | }; | |
119 | #endif |