ATLAS Offline Software
NswDcsDbAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
9 #include <string>
10 #include <regex>
11 #include "nlohmann/json.hpp"
13 
14 // Initialize
17 
18  // retrievals
19  ATH_MSG_DEBUG( "initializing " << name() );
21  ATH_CHECK(m_idHelperSvc.retrieve());
22 
23  // initialize read keys
30 
31  // write key for time/charge data
33 
35 
36  ATH_MSG_INFO("NswDcsAlg is using tdaq "<< m_loadTdaq << " and eltx " << m_loadEltx);
37 
38  return StatusCode::SUCCESS;
39 }
40 
41 // execute
43 NswDcsDbAlg::execute(const EventContext& ctx) const {
44 
45  ATH_MSG_DEBUG( "execute " << name() );
46 
47  // set up write handles
49  if (wrHdl.isValid()) {
50  ATH_MSG_DEBUG("CondHandle " << wrHdl.fullKey() << " is already valid."
51  << " In theory this should not be called, but may happen"
52  << " if multiple concurrent events are being processed out of order.");
53  return StatusCode::SUCCESS;
54  }
55  wrHdl.addDependency(EventIDRange(IOVInfiniteRange::infiniteMixed()));
56  ATH_MSG_DEBUG("Range of time/charge output is " << wrHdl.getRange());
57  std::unique_ptr<NswDcsDbData> wrCdo{std::make_unique<NswDcsDbData>(m_idHelperSvc->mmIdHelper(), m_idHelperSvc->stgcIdHelper(), m_muDetMgrFromDetStore)};
58 
59  // load HV data
60  ATH_CHECK(loadHvData(ctx, m_readKey_mmg_hv, DcsTechType::MMG, wrHdl, wrCdo.get()));
61  ATH_CHECK(loadHvData(ctx, m_readKey_mmg_hv, DcsTechType::MMD, wrHdl, wrCdo.get()));
62  ATH_CHECK(loadHvData(ctx, m_readKey_stg_hv, DcsTechType::STG, wrHdl, wrCdo.get()));
63 
64  // load TDAQ data
65  if(m_loadTdaq){
66  ATH_CHECK(loadTDaqData(ctx, m_readKey_mmg_tdaq, DcsTechType::MMG, wrHdl, wrCdo.get()));
67  ATH_CHECK(loadTDaqData(ctx, m_readKey_stg_tdaq, DcsTechType::STG, wrHdl, wrCdo.get()));
68  }
69  if(m_loadEltx){
70  ATH_CHECK(loadELTXData(ctx, m_readKey_mmg_eltx, DcsTechType::MMG, wrHdl, wrCdo.get()));
71  ATH_CHECK(loadELTXData(ctx, m_readKey_stg_eltx, DcsTechType::STG, wrHdl, wrCdo.get()));
72  }
73 
74  // insert/write data
75  if (wrHdl.record(std::move(wrCdo)).isFailure()) {
76  ATH_MSG_FATAL("Could not record " << wrHdl.key()
77  << " with EventRange " << wrHdl.getRange()
78  << " into Conditions Store");
79  return StatusCode::FAILURE;
80  }
81  ATH_MSG_DEBUG("Recorded new " << wrHdl.key() << " with range " << wrHdl.getRange() << " into Conditions Store");
82 
83  return StatusCode::SUCCESS;
84 
85 }
86 
87 // loadHvData
89 NswDcsDbAlg::loadHvData(const EventContext& ctx, const readKey_t& readKey, const DcsTechType tech, writeHandleDcs_t& writeHandle, NswDcsDbData* writeCdo) const {
90 
91  // set up read handle
92  SG::ReadCondHandle<CondAttrListCollection> readHandle{readKey, ctx};
93  const CondAttrListCollection* readCdo{*readHandle};
94  if(!readCdo){
95  ATH_MSG_ERROR("Null pointer to the read conditions object");
96  return StatusCode::FAILURE;
97  }
98  writeHandle.addDependency(readHandle);
99  ATH_MSG_DEBUG("Size of CondAttrListCollection " << readHandle.fullKey() << " readCdo->size()= " << readCdo->size());
100  ATH_MSG_DEBUG("Range of input is " << readHandle.getRange() << ", range of output is " << writeHandle.getRange());
101 
102  // iterate through data
104  unsigned int nChns = 0;
105  for(itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
106 
107  // channel ID and name
108  const unsigned int chanNum = itr->first;
109  const std::string& chanName = readCdo->chanName(chanNum);
110  if(chanName.empty()){
111  ATH_MSG_DEBUG("Channel number "<< chanNum <<"has empty name");
112  continue;
113  }
115  bool isOK = false;
116  bool found = buildChannelIdForHv(channelId, tech, chanName, isOK);
117  if(!found){
118  if(!isOK){
119  ATH_MSG_ERROR("Could not identify valid channelId for channel "<<chanNum<<" with name "<< chanName<<"!");
120  throw std::runtime_error("NswDcsDbAlg: Could not identify valid channelId for HV channel");
121  }
122  continue;
123  }
124 
125  // payload
126  const coral::AttributeList& atr = itr->second;
127 
128  NswDcsDbData::DcsConstants dcs_data{};
129  dcs_data.standbyVolt = *(static_cast<const float*>((atr["v0Set"]).addressOfData()));
130  dcs_data.readyVolt = *(static_cast<const float*>((atr["v1Set"]).addressOfData()));
131  dcs_data.fsmState = MuonCond::getFsmStateEnum(*(static_cast<const std::string*>((atr["fsmCurrentState"]).addressOfData())));
132  ATH_MSG_DEBUG("channel " << chanName << " has fsm state " << *(static_cast<const std::string*>((atr["fsmCurrentState"]).addressOfData()))<< " has v0 state " << *(static_cast<const float*>( (atr["v0Set"]).addressOfData()))<< " has v1 " << *(static_cast<const float*>((atr["v1Set"]).addressOfData())));
133 
134  writeCdo->setDataHv(tech, channelId, dcs_data);
135  ++nChns;
136  }
137  ATH_MSG_VERBOSE("Retrieved data for "<<nChns<<" channels.");
138 
139  return StatusCode::SUCCESS;
140 }
141 
142 
143 // loadTDaqData
144 StatusCode
145 NswDcsDbAlg::loadTDaqData(const EventContext& ctx, const readKey_t& readKey, const DcsTechType tech, writeHandleDcs_t& writeHandle, NswDcsDbData* writeCdo) const {
146  // set up read handle
147  SG::ReadCondHandle<CondAttrListCollection> readHandle{readKey, ctx};
148  const CondAttrListCollection* readCdo{*readHandle};
149  if(!readCdo){
150  ATH_MSG_ERROR("Null pointer to the read conditions object");
151  return StatusCode::FAILURE;
152  }
153  writeHandle.addDependency(readHandle);
154  ATH_MSG_DEBUG("Size of CondAttrListCollection " << readHandle.fullKey() << " readCdo->size()= " << readCdo->size());
155  ATH_MSG_DEBUG("Range of input is " << readHandle.getRange() << ", range of output is " << writeHandle.getRange());
156 
157  // iterate through data
159  for(itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
160 
161  // retrieve data
162  const coral::AttributeList& atr = itr->second;
163  std::string data = *(static_cast<const std::string *>((atr["data_array"]).addressOfData()));
164 
165  // unwrap the json and process the data
167  unsigned int nLB = 0;
168 
169  // loop over lumi blocks and channels
170  for (auto &yy : jx["holes"].items()) {
171  nlohmann::json jt = yy.value();
172 
173  // channel ID and name
175  bool isOK = false;
176  uint elink{0};
177  bool found = buildChannelIdForTDaq(channelId, elink, tech, jt["channelName"], isOK);
178  if(!found){
179  if(!isOK)
180  ATH_MSG_DEBUG("Could not identify valid channelId for channel "<<jt["channelId"]<<" with name "<< jt["channelName"]<<"! Skipping...");
181  continue;
182  }
183  // write data
184  int channelDead = jt["channelDead"];
185  writeCdo->setDataTDaq(tech, channelId, jt["hole_iovSince"], jt["hole_iovUntil"], elink, channelDead );
186  ATH_MSG_VERBOSE(m_idHelperSvc->toString(channelId)<<" " << jt["channelName"] << " " << jt["hole_iovSince"]<<" " <<jt["hole_iovUntil"]<<" " << elink<<" "<<channelDead );
187  ++nLB;
188  }
189  ATH_MSG_VERBOSE("Retrieved data for "<<nLB<<" entries (combinations of lumi block and channel).");
190  }
191 
192  return StatusCode::SUCCESS;
193 }
194 
195 StatusCode NswDcsDbAlg::loadELTXData(const EventContext& ctx, const readKey_t& readKey, const DcsTechType tech, writeHandleDcs_t& writeHandle, NswDcsDbData* writeCdo) const {
196 
197  // set up read handle
198  SG::ReadCondHandle<CondAttrListCollection> readHandle{readKey, ctx};
199  const CondAttrListCollection* readCdo{*readHandle};
200  if(!readCdo){
201  ATH_MSG_ERROR("Null pointer to the read conditions object");
202  return StatusCode::FAILURE;
203  }
204  writeHandle.addDependency(readHandle);
205  ATH_MSG_DEBUG("Size of CondAttrListCollection " << readHandle.fullKey() << " readCdo->size()= " << readCdo->size());
206  ATH_MSG_DEBUG("Range of input is " << readHandle.getRange() << ", range of output is " << writeHandle.getRange());
207 
208  // This code is under development so lets mute unused variable warnings for now
209  (void) writeCdo;
210  (void) tech;
211 
212  // iterate through data
214  for(itr = readCdo->begin(); itr != readCdo->end(); ++itr) {
215 
216  // channel ID and name
217  const unsigned int chanNum = itr->first;
218  const std::string& chanName = readCdo->chanName(chanNum);
219  if(chanName.empty()){
220  ATH_MSG_DEBUG("Channel number "<< chanNum <<"has empty name");
221  continue;
222  }
223  const coral::AttributeList& atr = itr->second;
224  bool online = *(static_cast<const bool*>((atr["online"]).addressOfData()));
225  ATH_MSG_DEBUG("found SCA " << chanName << " with status " << atr["online"] << " " << online);
226  if(online) continue; // we only want to record things that are dead
228  bool isOk{false};
229  if(!buildChannelIdForEltx(channelId, tech, chanName, isOk)){
230  continue;
231  }
232  ATH_MSG_DEBUG(__FILE__<<":"<<__LINE__<<" "<<m_idHelperSvc->toString(channelId));
233  writeCdo->setDataEltx(tech, channelId);
234  }
235  return StatusCode::SUCCESS;
236 
237 }
238 
239 
240 // buildChannelIdForHv
241 bool
242 NswDcsDbAlg::buildChannelIdForHv(Identifier& channelId, const DcsTechType tech0, const std::string& chanName, bool& isOK) const {
243 
244  // prepare regex
245  std::regex reMMG("^([A-Za-z]{1})([0-9]{2})_ML([0-9])P([0-9])_(IP|HO)R([0-9])__HV");
246  std::regex reMMD("^([A-Za-z]{1})([0-9]{2})_DRIFT_(IP|HO)R([0-9])__HV");
247  std::regex reSTG("^([A-Za-z]{1})([0-9]{2})_ML([0-9])_(IP|HO)R([0-9])__HV");
248  std::regex re;
250 
251  // match regex
252  if(std::regex_match(chanName, reMMG)) {
253  re = reMMG;
254  tech = DcsTechType::MMG;
255  }
256  else if(std::regex_match(chanName, reMMD)) {
257  re = reMMD;
258  tech = DcsTechType::MMD;
259  }
260  else if(std::regex_match(chanName, reSTG)) {
261  re = reSTG;
262  tech = DcsTechType::STG;
263  }
264  else {
265  ATH_MSG_ERROR("Could not identify channel with name "<<chanName);
266  isOK = false;
267  return false;
268  }
269 
270  // sanity check
271  if(tech0!=tech) {
272  isOK = true; // need to distinguish error in parsing and simple difference between required technologies
273  return false;
274  }
275 
276  // build channel Id
277  bool isValid{false};
278  std::smatch m;
279  std::regex_match(chanName, m, re);
280 
281  // copy to vec of strings
282  std::vector<std::string> res;
283  for(unsigned int i=0; i<m.size(); ++i) res.push_back(m[i].str());
284 
285  // MMG Channel
286  if(tech==DcsTechType::MMG){
287  int wheel = res[1]=="A"? 1 : -1;
288  int sector = std::stoi(res[2]);
289  const std::string stationName = sector%2==0 ? "MMS" : "MML";
290  int stationEta = wheel*std::stoi(res[6]);
291  int stationPhi = (sector-1)/2+1;
292  int multiLayer = res[5]=="IP" ? 1 : 2;
293  int gasGap = std::stoi(res[3]);
294  int pcb = std::stoi(res[4]);
295  Identifier chnlId = m_idHelperSvc->mmIdHelper().pcbID(stationName, stationEta, stationPhi, multiLayer, gasGap, pcb, isValid);
296  if(!isValid){
297  ATH_MSG_DEBUG("Could not extract valid channelId for MMG channel "<<chanName);
298  ATH_MSG_DEBUG("Fields: "<< wheel << " "<<sector<<" " << stationName<< " " << stationEta<<" "<<stationPhi<<" "<<multiLayer);
299  isOK = false;
300  return false;
301  }
302  channelId = chnlId;
303  }
304 
305  // MMG Drift Channel
306  else if(tech==DcsTechType::MMD){
307  int wheel = res[1]=="A"? 1 : -1;
308  int sector = std::stoi(res[2]);
309  const std::string stationName = sector%2==0 ? "MMS" : "MML";
310  int stationEta = wheel*std::stoi(res[4]);
311  int stationPhi = (sector-1)/2+1;
312  int multiLayer = res[3]=="IP" ? 1 : 2;
313  Identifier modId = m_idHelperSvc->mmIdHelper().elementID(stationName, stationEta, stationPhi, isValid);
314  if(!isValid){
315  ATH_MSG_DEBUG("Could not extract valid elementId for MMGD channel "<<chanName);
316  ATH_MSG_DEBUG("Fields: "<< wheel << " "<<sector<<" " << stationName<< " " << stationEta<<" "<<stationPhi<<" "<<multiLayer);
317  isOK = false;
318  return false;
319  }
320  Identifier chnlId = m_idHelperSvc->mmIdHelper().multilayerID(modId, multiLayer, isValid);
321  if(!isValid){
322  ATH_MSG_DEBUG("Could not extract valid multilayerId for MMG channel "<<chanName);
323  ATH_MSG_DEBUG("Fields: "<< wheel << " "<<sector<<" " << stationName<< " " << stationEta<<" "<<stationPhi<<" "<<multiLayer);
324  isOK = false;
325  //return false;
326  }
327  channelId = chnlId;
328  }
329 
330  // STG
331  else if(tech==DcsTechType::STG){
332  int wheel = res[1]=="A"? 1 : -1;
333  int sector = std::stoi(res[2]);
334  const std::string stationName = sector%2==0 ? "STS" : "STL";
335  int radius = std::stoi(res[5]);
336  int stationEta = wheel*(radius<=2 ? 1 : radius-1);
337  int stationPhi = (sector-1)/2+1;
338  int multiLayer = res[4]=="IP" ? 1 : 2;
339  int gasGap = std::stoi(res[3]);
340  Identifier chnlId = m_idHelperSvc->stgcIdHelper().hvID(stationName, stationEta, stationPhi, multiLayer, gasGap, radius == 1 /*radius 1 is the inner hv section*/ , isValid);
341  if(!isValid){
342  ATH_MSG_DEBUG("Could not extract valid channelId for STG channel "<<chanName);
343  ATH_MSG_DEBUG("Fields: "<< wheel << " "<<sector<<" " << stationName<< " " << stationEta<<" "<<stationPhi<<" "<<multiLayer);
344  isOK = false;
345  return false;
346  }
347  channelId = chnlId;
348  }
349 
350  return true;
351 }
352 
353 
354 // buildChannelIdForTDaq
355 bool
356 NswDcsDbAlg::buildChannelIdForTDaq(Identifier& channelId, uint& elink ,const DcsTechType tech0, const std::string& chanName, bool& isOK) const {
357 
358  // prepare regex
359  std::regex reMMG("^ELink-MM-(A|C)/V([0-9]{1})/L1A/Strip/S([0-9]{1,2})/L([0-9]{1})/R([0-9]{1,2})/E([0-9]{1})");
360  std::regex reSTG("^ELink-sTGC-(A|C)/V([0-9]{1})/L1A/(Strip|Pad)/S([0-9]{1,2})/L([0-9]{1})/R([0-9]{1})/E([0-9]{1})");
361  std::regex reSTGTrigProc("^ELink-sTGC-A/V0/L1A/TrigProc/");
362  std::regex reSTGPadTrig("^ELink-sTGC-A/V0/L1A/PadTrig/");
363 
364  std::regex re;
366 
367  // match regex
368  if(std::regex_match(chanName, reMMG)) {
369  re = reMMG;
370  tech = DcsTechType::MMG;
371  }
372  else if(std::regex_match(chanName, reSTG)) {
373  re = reSTG;
374  tech = DcsTechType::STG;
375  } else if(std::regex_match(chanName, reSTGPadTrig) || std::regex_match(chanName, reSTGTrigProc)){ // those are trigger elinks that are not needed in athena
376  isOK = true;
377  return false;
378  }
379  else {
380  ATH_MSG_DEBUG("Could not identify channel with name "<<chanName);
381  isOK = false;
382  return false;
383  }
384 
385  // sanity check
386  if(tech0!=tech) {
387  isOK = true; // need to distinguish error in parsing and simple difference between required technologies
388  return false;
389  }
390 
391  // build channel Id
392  bool isValid{false};
393  std::smatch m;
394  std::regex_match(chanName, m, re);
395 
396  // copy to vec of strings
397  std::vector<std::string> res;
398  for(unsigned int i=0; i<m.size(); ++i) res.push_back(m[i].str());
399 
400  // MMG Channel
401  if(tech==DcsTechType::MMG){
402  int wheel = res[1]=="A"? 1 : -1;
403  int sector = std::stoi(res[3])+1; // elx counts from 0 athena from 1 -->need a +1
404  int stationName = sector%2==0 ? 55 : 56;
405  /*
406  res[4] -> L
407  res[5] -> R
408  res[6] -> E
409  */
410  int stationEta = wheel*(std::stoi(res[5])<10? 1 : 2); // boards 0-9 are und the first quad, boards 10-15 und the second one
411  int stationPhi = (sector-1)/2+1;
412  int multiLayer = std::stoi(res[4])< 4 ? 1 : 2; // layers 0-3 are on multilayer 1 and layers 4-7 are on multilayer 2
413  int gasGap = (std::stoi(res[4])%4) + 1; // identifies layer within multilayer --> counts from 0-3; +1 because athena counts from 1-4
414  int radius = std::stoi(res[5]);
416  elink = std::stoi(res[6]);
417  if(!isValid){
418  ATH_MSG_DEBUG("Could not extract valid channelId for MMG channel "<<chanName);
419  ATH_MSG_DEBUG("Fields: "<< wheel << " "<<sector<<" " << stationName<< " " << stationEta<<" "<<stationPhi<<" "<<multiLayer<<" " << gasGap<<" " << radius<<" " << elink);
420  isOK = false;
421  return false;
422  }
423  channelId = chnlId;
424  }
425 
426  // STG
427  else if(tech==DcsTechType::STG){
428  int wheel = res[1]=="A"? 1 : -1;
429  int sector = std::stoi(res[4]) + 1;
430  std::string stationName = sector%2==0 ? "STS" : "STL";
431 
432  /*
433  res[3] -> Strip/Pad
434  res[5] -> L
435  res[6] -> R
436  res[7] -> E
437  */
438 
439  int radius = std::stoi(res[6]);
440  int stationEta = wheel*(radius+1);
441  int stationPhi = (sector-1)/2+1;
442  int multiLayer = (std::stoi(res[5]) < 4 ? 1 : 2);
443  int gasGap = ((std::stoi(res[5]))%4)+1;
444  uint channelType = (res[3] == "Pad" ? sTgcIdHelper::sTgcChannelTypes::Pad : sTgcIdHelper::sTgcChannelTypes::Strip);
445  Identifier chnlId = m_idHelperSvc->stgcIdHelper().febID(stationName, stationEta, stationPhi, multiLayer, gasGap, channelType, isValid);
446  if(!isValid){
447  ATH_MSG_DEBUG("Could not extract valid channelId for STG channel "<<chanName);
448  ATH_MSG_DEBUG("Fields: "<< wheel << " "<<sector<<" " << stationName<< " " << stationEta<<" "<<stationPhi<<" "<<multiLayer<<" " << gasGap<<" " << radius<<" " << elink);
449  isOK = false;
450  return false;
451  }
452  channelId = chnlId;
453  elink = std::stoi(res[7]);
454  }
455 
456  return true;
457 }
458 
459 // buildChannelIdForElx
460 bool
461 NswDcsDbAlg::buildChannelIdForEltx(Identifier& channelId, const DcsTechType tech, const std::string& chanName, bool& isOK) const {
462 
463  // prepare regex
464  std::regex re("^(A|C)_([0-9]{2})_L([0-9])_B([0-9]{2})");
465 
466 
467  // match regex
468  if(!std::regex_match(chanName, re)) {
469  ATH_MSG_WARNING("Could not identify channel with name "<<chanName);
470  isOK = false;
471  return false;
472  }
473 
474  // build channel Id
475  bool isValid{false};
476  std::smatch m;
477  std::regex_match(chanName, m, re);
478 
479  // copy to vec of strings
480  std::vector<std::string> res;
481  for(unsigned int i=0; i<m.size(); ++i) res.push_back(m[i].str());
482 
483  //extract field common to MM and stgc
484  int wheel = res[1]=="A"? 1 : -1;
485  int sector = std::stoi(res[2])+1;
486  int board = std::stoi(res[4]);
487  int layer = std::stoi(res[3]);
488  int stationPhi = (sector-1)/2+1;
489  int multiLayer = layer< 5 ? 1 : 2; // layers 1-4 are on multilayer 1 and layers 5-8 are on multilayer 2
490  int gasGap = ((layer-1)%4) + 1; // identifies layer within multilayer
491 
492 
493  // MMG Channel
494  if(tech==DcsTechType::MMG){
495  int stationName = sector%2==0 ? 56 : 55;
496 
497  board -= (layer%2==1 ? 1 : 2); // for odd layers (counting 1-8 here) the first board is on position 1 for even ones on position 2. https://mattermost.web.cern.ch/files/i84ghkjsfbrzje7c3kr5h7ccdy/public?h=xs3cQQ38yZJDrct75eY73G9d1deOaEtJCHmk2Qcni4s
498  int radius{0};
499  if(board%4==0){
500  radius = 2*(board/4);
501  } else if (board%4==3) {
502  radius = 2*(board/4) + 1;
503  } else { // not a readout board
504  isOK = true;
505  return false;
506  }
507 
508  int stationEta = wheel*(radius<10? 1 : 2); // boards 0-9 are on the first quad, boards 10-15 on the second one
510  if(!isValid){
511  ATH_MSG_WARNING("Could not extract valid channelId for MMG channel "<<chanName);
512  ATH_MSG_WARNING("Fields: "<< wheel << " "<<sector<<" " << stationName<< " " << stationEta<<" "<<stationPhi<<" "<<multiLayer<<" " << gasGap<<" " << radius<<" " << board);
513  isOK = false;
514  return false;
515  }
516  channelId = chnlId;
517  } else if(tech==DcsTechType::STG){
518  int stationName = sector%2==0 ? 58 : 57;
519  board -= 1; // count from 0 while input counts from one
520  uint radius = board/2;
521  int stationEta = wheel*(radius+1);
522  uint channelType{0};
523  if(board>=6){ // not a STG readout board
524  isOK = true;
525  return false;
526  }
527  else if((layer&1)==1){// for odd layers (counting 1-8 here) the boards on even positions are reading the strips. https://mattermost.web.cern.ch/files/bdh8wwjzf7yiiggtad3u8bttrr/public?h=2fFnVki1EUefrMEa3tb8AZkTiC-tF3L11qdq43dBbJc
528  if(board%2==0){
529  channelType=sTgcIdHelper::sTgcChannelTypes::Strip;
530  } else {
531  channelType=sTgcIdHelper::sTgcChannelTypes::Pad;
532  }
533  } else if(layer%1==0){// for even layers (counting 1-8 here) the boards on even positions are reading the pads and wires. https://mattermost.web.cern.ch/files/taro34muwpb18pqgiufhwf5a5c/public?h=3YlA-w0NfEuCV2JIGUjiWwpnpDlxvIaEkzrTXWfo71M
534  if(board%2==0){
535  channelType=sTgcIdHelper::sTgcChannelTypes::Pad;
536  } else {
537  channelType=sTgcIdHelper::sTgcChannelTypes::Strip;
538  }
539  }
540  Identifier chnlId = m_idHelperSvc->stgcIdHelper().febID(stationName, stationEta, stationPhi, multiLayer, gasGap, channelType ,isValid);
541  if(!isValid){
542  ATH_MSG_WARNING("Could not extract valid channelId for STG channel "<<chanName);
543  ATH_MSG_WARNING("Fields: "<< wheel << " "<<sector<<" " << stationName<< " " << stationEta<<" "<<stationPhi<<" "<<multiLayer<<" " << gasGap<<" " << radius<<" " << board << " " << channelType);
544  isOK = false;
545  return false;
546  }
547  channelId = chnlId;
548  }
549  return true;
550 }
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
NswDcsDbAlg::buildChannelIdForEltx
bool buildChannelIdForEltx(Identifier &channelId, const DcsTechType tech0, const std::string &chanName, bool &isOK) const
Definition: NswDcsDbAlg.cxx:461
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
Muon::nsw::STGTPSegments::moduleIDBits::stationPhi
constexpr uint8_t stationPhi
station Phi 1 to 8
Definition: NSWSTGTPDecodeBitmaps.h:129
NswDcsDbData::DcsTechType
DcsTechType
Definition: NswDcsDbData.h:22
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
NswDcsDbData::DcsTechType::STG
@ STG
NswDcsDbData::setDataEltx
void setDataEltx(const DcsTechType tech, const Identifier &chnlId)
Definition: NswDcsDbData.cxx:104
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
CondAttrListCollection.h
This file defines the class for a collection of AttributeLists where each one is associated with a ch...
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
PlotCalibFromCool.yy
yy
Definition: PlotCalibFromCool.py:714
json
nlohmann::json json
Definition: HistogramDef.cxx:9
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
SG::WriteCondHandle::getRange
const EventIDRange & getRange() const
Definition: WriteCondHandle.h:89
parse
std::map< std::string, std::string > parse(const std::string &list)
Definition: egammaLayerRecalibTool.cxx:983
NswDcsDbAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: NswDcsDbAlg.h:65
IOVInfiniteRange::infiniteMixed
static EventIDRange infiniteMixed()
Produces an mixed EventIDRange that is infinite in Time and RunLumi.
Definition: IOVInfiniteRange.h:55
NswDcsDbAlg::m_muDetMgrFromDetStore
const MuonGM::MuonDetectorManager * m_muDetMgrFromDetStore
Definition: NswDcsDbAlg.h:81
python.PyKernel.AttributeList
AttributeList
Definition: PyKernel.py:36
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
isValid
bool isValid(const T &p)
Definition: AtlasPID.h:214
NswDcsDbAlg::buildChannelIdForTDaq
bool buildChannelIdForTDaq(Identifier &channelId, uint &elink, const DcsTechType tech0, const std::string &chanName, bool &isOK) const
Definition: NswDcsDbAlg.cxx:356
SG::VarHandleKey::empty
bool empty() const
Test if the key is blank.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:150
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
NswDcsDbAlg::m_readKey_stg_tdaq
readKey_t m_readKey_stg_tdaq
Definition: NswDcsDbAlg.h:73
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
MuonCond::DcsConstants::standbyVolt
float standbyVolt
Definition: MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/Defs.h:32
PrepareReferenceFile.regex
regex
Definition: PrepareReferenceFile.py:43
NswDcsDbAlg::buildChannelIdForHv
bool buildChannelIdForHv(Identifier &channelId, const DcsTechType tech0, const std::string &chanName, bool &isOK) const
Definition: NswDcsDbAlg.cxx:242
NswDcsDbAlg::m_writeKey
writeKey_t m_writeKey
Definition: NswDcsDbAlg.h:67
TileSynchronizeBch.online
online
Definition: TileSynchronizeBch.py:88
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
checkCoolLatestUpdate.chanNum
chanNum
Definition: checkCoolLatestUpdate.py:27
NswDcsDbData::DcsTechType::MMD
@ MMD
lumiFormat.i
int i
Definition: lumiFormat.py:92
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
res
std::pair< std::vector< unsigned int >, bool > res
Definition: JetGroupProductTest.cxx:14
MuonCond::DcsConstants
Helper struct to cache all dcs constants in a common place of the memory.
Definition: MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/Defs.h:31
NswDcsDbAlg::loadELTXData
StatusCode loadELTXData(const EventContext &ctx, const readKey_t &readKey, const DcsTechType tech, writeHandleDcs_t &writeHandle, NswDcsDbData *writeCdo) const
Definition: NswDcsDbAlg.cxx:195
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
NswDcsDbAlg::loadHvData
StatusCode loadHvData(const EventContext &ctx, const readKey_t &readKey, const DcsTechType tech, writeHandleDcs_t &writeHandle, NswDcsDbData *writeCdo) const
Definition: NswDcsDbAlg.cxx:89
checkCorrelInHIST.nLB
int nLB
Definition: checkCorrelInHIST.py:21
NswDcsDbData::DcsTechType::MMG
@ MMG
NswDcsDbAlg::m_loadEltx
Gaudi::Property< bool > m_loadEltx
Definition: NswDcsDbAlg.h:79
IOVInfiniteRange.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
NswDcsDbData::setDataHv
void setDataHv(const DcsTechType tech, const Identifier &chnlId, DcsConstants constants)
Definition: NswDcsDbData.cxx:56
NswDcsDbAlg::m_readKey_mmg_tdaq
readKey_t m_readKey_mmg_tdaq
Definition: NswDcsDbAlg.h:72
NswDcsDbAlg.h
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
TrigJetMonitorAlgorithm.items
items
Definition: TrigJetMonitorAlgorithm.py:79
NswDcsDbData
Definition: NswDcsDbData.h:19
NswDcsDbAlg::m_readKey_mmg_eltx
readKey_t m_readKey_mmg_eltx
Definition: NswDcsDbAlg.h:75
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
NswDcsDbAlg::execute
virtual StatusCode execute(const EventContext &) const override
Definition: NswDcsDbAlg.cxx:43
SG::ReadCondHandleKey< CondAttrListCollection >
NswDcsDbAlg::m_readKey_stg_eltx
readKey_t m_readKey_stg_eltx
Definition: NswDcsDbAlg.h:76
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CondAttrListCollection::const_iterator
ChanAttrListMap::const_iterator const_iterator
Definition: CondAttrListCollection.h:63
re
const boost::regex re(r_e)
NswDcsDbAlg::m_loadTdaq
Gaudi::Property< bool > m_loadTdaq
Definition: NswDcsDbAlg.h:78
NswDcsDbAlg::m_readKey_mmg_hv
readKey_t m_readKey_mmg_hv
Definition: NswDcsDbAlg.h:69
MuonCond::getFsmStateEnum
DcsFsmState getFsmStateEnum(const std::string &fsmState)
Definition: Defs.cxx:8
NswDcsDbAlg::loadTDaqData
StatusCode loadTDaqData(const EventContext &ctx, const readKey_t &readKey, const DcsTechType tech, writeHandleDcs_t &writeHandle, NswDcsDbData *writeCdo) const
Definition: NswDcsDbAlg.cxx:145
NswDcsDbData::setDataTDaq
void setDataTDaq(const DcsTechType tech, const Identifier &chnlId, uint64_t timeSince, uint64_t timeUntil, unsigned int elink, bool permanentlyDisabled)
Definition: NswDcsDbData.cxx:91
NswDcsDbAlg::initialize
virtual StatusCode initialize() override
Definition: NswDcsDbAlg.cxx:16
NswDcsDbAlg::m_condSvc
ServiceHandle< ICondSvc > m_condSvc
Definition: NswDcsDbAlg.h:64
Muon::nsw::STGTPSegments::moduleIDBits::stationEta
constexpr uint8_t stationEta
1 to 3
Definition: NSWSTGTPDecodeBitmaps.h:127
sTgcDigitEffiDump.multiLayer
int multiLayer
Definition: sTgcDigitEffiDump.py:36
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
NswDcsDbAlg::m_readKey_stg_hv
readKey_t m_readKey_stg_hv
Definition: NswDcsDbAlg.h:70
IMuonIdHelperSvc.h
SG::WriteCondHandle::addDependency
void addDependency(const EventIDRange &range)
Definition: WriteCondHandle.h:275