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