ATLAS Offline Software
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 
24 class TileDCSState {
25 
26  public:
27 
36 
37  TileDCSState();
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 
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 
193  enum TileLimits {
198  NUMBER_OF_DRAWERS = 64
199  };
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 
218 #include "AthenaKernel/CLASS_DEF.h"
219 #include "AthenaKernel/CondCont.h"
220 
221 CLASS_DEF(TileDCSState, 125804125, 0)
223 
224 // inlines
225 
226 inline
227 float 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 
234 inline
235 void 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 
242 inline
243 float 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 
250 inline
251 void 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 
258 inline
259 int 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 
266 inline
267 void 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 
274 inline
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 
284 inline
285 void TileDCSState::setDCSHVStatus(unsigned int ros, unsigned int drawer, unsigned int channel,
287 
288  checkChannel("TileDCSState::setDCSHVStatus()", ros, drawer, channel, NUMBER_OF_CHANNELS);
289 
291 }
292 
293 inline
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 
303 inline
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 
314 inline
315 bool TileDCSState::isStatusHVBad(unsigned int ros, unsigned int drawer, unsigned int channel) const {
317 }
318 
319 inline
320 bool TileDCSState::isStatusBad (unsigned int ros, unsigned int drawer) const {
321  return getDCSStatus(ros, drawer) > WARNING;
322 }
323 
324 inline
325 bool 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 
332 inline
333 void TileDCSState::setGoodDrawer(int goodDrawer) { m_goodDrawer = goodDrawer;}
334 
335 inline
336 void TileDCSState::setWarningDrawer(const std::vector<int>& warningDrawer) {
337  m_warningDrawer = warningDrawer;
338 }
339 
340 inline
341 void TileDCSState::checkDrawer(const std::string& description,
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 
355 inline
356 void TileDCSState::checkChannel(const std::string& description,
357  unsigned int ros, unsigned int drawer,
358  unsigned int channel, unsigned int maxChannel) const {
359 
361 
362  if (channel >= maxChannel) {
363  throw TileCalib::IndexOutOfRange(description, channel, maxChannel);
364  }
365 
366 }
367 
368 #endif // TILECONDITIONS_TILEDCSSTATE_H
TileDCSState::getChannelHVSet
float getChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel) const
Return requested HV reported by DCS for given Tile channel.
Definition: TileDCSState.h:243
TileDCSState::checkDrawer
void checkDrawer(const std::string &description, unsigned int ros, unsigned int drawer) const
Definition: TileDCSState.h:341
TileCalib::IndexOutOfRange
Thrown if an index is out of range.
Definition: TileCalorimeter/TileCalib/TileCalibBlobObjs/TileCalibBlobObjs/Exception.h:141
CondCont.h
Hold mappings of ranges to condition objects.
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
TileDCSState::WARNING_DRAWER
@ WARNING_DRAWER
Definition: TileDCSState.h:34
TileDCSState::getChannelHV
float getChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel) const
Return measured HV reported by DCS for given Tile channel.
Definition: TileDCSState.h:227
TileDCSState::setDCSHVStatus
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.
Definition: TileDCSState.h:285
TileDCSState::m_hvSet
float m_hvSet[NUMBER_OF_ROSES][NUMBER_OF_DRAWERS][NUMBER_OF_HVSET_CHANNELS]
Definition: TileDCSState.h:207
TileDCSState::setChannelHV
void setChannelHV(unsigned int ros, unsigned int drawer, unsigned int channel, float hv)
Store measured HV reported by DCS for given Tile channel.
Definition: TileDCSState.h:235
TileDCSState::NON_EXISTING
@ NON_EXISTING
Definition: TileDCSState.h:32
TileDCSState::getDCSHVStatus
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...
Definition: TileDCSState.h:275
TileDCSState::TileDCSState
TileDCSState()
Definition: TileDCSState.cxx:12
TileDCSState::m_hv
float m_hv[NUMBER_OF_ROSES][NUMBER_OF_DRAWERS][NUMBER_OF_HV_CHANNELS]
Definition: TileDCSState.h:206
TileDCSState::isStatusBad
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...
Definition: TileDCSState.h:320
TileDCSState::TileLimits
TileLimits
Definition: TileDCSState.h:193
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
TileDCSState::m_status
TileDCSStatus m_status[NUMBER_OF_ROSES][NUMBER_OF_DRAWERS][NUMBER_OF_CHANNELS]
Definition: TileDCSState.h:208
TileDCSState::ALERT_KNOWNBADPMT
@ ALERT_KNOWNBADPMT
Definition: TileDCSState.h:35
TileDCSState::m_unknownValue
int m_unknownValue
Definition: TileDCSState.h:213
TileDCSState::setDrawerStates
void setDrawerStates(unsigned int ros, unsigned int drawer, int states)
Store Tile drawer summary states per LVPS reported by DCS.
Definition: TileDCSState.h:267
TileDCSState::OK
@ OK
Definition: TileDCSState.h:33
TileDCSState::TileDCSStatus
TileDCSStatus
Describes Tile DCS status.
Definition: TileDCSState.h:32
TileDCSState::isStatusHVBad
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...
Definition: TileDCSState.h:315
CONDCONT_MIXED_DEF
CONDCONT_MIXED_DEF(TileDCSState, 38603143)
TileDCSState::NUMBER_OF_HVSET_CHANNELS
@ NUMBER_OF_HVSET_CHANNELS
Number of Tile "channels" in DCS HVSET folder.
Definition: TileDCSState.h:197
TileDCSState::setChannelHVSet
void setChannelHVSet(unsigned int ros, unsigned int drawer, unsigned int channel, float hvSet)
Store requested HV reported by DCS for given Tile channel.
Definition: TileDCSState.h:251
TileDCSState::setGoodDrawer
void setGoodDrawer(int goodDrawer)
Store good Tile drawer summary states per LVPS as reference.
Definition: TileDCSState.h:333
TileDCSState::setWarningDrawer
void setWarningDrawer(const std::vector< int > &warningDrawer)
Store vector of warning Tile drawer summary states per LVPS as reference.
Definition: TileDCSState.h:336
urldecode::states
states
Definition: urldecode.h:39
TileDCSState::OK_DRAWER
@ OK_DRAWER
Definition: TileDCSState.h:33
TileDCSState::NUMBER_OF_DRAWERS
@ NUMBER_OF_DRAWERS
Number of Tile drawers in one ROS.
Definition: TileDCSState.h:198
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
TileDCSState::setDCSStatus
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...
Definition: TileDCSState.h:304
TileDCSState::WARNING_KNOWNBADPMT
@ WARNING_KNOWNBADPMT
Definition: TileDCSState.h:34
TileDCSState::m_hvStatus
TileDCSStatus m_hvStatus[NUMBER_OF_ROSES][NUMBER_OF_DRAWERS][NUMBER_OF_CHANNELS]
Definition: TileDCSState.h:209
TileDCSState::ALERT_DRAWER
@ ALERT_DRAWER
Definition: TileDCSState.h:35
TileDCSState::~TileDCSState
virtual ~TileDCSState()
Definition: TileDCSState.h:38
TileDCSState::getDrawerStates
int getDrawerStates(unsigned int ros, unsigned int drawer) const
Return Tile drawer summary states per LVPS reported by DCS.
Definition: TileDCSState.h:259
TileDCSState::NUMBER_OF_HV_CHANNELS
@ NUMBER_OF_HV_CHANNELS
Number of Tile "channels" in DCS HV folder.
Definition: TileDCSState.h:196
TileDCSState::NUMBER_OF_CHANNELS
@ NUMBER_OF_CHANNELS
Number of Tile channels.
Definition: TileDCSState.h:195
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
TileDCSState::WARNING
@ WARNING
Definition: TileDCSState.h:34
Exception.h
TileDCSState
Condition object to keep Tile DCS status from DB.
Definition: TileDCSState.h:24
TileDCSState::OK_KNOWNBADPMT
@ OK_KNOWNBADPMT
Definition: TileDCSState.h:33
TileDCSState::UNKNOWN
@ UNKNOWN
Definition: TileDCSState.h:32
merge.status
status
Definition: merge.py:17
TileDCSState::m_goodDrawer
int m_goodDrawer
Definition: TileDCSState.h:211
TileDCSState::ALERT
@ ALERT
Definition: TileDCSState.h:35
CLASS_DEF.h
macros to associate a CLID to a type
TileDCSState::NUMBER_OF_ROSES
@ NUMBER_OF_ROSES
Number of Tile ROSes.
Definition: TileDCSState.h:194
TileDCSState::checkChannel
void checkChannel(const std::string &description, unsigned int ros, unsigned int drawer, unsigned int channel, unsigned int maxChannel) const
Definition: TileDCSState.h:356
description
std::string description
glabal timer - how long have I taken so far?
Definition: hcg.cxx:88
TileDCSState::m_warningDrawer
std::vector< int > m_warningDrawer
Definition: TileDCSState.h:212
TileDCSState::getDCSStatus
TileDCSStatus getDCSStatus(unsigned int ros, unsigned int drawer) const
Return TileDCSstatus for given Tile drawer determined by summary states per LVPS.
Definition: TileDCSState.cxx:27
TileDCSState::m_states
int m_states[NUMBER_OF_ROSES][NUMBER_OF_DRAWERS]
Definition: TileDCSState.h:205