AliRoot Core  a565103 (a565103)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONRegHeader.h
Go to the documentation of this file.
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 
12 // Author Christian Finck
13 
14 #include <TObject.h>
15 #include <TClonesArray.h>
16 
17 class AliMUONLocalStruct;
18 
19 class AliMUONRegHeader : public TObject{
20 
21 public:
23  AliMUONRegHeader(TRootIOCtor* dummy);
24  AliMUONRegHeader(const AliMUONRegHeader& event);
26 
27  virtual ~AliMUONRegHeader();
28 
30  UInt_t GetDarcWord() const {return fDarcWord;}
32  UInt_t GetWord() const {return fWord;}
34  UInt_t GetInput(Int_t n) const {return fInput[n];}
36  UShort_t GetL0() const {return fL0 & 0xFFFF;}
38  UShort_t GetMask() const {return fMask & 0xFFFF;}
39 
40  //word: phys type:1, reset: 6, serialNb:5, Id:4, version: 8, regional output:8
41  //true for phys, false for soft
43  Bool_t GetRegPhysFlag() const {return (fWord & 0x80000000);}
45  UChar_t GetResetNb() const {return (UChar_t)(fWord >> 25) & 0x3F;}
47  UChar_t GetSerialNb() const {return (UChar_t)(fWord >> 20) & 0x1F;}
49  UChar_t GetId() const {return (UChar_t)(fWord >> 16) & 0x0F;}
51  UChar_t GetVersion() const {return (UChar_t)(fWord >> 8) & 0xFF;}
53  UChar_t GetOutput() const {return (UChar_t)(fWord & 0xFF);}
54 
55  //Darc Status: error:10, #fpag:3, MBZ:3, phys type:1, present:1, not_full:1
56  // not_empty:1, L2Rej:1, L2Acc:1, L1:1, L0:1, #evt:4, busy:4
58  UShort_t GetErrorBits() const {return (UShort_t)(fDarcWord >> 22) & 0x3FF;}
60  UChar_t GetFPGANumber() const {return (UChar_t) (fDarcWord >> 19) & 0x7;}
62  Bool_t GetDarcPhysFlag() const {return (fDarcWord & 0x8000);}
64  Bool_t GetPresentFlag() const {return (fDarcWord & 0x4000);}
66  Bool_t GetRamNotFullFlag() const {return (fDarcWord & 0x2000);}
68  Bool_t GetRamNotEmptyFlag() const {return (fDarcWord & 0x1000);}
70  Bool_t GetL2RejStatus() const {return (fDarcWord & 0x800);}
72  Bool_t GetL2AccStatus() const {return (fDarcWord & 0x400);}
74  Bool_t GetL1Status() const {return (fDarcWord & 0x200);}
76  Bool_t GetL0Status() const {return (fDarcWord & 0x100);}
78  UChar_t GetEventInRam() const {return (UChar_t) (fDarcWord >> 4) & 0x4;}
80  UChar_t GetBusy() const {return (UChar_t) (fDarcWord) & 0x4;}
81 
83  void SetDarcWord(UInt_t w) {fDarcWord = w;}
85  void SetWord(UInt_t w) {fWord = w;}
87  void SetMask(UShort_t m) {fMask = m;}
89  void SetL0(UShort_t l) {fL0 = (l & 0xFFFF);}
91  void SetInput(UInt_t in, Int_t n) {fInput[n] = in;}
92 
93 
95  Int_t GetHeaderLength() const {return fgkHeaderLength;}
97  UInt_t GetEndOfReg() const {return fgkEndOfReg;}
99  UInt_t GetErrorWord() const {return fgkErrorWord;}
100 
102  UInt_t* GetHeader() {return &fDarcWord;}
103 
104  // scalar methods
106  UInt_t GetClock() const {return fClk;}
108  const UInt_t* GetScaler() const {return fScaler;}
110  UInt_t GetHold() const {return fHold;}
111 
113  UInt_t* GetScalers() {return &fClk;}
114 
116  Int_t GetScalerLength() const {return fgkScalerLength;}
117 
119  void SetScalersNumbers();
120 
122  TClonesArray* GetLocalArray() const {return fLocalArray;}
123 
125  Int_t GetLocalEntries() const {return fLocalArray->GetEntriesFast();}
126 
129  return (AliMUONLocalStruct*)fLocalArray->At(i);}
130 
131  // clear
132  void Clear(Option_t* opt);
133 
134  private:
135 
136  // regional header
137  UInt_t fDarcWord;
138  UInt_t fWord;
139  UInt_t fInput[2];
140  UShort_t fMask;
141  UShort_t fL0;
142 
143  // regional card scalers
144  UInt_t fClk;
145  UInt_t fScaler[8];
146  UInt_t fHold;
147 
148  static const Int_t fgkScalerLength;
149  static const Int_t fgkHeaderLength;
150  static const UInt_t fgkEndOfReg;
151  static const UInt_t fgkErrorWord;
152 
153  TClonesArray* fLocalArray;
154 
155  ClassDef(AliMUONRegHeader,4) //MUON regional header for trigger
156 };
157 #endif
UInt_t GetEndOfReg() const
Return end of regional info word.
UChar_t GetBusy() const
Return Busy.
AliMUONRegHeader & operator=(const AliMUONRegHeader &event)
UInt_t fInput[2]
regional input
void SetL0(UShort_t l)
Set L0.
Bool_t GetRamNotEmptyFlag() const
Return RamNotEmptyFlag.
UShort_t GetErrorBits() const
Return ErrorBits.
void SetScalersNumbers()
set random numbers to fill variable
Rawdata local card structure for trigger.
UShort_t GetL0() const
Return L0.
TClonesArray * GetLocalArray() const
get TClonesArray
AliMUONLocalStruct * GetLocalEntry(Int_t i) const
get entry
static const UInt_t fgkErrorWord
error word when a regional board is missing
UChar_t GetEventInRam() const
Return EventInRam.
void SetMask(UShort_t m)
Set local mask ("poids faible" 16 bits)
Bool_t GetPresentFlag() const
Return PresentFlag.
Bool_t GetL2RejStatus() const
Return L2RejStatus.
UChar_t GetOutput() const
Return Output.
Bool_t GetDarcPhysFlag() const
Return DarcPhysFlag.
const UInt_t * GetScaler() const
Return regional ouput.
UInt_t fScaler[8]
regional ouput
MUON regional header for trigger.
virtual ~AliMUONRegHeader()
UInt_t GetDarcWord() const
Return darc word.
static const UInt_t fgkEndOfReg
end of regional info word
UInt_t GetWord() const
Return first reg word.
UChar_t GetVersion() const
Return Version.
UInt_t * GetScalers()
Return scalers.
Int_t GetScalerLength() const
get scaler length
UInt_t GetInput(Int_t n) const
Return regional input.
UInt_t * GetHeader()
Return header.
Bool_t GetL2AccStatus() const
Return L2AccStatus.
UChar_t GetFPGANumber() const
Return FPGANumber.
TClonesArray * fLocalArray
array of local structure
UInt_t fHold
regional hold (dead time)
UChar_t GetSerialNb() const
Return SerialNb.
static const Int_t fgkHeaderLength
header length in word
Int_t GetHeaderLength() const
Return header length in word.
UInt_t fDarcWord
darc word
UInt_t GetHold() const
Return regional hold (dead time)
UInt_t fClk
regional clock
static const Int_t fgkScalerLength
length of regional scaler in word
UShort_t GetMask() const
Return mask.
UInt_t fWord
first reg word
void SetInput(UInt_t in, Int_t n)
Set regional input.
UChar_t GetResetNb() const
Return ResetNb.
void SetWord(UInt_t w)
Set first reg word.
UInt_t GetErrorWord() const
Return error word.
UChar_t GetId() const
Return Id.
Int_t GetLocalEntries() const
get entries
Bool_t GetRegPhysFlag() const
Return RegPhysFlag.
Bool_t GetRamNotFullFlag() const
Return RamNotFullFlag.
void Clear(Option_t *opt)
UInt_t GetClock() const
Return regional clock.
void SetDarcWord(UInt_t w)
Set darc word.
UShort_t fMask
local mask ("poids faible" 16 bits)
UShort_t fL0
L0 counter (16 bits)
Bool_t GetL0Status() const
Return L0Status.
Bool_t GetL1Status() const
Return L1Status.