ATLAS Offline Software
Loading...
Searching...
No Matches
TileDCSState.h
Go to the documentation of this file.
1//Dear emacs, this is -*- c++ -*-
2
3/*
4 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef TILECONDITIONS_TILEDCSSTATE_H
8#define TILECONDITIONS_TILEDCSSTATE_H
9
11
12#include <vector>
13#include <string>
14
23
25
26 public:
27
36
38 virtual ~TileDCSState() {};
39
47 float getChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel) const;
48
56 void setChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel, float hv);
57
65 float getChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel) const;
66
74 void setChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel, float hvSet);
75
82 int getDrawerStates(unsigned int ros, unsigned int drawer) const;
83
90 void setDrawerStates(unsigned int ros, unsigned int drawer, int states);
91
101 TileDCSStatus getDCSHVStatus(unsigned int ros, unsigned int drawer, unsigned int channel) const;
102
112 void setDCSHVStatus(unsigned int ros, unsigned int drawer, unsigned int channel, TileDCSStatus status);
113
121 TileDCSStatus getDCSStatus(unsigned int ros, unsigned int drawer) const;
122
132 TileDCSStatus getDCSStatus(unsigned int ros, unsigned int drawer, unsigned int channel) const;
133
143 TileDCSStatus setDCSStatus(unsigned int ros, unsigned int drawer, unsigned int channel, TileDCSStatus status);
144
154 bool isStatusHVBad(unsigned int ros, unsigned int drawer, unsigned int channel) const;
155
164
165 bool isStatusBad (unsigned int ros, unsigned int drawer) const;
166
177 bool isStatusBad(unsigned int ros, unsigned int drawer, unsigned int channel) const;
178
183 void setGoodDrawer(int goodDrawer);
184
189 void setWarningDrawer(const std::vector<int>& warningDrawer);
190
191 private:
192
200
201 void checkDrawer(const std::string& description, unsigned int ros, unsigned int drawer) const;
202 void checkChannel(const std::string& description, unsigned int ros, unsigned int drawer,
203 unsigned int channel, unsigned int maxChannel) const;
204
210
212 std::vector<int> m_warningDrawer;
214
215};
216
217
220
221CLASS_DEF(TileDCSState, 125804125, 0)
223
224// inlines
225
226inline
227float TileDCSState::getChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel) const {
228
229 checkChannel("TileDCSState::getChannelHV()", ros, drawer, channel, NUMBER_OF_HV_CHANNELS);
230
231 return m_hv[ros - 1][drawer][channel];
232}
233
234inline
235void TileDCSState::setChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel, float hv) {
236
237 checkChannel("TileDCSState::setChannelHV()", ros, drawer, channel, NUMBER_OF_HV_CHANNELS);
238
239 m_hv[ros - 1][drawer][channel] = hv;
240}
241
242inline
243float TileDCSState::getChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel) const {
244
245 checkChannel("TileDCSState::getChannelHVSet()", ros, drawer, channel, NUMBER_OF_HVSET_CHANNELS);
246
247 return m_hvSet[ros - 1][drawer][channel]; // Return the HVSET
248}
249
250inline
251void TileDCSState::setChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel, float hvSet) {
252
253 checkChannel("TileDCSState::setChannelHVSet()", ros, drawer, channel, NUMBER_OF_HVSET_CHANNELS);
254
255 m_hvSet[ros - 1][drawer][channel] = hvSet; // Set the HVSET
256}
257
258inline
259int TileDCSState::getDrawerStates(unsigned int ros, unsigned int drawer) const {
260
261 checkDrawer("TileDCSState::getDrawerStates()", ros, drawer);
262
263 return m_states[ros - 1][drawer];
264}
265
266inline
267void TileDCSState::setDrawerStates(unsigned int ros, unsigned int drawer, int states) {
268
269 checkDrawer("TileDCSState::setDrawerStates()", ros, drawer);
270
271 m_states[ros - 1][drawer] = states; // Set the drawer state
272}
273
274inline
276 unsigned int drawer,
277 unsigned int channel) const {
278
279 checkChannel("TileDCSState::getDCSHVStatus()", ros, drawer, channel, NUMBER_OF_CHANNELS);
280
281 return m_hvStatus[ros - 1][drawer][channel];
282}
283
284inline
285void TileDCSState::setDCSHVStatus(unsigned int ros, unsigned int drawer, unsigned int channel,
287
288 checkChannel("TileDCSState::setDCSHVStatus()", ros, drawer, channel, NUMBER_OF_CHANNELS);
289
290 m_hvStatus[ros - 1][drawer][channel] = status;
291}
292
293inline
295 unsigned int drawer,
296 unsigned int channel) const {
297
298 checkChannel("TileDCSState::getDCSStatus()", ros, drawer, channel, NUMBER_OF_CHANNELS);
299
300 return m_status[ros - 1][drawer][channel]; // final status - the worst of 2 statuses above
301}
302
303inline
305 unsigned int drawer,
306 unsigned int channel,
308
309 checkChannel("TileDCSState::setDCSStatus()", ros, drawer, channel, NUMBER_OF_CHANNELS);
310
311 return m_status[ros - 1][drawer][channel] = status; // final status - the worst of 2 statuses above
312}
313
314inline
315bool TileDCSState::isStatusHVBad(unsigned int ros, unsigned int drawer, unsigned int channel) const {
316 return getDCSHVStatus(ros, drawer, channel) > WARNING;
317}
318
319inline
320bool TileDCSState::isStatusBad (unsigned int ros, unsigned int drawer) const {
321 return getDCSStatus(ros, drawer) > WARNING;
322}
323
324inline
325bool TileDCSState::isStatusBad(unsigned int ros, unsigned int drawer, unsigned int channel) const {
326
327 checkChannel("TileDCSState::isStatusBad()", ros, drawer, channel, NUMBER_OF_CHANNELS);
328
329 return m_status[ros - 1][drawer][channel] > WARNING;
330}
331
332inline
333void TileDCSState::setGoodDrawer(int goodDrawer) { m_goodDrawer = goodDrawer;}
334
335inline
336void TileDCSState::setWarningDrawer(const std::vector<int>& warningDrawer) {
337 m_warningDrawer = warningDrawer;
338}
339
340inline
342 unsigned int ros, unsigned int drawer) const {
343
344 if (ros > NUMBER_OF_ROSES) {
346 }
347
348 if (drawer >= NUMBER_OF_DRAWERS) {
350 }
351
352}
353
354
355inline
357 unsigned int ros, unsigned int drawer,
358 unsigned int channel, unsigned int maxChannel) const {
359
360 checkDrawer(description, ros, drawer);
361
362 if (channel >= maxChannel) {
363 throw TileCalib::IndexOutOfRange(description, channel, maxChannel);
364 }
365
366}
367
368#endif // TILECONDITIONS_TILEDCSSTATE_H
Hold mappings of ranges to condition objects.
#define CONDCONT_MIXED_DEF(...)
Definition CondCont.h:1446
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Condition object to keep Tile DCS status from DB.
TileDCSStatus getDCSHVStatus(unsigned int ros, unsigned int drawer, unsigned int channel) const
Return TileDCSstatus for given Tile channel determined by deviation between measured and requested HV...
void setDrawerStates(unsigned int ros, unsigned int drawer, int states)
Store Tile drawer summary states per LVPS reported by DCS.
virtual ~TileDCSState()
TileDCSStatus getDCSStatus(unsigned int ros, unsigned int drawer) const
Return TileDCSstatus for given Tile drawer determined by summary states per LVPS.
float getChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel) const
Return measured HV reported by DCS for given Tile channel.
float getChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel) const
Return requested HV reported by DCS for given Tile channel.
@ NUMBER_OF_HVSET_CHANNELS
Number of Tile "channels" in DCS HVSET folder.
@ NUMBER_OF_DRAWERS
Number of Tile drawers in one ROS.
@ NUMBER_OF_ROSES
Number of Tile ROSes.
@ NUMBER_OF_CHANNELS
Number of Tile channels.
@ NUMBER_OF_HV_CHANNELS
Number of Tile "channels" in DCS HV folder.
void checkChannel(const std::string &description, unsigned int ros, unsigned int drawer, unsigned int channel, unsigned int maxChannel) const
void setWarningDrawer(const std::vector< int > &warningDrawer)
Store vector of warning Tile drawer summary states per LVPS as reference.
bool isStatusHVBad(unsigned int ros, unsigned int drawer, unsigned int channel) const
Return true if given Tile channel considered as bad by deviation between measured and requested HV ot...
void setChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel, float hv)
Store measured HV reported by DCS for given Tile channel.
TileDCSStatus m_hvStatus[NUMBER_OF_ROSES][NUMBER_OF_DRAWERS][NUMBER_OF_CHANNELS]
TileDCSStatus
Describes Tile DCS status.
std::vector< int > m_warningDrawer
TileDCSStatus setDCSStatus(unsigned int ros, unsigned int drawer, unsigned int channel, TileDCSStatus status)
Store TileDCSstatus for given Tile channel determined by summary states per LVPS and deviation betwee...
void setDCSHVStatus(unsigned int ros, unsigned int drawer, unsigned int channel, TileDCSStatus status)
Store TileDCSstatus for given Tile channel determined by deviation between measured and requested HV.
void setChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel, float hvSet)
Store requested HV reported by DCS for given Tile channel.
float m_hv[NUMBER_OF_ROSES][NUMBER_OF_DRAWERS][NUMBER_OF_HV_CHANNELS]
int m_states[NUMBER_OF_ROSES][NUMBER_OF_DRAWERS]
void setGoodDrawer(int goodDrawer)
Store good Tile drawer summary states per LVPS as reference.
TileDCSStatus m_status[NUMBER_OF_ROSES][NUMBER_OF_DRAWERS][NUMBER_OF_CHANNELS]
bool isStatusBad(unsigned int ros, unsigned int drawer) const
Return true if given Tile drawer considered as bad by summary drawer states per LVPS otherwise return...
int getDrawerStates(unsigned int ros, unsigned int drawer) const
Return Tile drawer summary states per LVPS reported by DCS.
void checkDrawer(const std::string &description, unsigned int ros, unsigned int drawer) const
float m_hvSet[NUMBER_OF_ROSES][NUMBER_OF_DRAWERS][NUMBER_OF_HVSET_CHANNELS]
std::string description
glabal timer - how long have I taken so far?
Definition hcg.cxx:91