Line data Source code
1 : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 : * See cxx source for full Copyright notice */
3 :
4 : // $Id$
5 :
6 : /// \ingroup calib
7 : /// \class AliMUONGlobalCrateConfig
8 : /// \brief The class defines the configuration of global crate
9 : ///
10 : /// \author Ch. Finck, Subatech Nantes
11 :
12 : #ifndef ALI_MUON_GLOBAL_CRATE_CONFIG_H
13 : #define ALI_MUON_GLOBAL_CRATE_CONFIG_H
14 :
15 : #include <TNamed.h>
16 : #include <TString.h>
17 :
18 : class AliMUONGlobalCrateConfig : public TNamed {
19 :
20 : public:
21 : AliMUONGlobalCrateConfig();
22 : virtual ~AliMUONGlobalCrateConfig();
23 :
24 : // methods
25 : Int_t ReadData(const TString& fileName = "");
26 :
27 : // global crate enable
28 : /// set global crate enbale
29 0 : void SetGlobalCrateEnable(UInt_t enable) {fGlobalCrateEnable = enable;}
30 : /// Get global crate enbale
31 0 : UInt_t GetGlobalCrateEnable() const {return fGlobalCrateEnable;}
32 :
33 : // Jtag
34 : /// Get Jtag board VME address
35 0 : ULong_t GetJtagVmeAddr() const {return fJtagVmeAddr;}
36 : /// Set Jtag board VME address
37 0 : void SetJtagVmeAddr(ULong_t addr) {fJtagVmeAddr = addr;}
38 :
39 : /// Get Jtag board Clock Divider
40 0 : UInt_t GetJtagClockDiv() const {return fJtagClockDiv;}
41 : /// Set Jtag board Clock Divider
42 0 : void SetJtagClockDiv(UInt_t clk) {fJtagClockDiv = clk;}
43 :
44 : /// Get Jtag board Rx Phase
45 0 : UInt_t GetJtagRxPhase() const {return fJtagRxPhase;}
46 : /// Set Jtag board Rx Phase
47 0 : void SetJtagRxPhase(UInt_t rx) {fJtagRxPhase = rx;}
48 :
49 : /// Get Jtag board Read out Delay
50 0 : UInt_t GetJtagRdDelay() const {return fJtagRdDelay;}
51 : /// Set Jtag board Read out Delay
52 0 : void SetJtagRdDelay(UInt_t rd) {fJtagRdDelay = rd;}
53 :
54 : /// Get Jtag enabled lines
55 : Bool_t GetEnableJtag(Int_t index) const;
56 : /// Set Jtag enable word
57 0 : void SetEnableJtag(UChar_t en) {fEnableJtag = en;}
58 : /// Get Jtag enable word
59 0 : UChar_t GetEnableJtag() const {return fEnableJtag;}
60 : /// Set First Darc enable word
61 0 : void SetEnableFirstDarc(UChar_t en) {fEnableFirstDarc = en;}
62 : /// Get First Darc enable word
63 0 : UChar_t GetEnableFirstDarc() const {return fEnableFirstDarc;}
64 : /// Get First Darc enable lines
65 : Bool_t GetEnableFirstDarc(Int_t index) const;
66 : /// Set Second Darc enable word
67 0 : void SetEnableSecondDarc(UChar_t en) {fEnableSecondDarc = en;}
68 : /// Get Second Darc enable word
69 0 : UChar_t GetEnableSecondDarc() const {return fEnableSecondDarc;}
70 : /// Get Second Darc enable lines
71 : Bool_t GetEnableSecondDarc(Int_t index) const;
72 :
73 : /// Get Jtag Crate names
74 : TString GetJtagCrateName(Int_t jtagLine, Int_t index) const;
75 : /// Set Jtag Crate names
76 : void SetJtagCrateName(Int_t index, TString name);
77 :
78 : // first Darc Board
79 : /// Get First Darc board VME address
80 0 : ULong_t GetFirstDarcVmeAddr() const {return fFirstDarcVmeAddr;}
81 : /// Get First Darc board VME address
82 0 : void SetFirstDarcVmeAddr(ULong_t addr) {fFirstDarcVmeAddr = addr;}
83 :
84 : /// Get type for First Darc board
85 0 : Int_t GetFirstDarcType() const {return fFirstDarcType;}
86 : /// Get type for First Darc board
87 0 : void SetFirstDarcType(Int_t type) {fFirstDarcType = type;}
88 :
89 : /// Get disable word for First Darc board
90 0 : UChar_t GetFirstDarcDisable() const {return fFirstDarcDisable;}
91 : /// Get disable per regional crate for First Darc board
92 0 : Bool_t GetFirstDarcDisable(Int_t iCrate) const {return !((fFirstDarcDisable >> iCrate) & 0x1);}
93 : /// Set disable word for First Darc board
94 0 : void SetFirstDarcDisable(UChar_t en) {fFirstDarcDisable = en;}
95 :
96 : /// Get L0 Delay for First Darc board
97 0 : UInt_t GetFirstDarcL0Delay() const {return fFirstDarcL0Delay;}
98 : /// Set L0 Delay for First Darc board
99 0 : void SetFirstDarcL0Delay(UInt_t delay) {fFirstDarcL0Delay = delay;}
100 :
101 : /// Get L1 Time Out for First Darc board
102 0 : UInt_t GetFirstDarcL1TimeOut() const {return fFirstDarcL1TimeOut;}
103 : /// Set L1 Time Out for First Darc board
104 0 : void SetFirstDarcL1TimeOut(UInt_t time) {fFirstDarcL1TimeOut = time;}
105 :
106 : /// Get global L0 delay for First Darc board
107 0 : UInt_t GetFirstDarcGlobalL0() const {return fFirstDarcGlobalL0;}
108 : /// set global L0 delay for First Darc board
109 0 : void SetFirstDarcGlobalL0(UInt_t time) {fFirstDarcGlobalL0 = time;}
110 :
111 : /// Get configuration for First Darc board
112 0 : UInt_t GetFirstDarcConfig() const {return fFirstDarcConfig;}
113 : /// set configuration for First Darc board
114 0 : void SetFirstDarcConfig(UInt_t conf) {fFirstDarcConfig = conf;}
115 :
116 : /// Get First Darc Crate names
117 : TString GetFirstDarcCrateName(Int_t index) const;
118 : /// Set First Darc Crate names
119 : void SetFirstDarcCrateName(Int_t index, TString name);
120 :
121 : // second Darc Board
122 : /// Get Second Darc board VME address
123 0 : ULong_t GetSecondDarcVmeAddr() const {return fSecondDarcVmeAddr;}
124 : /// Set Second Darc board VME address
125 0 : void SetSecondDarcVmeAddr(ULong_t addr) {fSecondDarcVmeAddr = addr;}
126 :
127 : /// Get type for Second Darc board
128 0 : Int_t GetSecondDarcType() const {return fSecondDarcType;}
129 : /// Set type for Second Darc board
130 0 : void SetSecondDarcType(Int_t type) {fSecondDarcType = type;}
131 :
132 : /// Get disable word for Second Darc board
133 0 : UChar_t GetSecondDarcDisable() const {return fSecondDarcDisable;}
134 : /// Get disable per regional crate for Second Darc board
135 0 : Bool_t GetSecondDarcDisable(Int_t iCrate) const {return !((fSecondDarcDisable >> iCrate) & 0x1);}
136 : /// Set disable word for Second Darc board
137 0 : void SetSecondDarcDisable(UChar_t en) {fSecondDarcDisable = en;}
138 :
139 : /// Get L0 Delay for Second Darc board
140 0 : UInt_t GetSecondDarcL0Delay() const {return fSecondDarcL0Delay;}
141 : /// Set L0 Delay for Second Darc board
142 0 : void SetSecondDarcL0Delay(UInt_t delay) {fSecondDarcL0Delay = delay;}
143 : /// Get L1 Time Out for Second Darc board
144 0 : UInt_t GetSecondDarcL1TimeOut() const {return fSecondDarcL1TimeOut;}
145 : /// Set L1 Time Out for Second Darc board
146 0 : void SetSecondDarcL1TimeOut(UInt_t time) {fSecondDarcL1TimeOut = time;}
147 :
148 : /// Get global L0 delay for Second Darc board
149 0 : UInt_t GetSecondDarcGlobalL0() const {return fSecondDarcGlobalL0;}
150 : /// set global L0 delay for Second Darc board
151 0 : void SetSecondDarcGlobalL0(UInt_t time) {fSecondDarcGlobalL0 = time;}
152 :
153 : /// Get configuration for Second Darc board
154 0 : UInt_t GetSecondDarcConfig() const {return fSecondDarcConfig;}
155 : /// set configuration for Second Darc board
156 0 : void SetSecondDarcConfig(UInt_t conf) {fSecondDarcConfig = conf;}
157 :
158 : /// Get Second Darc Crate names
159 : TString GetSecondDarcCrateName(Int_t index) const;
160 : /// Set Second Darc Crate names
161 : void SetSecondDarcCrateName(Int_t index, TString name);
162 :
163 : // global board
164 : /// Get Global board VME address
165 0 : ULong_t GetGlobalVmeAddr() const {return fGlobalVmeAddr;}
166 : /// Set Global board VME address
167 0 : void SetGlobalVmeAddr(ULong_t addr) {fGlobalVmeAddr = addr;}
168 :
169 : /// Get register for Global
170 : UInt_t GetGlobalRegister(Int_t index) const;
171 : /// Set register for Global
172 : void SetGlobalRegister(Int_t index, UInt_t reg);
173 : /// Get register word for Global
174 0 : UInt_t* GetGlobalRegister() {return fGlobalRegisters;}
175 : /// Set mask for the global input
176 : void SetGlobalMask(Int_t index, UInt_t mask);
177 : /// Get mask for the global input
178 : UInt_t GetGlobalMask(Int_t index) const;
179 : /// Indicates if global masks are active on global inputs
180 : Bool_t GetMasksOn() const;
181 :
182 : // fet board
183 : /// Get FET board VME address
184 0 : ULong_t GetFetVmeAddr() const {return fFetVmeAddr;}
185 : /// Set FET board VME address
186 0 : void SetFetVmeAddr(ULong_t addr) {fFetVmeAddr = addr;}
187 :
188 : /// Get register for FET
189 : UInt_t GetFetRegister(Int_t index) const;
190 : /// Set register for FET
191 : void SetFetRegister(Int_t index, UInt_t reg);
192 : /// Set register word for FET
193 0 : UInt_t* GetFetRegister() {return fFetRegisters;}
194 :
195 : //static members
196 : /// Get Jtag Name identifier
197 0 : const Char_t* GetJtagName() const {return fgkJtagName;}
198 : /// Get First Darc Name identifier
199 0 : const Char_t* GetFirstDarcName() const {return fgkFirstDarcName;}
200 : /// Get Second Darc Name identifier
201 0 : const Char_t* GetSecondDarcName() const {return fgkSecondDarcName;}
202 : /// Get Global Name identifier
203 0 : const Char_t* GetGlobalName() const {return fgkGlobalName;}
204 : /// Get Global Name identifier
205 0 : const Char_t* GetFetName() const {return fgkFetName;}
206 :
207 : /// Get number of registers for Global
208 0 : Int_t GetGlobalNofRegisters() const {return fgkGlobalNofRegisters;}
209 : /// Get number of registers for FET
210 0 : Int_t GetFetNofRegisters() const {return fgkFetNofRegisters;}
211 : /// Get number of JTag lines
212 0 : Int_t GetJtagNofLines() const {return fgkJtagNofLines;}
213 : /// Get number of Darc Crate lines
214 0 : Int_t GetDarcNofLines() const {return fgkDarcNofLines;}
215 :
216 : private:
217 : /// Not implemented
218 : AliMUONGlobalCrateConfig(const AliMUONGlobalCrateConfig& rhs);
219 : /// Not implemented
220 : AliMUONGlobalCrateConfig& operator=(const AliMUONGlobalCrateConfig& rhs);
221 :
222 : // data members
223 : UInt_t fGlobalCrateEnable; ///< Global Crate Enable
224 : ULong_t fJtagVmeAddr; ///< JTag VME address
225 : UInt_t fJtagClockDiv; ///< Clock Divider number for JTag
226 : UInt_t fJtagRxPhase; ///< Rx phase number for JTag
227 : UInt_t fJtagRdDelay; ///< Read delay for JTag
228 : UChar_t fEnableJtag; ///< Enable mask for JTag lines
229 : TString fJtagCrateName[16]; ///< Crate name for the Jtag lines
230 : TString fFirstDarcCrateName[8]; ///< Crate name for the First Darc lines
231 : TString fSecondDarcCrateName[8]; ///< Crate name for the Second Darc lines
232 :
233 : ULong_t fFirstDarcVmeAddr; ///< First Darc Board VME Address
234 : Int_t fFirstDarcType; ///< Type of the first Darc Board
235 : UChar_t fFirstDarcDisable; ///< disable the readout of the 8 crates connected to this board
236 : UInt_t fFirstDarcL0Delay; ///< L0 delay for this board
237 : UInt_t fFirstDarcL1TimeOut; ///< L1 time out for this board
238 : UInt_t fFirstDarcGlobalL0 ; ///< L0 global l0 delay this board
239 : UInt_t fFirstDarcConfig ; ///< Trigger configuration this board
240 :
241 : ULong_t fSecondDarcVmeAddr; ///< Second Darc Board VME Address
242 : Int_t fSecondDarcType; ///< Type of the first Darc Board
243 : UChar_t fSecondDarcDisable; ///< disable the readout of the 8 crates connected to this board
244 : UInt_t fSecondDarcL0Delay; ///< L0 delay for this board
245 : UInt_t fSecondDarcL1TimeOut; ///< L1 time out for this board
246 : UInt_t fSecondDarcGlobalL0; ///< Global L0 delay for this board
247 : UInt_t fSecondDarcConfig ; ///< Trigger configuration this board
248 :
249 : ULong_t fGlobalVmeAddr; ///< Global Board VME Address
250 : UInt_t fGlobalRegisters[13]; ///< Global registers
251 :
252 : ULong_t fFetVmeAddr; ///< Fet Board VME Address
253 : UInt_t fFetRegisters[7]; ///< Fet registers
254 :
255 : UChar_t fEnableFirstDarc; ///< Enable mask for First Darc lines
256 : UChar_t fEnableSecondDarc; ///< Enable mask for Second Darc lines
257 :
258 : static const Char_t* fgkJtagName; ///< JTag Board name
259 : static const Char_t* fgkFirstDarcName; ///< First DARC board name
260 : static const Char_t* fgkSecondDarcName; ///< Second DARC board name
261 : static const Char_t* fgkGlobalName; ///< Global Board name
262 : static const Char_t* fgkFetName; ///< FET Board name
263 :
264 : static const Int_t fgkGlobalNofRegisters; ///< Number of registers for Global Board
265 : static const Int_t fgkFetNofRegisters; ///< Number of registers for Fet
266 : static const Int_t fgkJtagNofLines; ///< Number of lines for Jtag
267 : static const Int_t fgkDarcNofLines; ///< Number of lines for Darc Crate
268 :
269 42 : ClassDef(AliMUONGlobalCrateConfig,4)
270 : };
271 :
272 : #endif
273 :
274 :
275 :
276 :
277 :
278 :
279 :
280 :
281 :
282 :
283 :
284 :
285 :
286 :
|