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 */
9 /// \class AliMUONRegHeader
10 /// \brief MUON regional header for trigger
12 /// \author Christian Finck
15 #include <TClonesArray.h>
17 class AliMUONLocalStruct;
19 class AliMUONRegHeader : public TObject{
23 AliMUONRegHeader(const AliMUONRegHeader& event);
24 AliMUONRegHeader& operator=(const AliMUONRegHeader& event);
26 virtual ~AliMUONRegHeader();
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 UInt_t GetL0() const {return ((fL0Mask >> 16) & 0xFFFF);}
32 UInt_t GetMask() const {return (fL0Mask & 0xFFFF);}
34 //word: phys type:1, reset: 6, serialNb:5, Id:4, version: 8, regional output:8
35 //true for phys, false for soft
36 Bool_t GetRegPhysFlag() const {return (fWord & 0x80000000);}
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);}
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;}
46 UChar_t GetFPGANumber() const {return (UChar_t) (fDarcWord >> 18) & 0x7;}
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);}
55 UChar_t GetEventInRam() const {return (UChar_t) (fDarcWord >> 4) & 0x4;}
56 UChar_t GetBusy() const {return (UChar_t) (fDarcWord) & 0x4;}
58 void SetDarcWord(UInt_t w) {fDarcWord = w;}
59 void SetWord(UInt_t w) {fWord = w;}
60 void SetInput(UInt_t in, Int_t n) {fInput[n] = in;}
62 Int_t GetHeaderLength() const {return fgkHeaderLength;}
63 UInt_t GetEndOfReg() const {return fgkEndOfReg;}
66 UInt_t* GetHeader() {return &fDarcWord;}
69 UInt_t GetClock() const {return fClk;}
70 const UInt_t* GetScaler() const {return fScaler;}
71 UInt_t GetHold() const {return fHold;}
73 UInt_t* GetScalers() {return &fClk;}
76 Int_t GetScalerLength() const {return fgkScalerLength;}
78 // set random numbers to fill variable
79 void SetScalersNumbers();
82 TClonesArray* GetLocalArray() const {return fLocalArray;}
85 Int_t GetLocalEntries() const {return fLocalArray->GetEntriesFast();}
88 AliMUONLocalStruct* GetLocalEntry(Int_t i) const {
89 return (AliMUONLocalStruct*)fLocalArray->At(i);}
92 void Clear(Option_t* opt);
97 UInt_t fDarcWord; ///< darc word
98 UInt_t fWord; ///< first reg word
99 UInt_t fInput[2]; ///< regional input
100 UInt_t fL0Mask; ///< L0 counter (16 bits) and local mask (16 bits)
102 // regional card scalers
103 UInt_t fClk; ///< regional clock
104 UInt_t fScaler[8]; ///< regional ouput
105 UInt_t fHold; ///< regional hold (dead time)
107 static const Int_t fgkScalerLength; ///< length of regional scaler in word
108 static const Int_t fgkHeaderLength; ///< header length in word
109 static const UInt_t fgkEndOfReg; ///< end of regional info word
111 TClonesArray* fLocalArray; ///< array of local structure
113 ClassDef(AliMUONRegHeader,3)