ATLAS Offline Software
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
LArBadChannelHunter Class Reference

#include <LArBadChannelHunter.h>

Inheritance diagram for LArBadChannelHunter:
Collaboration diagram for LArBadChannelHunter:

Classes

class  Average
 
class  CellData
 

Public Member Functions

 LArBadChannelHunter (const std::string &name, ISvcLocator *pSvcLocator)
 Regular algorithm constructor. More...
 
 ~LArBadChannelHunter ()
 Destructor. More...
 
virtual StatusCode initialize () override
 Standard initialization method. More...
 
virtual StatusCode execute () override
 Standard execute method This method has to be emtpy since all the job is done in finalize. More...
 
virtual StatusCode stop ATLAS_NOT_THREAD_SAFE () override
 Standard stop method. More...
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

enum  AvgType { FEB, PHI }
 
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

const std::string channelDescription (const HWIdentifier &chid, const LArOnOffIdMapping *cabling, const unsigned gain=99) const
 
unsigned getSymId (const HWIdentifier, const LArOnOffIdMapping *cabling) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

const LArOnlineIDm_onlineId
 
const CaloCell_IDm_caloId
 
SG::ReadCondHandleKey< LArOnOffIdMappingm_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
 
SG::ReadCondHandleKey< LArBadChannelContm_BCKey {this, "BadChanKey", "LArBadChannel", "SG bad channels key"}
 
SG::ReadCondHandleKey< LArCalibLineMappingm_CLKey {this, "CalibLineKey", "LArCalibLineMap", "SG calib line key"}
 
std::string m_pedKey
 
std::string m_caliWaveKey
 
std::string m_avgTypeProp
 
std::string m_outFileName
 
std::string m_cutType
 
bool m_undoCorr
 
bool m_outOnlyNew
 
float m_recalcPer
 
float m_lowNoiseTh [CaloGain::LARNGAIN] {}
 
float m_highNoiseTh [CaloGain::LARNGAIN] {}
 
float m_amplTh [CaloGain::LARNGAIN] {}
 
float m_widTh [CaloGain::LARNGAIN] {}
 
float m_distwidTh [CaloGain::LARNGAIN] {}
 
float m_distampTh [CaloGain::LARNGAIN] {}
 
float m_tmaxampTh [CaloGain::LARNGAIN] {}
 
AvgType m_avgType
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 34 of file LArBadChannelHunter.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Enumeration Documentation

◆ AvgType

Enumerator
FEB 
PHI 

Definition at line 91 of file LArBadChannelHunter.h.

91  {
92  FEB,
93  PHI
94  };

Constructor & Destructor Documentation

◆ LArBadChannelHunter()

LArBadChannelHunter::LArBadChannelHunter ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Regular algorithm constructor.

Definition at line 19 of file LArBadChannelHunter.cxx.

