1 #ifndef ALIMUONDARCHEADER_H
2 #define ALIMUONDARCHEADER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
9 /// \class AliMUONDarcHeader
10 /// \brief MUON Darc header for Trigger
12 // Author Christian Finck
15 #include <TClonesArray.h>
17 class AliMUONRegHeader;
19 class AliMUONDarcHeader : public TObject {
23 AliMUONDarcHeader(const AliMUONDarcHeader& event);
24 AliMUONDarcHeader& operator=(const AliMUONDarcHeader& event);
26 virtual ~AliMUONDarcHeader();
30 UInt_t GetWord() const {return fWord;}
31 /// Return global input
32 UInt_t GetGlobalInput(Int_t n) const {return fGlobalInput[n];}
33 /// Return global output
34 UChar_t GetGlobalOutput() const {return (fGlobalOutput & 0xFF);}
35 /// Return global config
36 UShort_t GetGlobalConfig() const {return ((fGlobalOutput >> 16) & 0xFFFF);}
38 //MBZ:1, phys trig:1, type:3, ,SerialNb:4,Version:8,VME trig:1,
39 //GlobalFlag:1, CTP trig:1, DAQ:1, Reg pattern:8;
42 //Bool_t GetEventType() const {return (fWord & 0x40000000);}
43 Bool_t GetEventType() const;
45 UChar_t GetDarcType() const {return (UChar_t)(fWord >> 24) & 0x7;}
46 /// Return serial number
47 UChar_t GetSerialNb() const {return (UChar_t)(fWord >> 20) & 0xF;}
49 UChar_t GetVersion() const {return (UChar_t)(fWord >> 12) & 0xFF;}
51 Bool_t GetVMETrig() const {return (fWord & 0x800);}
52 /// Return global flag
53 Bool_t GetGlobalFlag() const {return (fWord & 0x400);}
54 /// Return CPT trigger
55 Bool_t GetCTPTrig() const {return (fWord & 0x200);}
57 Bool_t GetDAQFlag() const {return (fWord & 0x100);}
58 /// Return reg pattern
59 UChar_t GetRegPattern() const {return (UChar_t)(fWord & 0xFF);}
62 void SetWord(UInt_t w) {fWord = w;}
64 void SetGlobalInput(UInt_t in, Int_t n) {fGlobalInput[n] = in;}
66 void SetGlobalOutput(Int_t out) {fGlobalOutput = out;}
68 /// Return darc header length
69 Int_t GetDarcHeaderLength() const {return fgkDarcHeaderLength;}
70 /// Return global header length
71 Int_t GetGlobalHeaderLength() const {return fgkGlobalHeaderLength;}
74 UInt_t* GetHeader() {return &fWord;}
75 /// Return global input
76 UInt_t* GetGlobalInput() {return &fGlobalInput[0];}
79 /// Return DARC L0 received and used
80 UInt_t GetDarcL0R() const {return fDarcL0R;}
81 /// Return DARC L1 physics
82 UInt_t GetDarcL1P() const {return fDarcL1P;}
83 /// Return DARC L1 software
84 UInt_t GetDarcL1S() const {return fDarcL1S;}
85 /// Return DARC L2 accept
86 UInt_t GetDarcL2A() const {return fDarcL2A;}
87 /// Return DARC L2 reject
88 UInt_t GetDarcL2R() const {return fDarcL2R;}
90 UInt_t GetDarcClock() const {return fDarcClk;}
91 /// Return DARC hold (dead time)
92 UInt_t GetDarcHold() const {return fDarcHold;}
94 // don't use setting methods but memcpy
96 UInt_t* GetGlobalScalers() {return &fGlobalL0;}
97 /// Return DARC L0 received and used
98 UInt_t* GetDarcScalers() {return &fDarcL0R;}
100 // global get methods
102 UInt_t GetGlobalL0() const {return fGlobalL0;}
103 /// Return global clock
104 UInt_t GetGlobalClock() const {return fGlobalClk;}
105 /// Return global scaler
106 const UInt_t* GetGlobalScaler() const {return fGlobalScaler;}
107 /// Return global hold (dead time)
108 UInt_t GetGlobalHold() const {return fGlobalHold;}
109 /// Return global spare
110 UInt_t GetGlobalSpare() const {return fGlobalSpare;}
112 /// Return length of global scaler in word
113 Int_t GetGlobalScalerLength() const {return fgkGlobalScalerLength;}
114 /// Return length of DARC scaler in word
115 Int_t GetDarcScalerLength() const {return fgkDarcScalerLength;}
117 /// Return end of darc info word
118 UInt_t GetEndOfDarc() const {return fgkEndOfDarc;}
119 /// Return end of global info word
120 UInt_t GetEndOfGlobal() const {return fgkEndOfGlobal;}
122 /// Return default type for DARC def.
123 UInt_t GetDarcDefaultType() const {return fgkDarcDefaultType;}
124 /// Return default type for DARC def.
125 UInt_t GetDarcVadohrType() const {return fgkDarcVadorhType;}
127 // set random numbers to fill variable
128 void SetScalersNumbers();
131 TClonesArray* GetRegHeaderArray() const {return fRegHeaderArray;}
134 Int_t GetRegHeaderEntries() const {return fRegHeaderArray->GetEntriesFast();}
137 AliMUONRegHeader* GetRegHeaderEntry(Int_t i) const {
138 return (AliMUONRegHeader*)fRegHeaderArray->At(i);}
141 void Clear(Option_t* opt);
145 UInt_t fWord; ///< first word
146 UInt_t fGlobalInput[4]; ///< global input
147 Int_t fGlobalOutput; ///< global ouput
149 static const Int_t fgkDarcHeaderLength; ///< darc header length
150 static const Int_t fgkGlobalHeaderLength; ///< global header length
153 // global card scalers
154 UInt_t fGlobalL0; ///< global L0
155 UInt_t fGlobalClk; ///< global clock
156 UInt_t fGlobalScaler[6]; ///< global ouput
157 UInt_t fGlobalHold; ///< global hold (dead time)
158 UInt_t fGlobalSpare; ///< global spare
159 static const Int_t fgkGlobalScalerLength; ///< length of global scaler in word
162 UInt_t fDarcL0R; ///< DARC L0 received and used
163 UInt_t fDarcL1P; ///< DARC L1 physics
164 UInt_t fDarcL1S; ///< DARC L1 software
165 UInt_t fDarcL2A; ///< DARC L2 accept
166 UInt_t fDarcL2R; ///< DARC L2 reject
167 UInt_t fDarcClk; ///< DARC clock
168 UInt_t fDarcHold; ///< DARC hold (dead time)
169 UInt_t fDarcSpare; ///< DARC Empty slot (for the moment)
171 static const Int_t fgkDarcScalerLength; ///< length of DARC scaler in word
173 static const UInt_t fgkEndOfDarc; ///< end of darc info word
174 static const UInt_t fgkEndOfGlobal; ///< end of global info word
176 static const UInt_t fgkDarcDefaultType; ///< default type for DARC def.
177 static const UInt_t fgkDarcVadorhType; ///< default type for DARC vadorh
180 TClonesArray* fRegHeaderArray; ///< container for regional header
182 ClassDef(AliMUONDarcHeader,2) // MUON DDL Trigger