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