7#include "CaloDetDescr/CaloDetDescrElement.h"
25 return StatusCode::SUCCESS;
36 return StatusCode::SUCCESS;
42 return StatusCode::FAILURE;
49 ATH_MSG_ERROR(
"Do not have Onl-Ofl cabling map for SuperCells !!!!");
50 return StatusCode::FAILURE;
58 return StatusCode::FAILURE;
65 return StatusCode::FAILURE;
73 return StatusCode::FAILURE;
78 const auto& badFebs = mfHdl->fullCont();
80 std::unique_ptr<LArDeadOTXCorrFactors> output=std::make_unique<LArDeadOTXCorrFactors>();
82 auto& scToHwidMap=output->get();
84 unsigned nDeadFebs = 0;
85 for (
const auto& idBF : badFebs) {
86 if (idBF.second.deadReadout()) {
90 const int nChans =
m_onlineID->channelInSlotMax(febid);
91 if (nChans < 1)
continue;
92 for (
int ch = 0; ch < nChans; ++ch) {
104 <<
" is ignored b/c of it's bad-channel word. Connected to deadFEB channel " <<
m_onlineID->channel_name(chid));
107 const unsigned nCell = (
m_scidtool->superCellToOfflineID(scID)).size();
111 return StatusCode::FAILURE;
113 const float convFactor = 12.5 * (1.0 / nCell) * (1.0 / dde->
sinTh());
115 scToHwidMap[scHwid].emplace_back(hashId, convFactor);
120 if(outputHdl.
record(std::move(output)).isFailure()) {
121 ATH_MSG_ERROR(
"Could not record LArOnOffMapping object with "
123 <<
" with EventRange " << outputHdl.
getRange()
124 <<
" into Conditions Store");
125 return StatusCode::FAILURE;
127 ATH_MSG_INFO(
"recorded new " << outputHdl.
key() <<
" with range " << outputHdl.
getRange() <<
" into Conditions Store");
132 ATH_MSG_INFO(
"Number of deadReadout FEBs for this IOV: " << nDeadFebs);
134 for (
const auto& p : scToHwidMap) {
135 ATH_MSG_DEBUG(
" SuperCell with id 0x" << std::hex << p.first.get_identifier32().get_compact() << std::dec <<
" connected to " << p.second.size()
136 <<
" deadFEB channels.");
137 for (
const auto& [
h, convFactor] : p.second) {
138 const HWIdentifier hwid = cablingHdl->createSignalChannelIDFromHash(
h);
143 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
LArBadXCont< LArBadChannel > LArBadChannelCont
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
Header file for AthHistogramAlgorithm.
This class groups all DetDescr information related to a CaloCell.
float sinTh() const
for algorithm working in transverse Energy
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
This class provides the client interface for accessing the detector description information common to...
value_type get_compact() const
Get the compact id.
This is a "hash" representation of an Identifier.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
bool good() const
Returns true if no problems at all (all bits at zero)
LArBC_t status(const HWIdentifier channel) const
Query the status of a particular channel or FEB This is the main client access method.
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
SG::ReadCondHandleKey< LArBadChannelCont > m_badSCKey
const CaloCell_ID * m_calo_id
virtual StatusCode initialize() override final
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
SG::WriteCondHandleKey< LArDeadOTXCorrFactors > m_outputKey
virtual StatusCode execute(const EventContext &ctx) const override final
ToolHandle< ICaloSuperCellIDTool > m_scidtool
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingSCKey
SG::ReadCondHandleKey< LArBadFebCont > m_MFKey
const LArOnlineID * m_onlineID
Identifier cnvToIdentifier(const HWIdentifier &sid) const
create an Identifier from a HWIdentifier (inline)
HWIdentifier createSignalChannelID(const Identifier &id) const
create a HWIdentifier from an Identifier (not inline)
const_pointer_type cptr()
const std::string & key() const
void addDependency(const EventIDRange &range)
const EventIDRange & getRange() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED