8#include "CaloDetDescr/CaloDetDescrElement.h"
30 return StatusCode::SUCCESS;
37 StatusCode
sc = StatusCode::SUCCESS;
41 ATH_MSG_ERROR(
"Call to LArCelldeadOTXAlg::buidMap returned an error");
42 return StatusCode::FAILURE;
46 std::unique_ptr<LArDeadOTXFromSC> deadHandle = std::make_unique<LArDeadOTXFromSC>();
52 return StatusCode::SUCCESS;
55 const unsigned int bcid = ctx.eventID().bunch_crossing_id();
59 std::vector<float> vecEnergies;
63 std::vector<float> cellEnergies(128, 0.f);
65 for (
const auto* supercell : *scells) {
69 uint32_t scIDHash = (
m_onlineSCID->channel_Hash(scHwid)).value();
71 const std::vector<unsigned short>& bcids = supercell->bcids();
72 const std::vector<int>& energies = supercell->energies();
73 const std::vector<bool>& satur = supercell->satur();
77 const size_t nBCIDs = bcids.size();
79 for (i = 0; i < nBCIDs && bcids[i] != bcid; i++)
88 vecEnergies[scIDHash]=scEne;
91 for(
size_t i=0;i<m_channels.size();i++){
92 std::vector<uint32_t>& chans = m_channels[i];
93 std::vector<float>& mults = m_multipliers.at(i);
95 std::fill(cellEnergies.begin(), cellEnergies.end(),0.f);
96 for(
size_t j=0; j<chans.size(); j++) {
97 if ( chans[j] < 0xfffffffe ) cellEnergies[j] = mults[j]*vecEnergies[chans[j]];
99 deadHandle->addFEB(m_febs[i],cellEnergies);
106 return StatusCode::SUCCESS;
111 sc = StatusCode::FAILURE;
122 ATH_MSG_ERROR(
"Do not have Onl-Ofl cabling map for SuperCells !!!!");
135 if (!caloMgrHandle.
isValid()) {
149 const std::vector<std::pair<unsigned int, LArBadFeb> >& badFebs = mfHdl->fullCont();
151 for (
const auto& idBF : badFebs) {
152 if (idBF.second.deadReadout()) {
154 m_febs.push_back(febid);
156 std::vector<float> vector_of_multipliers;
157 std::vector<uint32_t> vector_of_chans;
158 const int nChans =
m_onlineID->channelInSlotMax(febid);
163 vector_of_multipliers.resize(nChans,0.0);
164 vector_of_chans.resize(nChans,0xffffffff);
165 for (
int ch = 0; ch < nChans; ++ch) {
174 <<
" is ignored b/c of it's bad-channel word. Connected to deadFEB channel " <<
m_onlineID->channel_name(chid));
177 const unsigned nCell = (
m_scidtool->superCellToOfflineID(scID)).size();
180 ATH_MSG_INFO(
"No DetDescElement for cell hash : " << hashId);
183 const float convFactor = 12.5 * (1.0 / nCell) * (1.0 / dde->
sinTh());
184 vector_of_multipliers[ch]=convFactor;
185 vector_of_chans[ch]=hashidSC.
value();
188 m_multipliers.push_back(std::move(vector_of_multipliers));
189 m_channels.push_back(std::move(vector_of_chans));
193 sc = StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
LArBadXCont< LArBadChannel > LArBadChannelCont
Handle class for recording to StoreGate.
const ServiceHandle< StoreGateSvc > & detStore() const
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.
const LArOnline_SuperCellID * m_onlineSCID
ToolHandle< ICaloSuperCellIDTool > m_scidtool
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
const LArOnlineID * m_onlineID
SG::ReadCondHandleKey< LArBadChannelCont > m_badSCKey
virtual StatusCode initialize() override final
virtual StatusCode execute(const EventContext &ctx) const override final
const CaloCell_ID * m_calo_id
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Gaudi::Property< int > m_scCut
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingSCKey
SG::ReadHandleKey< LArRawSCContainer > m_SCKey
void buildMap(const EventContext &ctx, StatusCode &sc) const
SG::WriteHandleKey< LArDeadOTXFromSC > m_deadOTXFromSCKey
SG::ReadCondHandleKey< LArBadFebCont > m_MFKey
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)
Container class for LArRawSC.
const_pointer_type cptr()
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.