19  :
20  AthAlgorithm(name,pSvcLocator),
21  m_onlineId(0),
22  m_caloId(0),
23  m_avgType(FEB) {
24 
25  declareProperty("PedestalKey", m_pedKey="", "Key of the pedestal container");
26  declareProperty("CaliWaveKey", m_caliWaveKey="", "Key of the CaliWave container");
27 
28  declareProperty("OutFileName", m_outFileName="", "File for text output");
29  declareProperty("OutOnlyNew", m_outOnlyNew=false, "remove all known bad channels in output list");
30  declareProperty("AverageType", m_avgTypeProp="FEB", "Reference options: average over 'FEB' or 'PHI'");
31  declareProperty("UndoCorrections", m_undoCorr=false, "go back to unpatched values for cali-waves");
32 
33  declareProperty("CutType", m_cutType="SIG", "Cut criteria: bad if deviation > X 'SIG' (sigma) or 'PER' (percent)");
34  declareProperty("RecalcPer", m_recalcPer=0.03, "Condition cuts to do recalculation, <=0 means NO recalculation");
35 
36 
38  declareProperty("LowNoiseThresholdHG",m_lowNoiseTh[CaloGain::LARHIGHGAIN]=6.0,
39  "Channels with pedestal rms x sigma or percent above average are tagged 'low noise' (in high gain) ");
40  declareProperty("LowNoiseThresholdMG",m_lowNoiseTh[CaloGain::LARMEDIUMGAIN]=6.0,
41  "Channels with pedestal rms x sigma or percent above average are tagged 'low noise' (in medium gain) ");
42  declareProperty("LowNoiseThresholdLG",m_lowNoiseTh[CaloGain::LARLOWGAIN]=6.0,
43  "Channels with pedestal rms x sigma or percent above average are tagged 'low noise' (in low gain) ");
44 
45  declareProperty("HighNoiseThresholdHG",m_highNoiseTh[CaloGain::LARHIGHGAIN]=50.0,
46  "Channels with pedestal rms x sigma or percent above average are tagged 'High noise' (in high gain) ");
47  declareProperty("HighNoiseThresholdMG",m_highNoiseTh[CaloGain::LARMEDIUMGAIN]=50.0,
48  "Channels with pedestal rms x sigma or percent above average are tagged 'High noise' (in medium gain) ");
49  declareProperty("HighNoiseThresholdLG",m_highNoiseTh[CaloGain::LARLOWGAIN]=50.0,
50  "Channels with pedestal rms x sigma or percent above average are tagged 'High noise' (in low gain) ");
51 
53  declareProperty("DeadThresholdAmpHG",m_amplTh[CaloGain::LARHIGHGAIN]=60.0,
54  "Channels with amplitudes x sigma or percent above the average are tagged as 'deadReadout' or 'deadCalib' (H gain)");
55  declareProperty("DeadThresholdAmpMG",m_amplTh[CaloGain::LARMEDIUMGAIN]=60.0,
56  "Channels with amplitudes x sigma or percent above the average are tagged as 'deadReadout' or 'deadCalib' (M gain)");
57  declareProperty("DeadThresholdAmpLG",m_amplTh[CaloGain::LARLOWGAIN]=60.0,
58  "Channels with amplitudes x sigma or percent above the average are tagged as 'deadReadout' or 'deadCalib' (L gain)");
59 
60  declareProperty("DistortThresholdAmpHG",m_distampTh[CaloGain::LARHIGHGAIN]=5.0,
61  "Channels with a width x sigma or percent above the average are tagged as 'distorted' (H gain)");
62  declareProperty("DistortThresholdAmpMG",m_distampTh[CaloGain::LARMEDIUMGAIN]=5.0,
63  "Channels with a width x sigma or percent above the average are tagged as 'distorted' (M gain)");
64  declareProperty("DistortThresholdAmpLG",m_distampTh[CaloGain::LARLOWGAIN]=5.0,
65  "Channels with a width x sigma or percent above the average are tagged as 'distorted' (L gain)");
66 
68  declareProperty("DeadThresholdWidHG",m_widTh[CaloGain::LARHIGHGAIN]=100.0,
69  "Channels with a width x sigma or percent above the average are tagged as 'deadReadout' or 'deadCalib' (H gain)");
70  declareProperty("DeadThresholdWidMG",m_widTh[CaloGain::LARMEDIUMGAIN]=100.0,
71  "Channels with a width x sigma or percent above the average are tagged as 'deadReadout' or 'deadCalib' (M gain)");
72  declareProperty("DeadThresholdWidLG",m_widTh[CaloGain::LARLOWGAIN]=100.0,
73  "Channels with a width x sigma or percent above the average are tagged as 'deadReadout' or 'deadCalib' (L gain)");
74 
75  declareProperty("DistortThresholdWidHG",m_distwidTh[CaloGain::LARHIGHGAIN]=4.0,
76  "Channels with a width x sigma or percent above the average are tagged as 'distorted' (H gain)");
77  declareProperty("DistortThresholdWidMG",m_distwidTh[CaloGain::LARMEDIUMGAIN]=4.0,
78  "Channels with a width x sigma or percent above the average are tagged as 'distorted' (M gain)");
79  declareProperty("DistortThresholdWidLG",m_distwidTh[CaloGain::LARLOWGAIN]=4.0,
80  "Channels with a width x sigma or percent above the average are tagged as 'distorted' (L gain)");
81 
83  declareProperty("DistortThresholdTmaxHG",m_tmaxampTh[CaloGain::LARHIGHGAIN]=5.0,
84  "Distorted with a TamxAmpl x sigma or percent above the average are tagged as 'distorted' (H gain)");
85  declareProperty("DistortThresholdTmaxMG",m_tmaxampTh[CaloGain::LARMEDIUMGAIN]=5.0,
86  "Distorted with a TamxAmpl x sigma or percent above the average are tagged as 'distorted' (M gain)");
87  declareProperty("DistortThresholdTmaxLG",m_tmaxampTh[CaloGain::LARLOWGAIN]=5.0,
88  "Distorted with a TamxAmpl x sigma or percent above the average are tagged as 'distorted' (L gain)");
89 }

