]>
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 | /// | |
78649106 | 12 | // Author Christian Finck |
32def6aa | 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 | ||
71a2d3aa | 28 | /// Return darc word |
bebe0279 | 29 | UInt_t GetDarcWord() const {return fDarcWord;} |
71a2d3aa | 30 | /// Return first reg word |
bebe0279 | 31 | UInt_t GetWord() const {return fWord;} |
71a2d3aa | 32 | /// Return regional input |
bebe0279 | 33 | UInt_t GetInput(Int_t n) const {return fInput[n];} |
71a2d3aa | 34 | /// Return L0 |
bebe0279 | 35 | UShort_t GetL0() const {return fL0 & 0xFFFF;} |
71a2d3aa | 36 | /// Return mask |
bebe0279 | 37 | UShort_t GetMask() const {return fMask & 0xFFFF;} |
32def6aa | 38 | |
d622a0ec | 39 | //word: phys type:1, reset: 6, serialNb:5, Id:4, version: 8, regional output:8 |
251b70b4 | 40 | //true for phys, false for soft |
71a2d3aa | 41 | /// Return RegPhysFlag |
bebe0279 | 42 | Bool_t GetRegPhysFlag() const {return (fWord & 0x80000000);} |
71a2d3aa | 43 | /// Return ResetNb |
b6ab2009 | 44 | UChar_t GetResetNb() const {return (UChar_t)(fWord >> 25) & 0x20;} |
71a2d3aa | 45 | /// Return SerialNb |
b6ab2009 | 46 | UChar_t GetSerialNb() const {return (UChar_t)(fWord >> 20) & 0x1F;} |
71a2d3aa | 47 | /// Return Id |
b6ab2009 | 48 | UChar_t GetId() const {return (UChar_t)(fWord >> 16) & 0x0F;} |
71a2d3aa | 49 | /// Return Version |
b6ab2009 | 50 | UChar_t GetVersion() const {return (UChar_t)(fWord >> 8) & 0xFF;} |
71a2d3aa | 51 | /// Return Output |
b6ab2009 | 52 | UChar_t GetOutput() const {return (UChar_t)(fWord & 0xFF);} |
251b70b4 | 53 | |
54 | //Darc Status: error:10, #fpag:3, MBZ:3, phys type:1, present:1, not_full:1 | |
55 | // not_empty:1, L2Rej:1, L2Acc:1, L1:1, L0:1, #evt:4, busy:4 | |
71a2d3aa | 56 | /// Return ErrorBits |
251b70b4 | 57 | UShort_t GetErrorBits() const {return (UShort_t)(fDarcWord >> 21) & 0x3FF;} |
71a2d3aa | 58 | /// Return FPGANumber |
b6ab2009 | 59 | UChar_t GetFPGANumber() const {return (UChar_t) (fDarcWord >> 18) & 0x7;} |
71a2d3aa | 60 | /// Return DarcPhysFlag |
251b70b4 | 61 | Bool_t GetDarcPhysFlag() const {return (fDarcWord & 0x1000);} |
71a2d3aa | 62 | /// Return PresentFlag |
251b70b4 | 63 | Bool_t GetPresentFlag() const {return (fDarcWord & 0x800);} |
71a2d3aa | 64 | /// Return RamNotFullFlag |
251b70b4 | 65 | Bool_t GetRamNotFullFlag() const {return (fDarcWord & 0x400);} |
71a2d3aa | 66 | /// Return RamNotEmptyFlag |
251b70b4 | 67 | Bool_t GetRamNotEmptyFlag() const {return (fDarcWord & 0x200);} |
71a2d3aa | 68 | /// Return L2RejStatus |
251b70b4 | 69 | Bool_t GetL2RejStatus() const {return (fDarcWord & 0x100);} |
71a2d3aa | 70 | /// Return L2AccStatus |
251b70b4 | 71 | Bool_t GetL2AccStatus() const {return (fDarcWord & 0x80);} |
71a2d3aa | 72 | /// Return L1Status |
251b70b4 | 73 | Bool_t GetL1Status() const {return (fDarcWord & 0x40);} |
71a2d3aa | 74 | /// Return L0Status |
251b70b4 | 75 | Bool_t GetL0Status() const {return (fDarcWord & 0x20);} |
71a2d3aa | 76 | /// Return EventInRam |
b6ab2009 | 77 | UChar_t GetEventInRam() const {return (UChar_t) (fDarcWord >> 4) & 0x4;} |
71a2d3aa | 78 | /// Return Busy |
b6ab2009 | 79 | UChar_t GetBusy() const {return (UChar_t) (fDarcWord) & 0x4;} |
32def6aa | 80 | |
71a2d3aa | 81 | /// Set darc word |
00f56161 | 82 | void SetDarcWord(UInt_t w) {fDarcWord = w;} |
71a2d3aa | 83 | /// Set first reg word |
bebe0279 | 84 | void SetWord(UInt_t w) {fWord = w;} |
71a2d3aa | 85 | /// Set local mask ("poids faible" 16 bits) |
bebe0279 | 86 | void SetMask(UShort_t m) {fMask = m;} |
71a2d3aa | 87 | /// Set L0 |
bebe0279 | 88 | void SetL0(UShort_t l) {fL0 = (l & 0xFFFF);} |
71a2d3aa | 89 | /// Set regional input |
32def6aa | 90 | void SetInput(UInt_t in, Int_t n) {fInput[n] = in;} |
bebe0279 | 91 | |
92 | ||
71a2d3aa | 93 | /// Return header length in word |
32def6aa | 94 | Int_t GetHeaderLength() const {return fgkHeaderLength;} |
71a2d3aa | 95 | /// Return end of regional info word |
32def6aa | 96 | UInt_t GetEndOfReg() const {return fgkEndOfReg;} |
97 | ||
98 | ||
71a2d3aa | 99 | /// Return header |
00f56161 | 100 | UInt_t* GetHeader() {return &fDarcWord;} |
32def6aa | 101 | |
102 | // scalar methods | |
71a2d3aa | 103 | /// Return regional clock |
32def6aa | 104 | UInt_t GetClock() const {return fClk;} |
71a2d3aa | 105 | /// Return regional ouput |
32def6aa | 106 | const UInt_t* GetScaler() const {return fScaler;} |
71a2d3aa | 107 | /// Return regional hold (dead time) |
32def6aa | 108 | UInt_t GetHold() const {return fHold;} |
109 | ||
71a2d3aa | 110 | /// Return scalers |
d622a0ec | 111 | UInt_t* GetScalers() {return &fClk;} |
32def6aa | 112 | |
71a2d3aa | 113 | /// get scaler length |
32def6aa | 114 | Int_t GetScalerLength() const {return fgkScalerLength;} |
115 | ||
71a2d3aa | 116 | /// set random numbers to fill variable |
32def6aa | 117 | void SetScalersNumbers(); |
118 | ||
71a2d3aa | 119 | /// get TClonesArray |
32def6aa | 120 | TClonesArray* GetLocalArray() const {return fLocalArray;} |
121 | ||
71a2d3aa | 122 | /// get entries |
32def6aa | 123 | Int_t GetLocalEntries() const {return fLocalArray->GetEntriesFast();} |
124 | ||
71a2d3aa | 125 | /// get entry |
32def6aa | 126 | AliMUONLocalStruct* GetLocalEntry(Int_t i) const { |
127 | return (AliMUONLocalStruct*)fLocalArray->At(i);} | |
128 | ||
129 | // clear | |
130 | void Clear(Option_t* opt); | |
131 | ||
132 | private: | |
133 | ||
134 | // regional header | |
00f56161 | 135 | UInt_t fDarcWord; ///< darc word |
136 | UInt_t fWord; ///< first reg word | |
829425a5 | 137 | UInt_t fInput[2]; ///< regional input |
bebe0279 | 138 | UShort_t fMask; ///< local mask ("poids faible" 16 bits) |
139 | UShort_t fL0; ///< L0 counter (16 bits) | |
32def6aa | 140 | |
141 | // regional card scalers | |
829425a5 | 142 | UInt_t fClk; ///< regional clock |
143 | UInt_t fScaler[8]; ///< regional ouput | |
144 | UInt_t fHold; ///< regional hold (dead time) | |
32def6aa | 145 | |
829425a5 | 146 | static const Int_t fgkScalerLength; ///< length of regional scaler in word |
147 | static const Int_t fgkHeaderLength; ///< header length in word | |
148 | static const UInt_t fgkEndOfReg; ///< end of regional info word | |
32def6aa | 149 | |
829425a5 | 150 | TClonesArray* fLocalArray; ///< array of local structure |
32def6aa | 151 | |
69d7ac2e | 152 | ClassDef(AliMUONRegHeader,3) //MUON regional header for trigger |
32def6aa | 153 | }; |
154 | #endif |