ATLAS Offline Software
LArHVCondAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "./LArHVCondAlg.h"
12 #include "LArHV/LArHVManager.h"
13 #include "LArHV/EMBHVManager.h"
14 #include "LArHV/EMECHVModule.h"
15 #include "LArHV/EMBHVElectrode.h"
19 #include "LArHV/EMECHVManager.h"
20 #include "LArHV/EMECHVElectrode.h"
23 #include "LArHV/HECHVManager.h"
24 #include "LArHV/HECHVSubgap.h"
26 #include "LArHV/FCALHVManager.h"
27 #include "LArHV/FCALHVLine.h"
28 
32 
35 
36 #include "CoralBase/Blob.h"
37 
38 #include <cmath>
39 #include <cstdlib>
40 
41 #define HV_NON_NOMINAL_TOLERANCE 10 // tolerance : 1V for HV
42 #define DEAD_HV_THRESHOLD 10 // HV <10 V="dead"
43 #define MAX_LAR_CELLS 182468
44 
45 //initialize
47  ATH_CHECK( detStore()->retrieve (m_calocellID, "CaloCell_ID") );
48 
52 
56 
58 
59  if (m_doR) {
60  ATH_MSG_INFO("Will use currents to correct voltage-drop at HV-resistors");
61  }
62  else {
63  ATH_MSG_INFO("Will NOT correct voltage-drop at HV-resistors");
64  }
65 
66  // Read Handles
71  ATH_CHECK(m_BFKey.initialize() );
76  // Write Handles
77 
80 
81  m_scaleTool=std::make_unique<LArHVScaleCorrTool>(m_calocellID,msg(),m_fixHVStrings);
82 
83  ATH_MSG_DEBUG("Configured with doHV " << m_doHV << " doAffected " << m_doAffected << " doAffectedHV " << m_doAffectedHV);
84 
85  return StatusCode::SUCCESS;
86 }
87 
88 
90 {
91  ATH_MSG_DEBUG("executing");
92  const EventContext& ctx = Gaudi::Hive::currentContext();
93  // Allow sharing this between the two calls.
94  voltagePerLine_t voltagePerLine;
95  if (m_doHV || m_doAffectedHV) {
96  ATH_CHECK( makeHVScaleCorr (ctx, voltagePerLine) );
97  }
98  if (m_doAffected) {
99  ATH_CHECK( makeAffectedRegionInfo (ctx, voltagePerLine) );
100  }
101 
102  return StatusCode::SUCCESS;
103 }
104 
105 StatusCode LArHVCondAlg::makeHVScaleCorr (const EventContext& ctx,
106  voltagePerLine_t& voltagePerLine) const
107 {
109  if (writeHandle.isValid()) {
110  ATH_MSG_DEBUG("Found valid write handle for LArHVCorr");
111  return StatusCode::SUCCESS;
112  }
113 
114  //Start with infinite range and narrow it down
115  const EventIDRange fullRange=IOVInfiniteRange::infiniteMixed();
116  writeHandle.addDependency (fullRange);
117 
119  const LArOnOffIdMapping* cabling=*larCablingHdl;
120  ATH_MSG_DEBUG("Range of cabling" << larCablingHdl.getRange() << ", intersection: " << writeHandle.getRange());
121  writeHandle.addDependency(larCablingHdl);
122 
124  const CaloDetDescrManager* calodetdescrmgr = *caloMgrHandle;
125  writeHandle.addDependency(caloMgrHandle);
126 
127  const ILArHVScaleCorr *onlHVCorr{nullptr};
128  if(m_undoOnlineHVCorr) {
130  onlHVCorr = *onlHVCorrHdl;
131  writeHandle.addDependency(onlHVCorrHdl);
132  ATH_MSG_DEBUG("Range of online HV correction " << onlHVCorrHdl.getRange() << ", intersection: " << writeHandle.getRange());
133  }
134 
136  const LArHVIdMapping* hvCabling = *mappingHdl;
137  writeHandle.addDependency(mappingHdl);
138 
139  pathVec hasPathologyEM;
140  pathVec hasPathologyHEC;
141  pathVec hasPathologyFCAL;
142  hasPathologyEM.resize(m_larem_id->channel_hash_max());
143  hasPathologyHEC.resize(m_larhec_id->channel_hash_max());
144  hasPathologyFCAL.resize(m_larfcal_id->channel_hash_max());
145 
146  bool doPathology=true;
148  const LArHVPathology* pathologyContainer = *pHdl;
149  if(!pathologyContainer) {
150  ATH_MSG_WARNING("Why do not have HV pathology object " << m_pathologiesKey.fullKey() << " ? Work without pathologies !!!");
151  doPathology=false;
152  }
153 
154  if(doPathology) {
155  writeHandle.addDependency(pHdl);
156  ATH_MSG_DEBUG("Range of HV-Pathology " << pHdl.getRange() << ", intersection: " << writeHandle.getRange());
157  const std::vector<LArHVPathologiesDb::LArHVElectPathologyDb> &pathCont = pathologyContainer->getPathology();
158  const size_t nPathologies=pathCont.size();
159  if (m_nPathologies != nPathologies) {
160  ATH_MSG_INFO( "Number of HV pathologies found " << nPathologies);
161  m_nPathologies=nPathologies;
162  }
163  for(unsigned i=0; i<nPathologies; ++i) {
164  LArHVPathologiesDb::LArHVElectPathologyDb electPath = pathCont[i];
165  Identifier id(electPath.cellID);
166  if (m_larem_id->is_lar_em(id)) {
167  IdentifierHash idHash = m_larem_id->channel_hash(id);
168  unsigned int index = (unsigned int)(idHash);
169  if (index<hasPathologyEM.size()) {
170  if(!hasPathologyEM[index].empty()) {
171  if(hasPathologyEM[index].size()<static_cast<size_t>(abs(electPath.electInd+1)))
172  hasPathologyEM[index].resize(electPath.electInd+1);
173  hasPathologyEM[index][electPath.electInd]=electPath.pathologyType;
174  } else {
175  std::vector<unsigned short> svec;
176  svec.resize(electPath.electInd+1);
177  svec[electPath.electInd]=electPath.pathologyType;
178  hasPathologyEM[index]=svec;
179  }
180  }
181  }
182  if (m_larhec_id->is_lar_hec(id)) {
184  unsigned int index = (unsigned int)(idHash);
185  if (index<hasPathologyHEC.size()) {
186  if(!hasPathologyHEC[index].empty()) {
187  if(hasPathologyHEC[index].size()<static_cast<size_t>(abs(electPath.electInd+1)))
188  hasPathologyHEC[index].resize(electPath.electInd+1);
189  hasPathologyHEC[index][electPath.electInd]=electPath.pathologyType;
190  } else {
191  std::vector<unsigned short> svec;
192  svec.resize(electPath.electInd+1);
193  svec[electPath.electInd]=electPath.pathologyType;
194  hasPathologyHEC[index]=svec;
195  }
196  }
197  }
198  if (m_larfcal_id->is_lar_fcal(id)) {
200  unsigned int index = (unsigned int)(idHash);
201  if (index<hasPathologyFCAL.size()) {
202  if(!hasPathologyFCAL[index].empty()) {
203  if(hasPathologyFCAL[index].size()<static_cast<size_t>(abs(electPath.electInd+1)))
204  hasPathologyFCAL[index].resize(electPath.electInd+1);
205  hasPathologyFCAL[index][electPath.electInd]=electPath.pathologyType;
206  } else {
207  std::vector<unsigned short> svec;
208  svec.resize(electPath.electInd+1);
209  svec[electPath.electInd]=electPath.pathologyType;
210  hasPathologyFCAL[index]=svec;
211  }
212 
213  }
214  }
215  } // Pathology containers
216  }//doPathology
217 
218  const float* rValues{nullptr};
219  if(m_doR) {
221  const AthenaAttributeList* attr = *readAttrHandle;
222  writeHandle.addDependency(readAttrHandle);
223  // store the conditions blob
224  const coral::Blob& rBlob = (*attr)["ElectrodeRvalues"].data<coral::Blob>();
225  if(rBlob.size()/sizeof(float) != m_electrodeID->electrodeHashMax()) {
226  ATH_MSG_ERROR("Expected " << m_electrodeID->electrodeHashMax() << " R values, but got " << rBlob.size()/sizeof(float) << " aborting");
227  return StatusCode::FAILURE;
228  }
229  rValues = static_cast<const float*>(rBlob.startingAddress());
230  }
231 
232  auto addDep = [&writeHandle] (SG::ReadCondHandle<CondAttrListCollection>& h) -> const EventIDRange& {
233  writeHandle.addDependency (h);
234  return writeHandle.getRange();
235  };
236  ATH_CHECK( getVoltagePerLine (ctx, voltagePerLine, addDep) );
237 
238  voltagePerCell_t voltageVec(MAX_LAR_CELLS);
239  ATH_CHECK(fillPathAndCellHV(calodetdescrmgr,voltageVec, hvCabling, voltagePerLine,
240  pathologyContainer, hasPathologyEM, hasPathologyHEC, hasPathologyFCAL, rValues));
241 
242  std::vector<float> vScale;
243  vScale.resize(MAX_LAR_CELLS,(float)1.0);
244  for (unsigned i=0;i<MAX_LAR_CELLS;++i) {
246  const CaloDetDescrElement* dde = calodetdescrmgr->get_element(hash);
247  const HWIdentifier hwid=cabling->createSignalChannelIDFromHash(hash);
248  vScale[i]=m_scaleTool->getHVScale(dde,voltageVec[i],msg());
249  if(onlHVCorr) { // undo the online one
250  const float hvonline = onlHVCorr->HVScaleCorr(hwid);
251  if (hvonline>0. && hvonline<100.) vScale[i]=vScale[i]/hvonline;
252  }
253  //Final sanity check:
254  if (vScale[i]<0.01) {
255  ATH_MSG_WARNING("Ignoring suspicously small correction factor of " << vScale[i] << " for channel " << m_onlineID->channel_name(hwid));
256  vScale[i]=1.0;
257  }
258 
259  if (vScale[i] < 0.9) {
260  if (vScale[i] < 0.4) {
261  ATH_MSG_WARNING("HV corr for channel " << m_onlineID->channel_name(hwid)
262  << " = " << vScale[i]);
263  } else {
264  ATH_MSG_DEBUG("HV corr for channel " << m_onlineID->channel_name(hwid)
265  << " = " << vScale[i]);
266  }
267  } //end of vScale < 0.9
268  } //end loop over all cells
269 
270  auto hvCorr = std::make_unique<LArHVCorr>(std::move(vScale), cabling, m_calocellID);
271 
272  if (writeHandle.record(std::move(hvCorr)).isFailure()) {
273  ATH_MSG_ERROR("Could not record LArHVCorr object with " << writeHandle.key()
274  << " with EventRange " << writeHandle.getRange() << " into Conditions Store");
275  return StatusCode::FAILURE;
276  }
277  ATH_MSG_INFO("recorded new " << writeHandle.key() << " with range " << writeHandle.getRange() << " into Conditions Store");
278 
279  return StatusCode::SUCCESS;
280 }
281 
282 
284  voltagePerLine_t& voltagePerLine) const
285 {
287  if (writeAffectedHandle.isValid()) {
288  ATH_MSG_DEBUG("Found valid write LArAffectedRegions handle");
289  return StatusCode::SUCCESS;
290  }
291 
293  const LArOnOffIdMapping* cabling=*larCablingHdl;
294  ATH_MSG_DEBUG("Range of cabling" << larCablingHdl.getRange() << ", intersection: " << writeAffectedHandle.getRange());
295  writeAffectedHandle.addDependency(larCablingHdl);
296 
297  SG::ReadCondHandle<LArBadFebCont> readBFHandle{m_BFKey, ctx};
298  const LArBadFebCont* bfCont = *readBFHandle;
299  writeAffectedHandle.addDependency(readBFHandle);
300  ATH_MSG_DEBUG("Range of BadFeb " << readBFHandle.getRange() << ", intersection: " << writeAffectedHandle.getRange());
301 
302  auto vAffected = std::make_unique<CaloAffectedRegionInfoVec>();
303  if (m_doAffectedHV) {
304  auto addDep = [&writeAffectedHandle] (SG::ReadCondHandle<CondAttrListCollection>& h) -> const EventIDRange& {
305  writeAffectedHandle.addDependency (h);
306  return writeAffectedHandle.getRange();
307  };
308  ATH_CHECK( getVoltagePerLine (ctx, voltagePerLine, addDep) );
309 
311  const LArHVIdMapping* hvCabling = *mappingHdl;
312  writeAffectedHandle.addDependency(mappingHdl);
313 
314  ATH_CHECK(searchNonNominalHV_EMB(vAffected.get(), hvCabling, voltagePerLine));
315  ATH_CHECK(searchNonNominalHV_EMEC_OUTER(vAffected.get(), hvCabling, voltagePerLine));
316  ATH_CHECK(searchNonNominalHV_EMEC_INNER(vAffected.get(), hvCabling, voltagePerLine));
317  ATH_CHECK(searchNonNominalHV_HEC(vAffected.get(), hvCabling, voltagePerLine));
318  ATH_CHECK(searchNonNominalHV_FCAL(vAffected.get(), hvCabling, voltagePerLine));
319  }
320 
321  ATH_CHECK(updateMethod(ctx, vAffected.get(), bfCont, cabling));
322  ATH_CHECK(writeAffectedHandle.record(std::move(vAffected)));
323  ATH_MSG_INFO("recorded new " << writeAffectedHandle.key() << " with range "
324  << writeAffectedHandle.getRange()<< " into Conditions Store");
325 
326  return StatusCode::SUCCESS;
327 }
328 
329 
331  voltagePerLine_t& voltagePerLine,
332  const addDepFcn_t& addDep) const
333 {
334  // Do this bit unconditionally, so that dependencies are propagated correctly.
335  std::vector<const CondAttrListCollection*> attrvec;
336  // get handles to DCS Database folders
337  for (const auto& fldkey: m_DCSFolderKeys ) {
338  SG::ReadCondHandle<CondAttrListCollection> dcsHdl(fldkey, ctx);
339  const CondAttrListCollection* cattr = *dcsHdl;
340  if(cattr) {
341  ATH_MSG_DEBUG("Folder: "<<dcsHdl.key()<<" has size: "<<std::distance(cattr->begin(),cattr->end()));
342  attrvec.push_back(cattr);
343  const EventIDRange& range = addDep (dcsHdl);
344  ATH_MSG_DEBUG("Range of " << dcsHdl.key() << " " << dcsHdl.getRange() << ", intersection: " << range);
345 
346  } else {
347  ATH_MSG_WARNING("Why do not have DCS folder " << fldkey.fullKey());
348  }
349  } // over DCS folders
350 
351  // But we can skip this if we've already done it.
352  if (voltagePerLine.empty()) {
353  ATH_CHECK(dcs2LineVoltage(voltagePerLine, attrvec));
354  }
355 
356  return StatusCode::SUCCESS;
357 }
358 
359 
361  , voltagePerCell_t& hvdata
362  , const LArHVIdMapping* hvCabling
363  , const voltagePerLine_t& voltage
364  , const LArHVPathology& pathologies
365  , pathVec& hasPathologyEM
366  , pathVec& hasPathologyHEC
367  , pathVec& hasPathologyFCAL
368  , const float* rValues) const
369 {
370 
371  std::vector<unsigned int> listElec;
372 
373  const float uAkOhm = 1.e-3; // current is uA, rValues kOhm, result should be V
374 
375 
376  // loop over all EM Identifiers
377  for (auto id: m_larem_id->channel_ids()) {
379  voltageCell_t& v=hvdata[hash];
380  if (abs(m_larem_id->barrel_ec(id))==1 && m_larem_id->sampling(id) > 0) { // LAr EMB
381  unsigned int index = (unsigned int)(m_larem_id->channel_hash(id));
382  bool hasPathology=false;
383  if (index<hasPathologyEM.size()) {
384  if (!hasPathologyEM[index].empty()) {
385  hasPathology=true;
386  listElec = getElecList(id,pathologies);
387  }
388  }
389  const EMBDetectorElement* embElement = dynamic_cast<const EMBDetectorElement*>(calodetdescrmgr->get_element(hash));
390  if (!embElement) std::abort();
391  const EMBCellConstLink cell = embElement->getEMBCell();
392  unsigned int nelec = cell->getNumElectrodes();
393  unsigned int ngap = 2*nelec;
394  float wt = 1./ngap;
395  for (unsigned int i=0;i<nelec;i++) {
396  const EMBHVElectrode& electrode = cell->getElectrode(i);
397  // " " << electrode->getModule()->getEtaIndex() << " " << electrode->getModule()->getPhiIndex() <<
398  // " " << electrode->getModule()->getSectorIndex() << " " << electrode->getElectrodeIndex() << std::endl;
399  for (unsigned int igap=0;igap<2;igap++) {
400  float hv=0;
401  float curr=0;
402  unsigned int hvline = electrode.hvLineNo(igap,hvCabling);
403  auto hvIt=voltage.find(hvline);
404  if(hvIt != voltage.end()) { //Found HV line
405  hv=hvIt->second.hv;
406  if(rValues && m_useCurrentEMB) { // modify the current record
407  curr=hvIt->second.curr;
408  const EMBHVModule &hvmod = electrode.getModule();
410  hvmod.getSideIndex(),
411  hvCabling->getCellModule(id),
412  hvmod.getPhiIndex(),
413  hvmod.getEtaIndex(),
414  igap,
415  electrode.getElectrodeIndex() ));
416  if(curr > 0.) curr *= uAkOhm * rValues[ridx]; else curr = 0.;
417  ATH_MSG_VERBOSE("channel. "<<std::hex<<id.get_identifier32()<<std::dec <<" hvline: "<<hvline<<" curr. " << curr << " R: "<<rValues[ridx]);
418  }//end if rValues
419  if (hasPathology) {
420  ATH_MSG_VERBOSE( "Has pathology for id: "<< m_larem_id->print_to_string(id)<<" "<<hasPathologyEM[index]);
421  msg(MSG::VERBOSE) << "Original hv: "<<hv<<" ";
422  for (unsigned int ii=0;ii<listElec.size();ii++) {
423  if (listElec[ii]==(2*i+igap) && listElec[ii]<hasPathologyEM[index].size() && hasPathologyEM[index][listElec[ii]]) {
424  if(hasPathologyEM[index][listElec[ii]]&LArHVPathologyBits::MaskHV) {
425  hv=0.;
426  curr = 0.;
427  } else if(hasPathologyEM[index][listElec[ii]]&LArHVPathologyBits::MaskCurr) {
428  curr = 0.;
429  } else {
430  hv=((hasPathologyEM[index][listElec[ii]]&LArHVPathologyBits::SetHVMask)>>4);
431  curr=0.;
432  }
433  }
434  }
435  msg(MSG::VERBOSE) << "set hv: "<<hv<<endmsg;
436  }//end if has patology
437 
438  }//end got hv
439  else {
440  ATH_MSG_WARNING("Do not have hvline: "<<hvline<<" in LArHVData mapping ! Set voltage to 0 !");
441  }
442  addHV(v,hv-curr,wt);
443  }//end loop over gaps
444  }//end loop over electrodes
445  } else if (abs(m_larem_id->barrel_ec(id))==1 && m_larem_id->sampling(id) == 0) { // EMBPS
446 
447  const EMBDetectorElement* embElement = dynamic_cast<const EMBDetectorElement*>(calodetdescrmgr->get_element(hash));
448  if (!embElement) std::abort();
449  const EMBCellConstLink cell = embElement->getEMBCell();
450  const EMBPresamplerHVModule& hvmodule = cell->getPresamplerHVModule ();
451 
452  float wt = 0.5;
453  for (unsigned int igap=0;igap<2;igap++) {
454  float hv=0;
455  float curr=0;
456  unsigned hvline = hvmodule.hvLineNo(igap,hvCabling);
457  auto hvIt=voltage.find(hvline);
458  if(hvIt != voltage.end()) { //Found HV line
459  hv=hvIt->second.hv;
460  if(rValues && m_useCurrentOthers) { // modify the current record
461  curr=hvIt->second.curr;
463  hvmodule.getSideIndex(),
464  hvCabling->getCellModule(id),
465  0, // not used in EMBPS
466  hvmodule.getEtaIndex(),
467  igap,
468  0 // not used in EMBPS
469  ));
470  if(curr > 0.) curr *= uAkOhm * rValues[ridx]; else curr = 0;
471  ATH_MSG_VERBOSE("channel. "<<std::hex<<id.get_identifier32()<<std::dec <<" hvline: "<<hvline<<" curr. " << curr << " R: "<<rValues[ridx]);
472  }//end have rValue
473  }//end have voltage
474  else {
475  ATH_MSG_WARNING("Do not have hvline: "<<hvline<<" in LArHVData mapping ! Set voltage to 0 !");
476  }
477  addHV(v,hv-curr,wt);
478  }//end loop over gaps
479  } else if (abs(m_larem_id->barrel_ec(id))>1 && m_larem_id->sampling(id) > 0){ // LAr EMEC
480  unsigned int index = (unsigned int)(m_larem_id->channel_hash(id));
481  bool hasPathology=false;
482  if (index<hasPathologyEM.size()) {
483  if (!hasPathologyEM[index].empty()) {
484  hasPathology=true;
485  listElec = getElecList(id, pathologies);
486  }
487  }
488 
489  const EMECDetectorElement* emecElement = dynamic_cast<const EMECDetectorElement*>(calodetdescrmgr->get_element(hash));
490  if (!emecElement) std::abort();
491  const EMECCellConstLink cell = emecElement->getEMECCell();
492  unsigned int nelec = cell->getNumElectrodes();
493  unsigned int ngap = 2*nelec;
494  float wt = 1./ngap;
495  for (unsigned int i=0;i<nelec;i++) {
496  const EMECHVElectrode& electrode = cell->getElectrode(i);
497  for (unsigned int igap=0;igap<2;igap++) {
498  float hv=0;
499  float curr=0;
500  unsigned hvline = electrode.hvLineNo(igap,hvCabling);
501  auto hvIt=voltage.find(hvline);
502  if(hvIt != voltage.end()) { //Found HV line
503  hv=hvIt->second.hv;
504  if(rValues && m_useCurrentOthers) { // modify the current record
505  curr=hvIt->second.curr;
506  const EMECHVModule &hvmod = electrode.getModule();
508  hvmod.getSideIndex(),
509  hvCabling->getCellModule(id),
510  hvmod.getPhiIndex(),
511  hvmod.getEtaIndex(),
512  hvmod.getSectorIndex(),
513  electrode.getElectrodeIndex() ));
514  if(curr > 0.) curr *= uAkOhm * rValues[ridx]; else curr = 0.;
515  ATH_MSG_VERBOSE("channel. "<<std::hex<<id.get_identifier32()<<std::dec <<" hvline: "<<hvline<<" curr. " << curr << " R: "<<rValues[ridx]);
516  }
517  if (hasPathology) {
518  msg(MSG::VERBOSE) << "Has pathology for id: "<< m_larem_id->print_to_string(id)<<" "<<hasPathologyEM[index]<<endmsg;
519  for (unsigned int ii=0;ii<listElec.size();ii++) {
520  if (listElec[ii]==(2*i+igap) && listElec[ii]<hasPathologyEM[index].size() && hasPathologyEM[index][listElec[ii]]) {
521  if(hasPathologyEM[index][listElec[ii]]&LArHVPathologyBits::MaskHV) {
522  hv=0.;
523  curr = 0.;
524  } else if(hasPathologyEM[index][listElec[ii]]&LArHVPathologyBits::MaskCurr) {
525  curr = 0.;
526  } else {
527  hv=((hasPathologyEM[index][listElec[ii]]&0xFFF0)>>4);
528  curr=0.;
529  }
530  }
531  }
532  }//end hasPatology
533  }//end have voltage
534  else {
535  ATH_MSG_WARNING("Do not have hvline: "<<hvline<<" in LArHVData mapping ! Set voltage to 0 !");
536  }
537  addHV(v,hv-curr,wt);
538  }//end loop over gaps
539  }//end loop over electrodes
540 
541  } else if (abs(m_larem_id->barrel_ec(id))>1 && m_larem_id->sampling(id)==0) { // EMECPS
542 
543  const EMECDetectorElement* emecElement = dynamic_cast<const EMECDetectorElement*>(calodetdescrmgr->get_element(hash));
544  if (!emecElement) std::abort();
545  const EMECCellConstLink cell = emecElement->getEMECCell();
546  const EMECPresamplerHVModule& hvmodule = cell->getPresamplerHVModule ();
547 
548  double wt = 0.5;
549  for (unsigned int igap=0;igap<2;igap++) {
550  float hv=0;
551  float curr=0;
552  unsigned int hvline = hvmodule.hvLineNo(igap,hvCabling);
553  auto hvIt=voltage.find(hvline);
554  if(hvIt != voltage.end()) { //Found HV line
555  hv=hvIt->second.hv;
556  if(rValues && m_useCurrentOthers) { // modify the current record
557  curr=hvIt->second.curr;
559  hvmodule.getSideIndex(),
560  hvCabling->getCellModule(id),
561  0, // not used in EMECPS
562  0,
563  igap,
564  0 // not used in EMECPS
565  ));
566  if(curr >0.) curr *= uAkOhm * rValues[ridx]; else curr=0.;
567  ATH_MSG_VERBOSE("channel. "<<std::hex<<id.get_identifier32()<<std::dec <<" hvline: "<<hvline<<" curr. " << curr << " R: "<<rValues[ridx]);
568  }//end if rValues
569 
570  }//end have hv-value
571  else {
572  ATH_MSG_WARNING("Do not have hvline: "<<hvline<<" in LArHVData mapping ! Set voltage to 0 !");
573  }
574  addHV(v,hv-curr,wt);
575  }//end loop over gaps
576  } else { // something wrong
577  ATH_MSG_ERROR("This could not be, what happened with EM identifiers ?");
578  return StatusCode::FAILURE;
579  }
580  } // end loop over EM-identifiers
581 
582 
583  // LAr HEC
584  for( auto id: m_larhec_id->channel_ids()) {
586  unsigned int index = (unsigned int)(m_larhec_id->channel_hash(id));
587  bool hasPathology=false;
588  if (index<hasPathologyHEC.size()) {
589  if (!hasPathologyHEC[index].empty()) {
590  hasPathology=true;
591  listElec = getElecList(id, pathologies);
592  }
593  }
594  const HECDetectorElement* hecElement = dynamic_cast<const HECDetectorElement*>(calodetdescrmgr->get_element(hash));
595  if (!hecElement) std::abort();
596  const HECCellConstLink cell = hecElement->getHECCell();
597  unsigned int nsubgaps = cell->getNumSubgaps();
598  float wt = 1./nsubgaps;
599  voltageCell_t& v=hvdata[hash];
600  for (unsigned int i=0;i<nsubgaps;i++) {
601  float hv=0;
602  float curr=0;
603  const HECHVSubgap& subgap = cell->getSubgap(i);
604  unsigned int hvline = subgap.hvLineNo(hvCabling);
605  auto hvIt=voltage.find(hvline);
606  if(hvIt != voltage.end()) { //Found HV line
607  hv=hvIt->second.hv;
608  if(rValues && m_useCurrentOthers) { // modify the current record
609  curr=hvIt->second.curr;
610  const HECHVModule &hvmod = subgap.getModule();
612  hvmod.getSideIndex(),
613  hvCabling->getCellModule(id),
614  0, // not used in HEC
615  hvmod.getSamplingIndex(),
616  subgap.getSubgapIndex(),
617  0 // not used in HEC
618  ));
619  if(curr > 0.) curr *= uAkOhm * rValues[ridx]; else curr = 0.;
620  ATH_MSG_VERBOSE("channel. "<<std::hex<<id.get_identifier32()<<std::dec <<" hvline: "<<hvline<<" cur. " << curr << " R: "<<rValues[ridx]);
621  }
622  if (hasPathology) {
623  msg(MSG::VERBOSE) << "Has pathology for id: "<< m_larhec_id->print_to_string(id)<<" "<<hasPathologyHEC[index]<<endmsg;
624  for (unsigned int ii=0;ii<listElec.size();ii++) {
625  if (listElec[ii]==i && listElec[ii]<hasPathologyHEC[index].size() && hasPathologyHEC[index][listElec[ii]]) {
626  if(hasPathologyHEC[index][listElec[ii]]&LArHVPathologyBits::MaskHV) {
627  hv=0.;
628  curr = 0.;
629  } else if(hasPathologyHEC[index][listElec[ii]]&LArHVPathologyBits::MaskCurr){
630  curr = 0.;
631  } else {
632  hv=((hasPathologyHEC[index][listElec[ii]]&LArHVPathologyBits::SetHVMask)>>4);
633  curr=0.;
634  }
635  }
636  }
637  }//end have pathology
638  } //end have voltage
639  else {
640  ATH_MSG_WARNING("Do not have hvline: "<<hvline<<" in LArHVData mapping ! Set voltage to 0 !");
641  }
642  addHV(v,hv-curr,wt);
643  }//end loop over subgaps
644  }//end loop over HEC-IDs
645 
646 
647  for(auto id: m_larfcal_id->channel_ids()) { // LAr FCAL
648  unsigned int index = (unsigned int)(m_larfcal_id->channel_hash(id));
650  bool hasPathology=false;
651  if (index<hasPathologyFCAL.size()) {
652  if (!hasPathologyFCAL[index].empty()) {
653  hasPathology=true;
654  listElec = getElecList(id, pathologies);
655  }
656  }
657 
658  const FCALDetectorElement* fcalElement = dynamic_cast<const FCALDetectorElement*>(calodetdescrmgr->get_element(hash));
659  if (!fcalElement) std::abort();
660  const FCALTile* tile = fcalElement->getFCALTile();
661  unsigned int nlines = tile->getNumHVLines();
662  unsigned int nlines_found=0;
663  for (unsigned int i=0;i<nlines;i++) {
664  const FCALHVLine* line = tile->getHVLine(i);
665  if (line) nlines_found++;
666  }
667  if (nlines_found>0) {
668  float wt = 1./nlines_found;
669  voltageCell_t& v=hvdata[hash];
670  for (unsigned int i=0;i<nlines;i++) {
671  const FCALHVLine* line = tile->getHVLine(i);
672  if (!line) continue;
673  unsigned int hvline = line->hvLineNo(hvCabling);
674  float hv=0;
675  float curr=0;
676  auto hvIt=voltage.find(hvline);
677  if(hvIt != voltage.end()) { //Found HV line
678  hv=hvIt->second.hv;
679  bool useCurrent= (m_larfcal_id->module(id)==1 && m_useCurrentFCAL1) || (m_larfcal_id->module(id)!=1 && m_useCurrentOthers);
680  if(rValues && useCurrent) { // modify the current record
681  curr=hvIt->second.curr;
682  const FCALHVModule& hvmod = line->getModule();
684  hvmod.getSideIndex(),
685  hvCabling->getCellModule(id),
686  0, // not used in FCAL
687  hvmod.getSamplingIndex(),
688  hvmod.getSectorIndex(),
689  line->getLineIndex()
690  ));
691  if(curr > 0.) curr *= uAkOhm * rValues[ridx]; else curr = 0.;
692  ATH_MSG_VERBOSE("channel. "<<std::hex<<id.get_identifier32()<<std::dec <<" hvline: "<<hvline<<" curr." << curr << " R: "<<rValues[ridx]);
693  }
694  if (hasPathology) {
695  msg(MSG::VERBOSE) << "Has pathology for id: "<< m_larfcal_id->print_to_string(id)<<" "<<hasPathologyFCAL[index]<<endmsg;
696  for (unsigned int ii=0;ii<listElec.size();ii++) {
697  if (listElec[ii]==i && listElec[ii]<hasPathologyFCAL[index].size() && hasPathologyFCAL[index][listElec[ii]]) {
698  if(hasPathologyFCAL[index][listElec[ii]]&LArHVPathologyBits::MaskHV){
699  hv=0.;
700  curr = 0.;
701  } else if(hasPathologyFCAL[index][listElec[ii]]&LArHVPathologyBits::MaskCurr){
702  curr = 0.;
703  } else {
704  hv=((hasPathologyFCAL[index][listElec[ii]]&0xFFF0)>>4);
705  curr=0.;
706  }
707  }
708  }
709  }//end if have pathology
710  }//end got voltage
711  else {
712  ATH_MSG_WARNING("Do not have hvline: "<<hvline<<" in LArHVData mapping ! Set voltage to 0 !");
713  }
714  addHV(v,hv-curr,wt);
715 
716  }//end loop over lines
717  }//end if found line
718  }// end loop over fcal ids
719 
720  return StatusCode::SUCCESS;
721 }
722 
723 void LArHVCondAlg::addHV(voltageCell_t& v , float hv, float wt) const {
724  bool found=false;
725  for (unsigned int i=0;i<v.size();i++) {
726  if (std::fabs(hv-v[i].hv) <0.1) {
727  found=true;
728  v[i].weight += wt;
729  break;
730  }
731  }
732  if (!found) {
733  v.emplace_back(hv,wt);
734  } // not already in the list
735 }
736 
737 
738 std::vector<unsigned int> LArHVCondAlg::getElecList(const Identifier& id, const LArHVPathology& pathologyContainer) const
739 {
740  std::vector<unsigned int> myList;
741  myList.clear();
742  for(unsigned i=0; i<pathologyContainer.getPathology().size(); ++i) {
743  LArHVPathologiesDb::LArHVElectPathologyDb electPath = pathologyContainer.getPathology()[i];
744  if (electPath.cellID == (unsigned int)(id.get_identifier32().get_compact())) {
745  myList.push_back(electPath.electInd);
746  }
747  }
748  return myList;
749 
750 }
751 
752 
753 
754 StatusCode LArHVCondAlg::dcs2LineVoltage(voltagePerLine_t& result, const std::vector<const CondAttrListCollection* >& fldvec) const {
755 
756 
757  result.clear();
758 
759  ATH_MSG_DEBUG("Got "<<fldvec.size()<<" DCS HV folders");
760  for(const auto *attrlist : fldvec) { // loop over all DCS folders
761  CondAttrListCollection::const_iterator citr=attrlist->begin();
762  CondAttrListCollection::const_iterator citr_e=attrlist->end();
763  ATH_MSG_DEBUG("Length: "<<std::distance(citr,citr_e));
764  for(;citr!=citr_e;++citr) {
765  const unsigned chan=citr->first;
766  ATH_MSG_VERBOSE("Got HV cool chan: "<< chan);
767  const coral::Attribute& attr=((citr)->second)["R_VMEAS"];
768  float voltage=-999;
769  if (!attr.isNull()) voltage=attr.data<float>(); //Ignore NULL values
770  const coral::Attribute& attrc=((citr)->second)["R_IMEAS"];
771  float current=0.;
772  if (!attrc.isNull()) current=attrc.data<float>(); //Ignore NULL values
773  ATH_MSG_VERBOSE("read voltage: "<<voltage<<" and current: "<<current );
774  auto empl=result.emplace(chan,DCS_t{voltage,current});
775  if (!empl.second) {
776  ATH_MSG_WARNING("DCS channel " << chan << " encountered twice!");
777  }
778  }//end loop over attributeListCollection
779  }
780  return StatusCode::SUCCESS;
781 }
782 
783 //=========================================================================================
785  , const LArHVIdMapping* hvCabling
786  , const voltagePerLine_t& voltage) const { // deals with LAr HV, EMBarrel
787 
788  ATH_MSG_DEBUG(" start HV_EMB ");
789  const LArHVManager *manager = nullptr;
790 
791  if (detStore()->retrieve(manager)==StatusCode::SUCCESS) {
792 
793  // accordion calorimeter
794  float HVnominal = HV_nominal("EMB",0.);
795  const EMBHVManager& hvManager_EMB=manager->getEMBHVManager();
796 
797  for (unsigned int iSide=hvManager_EMB.beginSideIndex();iSide<hvManager_EMB.endSideIndex();iSide++) { // loop over HV modules
798  for (unsigned int iPhi=hvManager_EMB.beginPhiIndex();iPhi<hvManager_EMB.endPhiIndex();iPhi++) {
799  for (unsigned int iSector=hvManager_EMB.beginSectorIndex();iSector<hvManager_EMB.endSectorIndex();iSector++) {
800  for (unsigned int iEta=hvManager_EMB.beginEtaIndex();iEta<hvManager_EMB.endEtaIndex();iEta++) { //0 to 7
801  const EMBHVModule& hvMod = hvManager_EMB.getHVModule(iSide,iEta,iPhi,iSector);
802 
803  float eta_min=hvMod.getEtaMin();
804  float eta_max=hvMod.getEtaMax();
805 
806  ATH_MSG_VERBOSE("iSide,iPhi,iSector,iEta " << iSide << " " << iPhi << " " << iSector << " " << iEta);
807  float phi_min=+30.,phi_max=-30.;
808 
809  bool are_previous_HV_affected=false;
810  bool are_previous_HV_dead=false;
811  for (unsigned int ielec=0;ielec<32;ielec++) { //use hvMod->getNumElectrodes when bug is corrected
812  const EMBHVElectrode& electrode = hvMod.getElectrode(ielec);
813 
814  double hv[2]={0.,0.};
815  for (unsigned int iGap=0;iGap<2;iGap++) { // EMB : 2, TRY TO FIND AUTOMATICALLY NB OF GAPS
816  unsigned int hvline = electrode.hvLineNo(iGap,hvCabling);
817  auto hvIt=voltage.find(hvline);
818  if(hvIt == voltage.end()) {
819  ATH_MSG_WARNING("Do not have hvline: "<<hvline<<" in LArHVData ! Assuming missing DCS data");
820  continue;
821  }
822  hv[iGap]=hvIt->second.hv;
823  } //end for iGap
824 
825  ATH_MSG_VERBOSE(" electrode HV " << ielec << " " << electrode.getPhi() << " "<< hv[0] << " " << hv[1] );
826 
827  //take decisions according to all the gaps HV :
828  bool isDead=false;
829  if (fabs(hv[0])<DEAD_HV_THRESHOLD && fabs(hv[1])<DEAD_HV_THRESHOLD) isDead=true;
830  bool isAffected=false;
831  if ( !isDead && ((fabs(hv[0]-HVnominal)>HV_NON_NOMINAL_TOLERANCE) || (fabs(hv[1]-HVnominal)>HV_NON_NOMINAL_TOLERANCE))) isAffected=true;
832  ATH_MSG_VERBOSE(" dead/affected " << isDead << " " << isAffected);
833 
834  // end previous dead region
835  if (are_previous_HV_dead && !isDead) {
836  are_previous_HV_dead=false;
837  ATH_MSG_VERBOSE(" -- end dead region " << eta_min << " " << eta_max << " " <<phi_min << " " << phi_max);
838  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phi_min,phi_max,1,3,CaloAffectedRegionInfo::HVdead);
839  vAffected->push_back(current_CaloAffectedRegionInfo);
840  }
841 
842  // end previous affected region
843  if (are_previous_HV_affected && !isAffected) {
844  are_previous_HV_affected=false;
845  ATH_MSG_VERBOSE(" -- end affected region " << eta_min << " " << eta_max << " " <<phi_min << " " << phi_max);
846  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phi_min,phi_max,1,3,CaloAffectedRegionInfo::HVaffected);
847  vAffected->push_back(current_CaloAffectedRegionInfo);
848  }
849 
850  if (isDead) {
851  if (!are_previous_HV_dead) {
852  phi_min=CaloPhiRange::fix(electrode.getPhi()-1e-4);
853  phi_max=CaloPhiRange::fix(electrode.getPhi()+1e-4);
854  ATH_MSG_VERBOSE(" -- start dead region " << eta_min << " " << eta_max << " " << phi_min << " " <<phi_max);
855  are_previous_HV_dead = true;
856  }
857  else {
858  extendPhiRegion(electrode.getPhi(),phi_min,phi_max);
859  ATH_MSG_VERBOSE(" extend dead region " << phi_min << " " << phi_max);
860  }
861  }
862 
863  if (isAffected) {
864  if (!are_previous_HV_affected) {
865  phi_min=CaloPhiRange::fix(electrode.getPhi()-1e-4);
866  phi_max=CaloPhiRange::fix(electrode.getPhi()+1e-4);
867  ATH_MSG_VERBOSE(" -- start affected region " << eta_min << " " << eta_max << " " << phi_min << " " <<phi_max);
868  are_previous_HV_affected = true;
869  }
870  else {
871  extendPhiRegion(electrode.getPhi(),phi_min,phi_max);
872  ATH_MSG_VERBOSE(" extend affected region " << phi_min << " " << phi_max);
873  }
874  }
875 
876  } // end for ielec
877 
878  if (are_previous_HV_affected) { //in case a non nominal exists, stores it if we finish the 32 electrodes (because else the are_previous_HV_affected will be reinitialized for the next 32 electrodes serie )
879  ATH_MSG_VERBOSE(" -- finish affected region after electrode loop " << eta_min << " " << eta_max << " " << phi_min << " " <<phi_max);
880  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phi_min,phi_max,1,3,CaloAffectedRegionInfo::HVaffected);
881  vAffected->push_back(current_CaloAffectedRegionInfo);
882  }
883  if (are_previous_HV_dead) {
884  ATH_MSG_VERBOSE(" -- finish dead region after electrode loop " << eta_min << " " << eta_max << " " << phi_min << " " <<phi_max);
885  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phi_min,phi_max,1,3,CaloAffectedRegionInfo::HVdead);
886  vAffected->push_back(current_CaloAffectedRegionInfo);
887  }
888  } // end for iEta
889  } // end for iSector
890  } // end for iPhi
891  } //end for iSide
892 
893  // barrel presampler
894  const EMBPresamplerHVManager& hvManager_EMBPS=manager->getEMBPresamplerHVManager();
895  HVnominal = HV_nominal("EMBPS",0.);
896  for (unsigned int iSide=hvManager_EMBPS.beginSideIndex();iSide<hvManager_EMBPS.endSideIndex();iSide++) { // loop over HV modules
897  for (unsigned int iPhi=hvManager_EMBPS.beginPhiIndex();iPhi<hvManager_EMBPS.endPhiIndex();iPhi++) {
898  for (unsigned int iEta=hvManager_EMBPS.beginEtaIndex();iEta<hvManager_EMBPS.endEtaIndex();iEta++) { //0 to 7
899  const EMBPresamplerHVModule& hvMod = hvManager_EMBPS.getHVModule(iSide,iEta,iPhi);
900  ATH_MSG_VERBOSE("iSide,iPhi,iEta " << iSide << " " << iPhi << " " << iEta);
901  double hv[2];
902  for (int iGap=0;iGap<2;iGap++) {
903  unsigned int hvline = hvMod.hvLineNo(iGap,hvCabling);
904  auto hvIt=voltage.find(hvline);
905  if(hvIt == voltage.end()) {
906  ATH_MSG_WARNING("Do not have hvline: "<<hvline<<" in LArHVData ! Assuming missing DCS data");
907  continue;
908  }
909  hv[iGap]=hvIt->second.hv;
910  }
911  float eta_min=hvMod.getEtaMin();
912  float eta_max=hvMod.getEtaMax();
913  float phi_min=CaloPhiRange::fix(hvMod.getPhiMin());
914  float phi_max=CaloPhiRange::fix(hvMod.getPhiMax());
915  ATH_MSG_VERBOSE(" HV " << hv[0] << " " << hv[1] << " " << " etamin,etamax,phimin,phimax " << eta_min << " " << eta_max << " " << phi_min << " " << phi_max);
916 
917  //take decisions according to all the gaps HV :
918  bool isDead=false;
919  if (fabs(hv[0])<DEAD_HV_THRESHOLD && fabs(hv[1])<DEAD_HV_THRESHOLD) isDead=true;
920  bool isAffected=false;
921  if ( !isDead && ((fabs(hv[0]-HVnominal)>HV_NON_NOMINAL_TOLERANCE) || (fabs(hv[1]-HVnominal)>HV_NON_NOMINAL_TOLERANCE))) isAffected=true;
922  ATH_MSG_VERBOSE(" dead/affected " << isDead << " " << isAffected );
923 
924  if (isDead) {
925  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phi_min,phi_max,0,0,CaloAffectedRegionInfo::HVdead);
926  vAffected->push_back(current_CaloAffectedRegionInfo);
927  }
928  if (isAffected) {
929  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phi_min,phi_max,0,0,CaloAffectedRegionInfo::HVaffected);
930  vAffected->push_back(current_CaloAffectedRegionInfo);
931  }
932  } // loop over iEta EMBPS
933  } // loop over iphi EMBPS
934  } // lop over EMBPS side
935  } else {
936  ATH_MSG_ERROR("Do not have EMB HV Manager !!! ");
937  return StatusCode::FAILURE;
938  }
939  return StatusCode::SUCCESS;
940 }
941 //=========================================================================================
943  , const LArHVIdMapping* hvCabling
944  , const voltagePerLine_t& voltage) const { // deals with LAr HV, EM EndCap OUTER
945 
946  const LArHVManager *manager = nullptr;
947 
948  ATH_MSG_DEBUG(" start HV_EMEC_OUTER ");
949 
950  if (detStore()->retrieve(manager)==StatusCode::SUCCESS) {
951 
952  const EMECHVManager& hvManager_EMEC_OUT=manager->getEMECHVManager(EMECHVModule::OUTER);
953 
954  for (unsigned int iSide=hvManager_EMEC_OUT.beginSideIndex();iSide<hvManager_EMEC_OUT.endSideIndex();iSide++) { // loop over HV modules
955  for (unsigned int iPhi=hvManager_EMEC_OUT.beginPhiIndex();iPhi<hvManager_EMEC_OUT.endPhiIndex();iPhi++) {
956  for (unsigned int iSector=hvManager_EMEC_OUT.beginSectorIndex();iSector<hvManager_EMEC_OUT.endSectorIndex();iSector++) {
957  for (unsigned int iEta=hvManager_EMEC_OUT.beginEtaIndex();iEta<hvManager_EMEC_OUT.endEtaIndex();iEta++) {
958  const EMECHVModule& hvMod=hvManager_EMEC_OUT.getHVModule(iSide,iEta,iPhi,iSector);
959 
960  float etaMod = 0.5*(fabs(hvMod.getEtaMin())+fabs(hvMod.getEtaMax()));
961  float HVnominal = HV_nominal("EMEC",etaMod);
962 
963  float eta_min=hvMod.getEtaMin();
964  float eta_max=hvMod.getEtaMax();
965 
966  ATH_MSG_VERBOSE("iSide,iPhi,iSector,iEta " << iSide << " " << iPhi << " " << iSector << " "
967  << iEta << " eta_min , eta_max " << eta_min << " " << eta_max );
968 
969 
970  float phi_min=+30.,phi_max=-30.;
971 
972  bool are_previous_HV_affected=false;
973  bool are_previous_HV_dead=false;
974  for (unsigned int ielec=0;ielec<hvMod.getNumElectrodes();ielec++) { //use hvMod->getNumElectrodes when bug is corrected
975  const EMECHVElectrode& electrode = hvMod.getElectrode(ielec);
976 
977  double hv[2];
978  for (unsigned int iGap=0;iGap<2;iGap++) { //EMEC : 2 gaps, TRY TO FIND AUTOMATICALLY NB OF GAPS
979  unsigned int hvline = electrode.hvLineNo(iGap,hvCabling);
980  auto hvIt=voltage.find(hvline);
981  if(hvIt == voltage.end()) {
982  ATH_MSG_WARNING("Do not have hvline: "<<hvline<<" in LArHVData ! Assuming missing DCS data");
983  continue;
984  }
985  hv[iGap]=hvIt->second.hv;
986  } //end for iGap
987 
988  //------------------
989  //take decisions according to all the gaps HV :
990  bool isDead=false;
991  if (fabs(hv[0])<DEAD_HV_THRESHOLD && fabs(hv[1])<DEAD_HV_THRESHOLD) isDead=true;
992  bool isAffected=false;
993  if ( !isDead && ((fabs(hv[0]-HVnominal)>HV_NON_NOMINAL_TOLERANCE) || (fabs(hv[1]-HVnominal)>HV_NON_NOMINAL_TOLERANCE))) isAffected=true;
994  ATH_MSG_VERBOSE(" electrode HV " << ielec << " " << electrode.getPhi() << " " << hv[0]
995  << " " << hv[1] << " " << " isDead/isAffected " << isDead << " " << isAffected );
996 
997  // end previous dead region
998  if (are_previous_HV_dead && !isDead) {
999  are_previous_HV_dead=false;
1000  ATH_MSG_VERBOSE(" -- end dead region " << eta_min << " " << eta_max << " " <<phi_min << " " << phi_max);
1001  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phi_min,phi_max,5,7,CaloAffectedRegionInfo::HVdead);
1002  vAffected->push_back(current_CaloAffectedRegionInfo);
1003  }
1004 
1005  // end previous affected region
1006  if (are_previous_HV_affected && !isAffected) {
1007  are_previous_HV_affected=false;
1008  ATH_MSG_VERBOSE(" -- end affected region " << eta_min << " " << eta_max << " " <<phi_min << " " << phi_max);
1009  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phi_min,phi_max,5,7,CaloAffectedRegionInfo::HVaffected);
1010  vAffected->push_back(current_CaloAffectedRegionInfo);
1011  }
1012 
1013  if (isDead) {
1014  if (!are_previous_HV_dead) {
1015  phi_min=CaloPhiRange::fix(electrode.getPhi()-1e-4);
1016  phi_max=CaloPhiRange::fix(electrode.getPhi()+1e-4);
1017  are_previous_HV_dead = true;
1018  ATH_MSG_VERBOSE(" -- start dead region " << eta_min << " " << eta_max << " " << phi_min << " " <<phi_max);
1019  }
1020  else {
1021  extendPhiRegion(electrode.getPhi(),phi_min,phi_max);
1022  ATH_MSG_VERBOSE(" extend affected region " << phi_min << " " << phi_max);
1023  }
1024  }
1025 
1026  if (isAffected) {
1027  if (!are_previous_HV_affected) {
1028  phi_min=CaloPhiRange::fix(electrode.getPhi()-1e-4);
1029  phi_max=CaloPhiRange::fix(electrode.getPhi()+1e-4);
1030  are_previous_HV_affected = true;
1031  ATH_MSG_VERBOSE(" -- start affected region " << eta_min << " " << eta_max << " " << phi_min << " " <<phi_max);
1032  }
1033  else {
1034  extendPhiRegion(electrode.getPhi(),phi_min,phi_max);
1035  ATH_MSG_VERBOSE(" extend affected region " << phi_min << " " << phi_max);
1036  }
1037  }
1038 
1039  } // end for ielec
1040 
1041  if (are_previous_HV_affected) {
1042  //in case a non nominal exists, stores it if we finish the 32 electrodes
1043  //(because else the are_previous_HV_affected will be reinitialized
1044  //for the next 32 electrodes serie )
1045  ATH_MSG_VERBOSE(" - finih affected region after electrode loop " << eta_min << " " << eta_max
1046  << " " << phi_max << " " <<phi_max);
1047  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phi_min,phi_max,5,7,CaloAffectedRegionInfo::HVaffected);
1048  vAffected->push_back(current_CaloAffectedRegionInfo);
1049  }
1050  if (are_previous_HV_dead) {
1051  ATH_MSG_VERBOSE(" -- finish dead region after electrode loop " << eta_min << " " << eta_max << " " << phi_max << " " <<phi_max);
1052  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phi_min,phi_max,5,7,CaloAffectedRegionInfo::HVdead);
1053  vAffected->push_back(current_CaloAffectedRegionInfo);
1054  }
1055  } // end for iEta
1056  } // end for iSector
1057  } // end for iPhi
1058  } //end for iSide
1059 
1060  // endcap presampler
1061  const EMECPresamplerHVManager& hvManager_EMECPS=manager->getEMECPresamplerHVManager();
1062  float HVnominal = HV_nominal("EMECPS",0.);
1063  for (unsigned int iSide=hvManager_EMECPS.beginSideIndex();iSide<hvManager_EMECPS.endSideIndex();iSide++) { // loop over HV modules
1064  for (unsigned int iPhi=hvManager_EMECPS.beginPhiIndex();iPhi<hvManager_EMECPS.endPhiIndex();iPhi++) {
1065  const EMECPresamplerHVModule& hvMod = hvManager_EMECPS.getHVModule(iSide,iPhi);
1066  double hv[2];
1067  for (int iGap=0;iGap<2;iGap++) {
1068  unsigned int hvline = hvMod.hvLineNo(iGap,hvCabling);
1069  auto hvIt=voltage.find(hvline);
1070  if(hvIt == voltage.end()) {
1071  ATH_MSG_WARNING("Do not have hvline: "<<hvline<<" in LArHVData ! Assuming missing DCS data");
1072  continue;
1073  }
1074  hv[iGap]=hvIt->second.hv;
1075  }//end loop over gaps
1076  float eta_min=hvMod.getEtaMin();
1077  float eta_max=hvMod.getEtaMax();
1078  float phi_min=CaloPhiRange::fix(hvMod.getPhiMin());
1079  float phi_max=CaloPhiRange::fix(hvMod.getPhiMax());
1080  ATH_MSG_VERBOSE("iSide,iPhi" << iSide << " " << iPhi << " HV " << hv[0] << " " << hv[1] << " "
1081  << " etamin,etamax,phimin,phimax " << eta_min << " " << eta_max << " "
1082  << phi_min << " " << phi_max);
1083 
1084  //take decisions according to all the gaps HV :
1085  bool isDead=false;
1086  if (fabs(hv[0])<DEAD_HV_THRESHOLD && fabs(hv[1])<DEAD_HV_THRESHOLD) isDead=true;
1087  bool isAffected=false;
1088  if ( !isDead && ((fabs(hv[0]-HVnominal)>HV_NON_NOMINAL_TOLERANCE) || (fabs(hv[1]-HVnominal)>HV_NON_NOMINAL_TOLERANCE))) isAffected=true;
1089  ATH_MSG_VERBOSE(" dead/affected " << isDead << " " << isAffected);
1090 
1091  if (isDead) {
1092  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phi_min,phi_max,4,4,CaloAffectedRegionInfo::HVdead);
1093  vAffected->push_back(current_CaloAffectedRegionInfo);
1094  }
1095  if (isAffected) {
1096  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phi_min,phi_max,4,4,CaloAffectedRegionInfo::HVaffected);
1097  vAffected->push_back(current_CaloAffectedRegionInfo);
1098  }
1099  } // loop over iphi EMECPS
1100  } // lop over EMECPS side
1101  } else {
1102  ATH_MSG_ERROR("DO not have EMEC HV manager !");
1103  return StatusCode::FAILURE;
1104  }
1105  return StatusCode::SUCCESS;
1106 }
1107 //=========================================================================================
1109  , const LArHVIdMapping* hvCabling
1110  , const voltagePerLine_t& voltage) const { // deals with LAr HV, EM EndCap INNER
1111  const LArHVManager *manager = nullptr;
1112 
1113  ATH_MSG_VERBOSE(" start loop over EMEC_INNER ");
1114  if (detStore()->retrieve(manager)==StatusCode::SUCCESS) {
1115 
1116  const EMECHVManager& hvManager_EMEC_IN=manager->getEMECHVManager(EMECHVModule::INNER);
1117 
1118  for (unsigned int iSide=hvManager_EMEC_IN.beginSideIndex();iSide<hvManager_EMEC_IN.endSideIndex();iSide++) { // loop over HV modules
1119  for (unsigned int iPhi=hvManager_EMEC_IN.beginPhiIndex();iPhi<hvManager_EMEC_IN.endPhiIndex();iPhi++) {
1120  for (unsigned int iSector=hvManager_EMEC_IN.beginSectorIndex();iSector<hvManager_EMEC_IN.endSectorIndex();iSector++) {
1121  for (unsigned int iEta=hvManager_EMEC_IN.beginEtaIndex();iEta<hvManager_EMEC_IN.endEtaIndex();iEta++) {
1122  const EMECHVModule& hvMod=hvManager_EMEC_IN.getHVModule(iSide,iEta,iPhi,iSector);
1123 
1124  float etaMod = 0.5*(fabs(hvMod.getEtaMin())+fabs(hvMod.getEtaMax()));
1125  float HVnominal = HV_nominal("EMEC",etaMod);
1126 
1127  float eta_min = hvMod.getEtaMin();
1128  float eta_max = hvMod.getEtaMax();
1129 
1130  ATH_MSG_VERBOSE("iSide,iPhi,iSector,iEta " << iSide << " " << iPhi << " " << iSector << " "
1131  << iEta << " eta_min , eta_max " << eta_min << " " << eta_max);
1132 
1133  float phi_min=+30.,phi_max=-30.;
1134 
1135  bool are_previous_HV_affected=0;
1136  bool are_previous_HV_dead=0;
1137  for (unsigned int ielec=0;ielec<hvMod.getNumElectrodes();ielec++) {
1138  const EMECHVElectrode& electrode = hvMod.getElectrode(ielec);
1139 
1140  double hv[2];
1141  for (unsigned int iGap=0;iGap<2;iGap++) {
1142  unsigned int hvline = electrode.hvLineNo(iGap,hvCabling);
1143  auto hvIt=voltage.find(hvline);
1144  if(hvIt == voltage.end()) {
1145  ATH_MSG_WARNING("Do not have hvline: "<<hvline<<" in LArHVData ! Assuming missing DCS data");
1146  continue;
1147  }
1148  hv[iGap]=hvIt->second.hv;
1149  } //end for iGap
1150 
1151  //------------------
1152  //take decisions according to all the gaps HV :
1153  bool isDead=false;
1154  if (fabs(hv[0])<DEAD_HV_THRESHOLD && fabs(hv[1])<DEAD_HV_THRESHOLD) isDead=true;
1155  bool isAffected=false;
1156  if ( !isDead && ((fabs(hv[0]-HVnominal)>HV_NON_NOMINAL_TOLERANCE) || (fabs(hv[1]-HVnominal)>HV_NON_NOMINAL_TOLERANCE))) isAffected=true;
1157  ATH_MSG_VERBOSE(" electrode HV " << ielec << " " << electrode.getPhi() << " "
1158  << hv[0] << " " << hv[1] << " " << " isDead, isAffected "
1159  << isDead << " " << isAffected);
1160 
1161  // end previous dead region
1162  if (are_previous_HV_dead && !isDead) {
1163  are_previous_HV_dead=false;
1164  ATH_MSG_VERBOSE(" -- end dead region " << eta_min << " " << eta_max << " " <<phi_min << " " << phi_max);
1165  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phi_min,phi_max,5,7,CaloAffectedRegionInfo::HVdead);
1166  vAffected->push_back(current_CaloAffectedRegionInfo);
1167  }
1168 
1169  // end previous affected region
1170  if (are_previous_HV_affected && !isAffected) {
1171  are_previous_HV_affected=false;
1172  ATH_MSG_VERBOSE(" -- end affected region " << eta_min << " " << eta_max << " " <<phi_min << " " << phi_max);
1173  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phi_min,phi_max,5,7,CaloAffectedRegionInfo::HVaffected);
1174  vAffected->push_back(current_CaloAffectedRegionInfo);
1175  }
1176 
1177  if (isDead) {
1178  if (!are_previous_HV_dead) {
1179  phi_min=CaloPhiRange::fix(electrode.getPhi()-1e-4);
1180  phi_max=CaloPhiRange::fix(electrode.getPhi()+1e-4);
1181  ATH_MSG_VERBOSE(" -- start dead region " << phi_min << " " << phi_max);
1182  are_previous_HV_dead = true;
1183  }
1184  else {
1185  extendPhiRegion(electrode.getPhi(),phi_min,phi_max);
1186  ATH_MSG_VERBOSE(" extend dead region " << phi_min << " " << phi_max);
1187  }
1188  }
1189 
1190  if (isAffected) {
1191  if (!are_previous_HV_affected) {
1192  phi_min=CaloPhiRange::fix(electrode.getPhi()-1e-4);
1193  phi_max=CaloPhiRange::fix(electrode.getPhi()+1e-4);
1194  are_previous_HV_affected = true;
1195  ATH_MSG_VERBOSE(" -- start affected region " << phi_min << " " << phi_max);
1196  }
1197  else {
1198  extendPhiRegion(electrode.getPhi(),phi_min,phi_max);
1199  ATH_MSG_VERBOSE(" extend affected region " << phi_min << " " << phi_max);
1200  }
1201  }
1202 
1203  } // end for ielec
1204 
1205  if (are_previous_HV_affected) {
1206  //in case a non nominal exists, stores it if we finish the 32 electrodes
1207  //(because else the are_previous_HV_affected will be reinitialized
1208  //for the next 32 electrodes serie )
1209  ATH_MSG_VERBOSE(" - finish affected region after electrode loop " << eta_min << " "
1210  << eta_max << " " << phi_max << " " <<phi_max);
1211  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phi_min,phi_max,5,7,CaloAffectedRegionInfo::HVaffected);
1212  vAffected->push_back(current_CaloAffectedRegionInfo);
1213  }
1214  if (are_previous_HV_dead) {
1215  ATH_MSG_VERBOSE(" - end dead region after electrode loop " << eta_min << " " << eta_max << " " << phi_max << " " <<phi_max);
1216  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phi_min,phi_max,5,7,CaloAffectedRegionInfo::HVdead);
1217  vAffected->push_back(current_CaloAffectedRegionInfo);
1218  }
1219  } // end for iEta
1220  } // end for iSector
1221  } // end for iPhi
1222  } //end for iSide
1223  } else {
1224  ATH_MSG_ERROR("DO not have EMEC HV manager ");
1225  return StatusCode::FAILURE;
1226  }
1227  return StatusCode::SUCCESS;
1228 }
1229 //=========================================================================================
1231  , const LArHVIdMapping* hvCabling
1232  , const voltagePerLine_t& voltage) const { // deals with LAr HV, HEC
1233 
1234  ATH_MSG_DEBUG(" in HEC ");
1235  const LArHVManager *manager = nullptr;
1236  float etamax_layer[4]={3.3,3.1,3.1,3.3};
1237  float etamin_layer[4]={1.5,1.5,1.6,1.7};
1238 
1239  float HVnominal = HV_nominal("HEC",0.);
1240 
1241 
1242  if (detStore()->retrieve(manager)==StatusCode::SUCCESS) {
1243 
1244  const HECHVManager& hvManager_HEC=manager->getHECHVManager();
1245 
1246  for (unsigned int iSide=hvManager_HEC.beginSideIndex();iSide<hvManager_HEC.endSideIndex();iSide++) { // loop over HV modules
1247  for (unsigned int iPhi=hvManager_HEC.beginPhiIndex();iPhi<hvManager_HEC.endPhiIndex();iPhi++) {
1248  for (unsigned int iSampling=hvManager_HEC.beginSamplingIndex();iSampling<hvManager_HEC.endSamplingIndex();iSampling++) {
1249  float eta_min,eta_max;
1250  if (iSide==1) {
1251  eta_min = etamin_layer[iSampling];
1252  eta_max = etamax_layer[iSampling];
1253  } else {
1254  eta_min = -1.*etamax_layer[iSampling];
1255  eta_max = -1.*etamin_layer[iSampling];
1256  }
1257 
1258  const HECHVModule& hvMod = hvManager_HEC.getHVModule(iSide,iPhi,iSampling);
1259  ATH_MSG_VERBOSE(" iSide,iPhi,iSampling " << iSide << " " << iPhi << " " << iSampling);
1260 
1261  double hv[4] = {0}; // 4 subgaps in HEC
1262  for (unsigned int iGap=0;iGap<hvMod.getNumSubgaps();iGap++) {
1263  const HECHVSubgap& subgap=hvMod.getSubgap(iGap);
1264  unsigned int hvline = subgap.hvLineNo(hvCabling);
1265  auto hvIt=voltage.find(hvline);
1266  if(hvIt == voltage.end()) {
1267  ATH_MSG_WARNING("Do not have hvline: "<<hvline<<" in LArHVData ! Assuming missing DCS data");
1268  continue;
1269  }
1270  if(iGap<4) hv[iGap]=hvIt->second.hv;
1271  }// end for iGap
1272 
1273  //------------------
1274  //take decisions according to all the gaps HV :
1275  bool isDead=false;
1276  if (fabs(hv[0])<DEAD_HV_THRESHOLD && fabs(hv[1])<DEAD_HV_THRESHOLD && fabs(hv[2])<DEAD_HV_THRESHOLD && fabs(hv[3])<DEAD_HV_THRESHOLD) isDead=true;
1277  bool isAffected=false;
1278  if ( !isDead && ((fabs(hv[0]-HVnominal)>HV_NON_NOMINAL_TOLERANCE) || (fabs(hv[1]-HVnominal)>HV_NON_NOMINAL_TOLERANCE) ||
1279  (fabs(hv[2]-HVnominal)>HV_NON_NOMINAL_TOLERANCE) || (fabs(hv[3]-HVnominal)>HV_NON_NOMINAL_TOLERANCE)) ) isAffected=true;
1280  ATH_MSG_VERBOSE(" HV values " << hv[0] << " " << hv[1] << " " << hv[2] << " " << hv[3] << " "
1281  << " isDead/isAffected " << isDead << " " << isAffected);
1282 
1283  float phiMin = CaloPhiRange::fix(hvMod.getPhiMin());
1284  float phiMax = CaloPhiRange::fix(hvMod.getPhiMax());
1285 
1286 
1287  if (isDead) { //stores it, DEAD means all hvs < threshold
1288  ATH_MSG_VERBOSE(" new dead region " << eta_min << " " << eta_max << " " << phiMin << " " << phiMax << " layer " << 8+iSampling);
1289  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phiMin,phiMax,8+iSampling,8+iSampling,CaloAffectedRegionInfo::HVdead);
1290  vAffected->push_back(current_CaloAffectedRegionInfo);
1291  }
1292  if (isAffected) {
1293  ATH_MSG_VERBOSE(" new affected region " << eta_min << " " << eta_max << " " << phiMin << " " << phiMax << " layer " << 8+iSampling);
1294  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phiMin,phiMax,8+iSampling,8+iSampling,CaloAffectedRegionInfo::HVaffected);
1295  vAffected->push_back(current_CaloAffectedRegionInfo);
1296  }
1297 
1298  } //end for iSampling
1299  }//end for iPhi
1300  }//end for iSide
1301  } else {
1302  ATH_MSG_ERROR("Do not have HEC HV manager ");
1303  return StatusCode::FAILURE;
1304  }
1305  return StatusCode::SUCCESS;
1306 }
1307 //=========================================================================================
1309  , const LArHVIdMapping* hvCabling
1310  , const voltagePerLine_t& voltage) const { // deals with LAr HV, FCAL
1311 
1312  ATH_MSG_DEBUG( " inFCAL ");
1313  const LArHVManager *manager = nullptr;
1314  if (detStore()->retrieve(manager)==StatusCode::SUCCESS) {
1315 
1316  const FCALHVManager& hvManager_FCAL=manager->getFCALHVManager();
1317 
1318  for (unsigned int iSide=hvManager_FCAL.beginSideIndex();iSide<hvManager_FCAL.endSideIndex();iSide++) { // loop over HV modules
1319  float eta_min=3.1,eta_max=4.9;
1320  if (iSide==0) {
1321  eta_min=-4.9;
1322  eta_max=-3.1;
1323  }
1324  for (unsigned int iSampling=hvManager_FCAL.beginSamplingIndex();iSampling<hvManager_FCAL.endSamplingIndex();iSampling++) {
1325  float HVnominal = HV_nominal("FCAL",(float)(iSampling));
1326  for (unsigned int iSector=hvManager_FCAL.beginSectorIndex(iSampling);iSector<hvManager_FCAL.endSectorIndex(iSampling);iSector++) {
1327 
1328  const FCALHVModule& hvMod = hvManager_FCAL.getHVModule(iSide,iSector,iSampling);
1329  ATH_MSG_VERBOSE(" FCAL HVModule side,sampling,sector " << iSide << " " << iSampling << " "
1330  << iSector << " HV nominal " << HVnominal);
1331 
1332  float dphi=CaloPhiRange::twopi()/16;
1333  if (iSampling==1) dphi=CaloPhiRange::twopi()/8.;
1334  if (iSampling==2) dphi=CaloPhiRange::twopi()/4.;
1335  float phi_min = ((float)(iSector))*dphi;
1336  phi_min = CaloPhiRange::fix(phi_min);
1337  float phi_max = CaloPhiRange::fix(dphi+phi_min);
1338 
1339  ATH_MSG_VERBOSE(" eta_min,eta_max,phi_min,phi_max " << eta_min << " " << eta_max << " " << phi_min
1340  << " " << phi_max << " number of lines " << hvMod.getNumHVLines());
1341  float hv[4] = {0};
1342  for (unsigned int iLine=0;iLine<hvMod.getNumHVLines();iLine++) {
1343  const FCALHVLine& hvline = hvMod.getHVLine(iLine);
1344  unsigned int ihvline = hvline.hvLineNo(hvCabling);
1345  auto hvIt=voltage.find(ihvline);
1346  if(hvIt == voltage.end()) {
1347  ATH_MSG_WARNING("Do not have hvline: "<<ihvline<<" in LArHVData ! Assuming missing DCS data");
1348  continue;
1349  }
1350  if (iLine<4) hv[iLine]=hvIt->second.hv;
1351  }
1352  //------------------
1353  //take decisions according to all the gaps HV :
1354  bool isDead=false;
1355  if (fabs(hv[0]) < DEAD_HV_THRESHOLD && fabs(hv[1]) < DEAD_HV_THRESHOLD && fabs(hv[2]) < DEAD_HV_THRESHOLD && fabs(hv[3]) < DEAD_HV_THRESHOLD) isDead=true;
1356  bool isAffected=false;
1357  if ( !isDead && ((fabs(hv[0]-HVnominal)>HV_NON_NOMINAL_TOLERANCE) || (fabs(hv[1]-HVnominal)>HV_NON_NOMINAL_TOLERANCE) ||
1358  (fabs(hv[2]-HVnominal)>HV_NON_NOMINAL_TOLERANCE) || (fabs(hv[3]-HVnominal)>HV_NON_NOMINAL_TOLERANCE)) ) isAffected=true;
1359  ATH_MSG_VERBOSE(" HV values " << hv[0] << " " << hv[1] << " " << hv[2] << " " << hv[3] << " "
1360  << " isDead/isAffected " << isDead << " " << isAffected);
1361 
1362 
1363  if (isAffected) {
1364  ATH_MSG_VERBOSE(" -- store affected region ");
1365  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phi_min,phi_max,21+iSampling,21+iSampling,CaloAffectedRegionInfo::HVaffected);
1366  vAffected->push_back(current_CaloAffectedRegionInfo);
1367  }
1368  if (isDead) {
1369  ATH_MSG_VERBOSE(" -- store dead region ");
1370  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phi_min,phi_max,21+iSampling,21+iSampling,CaloAffectedRegionInfo::HVdead);
1371  vAffected->push_back(current_CaloAffectedRegionInfo);
1372  }
1373  } //end iSector
1374  } //end iSampling
1375  }// end iSide
1376  } else {
1377  ATH_MSG_ERROR("Do not have FCAL HV manager");
1378  return StatusCode::FAILURE;
1379  }
1380  return StatusCode::SUCCESS;
1381 }
1382 //=========================================================================================
1383 StatusCode LArHVCondAlg::updateMethod(const EventContext& ctx,
1384  CaloAffectedRegionInfoVec *vAffected, const LArBadFebCont* bfCont,
1385  const LArOnOffIdMapping* cabling) const { //store informations on the missing Febs w/ range of eta, phi, layer
1386  ATH_MSG_DEBUG ( "updateMethod()" );
1387 
1389  const CaloDetDescrManager* calodetdescrmgr = *caloMgrHandle;
1390 
1391  for (const HWIdentifier febId : m_onlineID->feb_range()) {
1392  bool IsMissingFeb=(bfCont->status(febId).deadAll() || bfCont->status(febId).deadReadout());
1393 
1394  if (IsMissingFeb) { //flag for special treatment for FEB that has non contiguous eta regions, so we have to separate them
1395  bool is_normal=0; //FEB without discontinuity
1396  bool is_additive1=0; //FEB with a discontinuity
1397 
1398  int layer_min=+30,layer_max=-30;
1399  float eta_min=+30,eta_max=-30;
1400  float phi_min=+30,phi_max=-30;
1401 
1402  int layer_min_additive1=+30,layer_max_additive1=-30;
1403  float eta_min_additive1=+30,eta_max_additive1=-30;
1404  float phi_min_additive1=+30,phi_max_additive1=-30;
1405 
1406  int chans_per_feb = m_onlineID->channelInSlotMax(febId);
1407 
1408  for (int icha=0;icha<chans_per_feb;icha++) { //loop on each channel of the relevant FEB
1410 
1411  if (cabling->isOnlineConnected(channelId)) {
1412  Identifier offlineId=cabling->cnvToIdentifier(channelId);
1413  const CaloDetDescrElement* caloddElement=calodetdescrmgr->get_element(offlineId);
1414 
1415  CaloCell_ID::CaloSample current_layer=caloddElement->getSampling(); // calo layer
1416  float current_eta=caloddElement->eta();
1417  float current_eta_low=caloddElement->eta()-0.5*caloddElement->deta();
1418  float current_eta_high=caloddElement->eta()+0.5*caloddElement->deta();
1419  float current_phi_low=caloddElement->phi()-0.5*caloddElement->dphi();
1420  float current_phi_high=caloddElement->phi()+0.5*caloddElement->dphi();
1421 
1422  if (caloddElement->is_lar_em_barrel() && caloddElement->getLayer()==3 && fabs(current_eta)>0.79 && fabs(current_eta)<1.33) { //EMB, back sampling, slot 12 : special treatment : this FEB has non contiguous eta regions, so we have to separate them
1423  is_additive1=1; //in order to add it to the summary only if it happens
1424 
1425  if (current_layer<layer_min_additive1)
1426  layer_min_additive1=current_layer;
1427  if (current_layer>layer_max_additive1)
1428  layer_max_additive1=current_layer;
1429 
1430  if (current_eta_low<eta_min_additive1)
1431  eta_min_additive1=current_eta_low;
1432  if (current_eta_high>eta_max_additive1)
1433  eta_max_additive1=current_eta_high;
1434 
1435  extendPhiRegion(current_phi_low,phi_min_additive1,phi_max_additive1);
1436  extendPhiRegion(current_phi_high,phi_min_additive1,phi_max_additive1);
1437 
1438  }
1439  else { //normal case
1440  is_normal=1; // normal case
1441 
1442  if (current_layer<layer_min)
1443  layer_min=current_layer;
1444  if (current_layer>layer_max)
1445  layer_max=current_layer;
1446 
1447  if (current_eta_low<eta_min)
1448  eta_min=current_eta_low;
1449  if (current_eta_high>eta_max)
1450  eta_max=current_eta_high;
1451 
1452  extendPhiRegion(current_phi_low,phi_min,phi_max);
1453  extendPhiRegion(current_phi_high,phi_min,phi_max);
1454 
1455  }
1456  } //end of isOnlineConnected()
1457  } // end of loop on channels
1458 
1459  if (is_normal) {
1460  CaloAffectedRegionInfo current_CaloAffectedRegionInfo(eta_min,eta_max,phi_min,phi_max,layer_min,layer_max,CaloAffectedRegionInfo::missingReadout);
1461  vAffected->push_back(current_CaloAffectedRegionInfo);
1462  }
1463 
1464  if (is_additive1) {
1465  CaloAffectedRegionInfo current_additive1_CaloAffectedRegionInfo(eta_min_additive1,eta_max_additive1,phi_min_additive1,phi_max_additive1,layer_min_additive1,layer_max_additive1,CaloAffectedRegionInfo::missingReadout);
1466  vAffected->push_back(current_additive1_CaloAffectedRegionInfo);
1467  }
1468  } // end of isMissingFeb
1469  } // end of loop on Febs
1470  return StatusCode::SUCCESS;
1471 }
1472 //====================================================================================
1473 float LArHVCondAlg::HV_nominal(const char *identification,const float myparameter) const
1474 {
1475  if (strcmp(identification,"EMBPS")==0)
1476  return 1200.;
1477  else if (strcmp(identification,"EMECPS")==0)
1478  return 1600.;
1479  else if (strcmp(identification,"EMB")==0)
1480  return 2000.;
1481  else if (strcmp(identification,"EMEC")==0) {
1482  if ( fabs(myparameter)<1.5 )
1483  return 2500.;
1484  else if (fabs(myparameter)<1.6)
1485  return 2300.;
1486  else if (fabs(myparameter)<1.8 )
1487  return 2100.;
1488  else if ( fabs(myparameter) < 2.0 )
1489  return 1700.;
1490  else if ( fabs(myparameter) < 2.1 )
1491  return 1500.;
1492  else if ( fabs(myparameter) < 2.3 )
1493  return 1250.;
1494  else if ( fabs(myparameter) < 2.5 )
1495  return 1000.;
1496  else if ( fabs(myparameter) < 2.8 )
1497  return 2300.;
1498  else return 1800.;
1499  }
1500  else if (strcmp(identification,"HEC")==0) {
1501  return 1800.;
1502  }
1503  else if (strcmp(identification,"FCAL")==0) {
1504  if (myparameter<0.5)
1505  return 250.;
1506  else if (myparameter<1.5)
1507  return 375.;
1508  else if (myparameter<2.5)
1509  return 500.;
1510  }
1511 
1512  return -1;
1513 }
1514 //=========================================================================================
1515 
1516 void LArHVCondAlg::extendPhiRegion(float phi, float & phi_min, float & phi_max) const {
1517 
1518  static const float epsilon=1e-4;
1519 
1521 
1522  if (phi_min>10. || phi_max<-10.) {
1523  phi_min = CaloPhiRange::fix(phi-epsilon);
1524  phi_max = CaloPhiRange::fix(phi+epsilon);
1525  return;
1526  }
1527 
1528  bool isInRegion=false;
1529  if (phi_min<phi_max) {
1530  if (phi>phi_min && phi<phi_max) isInRegion=true;
1531  }
1532  else {
1533  if (phi>phi_min || phi<phi_max) isInRegion=true;
1534  }
1535  if (isInRegion) return;
1536 
1537  float dphi1 = CaloPhiRange::diff(phi,phi_min);
1538  float dphi2 = CaloPhiRange::diff(phi,phi_max);
1539  if (fabs(dphi1)<fabs(dphi2) )
1540  phi_min=phi;
1541  else
1542  phi_max=phi;
1543 
1544  return;
1545 
1546 }
CaloDetDescrElement::deta
float deta() const
cell deta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:356
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
EMECPresamplerHVManager
This class provides direct access to information on the HV electrodes within the EMEC....
Definition: EMECPresamplerHVManager.h:36
LArHVCondAlg::m_doRProp
Gaudi::Property< bool > m_doRProp
Definition: LArHVCondAlg.h:90
CaloAffectedRegionInfoVec
std::vector< CaloAffectedRegionInfo > CaloAffectedRegionInfoVec
Definition: CaloAffectedRegionInfoVec.h:11
CaloAffectedRegionInfo
Definition: CaloAffectedRegionInfo.h:16
EMBHVManager::beginEtaIndex
unsigned int beginEtaIndex() const
Definition: EMBHVManager.cxx:184
fillPileUpNoiseLumi.current
current
Definition: fillPileUpNoiseLumi.py:52
python.SystemOfUnits.second
int second
Definition: SystemOfUnits.py:120
LArHVCondAlg::m_hvLineID
const LArHVLineID * m_hvLineID
Definition: LArHVCondAlg.h:108
LArHVCondAlg::dcs2LineVoltage
StatusCode dcs2LineVoltage(voltagePerLine_t &result, const std::vector< const CondAttrListCollection * > &fldvec) const
Read HV from DCS, store them in internal data structure per HV-line (Step 1)
Definition: LArHVCondAlg.cxx:754
DEAD_HV_THRESHOLD
#define DEAD_HV_THRESHOLD
Definition: LArHVCondAlg.cxx:42
EMBHVElectrode
Definition: EMBHVElectrode.h:15
LArHVManager.h
CondAttrListCollection::end
const_iterator end() const
Definition: CondAttrListCollection.h:315
EMBPresamplerHVManager::endSideIndex
static unsigned int endSideIndex()
Definition: EMBPresamplerHVManager.cxx:182
LArHVCondAlg::m_hvRKey
SG::ReadCondHandleKey< AthenaAttributeList > m_hvRKey
Definition: LArHVCondAlg.h:76
HECHVModule
Describes one HV Module within the HEC.
Definition: HECHVModule.h:21
EMECPresamplerHVModule::getEtaMin
double getEtaMin() const
Definition: EMECPresamplerHVModule.cxx:46
EMECHVManager::beginSideIndex
static unsigned int beginSideIndex()
Definition: EMECHVManager.cxx:230
EMECHVElectrode.h
LArHVCondAlg::m_pathologiesKey
SG::ReadCondHandleKey< LArHVPathology > m_pathologiesKey
Definition: LArHVCondAlg.h:70
checkFileSG.line
line
Definition: checkFileSG.py:75
ILArHVScaleCorr
Definition: ILArHVScaleCorr.h:13
EMECHVModule::getEtaMin
double getEtaMin() const
Definition: EMECHVModule.cxx:106
EMECHVManager::getHVModule
const EMECHVModule & getHVModule(unsigned int iSide, unsigned int iEta, unsigned int iPhi, unsigned int iSector) const
Definition: EMECHVManager.cxx:222
LArHVCondAlg::m_onlineHVScaleCorrKey
SG::ReadCondHandleKey< ILArHVScaleCorr > m_onlineHVScaleCorrKey
Definition: LArHVCondAlg.h:83
EMECDetectorElement
LAr EMEC Detector Element.
Definition: CaloDetectorElements.h:116
LArHVCondAlg::voltagePerLine_t
std::unordered_map< unsigned, DCS_t > voltagePerLine_t
Definition: LArHVCondAlg.h:120
get_generator_info.result
result
Definition: get_generator_info.py:21
CaloCell_Base_ID::calo_cell_hash
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
EMBHVModule::getEtaIndex
unsigned int getEtaIndex() const
Definition: EMBHVModule.cxx:49
LArHVPathologyBits::SetHVMask
static const unsigned short SetHVMask
Definition: LArHVPathologiesDb.h:15
ReadCellNoiseFromCool.cell
cell
Definition: ReadCellNoiseFromCool.py:53
SG::ReadCondHandle::getRange
const EventIDRange & getRange()
Definition: ReadCondHandle.h:242
LArHVPathology::getPathology
const std::vector< LArHVPathologiesDb::LArHVElectPathologyDb > & getPathology() const
Definition: LArHVPathology.h:23
CaloAffectedRegionInfo::missingReadout
@ missingReadout
Definition: CaloAffectedRegionInfo.h:21
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:64
HECHVManager::beginSideIndex
static unsigned int beginSideIndex()
Definition: HECHVManager.cxx:164
EMECHVModule::getPhiIndex
unsigned int getPhiIndex() const
Definition: EMECHVModule.cxx:65
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
LArHVCondAlg::execute
StatusCode execute() override
Definition: LArHVCondAlg.cxx:89
FCALHVModule::getSamplingIndex
unsigned int getSamplingIndex() const
Definition: FCALHVModule.cxx:57
CaloCell_ID::em_idHelper
const LArEM_ID * em_idHelper() const
access to EM idHelper
Definition: CaloCell_ID.h:63
EMECPresamplerHVManager::endSideIndex
static unsigned int endSideIndex()
Definition: EMECPresamplerHVManager.cxx:162
AtlasDetectorID::is_lar_fcal
bool is_lar_fcal(Identifier id) const
Definition: AtlasDetectorID.h:839
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
EMBHVManager::endPhiIndex
unsigned int endPhiIndex() const
Definition: EMBHVManager.cxx:179
LArHVCondAlg::searchNonNominalHV_EMEC_INNER
StatusCode searchNonNominalHV_EMEC_INNER(CaloAffectedRegionInfoVec *vAffected, const LArHVIdMapping *hvCabling, const voltagePerLine_t &voltage) const
Definition: LArHVCondAlg.cxx:1108
HECHVManager::beginPhiIndex
static unsigned int beginPhiIndex()
Definition: HECHVManager.cxx:174
CaloIDHelper::channel_hash_max
size_type channel_hash_max() const
One more than the largest channel (cell) hash code.
LArHVCondAlg::searchNonNominalHV_HEC
StatusCode searchNonNominalHV_HEC(CaloAffectedRegionInfoVec *vAffected, const LArHVIdMapping *hvCabling, const voltagePerLine_t &voltage) const
Definition: LArHVCondAlg.cxx:1230
EMBHVModule::getEtaMax
double getEtaMax() const
Definition: EMBHVModule.cxx:89
EMECPresamplerHVManager::beginSideIndex
static unsigned int beginSideIndex()
Definition: EMECPresamplerHVManager.cxx:157
LArHVCondAlg.h
index
Definition: index.py:1
EMBPresamplerHVModule::getEtaMin
double getEtaMin() const
Definition: EMBPresamplerHVModule.cxx:55
LArElectrodeID::ElectrodeId
HWIdentifier ElectrodeId(int det, int side, int mod, int phi, int eta, int gap, int elec) const
Create an Electrode identifier from fields.
Definition: LArElectrodeID.h:306
FCALHVModule::getSideIndex
unsigned int getSideIndex() const
Definition: FCALHVModule.cxx:52
EMBPresamplerHVManager.h
LArBadXCont
Conditions-Data class holding LAr Bad Channel or Bad Feb information.
Definition: LArBadChannelCont.h:28
EMECHVModule::getElectrode
const EMECHVElectrode & getElectrode(unsigned int iElectrode) const
Definition: EMECHVModule.cxx:81
CaloDetDescrElement
This class groups all DetDescr information related to a CaloCell. Provides a generic interface for al...
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:66
LArHVCondAlg::m_doAffected
Gaudi::Property< bool > m_doAffected
Definition: LArHVCondAlg.h:97
CaloDetDescrManager_Base::get_element
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
Definition: CaloDetDescrManager.cxx:159
LArHVCondAlg::m_useCurrentEMB
Gaudi::Property< bool > m_useCurrentEMB
Definition: LArHVCondAlg.h:92
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
IOVInfiniteRange::infiniteMixed
static EventIDRange infiniteMixed()
Produces an mixed EventIDRange that is infinite in Time and RunLumi.
Definition: IOVInfiniteRange.h:55
EMECHVManager::endSectorIndex
unsigned int endSectorIndex() const
Definition: EMECHVManager.cxx:245
EMECHVElectrode::getPhi
double getPhi() const
Definition: EMECHVElectrode.cxx:42
EMECHVManager::endEtaIndex
unsigned int endEtaIndex() const
Definition: EMECHVManager.cxx:217
EMECHVManager.h
LArHVIdMapping::getCellModule
int getCellModule(const Identifier &offId) const
returns the Module of a given offId
Definition: LArHVIdMapping.cxx:398
LArHVCondAlg::makeHVScaleCorr
StatusCode makeHVScaleCorr(const EventContext &ctx, voltagePerLine_t &voltagePerLine) const
Definition: LArHVCondAlg.cxx:105
LArElectrodeID::electrodeHash
IdentifierHash electrodeHash(HWIdentifier electrode_id) const
Create an electrode hash identifier from an electrode identifier.
Definition: LArElectrodeID.h:331
LArFCAL_Base_ID::module
int module(const Identifier id) const
module [1,3]
LArHVPathologyBits::MaskCurr
static const unsigned short MaskCurr
Definition: LArHVPathologiesDb.h:14
LArFCAL_Base_ID::channel_hash
IdentifierHash channel_hash(Identifier channelId) const
Convert a connected channel (cell) Identifier to a hash code.
CondAttrListCollection::begin
const_iterator begin() const
Access to Chan/AttributeList pairs via iterators.
Definition: CondAttrListCollection.h:309
python.subdetectors.tile.Blob
Blob
Definition: tile.py:17
LArEM_Base_ID::sampling
int sampling(const Identifier id) const
return sampling according to :
LArHVCondAlg::extendPhiRegion
void extendPhiRegion(float phi, float &phi_min, float &phi_max) const
Definition: LArHVCondAlg.cxx:1516
EMECPresamplerHVModule::getSideIndex
unsigned int getSideIndex() const
Definition: EMECPresamplerHVModule.cxx:41
EMECHVManager::endPhiIndex
unsigned int endPhiIndex() const
Definition: EMECHVManager.cxx:207
LArHVCondAlg::pathVec
std::vector< std::vector< unsigned short > > pathVec
Internal structure for HV pathologies.
Definition: LArHVCondAlg.h:137
EMBPresamplerHVManager::endPhiIndex
unsigned int endPhiIndex() const
Definition: EMBPresamplerHVManager.cxx:157
EMBHVManager::beginSectorIndex
static unsigned int beginSectorIndex()
Definition: EMBHVManager.cxx:199
FCALHVManager::getHVModule
const FCALHVModule & getHVModule(unsigned int iSide, unsigned int iSector, unsigned int iSampling) const
Definition: FCALHVManager.cxx:190
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
FCALDetectorElement::getFCALTile
const FCALTile * getFCALTile() const
FCAL Tile description from LArReadoutGeometry.
Definition: CaloDetectorElements.h:286
LArHVPathologiesDb::LArHVElectPathologyDb::cellID
unsigned int cellID
Definition: LArHVPathologiesDb.h:23
LArHVLineID.h
CaloAffectedRegionInfo::HVdead
@ HVdead
Definition: CaloAffectedRegionInfo.h:23
EMECDetectorElement::getEMECCell
EMECCellConstLink getEMECCell() const
EMEC Cell description from LArReadoutGeometry.
Definition: CaloDetectorElements.h:141
EMBDetectorElement
LAr EMB Detector Element.
Definition: CaloDetectorElements.h:52
HWIdentifier
Definition: HWIdentifier.h:13
CondAttrListCollection
This class is a collection of AttributeLists where each one is associated with a channel number....
Definition: CondAttrListCollection.h:52
EMECPresamplerHVManager::beginPhiIndex
unsigned int beginPhiIndex() const
Definition: EMECPresamplerHVManager.cxx:142
empty
bool empty(TH1 *h)
Definition: computils.cxx:294
LArBadXCont::status
LArBC_t status(const HWIdentifier channel) const
Query the status of a particular channel or FEB This is the main client access method.
EMECPresamplerHVManager::getHVModule
const EMECPresamplerHVModule & getHVModule(unsigned int iSide, unsigned int iPhi) const
Definition: EMECPresamplerHVManager.cxx:152
EMBHVManager::beginSideIndex
static unsigned int beginSideIndex()
Definition: EMBHVManager.cxx:209
EMBHVManager::endEtaIndex
unsigned int endEtaIndex() const
Definition: EMBHVManager.cxx:189
EMECHVModule
Definition: EMECHVModule.h:20
EMECPresamplerHVModule.h
EMBHVElectrode.h
CaloDetDescrManager.h
Definition of CaloDetDescrManager.
EMBPresamplerHVModule::getPhiMin
double getPhiMin() const
Definition: EMBPresamplerHVModule.cxx:75
CaloCell_ID.h
CaloCell_ID::hec_idHelper
const LArHEC_ID * hec_idHelper() const
access to HEC idHelper
Definition: CaloCell_ID.h:69
AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
HECHVManager.h
HECDetectorElement
LAr HEC Detector Element.
Definition: CaloDetectorElements.h:189
LArHVCondAlg::m_useCurrentFCAL1
Gaudi::Property< bool > m_useCurrentFCAL1
Definition: LArHVCondAlg.h:93
ReadCellNoiseFromCool.tile
tile
Definition: ReadCellNoiseFromCool.py:92
EMBHVManager::getHVModule
const EMBHVModule & getHVModule(unsigned int iSide, unsigned int iEta, unsigned int iPhi, unsigned int iSector) const
Definition: EMBHVManager.cxx:194
FCALHVLine.h
EMECHVManager::beginEtaIndex
unsigned int beginEtaIndex() const
Definition: EMECHVManager.cxx:212
HV_NON_NOMINAL_TOLERANCE
#define HV_NON_NOMINAL_TOLERANCE
Definition: LArHVCondAlg.cxx:41
LArHVCondAlg::makeAffectedRegionInfo
StatusCode makeAffectedRegionInfo(const EventContext &ctx, voltagePerLine_t &voltagePerLine) const
Definition: LArHVCondAlg.cxx:283
LArHVCondAlg::getElecList
std::vector< unsigned int > getElecList(const Identifier &id, const LArHVPathology &pathologies) const
Definition: LArHVCondAlg.cxx:738
EMBPresamplerHVManager
This class provides direct access to information on the HV electrodes within the barrels....
Definition: EMBPresamplerHVManager.h:37
EMBPresamplerHVManager::beginPhiIndex
unsigned int beginPhiIndex() const
Definition: EMBPresamplerHVManager.cxx:152
LArHVPathologyBits::MaskHV
static const unsigned short MaskHV
Definition: LArHVPathologiesDb.h:13
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
FCALTile
A tile of the forward calorimeter readout geometry.
Definition: FCALTile.h:27
dumpHVPathFromNtuple.hvline
hvline
Definition: dumpHVPathFromNtuple.py:72
EMBCell.h
LArHVPathologiesDb::LArHVElectPathologyDb::electInd
unsigned short electInd
Definition: LArHVPathologiesDb.h:24
HECHVModule::getSamplingIndex
unsigned int getSamplingIndex() const
Definition: HECHVModule.cxx:54
LArHVPathologiesDb.h
CaloAffectedRegionInfo::HVaffected
@ HVaffected
Definition: CaloAffectedRegionInfo.h:22
LArHVCondAlg::DCS_t
Definition: LArHVCondAlg.h:114
FCALHVLine
Definition: FCALHVLine.h:15
EMECHVModule::INNER
@ INNER
Definition: EMECHVModule.h:22
EMBHVElectrode::hvLineNo
int hvLineNo(int iGap, const LArHVIdMapping *hvIdMapping) const
Definition: EMBHVElectrode.cxx:43
LArEM_Base_ID::channel_hash
IdentifierHash channel_hash(Identifier channelId) const
create hash id from channel id
LArFCAL_Base_ID::channel_ids
const std::vector< Identifier > & channel_ids() const
provide acces to channel id vector, accessed via hash
LArHVCondAlg::m_DCSFolderKeys
SG::ReadCondHandleKeyArray< CondAttrListCollection > m_DCSFolderKeys
Definition: LArHVCondAlg.h:71
HECHVManager::endSideIndex
static unsigned int endSideIndex()
Definition: HECHVManager.cxx:169
LArHVCondAlg::HV_nominal
float HV_nominal(const char *identification, const float eta) const
Definition: LArHVCondAlg.cxx:1473
LArOnlineID_Base::feb_range
id_range feb_range() const
Definition: LArOnlineID_Base.cxx:1920
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LArHVCondAlg::initialize
virtual StatusCode initialize() override
Definition: LArHVCondAlg.cxx:46
LArHVCondAlg::voltagePerCell_t
std::vector< voltageCell_t > voltagePerCell_t
Definition: LArHVCondAlg.h:134
lumiFormat.i
int i
Definition: lumiFormat.py:92
FCALHVModule::getNumHVLines
static unsigned int getNumHVLines()
Definition: FCALHVModule.cxx:67
CaloSampling::CaloSample
CaloSample
Definition: Calorimeter/CaloGeoHelpers/CaloGeoHelpers/CaloSampling.h:22
EMBPresamplerHVModule::getEtaMax
double getEtaMax() const
Definition: EMBPresamplerHVModule.cxx:65
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
LArOnlineID_Base::channelInSlotMax
int channelInSlotMax(const HWIdentifier Id) const
Return the Maximum channel number of a given feb slot.
Definition: LArOnlineID_Base.cxx:286
EMBHVElectrode::getElectrodeIndex
unsigned int getElectrodeIndex() const
Definition: EMBHVElectrode.cxx:48
HECHVModule::getSubgap
const HECHVSubgap & getSubgap(unsigned int iElectrode) const
Definition: HECHVModule.cxx:69
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
LArHVCondAlg::m_electrodeID
const LArElectrodeID * m_electrodeID
Definition: LArHVCondAlg.h:107
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
FCALTile.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
extractSporadic.h
list h
Definition: extractSporadic.py:97
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
EMBHVModule::getEtaMin
double getEtaMin() const
Definition: EMBHVModule.cxx:79
EMECHVModule::getEtaMax
double getEtaMax() const
Definition: EMECHVModule.cxx:116
FCALDetectorElement
LAr FCAL Detector Element.
Definition: CaloDetectorElements.h:261
LArHVCondAlg::searchNonNominalHV_EMB
StatusCode searchNonNominalHV_EMB(CaloAffectedRegionInfoVec *vAffected, const LArHVIdMapping *hvCabling, const voltagePerLine_t &voltage) const
Definition: LArHVCondAlg.cxx:784
HECHVSubgap::hvLineNo
int hvLineNo(const LArHVIdMapping *hvIdMapping) const
Definition: HECHVSubgap.cxx:45
HECHVManager::endSamplingIndex
static unsigned int endSamplingIndex()
Definition: HECHVManager.cxx:189
LArHVCondAlg::m_fixHVStrings
Gaudi::Property< std::vector< std::string > > m_fixHVStrings
Definition: LArHVCondAlg.h:100
LArHVCondAlg::m_calocellID
const CaloCell_ID * m_calocellID
Definition: LArHVCondAlg.h:103
LArOnlineID_Base::channel_Id
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
Definition: LArOnlineID_Base.cxx:1569
LArHVCondAlg::m_BFKey
SG::ReadCondHandleKey< LArBadFebCont > m_BFKey
Definition: LArHVCondAlg.h:73
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
CaloPhiRange.h
CaloPhiRange class declaration.
EMBPresamplerHVModule::hvLineNo
int hvLineNo(int iGap, const LArHVIdMapping *hvIdMapping) const
Definition: EMBPresamplerHVModule.cxx:91
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthenaAttributeList
An AttributeList represents a logical row of attributes in a metadata table. The name and type of eac...
Definition: PersistentDataModel/PersistentDataModel/AthenaAttributeList.h:45
AtlasDetectorID::is_lar_hec
bool is_lar_hec(Identifier id) const
Definition: AtlasDetectorID.h:829
LArElectrodeID::electrodeHashMax
size_type electrodeHashMax(void) const
Define hash tables max size.
Definition: LArElectrodeID.h:341
EMECCell.h
EMBPresamplerHVModule::getEtaIndex
unsigned int getEtaIndex() const
Definition: EMBPresamplerHVModule.cxx:40
LArHVCondAlg::m_doHV
Gaudi::Property< bool > m_doHV
Definition: LArHVCondAlg.h:89
CaloPhiRange::twopi
static double twopi()
Definition: CaloPhiRange.h:46
LArHVCondAlg::m_larem_id
const LArEM_ID * m_larem_id
Definition: LArHVCondAlg.h:104
LArHVCondAlg::m_larfcal_id
const LArFCAL_ID * m_larfcal_id
Definition: LArHVCondAlg.h:106
LArHEC_Base_ID::channel_hash
IdentifierHash channel_hash(Identifier channelId) const
create hash id from channel id
LArHVCondAlg::m_doR
bool m_doR
Definition: LArHVCondAlg.h:95
EMECPresamplerHVModule::getEtaMax
double getEtaMax() const
Definition: EMECPresamplerHVModule.cxx:52
LArHVCondAlg::fillPathAndCellHV
StatusCode fillPathAndCellHV(const CaloDetDescrManager *calodetdescrmgr, voltagePerCell_t &hvdata, const LArHVIdMapping *hvCabling, const voltagePerLine_t &voltage, const LArHVPathology &pathologies, pathVec &hasPathologyEM, pathVec &hasPathologyHEC, pathVec &hasPathologyFCAL, const float *rValues) const
Read the voltage per HV line and store it in structure per readout-cell (resolve the many-HV-lines-to...
Definition: LArHVCondAlg.cxx:360
HECHVSubgap.h
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
EMECHVModule::getEtaIndex
unsigned int getEtaIndex() const
Definition: EMECHVModule.cxx:60
EMBPresamplerHVManager::endEtaIndex
unsigned int endEtaIndex() const
Definition: EMBPresamplerHVManager.cxx:167
HECHVSubgap::getModule
const HECHVModule & getModule() const
Definition: HECHVSubgap.cxx:34
CaloPhiRange::fix
static double fix(double phi)
Definition: CaloPhiRange.cxx:14
LArHVCondAlg::m_larhec_id
const LArHEC_ID * m_larhec_id
Definition: LArHVCondAlg.h:105
EMECPresamplerHVModule::getPhiMin
double getPhiMin() const
Definition: EMECPresamplerHVModule.cxx:58
HECHVModule::getSideIndex
unsigned int getSideIndex() const
Definition: HECHVModule.cxx:49
HECHVModule::getNumSubgaps
static unsigned int getNumSubgaps()
Definition: HECHVModule.cxx:64
LArHVCondAlg::addDepFcn_t
std::function< const EventIDRange &(SG::ReadCondHandle< CondAttrListCollection > &h)> addDepFcn_t
Definition: LArHVCondAlg.h:144
HECHVSubgap::getSubgapIndex
unsigned int getSubgapIndex() const
Definition: HECHVSubgap.cxx:39
LArHVPathologiesDb::LArHVElectPathologyDb::pathologyType
unsigned short pathologyType
Definition: LArHVPathologiesDb.h:25
AtlasDetectorID::print_to_string
std::string print_to_string(Identifier id, const IdContext *context=0) const
or provide the printout in string form
Definition: AtlasDetectorID.cxx:655
LArHVCondAlg::updateMethod
StatusCode updateMethod(const EventContext &ctx, CaloAffectedRegionInfoVec *vAffected, const LArBadFebCont *bfCont, const LArOnOffIdMapping *cabling) const
Definition: LArHVCondAlg.cxx:1383
IOVInfiniteRange.h
EMBHVManager::beginPhiIndex
unsigned int beginPhiIndex() const
Definition: EMBHVManager.cxx:174
EMECHVModule::getNumElectrodes
unsigned int getNumElectrodes() const
Definition: EMECHVModule.cxx:70
EMBPresamplerHVModule.h
EMECPresamplerHVModule::hvLineNo
int hvLineNo(int iGap, const LArHVIdMapping *hvIdMapping) const
Definition: EMECPresamplerHVModule.cxx:74
EMBHVElectrode::getModule
const EMBHVModule & getModule() const
Definition: EMBHVElectrode.cxx:32
LArHVCondAlg::searchNonNominalHV_FCAL
StatusCode searchNonNominalHV_FCAL(CaloAffectedRegionInfoVec *vAffected, const LArHVIdMapping *hvCabling, const voltagePerLine_t &voltage) const
Definition: LArHVCondAlg.cxx:1308
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
EMBPresamplerHVModule::getSideIndex
unsigned int getSideIndex() const
Definition: EMBPresamplerHVModule.cxx:50
LArEM_Base_ID::barrel_ec
int barrel_ec(const Identifier id) const
return barrel_ec according to :
FCALHVModule::getSectorIndex
unsigned int getSectorIndex() const
Definition: FCALHVModule.cxx:62
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
EMBHVManager
This class provides direct access to information on the HV electrodes within the barrels....
Definition: EMBHVManager.h:36
EMECHVManager::endSideIndex
static unsigned int endSideIndex()
Definition: EMECHVManager.cxx:235
HECHVModule::getPhiMax
double getPhiMax() const
Definition: HECHVModule.cxx:84
LArHVCondAlg::m_nPathologies
std::atomic< unsigned > m_nPathologies
Definition: LArHVCondAlg.h:205
EMECHVElectrode::getModule
const EMECHVModule & getModule() const
Definition: EMECHVElectrode.cxx:37
EMBDetectorElement::getEMBCell
EMBCellConstLink getEMBCell() const
EMB Cell description from LArReadoutGeometry.
Definition: CaloDetectorElements.h:77
EMBPresamplerHVManager::beginEtaIndex
unsigned int beginEtaIndex() const
Definition: EMBPresamplerHVManager.cxx:162
LArHVCondAlg::m_undoOnlineHVCorr
Gaudi::Property< bool > m_undoOnlineHVCorr
Definition: LArHVCondAlg.h:91
FCALHVModule::getHVLine
const FCALHVLine & getHVLine(unsigned int iLine) const
Definition: FCALHVModule.cxx:72
LArHVCondAlg::m_onlineID
const LArOnlineID * m_onlineID
Definition: LArHVCondAlg.h:109
EMBPresamplerHVManager::beginSideIndex
static unsigned int beginSideIndex()
Definition: EMBPresamplerHVManager.cxx:177
LArHVCondAlg::m_outputHVScaleCorrKey
SG::WriteCondHandleKey< LArHVCorr > m_outputHVScaleCorrKey
Definition: LArHVCondAlg.h:86
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:53
EMBHVModule::getSideIndex
unsigned int getSideIndex() const
Definition: EMBHVModule.cxx:74
EMECHVModule::OUTER
@ OUTER
Definition: EMECHVModule.h:22
MAX_LAR_CELLS
#define MAX_LAR_CELLS
Definition: LArHVCondAlg.cxx:43
python.PyAthena.v
v
Definition: PyAthena.py:157
LArHVCondAlg::m_caloMgrKey
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition: LArHVCondAlg.h:78
FCALHVManager::endSamplingIndex
static unsigned int endSamplingIndex()
Definition: FCALHVManager.cxx:185
HECHVManager
This class provides direct access to information on the HV electrodes within the barrels....
Definition: HECHVManager.h:36
CaloDetDescrElement::dphi
float dphi() const
cell dphi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:358
FCALHVManager::beginSectorIndex
static unsigned int beginSectorIndex(unsigned int iSampling)
Definition: FCALHVManager.cxx:167
CaloDetDescrElement::is_lar_em_barrel
bool is_lar_em_barrel() const
cell belongs to EM barrel
Definition: CaloDetDescrElement.cxx:98
DeMoScan.index
string index
Definition: DeMoScan.py:362
LArHVCondAlg::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: LArHVCondAlg.h:74
EMECPresamplerHVModule::getPhiMax
double getPhiMax() const
Definition: EMECPresamplerHVModule.cxx:63
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
CaloDetDescrElement::getLayer
virtual int getLayer() const
cell layer
Definition: CaloDetDescrElement.cxx:85
LArHVManager
This class provides access to the High Voltage throughout the LAr. High voltage conditions can also b...
Definition: LArHVManager.h:24
LArHVIdMapping
Definition: LArHVIdMapping.h:21
h
CaloDetDescrManager
This class provides the client interface for accessing the detector description information common to...
Definition: CaloDetDescrManager.h:473
EMBHVElectrode::getPhi
double getPhi() const
Definition: EMBHVElectrode.cxx:37
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
LArHVCondAlg::m_useCurrentOthers
Gaudi::Property< bool > m_useCurrentOthers
Definition: LArHVCondAlg.h:94
FCALHVManager.h
CaloDetDescrElement::getSampling
CaloCell_ID::CaloSample getSampling() const
cell sampling
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:395
LArHVCondAlg::m_doAffectedHV
Gaudi::Property< bool > m_doAffectedHV
Definition: LArHVCondAlg.h:98
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
CondAttrListCollection::const_iterator
ChanAttrListMap::const_iterator const_iterator
Definition: CondAttrListCollection.h:63
HECHVManager::endPhiIndex
static unsigned int endPhiIndex()
Definition: HECHVManager.cxx:179
EMECHVManager::beginPhiIndex
unsigned int beginPhiIndex() const
Definition: EMECHVManager.cxx:202
LArHVCondAlg::m_scaleTool
std::unique_ptr< const LArHVScaleCorrTool > m_scaleTool
Definition: LArHVCondAlg.h:111
LArHVCondAlg::searchNonNominalHV_EMEC_OUTER
StatusCode searchNonNominalHV_EMEC_OUTER(CaloAffectedRegionInfoVec *vAffected, const LArHVIdMapping *hvCabling, const voltagePerLine_t &voltage) const
Definition: LArHVCondAlg.cxx:942
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
HECHVModule::getPhiMin
double getPhiMin() const
Definition: HECHVModule.cxx:79
LArHVCondAlg::getVoltagePerLine
StatusCode getVoltagePerLine(const EventContext &ctx, voltagePerLine_t &voltagePerLine, const addDepFcn_t &addDep) const
Definition: LArHVCondAlg.cxx:330
EMBHVModule::getPhiIndex
unsigned int getPhiIndex() const
Definition: EMBHVModule.cxx:54
EMECHVElectrode::getElectrodeIndex
unsigned int getElectrodeIndex() const
Definition: EMECHVElectrode.cxx:27
FCALHVManager::endSectorIndex
static unsigned int endSectorIndex(unsigned int iSampling)
Definition: FCALHVManager.cxx:172
EMECPresamplerHVModule
Describes one HV Module within the EMEc Presampler.
Definition: EMECPresamplerHVModule.h:22
LArHVPathology
Definition: LArHVPathology.h:15
EMBHVModule::getElectrode
const EMBHVElectrode & getElectrode(unsigned int iElectrode) const
Definition: EMBHVModule.cxx:69
FCALHVModule
Describes one HV Module within the FCAL.
Definition: FCALHVModule.h:20
CaloDetDescrElement::eta
float eta() const
cell eta
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:344
EMECHVManager::beginSectorIndex
unsigned int beginSectorIndex() const
Definition: EMECHVManager.cxx:240
FCALHVManager::beginSideIndex
static unsigned int beginSideIndex()
Definition: FCALHVManager.cxx:157
python.Logging.manager
manager
Definition: PhysicsAnalysis/D3PDTools/AnaAlgorithm/python/Logging.py:92
CaloDetDescrElement::phi
float phi() const
cell phi
Definition: Calorimeter/CaloDetDescr/CaloDetDescr/CaloDetDescrElement.h:346
LArElectrodeID.h
HECHVManager::beginSamplingIndex
static unsigned int beginSamplingIndex()
Definition: HECHVManager.cxx:184
EMBHVManager::endSectorIndex
static unsigned int endSectorIndex()
Definition: EMBHVManager.cxx:204
EMECPresamplerHVManager::endPhiIndex
unsigned int endPhiIndex() const
Definition: EMECPresamplerHVManager.cxx:147
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
EMECHVElectrode
Definition: EMECHVElectrode.h:15
HECDetectorElement::getHECCell
HECCellConstLink getHECCell() const
HEC Cell description from LArReadoutGeometry.
Definition: CaloDetectorElements.h:214
EMECHVManager
This class provides direct access to information on the HV electrodes within the EMEC....
Definition: EMECHVManager.h:36
SG::ReadCondHandle::key
const std::string & key() const
Definition: ReadCondHandle.h:59
LArEM_Base_ID::channel_ids
const std::vector< Identifier > & channel_ids() const
provide access to channel id vector, accessed via hash
IdentifierHash
Definition: IdentifierHash.h:38
fillSCTHists.etaMod
etaMod
Definition: fillSCTHists.py:23
EMECHVModule.h
HECCell.h
EMBHVModule
Describes one HV Module within the EMB.
Definition: EMBHVModule.h:20
EMBHVManager::endSideIndex
static unsigned int endSideIndex()
Definition: EMBHVManager.cxx:214
LArHEC_Base_ID::channel_ids
const std::vector< Identifier > & channel_ids() const
provide access to channel id vector, accessed via hash
EMBPresamplerHVModule::getPhiMax
double getPhiMax() const
Definition: EMBPresamplerHVModule.cxx:80
LArOnlineID_Base::channel_name
std::string channel_name(const HWIdentifier id) const
Return a string corresponding to a feedthrough name given an identifier.
Definition: LArOnlineID_Base.cxx:218
EMBPresamplerHVManager::getHVModule
const EMBPresamplerHVModule & getHVModule(unsigned int iSide, unsigned int iEta, unsigned int iPhi) const
Definition: EMBPresamplerHVManager.cxx:172
xAOD::iEta
setScale setgFexType iEta
Definition: gFexJetRoI_v1.cxx:74
LArHVCondAlg::voltageCell_t
LArHVScaleCorrTool::voltageCell_t voltageCell_t
Definition: LArHVCondAlg.h:132
FCALHVManager
This class provides direct access to information on the HV electrodes within the barrels....
Definition: FCALHVManager.h:35
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
AtlasDetectorID::is_lar_em
bool is_lar_em(Identifier id) const
Definition: AtlasDetectorID.h:818
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
LArHVPathologiesDb::LArHVElectPathologyDb
Definition: LArHVPathologiesDb.h:22
HECHVSubgap
Definition: HECHVSubgap.h:15
EMECHVElectrode::hvLineNo
int hvLineNo(int iGap, const LArHVIdMapping *hvIdMapping) const
Definition: EMECHVElectrode.cxx:49
readCCLHist.float
float
Definition: readCCLHist.py:83
EMBHVManager.h
HECHVManager::getHVModule
const HECHVModule & getHVModule(unsigned int iSide, unsigned int iPhi, unsigned int iSampling) const
Definition: HECHVManager.cxx:194
EMBPresamplerHVModule
Describes one HV Module within the EMB Presampler.
Definition: EMBPresamplerHVModule.h:22
CaloCell_ID::fcal_idHelper
const LArFCAL_ID * fcal_idHelper() const
access to FCAL idHelper
Definition: CaloCell_ID.h:75
FCALHVManager::beginSamplingIndex
static unsigned int beginSamplingIndex()
Definition: FCALHVManager.cxx:180
CaloDetectorElements.h
Calo Subsystem specific Detector Elements + Dummy element for testing.
LArOnlineID.h
FCALHVManager::endSideIndex
static unsigned int endSideIndex()
Definition: FCALHVManager.cxx:162
EMECHVModule::getSideIndex
unsigned int getSideIndex() const
Definition: EMECHVModule.cxx:91
LArHVCondAlg::m_hvMappingKey
SG::ReadCondHandleKey< LArHVIdMapping > m_hvMappingKey
Definition: LArHVCondAlg.h:75
LArHVCondAlg::m_affectedKey
SG::WriteCondHandleKey< CaloAffectedRegionInfoVec > m_affectedKey
Definition: LArHVCondAlg.h:81
CaloPhiRange::diff
static double diff(double phi1, double phi2)
simple phi1 - phi2 calculation, but result is fixed to respect range.
Definition: CaloPhiRange.cxx:22
LArHVCondAlg::addHV
void addHV(voltageCell_t &v, float hv, float weight) const
Add voltage/weight for a sub-gap of a cell.
Definition: LArHVCondAlg.cxx:723
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20
EMECHVModule::getSectorIndex
unsigned int getSectorIndex() const
Definition: EMECHVModule.cxx:101