◆ ~LArBadChannelHunter()

LArBadChannelHunter::~LArBadChannelHunter ( )
inline

Destructor.

Definition at line 45 of file LArBadChannelHunter.h.

45 {};

Member Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

virtual StatusCode stop LArBadChannelHunter::ATLAS_NOT_THREAD_SAFE ( )
overridevirtual

Standard stop method.

◆ channelDescription()

const std::string LArBadChannelHunter::channelDescription ( const HWIdentifier chid,
const LArOnOffIdMapping cabling,
const unsigned  gain = 99 
) const
private

the format of output is changed a bit to be consistent with the output format of validation tools

Definition at line 438 of file LArBadChannelHunter.cxx.

440  {
441 
444  std::ostringstream output;
445 
446  if (gain<=2)
447  output << "Gain:"<< gain << " ";
448 
449  output << "Channel [";
450 // output << " id=0x" << std::hex << chid.get_compact() << std::dec << " [";
451  if (m_onlineId->barrel_ec(chid)==0)
452  output << "Bar";
453  else
454  output << "End";
455 
456 // output << ",Side:";
457  if (m_onlineId->pos_neg(chid)==0)
458  output << ",C";
459  else
460  output << ",A";
461 
462  output << ",FT:" << m_onlineId->feedthrough(chid)
463  << ",Sl:" << m_onlineId->slot(chid);
464 
465  output << ",Ch:" << m_onlineId->channel(chid);
466  if (!m_onlineId->isCalibration(chid)) {
467  try {
468  if (cabling->isOnlineConnected(chid)) {
469  if (m_onlineId->isFCALchannel(chid))
470  output << ",FCAL";
471  if (m_onlineId->isHECchannel(chid))
472  output << ",HEC";
473  if (m_onlineId->isEMBchannel(chid))
474  output << ",EMB";
475  if (m_onlineId->isEMECchannel(chid))
476  output << ",EMEC";
477  }//end if is connected
478  else
479  output << ",disconnected";
480  }
481  catch (LArID_Exception&) {}
482  }//end if !isCalibration
483  output << "]";
484  return output.str();
485 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

virtual StatusCode LArBadChannelHunter::execute ( )
inlineoverridevirtual

Standard execute method This method has to be emtpy since all the job is done in finalize.

Definition at line 56 of file LArBadChannelHunter.h.

56 {return StatusCode::SUCCESS;}

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ getSymId()

unsigned LArBadChannelHunter::getSymId ( const HWIdentifier  chid,
const LArOnOffIdMapping cabling 
) const
private

Definition at line 651 of file LArBadChannelHunter.cxx.

651  {
652  if (m_avgType==FEB)
653  return m_onlineId->feb_Id(chid).get_identifier32().get_compact();
654  else {
655  const unsigned caloRegionHashMax=m_caloId->calo_region_hash_max();
656  const Identifier id=cabling->cnvToIdentifier(chid);
657  const Identifier regid=m_caloId->region_id(id);
658  const unsigned reghash=m_caloId->calo_region_hash(regid);
659  const int eta=m_caloId->eta(id);
660 
661 
662 
663  if (eta<0 || eta==CaloCell_ID::NOT_VALID || regid==CaloCell_ID::NOT_VALID ||reghash==CaloCell_ID::NOT_VALID || caloRegionHashMax!=64) {
664  std::cout << "ERROR unexpected idetifier:"
665  << std::hex << " id=0x" << id << " regionId=0x" << regid
666  << std::dec << " reghash=" << reghash << " eta=" << eta
667  << " caloRegionHashMax=" << caloRegionHashMax
668  << std::endl;
669  assert(0);
670  }
671  //can't reach here if eta is negative
672  //cppcheck-suppress shiftNegativeLHS
673  const unsigned retval= (eta<<8) | reghash;
674  return retval;
675  }
676 }

◆ initialize()

StatusCode LArBadChannelHunter::initialize ( )
overridevirtual

Standard initialization method.

Definition at line 92 of file LArBadChannelHunter.cxx.

92  {
93  if (m_avgTypeProp=="FEB")
94  m_avgType=FEB;
95  else if (m_avgTypeProp=="PHI")
96  m_avgType=PHI;
97  else {
98  ATH_MSG_ERROR ( "Unknown AverageType " << m_avgTypeProp << ". Allowed values are 'FEB' or 'PHI'" ) ;
99  return StatusCode::FAILURE;
100  }
101 
102  for (int i=0; i < CaloGain::LARNGAIN; i++) {
103  if (m_lowNoiseTh[i]>=m_highNoiseTh[i]) {
104  ATH_MSG_ERROR ( "Low noise threshold (" << m_lowNoiseTh << ") is supposed to lower than the high noise threshold ("
105  << m_highNoiseTh << ")" ) ;
106  return StatusCode::FAILURE;
107  }
108  }
110  ATH_CHECK( m_BCKey.initialize() );
112 
113  return StatusCode::SUCCESS;
114 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg() [1/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_amplTh

float LArBadChannelHunter::m_amplTh[CaloGain::LARNGAIN] {}
private

Definition at line 86 of file LArBadChannelHunter.h.

◆ m_avgType

AvgType LArBadChannelHunter::m_avgType
private

Definition at line 96 of file LArBadChannelHunter.h.

◆ m_avgTypeProp

std::string LArBadChannelHunter::m_avgTypeProp
private

Definition at line 75 of file LArBadChannelHunter.h.

◆ m_BCKey

SG::ReadCondHandleKey<LArBadChannelCont> LArBadChannelHunter::m_BCKey {this, "BadChanKey", "LArBadChannel", "SG bad channels key"}
private

Definition at line 71 of file LArBadChannelHunter.h.

◆ m_cablingKey

SG::ReadCondHandleKey<LArOnOffIdMapping> LArBadChannelHunter::m_cablingKey {this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"}
private

Definition at line 70 of file LArBadChannelHunter.h.

◆ m_caliWaveKey

std::string LArBadChannelHunter::m_caliWaveKey
private

Definition at line 74 of file LArBadChannelHunter.h.

◆ m_caloId

const CaloCell_ID* LArBadChannelHunter::m_caloId
private

Definition at line 68 of file LArBadChannelHunter.h.

◆ m_CLKey

SG::ReadCondHandleKey<LArCalibLineMapping> LArBadChannelHunter::m_CLKey {this, "CalibLineKey", "LArCalibLineMap", "SG calib line key"}
private

Definition at line 72 of file LArBadChannelHunter.h.

◆ m_cutType

std::string LArBadChannelHunter::m_cutType
private

Definition at line 77 of file LArBadChannelHunter.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_distampTh

float LArBadChannelHunter::m_distampTh[CaloGain::LARNGAIN] {}
private

Definition at line 89 of file LArBadChannelHunter.h.

◆ m_distwidTh

float LArBadChannelHunter::m_distwidTh[CaloGain::LARNGAIN] {}
private

Definition at line 88 of file LArBadChannelHunter.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_highNoiseTh

float LArBadChannelHunter::m_highNoiseTh[CaloGain::LARNGAIN] {}
private

Definition at line 84 of file LArBadChannelHunter.h.

◆ m_lowNoiseTh

float LArBadChannelHunter::m_lowNoiseTh[CaloGain::LARNGAIN] {}
private

Definition at line 83 of file LArBadChannelHunter.h.

◆ m_onlineId

const LArOnlineID* LArBadChannelHunter::m_onlineId
private

Definition at line 67 of file LArBadChannelHunter.h.

◆ m_outFileName

std::string LArBadChannelHunter::m_outFileName
private

Definition at line 76 of file LArBadChannelHunter.h.

◆ m_outOnlyNew

bool LArBadChannelHunter::m_outOnlyNew
private

Definition at line 79 of file LArBadChannelHunter.h.

◆ m_pedKey

std::string LArBadChannelHunter::m_pedKey
private

Definition at line 74 of file LArBadChannelHunter.h.

◆ m_recalcPer

float LArBadChannelHunter::m_recalcPer
private

Definition at line 80 of file LArBadChannelHunter.h.

◆ m_tmaxampTh

float LArBadChannelHunter::m_tmaxampTh[CaloGain::LARNGAIN] {}
private

Definition at line 90 of file LArBadChannelHunter.h.

◆ m_undoCorr

bool LArBadChannelHunter::m_undoCorr
private

Definition at line 78 of file LArBadChannelHunter.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_widTh

float LArBadChannelHunter::m_widTh[CaloGain::LARNGAIN] {}
private

Definition at line 87 of file LArBadChannelHunter.h.


The documentation for this class was generated from the following files:
LArBadChannelHunter::PHI
@ PHI
Definition: LArBadChannelHunter.h:93
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:79
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CaloCell_Base_ID::region_id
Identifier region_id(const int subCalo, const int barec_or_posneg, const int sampling_or_fcalmodule, const int region_or_dummy) const
Make a region ID from constituting fields and subCalo index; for (Mini)FCAL and Tiles,...
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
ReadCellNoiseFromCool.cabling
cabling
Definition: ReadCellNoiseFromCool.py:154
LArBadChannelHunter::m_highNoiseTh
float m_highNoiseTh[CaloGain::LARNGAIN]
Definition: LArBadChannelHunter.h:84
LArOnlineID_Base::slot
int slot(const HWIdentifier id) const
Return the slot number of a hardware cell identifier: slot = [1,15] Slot-ID in top part of the crat...
Definition: LArOnlineID_Base.cxx:1961
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
LArBadChannelHunter::m_caloId
const CaloCell_ID * m_caloId
Definition: LArBadChannelHunter.h:68
LArBadChannelHunter::m_outFileName
std::string m_outFileName
Definition: LArBadChannelHunter.h:76
LArBadChannelHunter::m_amplTh
float m_amplTh[CaloGain::LARNGAIN]
Definition: LArBadChannelHunter.h:86
LArBadChannelHunter::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition: LArBadChannelHunter.h:70
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
LArBadChannelHunter::m_outOnlyNew
bool m_outOnlyNew
Definition: LArBadChannelHunter.h:79
CaloGain::LARNGAIN
@ LARNGAIN
Definition: CaloGain.h:19
LArOnlineID_Base::barrel_ec
int barrel_ec(const HWIdentifier id) const
Return the position barrel or endcap of a hardware cell identifier: barrel_ec = [0,...
Definition: LArOnlineID_Base.cxx:1942
LArBadChannelHunter::m_CLKey
SG::ReadCondHandleKey< LArCalibLineMapping > m_CLKey
Definition: LArBadChannelHunter.h:72
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
LArBadChannelHunter::m_avgType
AvgType m_avgType
Definition: LArBadChannelHunter.h:96
LArBadChannelHunter::m_recalcPer
float m_recalcPer
Definition: LArBadChannelHunter.h:80
LArCellBinning_test.retval
def retval
Definition: LArCellBinning_test.py:112
CaloCell_Base_ID::calo_region_hash
IdentifierHash calo_region_hash(const Identifier regionId) const
create hash id from 'global' region id
LArBadChannelHunter::m_cutType
std::string m_cutType
Definition: LArBadChannelHunter.h:77
LArOnlineID_Base::isFCALchannel
bool isFCALchannel(const HWIdentifier id) const
Definition: LArOnlineID_Base.cxx:1657
LArBadChannelHunter::m_onlineId
const LArOnlineID * m_onlineId
Definition: LArBadChannelHunter.h:67
LArBadChannelHunter::m_tmaxampTh
float m_tmaxampTh[CaloGain::LARNGAIN]
Definition: LArBadChannelHunter.h:90
LArBadChannelHunter::FEB
@ FEB
Definition: LArBadChannelHunter.h:92
LArOnlineID_Base::channel
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
Definition: LArOnlineID_Base.cxx:1967
LArOnlineID::isEMECchannel
bool isEMECchannel(const HWIdentifier id) const override final
Definition: LArOnlineID.cxx:774
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
LArBadChannelHunter::m_BCKey
SG::ReadCondHandleKey< LArBadChannelCont > m_BCKey
Definition: LArBadChannelHunter.h:71
Identifier32::get_compact
value_type get_compact(void) const
Get the compact id.
Definition: Identifier32.h:171
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
LArBadChannelHunter::m_undoCorr
bool m_undoCorr
Definition: LArBadChannelHunter.h:78
lumiFormat.i
int i
Definition: lumiFormat.py:92
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
LArOnlineID_Base::pos_neg
int pos_neg(const HWIdentifier id) const
Return the side of a hardware cell identifier pos_neg = [0,1] positive-side or negative-side Barrel...
Definition: LArOnlineID_Base.cxx:1954
CaloCell_Base_ID::eta
int eta(const Identifier id) const
LAr field values (NOT_VALID == invalid request)
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
LArOnlineID_Base::feb_Id
HWIdentifier feb_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Create feb_Id from fields.
Definition: LArOnlineID_Base.cxx:1483
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
merge.output
output
Definition: merge.py:17
LArBadChannelHunter::m_caliWaveKey
std::string m_caliWaveKey
Definition: LArBadChannelHunter.h:74
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
LArOnlineID_Base::isCalibration
bool isCalibration(const HWIdentifier id) const
Definition: LArOnlineID_Base.cxx:1787
CaloGain::LARHIGHGAIN
@ LARHIGHGAIN
Definition: CaloGain.h:18
LArOnlineID_Base::isEMBchannel
bool isEMBchannel(const HWIdentifier id) const
Definition: LArOnlineID_Base.cxx:1652
CaloGain::LARMEDIUMGAIN
@ LARMEDIUMGAIN
Definition: CaloGain.h:18
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
LArOnlineID_Base::feedthrough
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
Definition: LArOnlineID_Base.cxx:1948
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
LArBadChannelHunter::m_avgTypeProp
std::string m_avgTypeProp
Definition: LArBadChannelHunter.h:75
LArBadChannelHunter::m_pedKey
std::string m_pedKey
Definition: LArBadChannelHunter.h:74
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
LArBadChannelHunter::m_widTh
float m_widTh[CaloGain::LARNGAIN]
Definition: LArBadChannelHunter.h:87
LArBadChannelHunter::m_distwidTh
float m_distwidTh[CaloGain::LARNGAIN]
Definition: LArBadChannelHunter.h:88
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
LArOnlineID::isHECchannel
bool isHECchannel(const HWIdentifier id) const override final
Definition: LArOnlineID.cxx:734
CaloGain::LARLOWGAIN
@ LARLOWGAIN
Definition: CaloGain.h:18
Identifier::get_identifier32
Identifier32 get_identifier32(void) const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
CaloCell_Base_ID::NOT_VALID
@ NOT_VALID
Definition: CaloCell_Base_ID.h:46
CaloCell_Base_ID::calo_region_hash_max
size_type calo_region_hash_max(void) const
cell 'global' region table max size
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
LArID_Exception
Exception class for LAr Identifiers.
Definition: LArID_Exception.h:20
LArBadChannelHunter::m_lowNoiseTh
float m_lowNoiseTh[CaloGain::LARNGAIN]
Definition: LArBadChannelHunter.h:83
LArBadChannelHunter::m_distampTh
float m_distampTh[CaloGain::LARNGAIN]
Definition: LArBadChannelHunter.h:89
fitman.k
k
Definition: fitman.py:528
ServiceHandle< ICondSvc >