ATLAS Offline Software
TileDCSCondAlg.cxx
Go to the documentation of this file.
1 //Dear emacs, this is -*- c++ -*-
2 /*
3  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
4 */
5 
6 // Tile includes
7 #include "TileDCSCondAlg.h"
10 
11 // Athena includes
16 
17 #include "CoralBase/Attribute.h"
18 
19 #include <cmath>
20 #include <fstream>
21 
22 TileDCSCondAlg::TileDCSCondAlg(const std::string& name, ISvcLocator* pSvcLocator) :
23  AthReentrantAlgorithm(name, pSvcLocator),
24  m_cabling(nullptr)
25 {
26 
27 }
28 
29 
31 
32  ATH_MSG_DEBUG( "In initialize()" );
33 
35 
38 
40 
41 
42  ATH_MSG_INFO( "Will read the following folders: "
43  << ((m_readHV) ? m_hvKey.key() : "") << " "
44  << ((m_readHVSet) ? m_hvSetKey.key() : "") << " "
45  << ((m_readStates) ? m_statesKey.key() : ""));
46 
47  //=== get TileCablingSvc
48  ATH_CHECK( m_cablingSvc.retrieve() );
49 
50  //=== cache pointers to cabling helpers
51  m_cabling = m_cablingSvc->cablingService();
52 
53  if (!m_cabling) {
54  ATH_MSG_ERROR( "Pointer to TileCablingService is zero: " << m_cabling);
55  return StatusCode::FAILURE;
56  }
57 
58  std::map<TileModuleType, unsigned int> roses{{LONG_BARREL, 2}, {EXTENDED_BARREL, 3}};
59 
60  for (TileModuleType moduleType : {LONG_BARREL, EXTENDED_BARREL}) {
61 
62  unsigned int ros = roses[moduleType];
63  unsigned int channel = 0;
64 
67  m_isChannelUsed[moduleType][channel] = (pmt > 0); // positive pmt - means channel is connected
68 
69  if (moduleType == EXTENDED_BARREL) {
72  }
73 
74  pmt = std::abs(pmt);
75  m_channel2pmt[moduleType][channel] = pmt - 1;
76  m_pmt2channel[moduleType][pmt - 1] = channel; // note - pmt-1 is used as index
77  }
78 
79  for (; channel < 68; ++channel) {
80  m_channel2pmt[moduleType][channel] = channel;
81  m_pmt2channel[moduleType][channel] = channel;
82  }
83 
84  }
85 
86  // description of EBA15 and EBC18 channel 0-3 do not exist, channel 18,19 used
93  // description of EB with special C10 - channel 4 (pmt 5) is not used
95 
96  if (m_readHVSet) {
97  // read special deltas for few unstable PMTs
98  readBadHV("BadHVChannels.dat");
99  if (readConfig(m_dcsChHvSetInCool, "Drawer", m_rosDrawerHVSet)) return StatusCode::FAILURE;
100  }
101 
102  if (readConfig(m_dcsChStatesInCool, "_LVPS_", m_rosDrawerStates)) return StatusCode::FAILURE;
103  if (readConfig(m_dcsChHvInCool, "Drawer", m_rosDrawerHV)) return StatusCode::FAILURE;
104 
106 
107  return StatusCode::SUCCESS;
108 }
109 
110 
111 StatusCode TileDCSCondAlg::execute(const EventContext& ctx) const {
112 
114 
115  if (dcsState.isValid()) {
116  ATH_MSG_DEBUG("Found valid TileDCSState: " << dcsState.key());
117  return StatusCode::SUCCESS;
118  }
119 
120  std::unique_ptr<TileDCSState> dcsStateData = std::make_unique<TileDCSState>();
121  dcsStateData->setGoodDrawer(m_goodDrawer.value());
122  dcsStateData->setWarningDrawer(m_warningDrawer.value());
123 
124  if (m_readHV) {
125 
127  dcsState.addDependency(hv);
128  for (const CondAttrListCollection::ChanAttrListPair& chanAttrListPair : **hv) {
129 
130  const CondAttrListCollection::ChanNum coolChannel = chanAttrListPair.first;
131 
132  const std::pair<int, int> rosDrawerPair = m_rosDrawerHV.at(coolChannel);
133  unsigned int ros = rosDrawerPair.first;
134  unsigned int drawer = rosDrawerPair.second;
135 
136  ATH_MSG_VERBOSE( "ros: " << ros
137  << ", drawer: " << drawer
138  << ", COOL channel: " << coolChannel
139  << ", payload: " << chanAttrListPair.second);
140 
141  int moduleType = (ros > 2) ? EXTENDED_BARREL : LONG_BARREL;
142  int pmt0 = 0; // runs over paylod parameters
143  for (const coral::Attribute& attribute : chanAttrListPair.second) {
144  int channel = m_pmt2channel[moduleType][pmt0];
145  dcsStateData->setChannelHV(ros, drawer, channel, attribute.data<float>());
146  ATH_MSG_VERBOSE( "HV[" << pmt0 << "] = " << attribute.data<float>() );
147  ++pmt0;
148  }
149 
150  }
151  }
152 
153 
154  if (m_readHVSet) {
155 
157  dcsState.addDependency(hvSet);
158  for (const CondAttrListCollection::ChanAttrListPair& chanAttrListPair : **hvSet) {
159 
160  const CondAttrListCollection::ChanNum coolChannel = chanAttrListPair.first;
161 
162  const std::pair<int, int> rosDrawerPair = m_rosDrawerHVSet.at(coolChannel);
163  unsigned int ros = rosDrawerPair.first;
164  unsigned int drawer = rosDrawerPair.second;
165 
166  ATH_MSG_VERBOSE( "ros: " << ros
167  << ", drawer: " << drawer
168  << ", COOL channel: " << coolChannel
169  << ", payload: " << chanAttrListPair.second);
170 
171  int moduleType = (ros > 2) ? EXTENDED_BARREL : LONG_BARREL;
172  int pmt0 = 0; // runs over paylod parameters
173  for (const coral::Attribute& attribute : chanAttrListPair.second) {
174  int channel = m_pmt2channel[moduleType][pmt0];
175  dcsStateData->setChannelHVSet(ros, drawer, channel, attribute.data<float>());
176  ATH_MSG_VERBOSE( "HVSET[" << pmt0 << "] = " << attribute.data<float>() );
177  ++pmt0;
178  }
179 
180  }
181  } else {
182  ATH_CHECK( fillReferenceHV(*dcsStateData, dcsState, ctx) );
183 
184  }
185 
186 
187  if (m_readStates) {
188 
190  dcsState.addDependency(states);
191  for (const CondAttrListCollection::ChanAttrListPair& chanAttrListPair : **states) {
192 
193  CondAttrListCollection::ChanNum coolChannel = chanAttrListPair.first;
194 
195  std::pair<int, int> rosDrawerPair = m_rosDrawerStates.at(coolChannel);
196  unsigned int ros = rosDrawerPair.first;
197  unsigned int drawer = rosDrawerPair.second;
198 
199  ATH_MSG_VERBOSE( "ros: " << ros
200  << ", drawer: " << drawer
201  << ", COOL channel: " << coolChannel
202  << ", payload: " << chanAttrListPair.second);
203 
204  for (const coral::Attribute& attribute : chanAttrListPair.second) {
205  dcsStateData->setDrawerStates(ros, drawer, attribute.data<int>());
206  ATH_MSG_VERBOSE( "STATES = " << attribute.data<int>() );
207  }
208 
209  }
210  }
211 
212 
213  for (unsigned int ros = 1; ros < TileCalibUtils::MAX_ROS; ++ros) {
214  for (unsigned int drawer = 0; drawer < TileCalibUtils::MAX_DRAWER; ++drawer) {
215 
216  TileDCSState::TileDCSStatus drawerStatus = dcsStateData->getDCSStatus(ros, drawer);
217 
218  int moduleType = (ros > 2) ? EXTENDED_BARREL : LONG_BARREL;
219  int specialModuleType(moduleType);
220  if (moduleType == EXTENDED_BARREL) {
221  if ((ros == 3 && drawer == 14) || (ros == 4 && drawer == 17)) {
222  specialModuleType = EXTENDED_BARREL_NO_D4; // EBA15 EBC18
223  } else if (!m_cabling->C10_connected(drawer)) {
224  specialModuleType = EXTENDED_BARREL_SPECIAL_C10; // EB modules with special C10
225  }
226  }
227 
228  for (unsigned int channel = 0; channel < TileCalibUtils::MAX_CHAN; ++channel) {
229  if (m_isChannelUsed[specialModuleType][channel]) {
230 
232 
233  float hvSet(dcsStateData->getChannelHVSet(ros, drawer, channel));
234  float hv(dcsStateData->getChannelHV(ros, drawer, channel));
235 
236  // ignore zero "set" and negative "measured" HV, set status to unknown
237  if (hvSet >= 1.0 && hv >= 0.0 // HV can't be negative
238  && hvSet < 999.9 && hv < 999.9) { // HV can't be greater 930V
239 
240  std::map<int, std::pair<float, float>>::const_iterator itr =
242 
243  if (itr != m_knownBadHV.end()) { // known unstable PMTs
244 
245  float hvGap = (m_readHVSet) ? // take into account offset if HVSET is used
246  std::fabs(hvSet + itr->second.second - hv) : std::fabs(hvSet - hv);
247 
248  if (hvGap <= m_goodHVLimit) channelHVStatus = TileDCSState::OK_KNOWNBADPMT;
249  else if (hvGap <= m_warningHVLimit) channelHVStatus = TileDCSState::WARNING_KNOWNBADPMT;
250  else channelHVStatus = TileDCSState::ALERT_KNOWNBADPMT;
251  } else {
252  float hvGap = std::fabs(hvSet - hv);
253  if (hvGap <= m_goodHVLimit) channelHVStatus = TileDCSState::OK;
254  else if (hvGap <= m_warningHVLimit) channelHVStatus = TileDCSState::WARNING;
255  else channelHVStatus = TileDCSState::ALERT;
256  }
257 
258  }
259 
260  dcsStateData->setDCSHVStatus(ros, drawer, channel, channelHVStatus);
261 
262  if (drawerStatus > TileDCSState::OK && !m_readHVSet) {
263  dcsStateData->setDCSStatus(ros, drawer, channel, drawerStatus);
264  } else {
265  dcsStateData->setDCSStatus(ros, drawer, channel, std::max(drawerStatus, channelHVStatus));
266  }
267 
268  } else {
271  }
272  }
273 
274 
275  if (msgLvl(MSG::VERBOSE)) {
277  << " Status = " << drawerStatus << endmsg;
278 
279  std::string ignored = ((drawerStatus > TileDCSState::OK && !m_readHVSet) ? " ignored" : "");
280 
281  for (unsigned int channel = 0; channel < TileCalibUtils::MAX_CHAN; ++channel) {
282  int pmt0 = m_channel2pmt[moduleType][channel];
285  << " channel = " << channel
286  << " pmt = " << pmt0 + 1
287  << " HV = " << dcsStateData->getChannelHV(ros, drawer, channel)
288  << " HVSET = " << dcsStateData->getChannelHVSet(ros, drawer, channel)
289  << " Status = " << status
290  << ignored << endmsg;
291  }
292  }
293 
294  }
295  }
296 
297  // Define validity of the output cond object
298  if(dcsState.record(std::move(dcsStateData)).isFailure()) {
299 
300  ATH_MSG_ERROR("Could not record TileDCSState object with "
301  << dcsState.key()
302  << " with EventRange " << dcsState.getRange()
303  << " into Conditions Store");
304 
305  return StatusCode::FAILURE;
306  } else {
307 
308  ATH_MSG_VERBOSE("Recorded TileDCSState object with "
309  << dcsState.key()
310  << " with EventRange " << dcsState.getRange()
311  << " into Conditions Store");
312  }
313 
314  return StatusCode::SUCCESS;
315 
316 }
317 
318 
319 
320 //_____________________________________________________________________________
321 int TileDCSCondAlg::readConfig(const std::string& fileName,
322  const std::string& subStr,
323  std::vector<std::pair<int, int>>& rosDrawer) {
324 
325  std::string fullFileName = PathResolver::find_file(fileName, "DATAPATH");
326  std::ifstream file(fullFileName.c_str());
327  if (!file.is_open()) {
328  ATH_MSG_ERROR( "Can't find " << fileName);
329  return 2;
330  } else {
331  ATH_MSG_DEBUG( "Reading file " << fullFileName);
332  }
333 
334  rosDrawer.resize(257, std::make_pair<int, int>(0xFFFF, 0xFFFF));
335 
336  std::string compName[5] = { "XXX", "ATLTILLV01", "ATLTILLV02", "ATLTILLV00", "ATLTILLV03" };
337 
338  unsigned int ind, ros, module;
339  std::string s, line;
340  size_t pos;
341 
342  while (true) {
343 
344  file >> s >> ind >> line;
345 
346  if (file.eof() || file.fail()) break;
347 
348  for (ros = 1; ros < TileCalibUtils::MAX_ROS; ++ros) {
349  pos = line.find(compName[ros]);
350  if (pos != std::string::npos) break;
351  }
352 
353  if (ros == TileCalibUtils::MAX_ROS) {
354  msg(MSG::WARNING) << "File " << fileName << " Wrong computer name in " << line << endmsg;
355  continue;
356  }
357 
358  pos = line.find(subStr);
359  if (pos == std::string::npos) {
360  ATH_MSG_WARNING( "File " << fileName << " Word " << subStr << " not found in " << line);
361  continue;
362  }
363 
364  module = atoi(&line[pos + subStr.size()]);
365  if (module < 1 || module > TileCalibUtils::MAX_DRAWER) {
366  ATH_MSG_WARNING( "File " << fileName << " Wrong module number in " << line);
367  continue;
368  }
369 
370  ATH_MSG_VERBOSE("Module = " << TileCalibUtils::getDrawerString(ros, module - 1) << " ind = " << ind);
371 
372  if (rosDrawer.size() <= ind) {
373  rosDrawer.resize(ind + 1, std::make_pair<int, int> (0xFFFF, 0xFFFF));
374  }
375 
376  rosDrawer[ind] = std::make_pair<int, int>(ros, (module - 1));
377 
378  }
379 
380  file.close();
381 
382  return 0;
383 }
384 
385 //_____________________________________________________________________________
386 int TileDCSCondAlg::readBadHV(const std::string& fileName) {
387 
388  std::string fullFileName = PathResolver::find_file(fileName, "DATAPATH");
389  std::ifstream file(fullFileName.c_str());
390  if (!file.is_open()) {
391  ATH_MSG_WARNING( "Can't find " << fileName);
392  return 1;
393  } else {
394  ATH_MSG_DEBUG("Reading file " << fullFileName);
395  }
396 
397  std::string partName[5] = { "AUX", "LBA", "LBC", "EBA", "EBC" };
398 
399  unsigned int ros, module, pmt;
400  float delta, offset;
401  char ll[256];
402  std::string line;
403  size_t pos = 0;
404 
405  while (true) {
406 
407  file.getline(ll, sizeof(ll));
408 
409  if (file.eof() || file.fail()) break;
410 
411  line = std::string(ll);
412 
413  for (ros = 1; ros < TileCalibUtils::MAX_ROS; ++ros) {
414  pos = line.find(partName[ros]);
415  if (pos != std::string::npos) break;
416  }
417  if (ros == TileCalibUtils::MAX_ROS) {
418  ATH_MSG_WARNING( "File " << fileName << " Partition name not found in " << line);
419  continue;
420  }
421 
422  module = atoi(&line[pos + 3]);
423  if (module < 1 || module > TileCalibUtils::MAX_DRAWER) {
424  ATH_MSG_WARNING( "File " << fileName << " Wrong module number in " << line);
425  continue;
426  }
427 
428  pos = line.find("PMT number");
429  if (pos == std::string::npos) {
430  ATH_MSG_WARNING( "File " << fileName << " Word 'PMT number' not found in " << line);
431  continue;
432  }
433 
434  pmt = atoi(&line[pos + 10]);
435  if (pmt < 1 || pmt > TileCalibUtils::MAX_CHAN) {
436  ATH_MSG_WARNING( "File " << fileName << " Wrong pmt number in " << line);
437  continue;
438  }
439 
440  pos = line.find("Step Value is");
441  if (pos == std::string::npos) {
442  ATH_MSG_WARNING( "File " << fileName << " Word 'Step Value is' not found in " << line);
443  continue;
444  }
445 
446  delta = atof(&line[pos + 13]);
447  if (delta <= 0.0 || delta > 1000.0) {
448  ATH_MSG_WARNING( "File " << fileName << " Wrong delta number in " << line);
449  continue;
450  }
451 
452  pos = line.find("Offset is:");
453  if (pos == std::string::npos) {
454  ATH_MSG_WARNING( "File " << fileName << " Word 'Offset is:' not found in " << line);
455  continue;
456  }
457 
458  offset = atof(&line[pos + 10]);
459  if (offset < -1000.0 || offset > 1000.0) {
460  ATH_MSG_WARNING( "File " << fileName << " Wrong offset number in " << line);
461  continue;
462  }
463 
465  << " pmt = " << pmt
466  << " delta = " << delta
467  << " offset = " << offset);
468 
469  int moduleType = (ros > 2) ? EXTENDED_BARREL : LONG_BARREL;
470  int channel = m_pmt2channel[moduleType][pmt - 1];
471  m_knownBadHV[getChannelKey(ros, module - 1, channel)] = std::make_pair(delta, offset);
472 
473  }
474 
475  file.close();
476 
477  return 0;
478 }
479 
482  const EventContext& ctx) const {
483 
485  wh.addDependency(emScale);
486 
487  float laserReferenceHV = -5.;
488  float cesReferenceHV = -5.;
489 
490  for (unsigned int ros = 1; ros < TileCalibUtils::MAX_ROS; ++ros) {
491  int moduleType = (ros > 2) ? EXTENDED_BARREL : LONG_BARREL;
492 
493  for (unsigned int drawer = 0; drawer < TileCalibUtils::MAX_DRAWER; ++drawer) {
494  unsigned int drawerIdx = TileCalibUtils::getDrawerIdx(ros, drawer);
495 
496  for (unsigned int channel = 0; channel < TileCalibUtils::MAX_CHAN; ++channel) {
497  int pmt0 = m_channel2pmt[moduleType][channel];
498 
499  cesReferenceHV = emScale->getCesiumReferenceHV(drawerIdx, channel);
500  laserReferenceHV = emScale->getLaserReferenceHV(drawerIdx, channel);
501 
502  if (laserReferenceHV >= 0.) {
503  dcsState.setChannelHVSet(ros, drawer, channel, laserReferenceHV);
504  } else {
505  dcsState.setChannelHVSet(ros, drawer, channel, cesReferenceHV);
506  }
507 
508  if (msgLvl(MSG::VERBOSE)) {
510  << " channel = " << channel
511  << " pmt = " << pmt0 + 1
512  << " HVref = " << dcsState.getChannelHVSet(ros, drawer, channel);
513 
514  if (laserReferenceHV >= 0.) {
515  msg(MSG::VERBOSE) << " Taken from Laser run (replace "
516  << cesReferenceHV << " cesium value)" << endmsg;
517  } else {
518  msg(MSG::VERBOSE) << endmsg;
519  }
520  }
521  }
522  }
523  }
524 
525  return StatusCode::SUCCESS;
526 }
527 
528 
530  return StatusCode::SUCCESS;
531 }
TileDCSCondAlg::m_dcsChHvSetInCool
Gaudi::Property< std::string > m_dcsChHvSetInCool
File name with mapping Tile DCS HVSET DB COOL channels to ROS and drawer.
Definition: TileDCSCondAlg.h:180
TileDCSCondAlg::EXTENDED_BARREL_SPECIAL_C10
@ EXTENDED_BARREL_SPECIAL_C10
Definition: TileDCSCondAlg.h:48
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
TileDCSCondAlg::m_rosDrawerStates
std::vector< std::pair< int, int > > m_rosDrawerStates
Definition: TileDCSCondAlg.h:201
AddEmptyComponent.compName
compName
Definition: AddEmptyComponent.py:32
checkFileSG.line
line
Definition: checkFileSG.py:75
TileDCSCondAlg::m_channel2pmt
int m_channel2pmt[2][NUMBER_OF_HVSET_CHANNELS]
Definition: TileDCSCondAlg.h:205
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
TileDCSCondAlg.h
TileDCSCondAlg::m_rosDrawerHV
std::vector< std::pair< int, int > > m_rosDrawerHV
Definition: TileDCSCondAlg.h:199
max
#define max(a, b)
Definition: cfImp.cxx:41
plotting.yearwise_efficiency.channel
channel
Definition: yearwise_efficiency.py:28
TileDCSCondAlg::TileModuleType
TileModuleType
Definition: TileDCSCondAlg.h:45
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
PathResolver::find_file
static std::string find_file(const std::string &logical_file_name, const std::string &search_path, SearchType search_type=LocalSearch)
Definition: PathResolver.cxx:251
TileDCSCondAlg::finalize
virtual StatusCode finalize() override
Definition: TileDCSCondAlg.cxx:529
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
ReadBchFromCool.pmt
pmt
Definition: ReadBchFromCool.py:62
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
TileDCSCondAlg::EXTENDED_BARREL_NO_D4
@ EXTENDED_BARREL_NO_D4
Definition: TileDCSCondAlg.h:47
TileDCSCondAlg::m_warningDrawer
Gaudi::Property< std::vector< int > > m_warningDrawer
Status is WARNING if Tile DCS drawer states is like this.
Definition: TileDCSCondAlg.h:161
AthCommonMsg< Gaudi::Algorithm >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
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
TileCalibUtils.h
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
CondAttrListCollection::ChanAttrListPair
ChanAttrListMap::value_type ChanAttrListPair
Definition: CondAttrListCollection.h:58
TileDCSCondAlg::readBadHV
int readBadHV(const std::string &fileName)
Read special deltas for few unstable PMTs.
Definition: TileDCSCondAlg.cxx:386
TileDCSCondAlg::m_dcsChHvInCool
Gaudi::Property< std::string > m_dcsChHvInCool
File name with mapping Tile DCS HV DB COOL channels to ROS and drawer.
Definition: TileDCSCondAlg.h:173
TileDCSCondAlg::m_goodHVLimit
Gaudi::Property< float > m_goodHVLimit
Tile DCS Status is OK if difference between measured and requested HV is below this limit.
Definition: TileDCSCondAlg.h:142
AthenaAttributeList.h
Example_ReadSampleNoise.drawer
drawer
Definition: Example_ReadSampleNoise.py:39
ReadCondHandle.h
TileDCSCondAlg::m_cabling
const TileCablingService * m_cabling
Definition: TileDCSCondAlg.h:197
TileDCSState::ALERT_KNOWNBADPMT
@ ALERT_KNOWNBADPMT
Definition: TileDCSState.h:35
TileCalibUtils::MAX_DRAWER
static const unsigned int MAX_DRAWER
Number of drawers in ROS 1-4.
Definition: TileCalibUtils.h:139
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
python.PyAthena.module
module
Definition: PyAthena.py:134
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
TileDCSCondAlg::m_pmt2channel
int m_pmt2channel[2][NUMBER_OF_HVSET_CHANNELS]
Definition: TileDCSCondAlg.h:206
TileDCSState::OK
@ OK
Definition: TileDCSState.h:33
TileDCSState::TileDCSStatus
TileDCSStatus
Describes Tile DCS status.
Definition: TileDCSState.h:32
FortranAlgorithmOptions.fileName
fileName
Definition: FortranAlgorithmOptions.py:13
TileDCSCondAlg::fillReferenceHV
StatusCode fillReferenceHV(TileDCSState &dcsState, SG::WriteCondHandle< TileDCSState > &wh, const EventContext &ctx) const
Store reference HV from Tile CES or Laser DB folder in TileDCSState.
Definition: TileDCSCondAlg.cxx:480
TileEMScale::getLaserReferenceHV
float getLaserReferenceHV(unsigned int drawerIdx, unsigned int channel) const
Returns the reference PMT HV from appropriate laser calibration.
Definition: TileEMScale.cxx:394
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TileDCSCondAlg::readConfig
int readConfig(const std::string &fileName, const std::string &subStr, std::vector< std::pair< int, int >> &rosDrawer)
Read mapping of DB COOL channels into Tile ROS and drawer pairs.
Definition: TileDCSCondAlg.cxx:321
TileDCSCondAlg::m_hvSetKey
SG::ReadCondHandleKey< CondAttrListCollection > m_hvSetKey
The Tile DCS HVSET COOL folder name.
Definition: TileDCSCondAlg.h:99
TileCablingService.h
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
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
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
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
urldecode::states
states
Definition: urldecode.h:39
TileDCSCondAlg::m_readHV
Gaudi::Property< bool > m_readHV
Flag to control reading Tile DCS HV folder from DB.
Definition: TileDCSCondAlg.h:123
WriteCondHandle.h
TileDCSCondAlg::m_statesKey
SG::ReadCondHandleKey< CondAttrListCollection > m_statesKey
The Tile DCS STATES COOL folder name.
Definition: TileDCSCondAlg.h:105
TileDCSCondAlg::EXTENDED_BARREL
@ EXTENDED_BARREL
Definition: TileDCSCondAlg.h:46
python.comparexAODDigest.ignored
ignored
Definition: comparexAODDigest.py:145
TileDCSCondAlg::m_hvKey
SG::ReadCondHandleKey< CondAttrListCollection > m_hvKey
The Tile DCS HV COOL folder name.
Definition: TileDCSCondAlg.h:93
file
TFile * file
Definition: tile_monitor.h:29
TileDCSCondAlg::m_warningHVLimit
Gaudi::Property< float > m_warningHVLimit
Mask channels with difference between measured and requested HV above this limit.
Definition: TileDCSCondAlg.h:149
parseDir.wh
wh
Definition: parseDir.py:46
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TileDCSCondAlg::m_isChannelUsed
bool m_isChannelUsed[4][NUMBER_OF_CHANNELS]
Definition: TileDCSCondAlg.h:207
TileCalibUtils::MAX_ROS
static const unsigned int MAX_ROS
Number of ROSs
Definition: TileCalibUtils.h:138
maskDeadModules.ros
ros
Definition: maskDeadModules.py:35
CondAttrListCollection::ChanNum
unsigned int ChanNum
Definition: CondAttrListCollection.h:55
TileDCSCondAlg::initialize
virtual StatusCode initialize() override
Definition: TileDCSCondAlg.cxx:30
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
CxxUtils::atof
double atof(std::string_view str)
Converts a string into a double / float.
Definition: Control/CxxUtils/Root/StringUtils.cxx:91
TileDCSCondAlg::m_dcsChStatesInCool
Gaudi::Property< std::string > m_dcsChStatesInCool
File name with mapping Tile DCS STATES DB COOL channels to ROS and drawer.
Definition: TileDCSCondAlg.h:187
PathResolver.h
TileDCSState::WARNING_KNOWNBADPMT
@ WARNING_KNOWNBADPMT
Definition: TileDCSState.h:34
TileDCSCondAlg::m_rosDrawerHVSet
std::vector< std::pair< int, int > > m_rosDrawerHVSet
Definition: TileDCSCondAlg.h:200
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
TileCalibUtils::getDrawerString
static std::string getDrawerString(unsigned int ros, unsigned int drawer)
Return the drawer name, e.g.
Definition: TileCalibUtils.cxx:145
TileCablingService::C10_connected
static bool C10_connected(int module)
Definition: TileCablingService.cxx:1779
TileDCSCondAlg::LONG_BARREL
@ LONG_BARREL
Definition: TileDCSCondAlg.h:45
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
TileDCSCondAlg::m_cablingSvc
ServiceHandle< TileCablingSvc > m_cablingSvc
Name of Tile cabling service.
Definition: TileDCSCondAlg.h:194
TileCablingService::channel2hole
static int channel2hole(int ros, int channel)
Definition: TileCablingService.cxx:1946
AthCommonMsg< Gaudi::Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
TileDCSState::WARNING
@ WARNING
Definition: TileDCSState.h:34
TileDCSState
Condition object to keep Tile DCS status from DB.
Definition: TileDCSState.h:24
CxxUtils::atoi
int atoi(std::string_view str)
Helper functions to unpack numbers decoded in string into integers and doubles The strings are requir...
Definition: Control/CxxUtils/Root/StringUtils.cxx:85
TileDCSState::OK_KNOWNBADPMT
@ OK_KNOWNBADPMT
Definition: TileDCSState.h:33
TileDCSCondAlg::m_knownBadHV
std::map< int, std::pair< float, float > > m_knownBadHV
Definition: TileDCSCondAlg.h:203
TileDCSCondAlg::m_dcsStateKey
SG::WriteCondHandleKey< TileDCSState > m_dcsStateKey
The name of TileDCSState object to produce and put into condition store.
Definition: TileDCSCondAlg.h:111
TileDCSState::UNKNOWN
@ UNKNOWN
Definition: TileDCSState.h:32
merge.status
status
Definition: merge.py:17
TileCalibUtils::getDrawerIdx
static unsigned int getDrawerIdx(unsigned int ros, unsigned int drawer)
Returns a drawer hash.
Definition: TileCalibUtils.cxx:60
TileDCSCondAlg::getChannelKey
unsigned int getChannelKey(unsigned int ros, unsigned int drawer, unsigned int channel) const
@ brief Return Tile channel key used as index in internal caches @ ros Tile ROS in range [1....
Definition: TileDCSCondAlg.h:214
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
TileCalibUtils::MAX_CHAN
static const unsigned int MAX_CHAN
Number of channels in drawer.
Definition: TileCalibUtils.h:141
TileDCSCondAlg::m_goodDrawer
Gaudi::Property< int > m_goodDrawer
Status is OK if Tile DCS drawer states is like this.
Definition: TileDCSCondAlg.h:155
TileDCSCondAlg::m_emScaleKey
SG::ReadCondHandleKey< TileEMScale > m_emScaleKey
The name of TileEMScale object to get reference HV from Cesium or Laser folder.
Definition: TileDCSCondAlg.h:117
TileDCSState::ALERT
@ ALERT
Definition: TileDCSState.h:35
TileEMScale::getCesiumReferenceHV
float getCesiumReferenceHV(unsigned int drawerIdx, unsigned int channel) const
Return the reference PMT HV set in last cesium calibration.
Definition: TileEMScale.cxx:365
TileDCSCondAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: TileDCSCondAlg.cxx:111
TileDCSCondAlg::TileDCSCondAlg
TileDCSCondAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TileDCSCondAlg.cxx:22
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
checkFileSG.ind
list ind
Definition: checkFileSG.py:118
TileDCSCondAlg::m_readStates
Gaudi::Property< bool > m_readStates
Flag to control reading Tile DCS STATES folder from DB.
Definition: TileDCSCondAlg.h:135
DiTauMassTools::TauTypes::ll
@ ll
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:49
TileDCSCondAlg::m_readHVSet
Gaudi::Property< bool > m_readHVSet
Flag to control reading Tile DCS HVSET folder from DB.
Definition: TileDCSCondAlg.h:129
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