6 #include <unordered_map>
18 #include "eformat/Issue.h"
25 declareInterface<IMM_ROD_Decoder>(
this );
33 ATH_CHECK(m_cablingKey.initialize(!m_cablingKey.empty()));
34 ATH_CHECK(m_dscKey.initialize(!m_dscKey.empty()));
35 return StatusCode::SUCCESS;
52 return StatusCode::SUCCESS;
55 if (!m_cablingKey.empty()) {
57 if(!readCondHandle.isValid()){
59 return StatusCode::FAILURE;
61 mmCablingMap = readCondHandle.cptr();
64 if(!m_dscKey.empty()) {
66 if(!readCondHandle.isValid()){
67 ATH_MSG_ERROR(
"Cannot find the NSW DcsCondDataObj "<<m_dscKey.fullKey());
68 return StatusCode::FAILURE;
70 dcsData = readCondHandle.cptr();
75 bool seeded_mode(!rdoIdhVect.empty());
79 const std::vector<Muon::nsw::NSWElink *>& elinks = common_decoder.
get_elinks();
81 if (elinks.empty())
return StatusCode::SUCCESS;
85 for (
auto* elink : elinks) {
88 if (elink->isNull())
continue;
92 const char*
station_name = elink->elinkId()->is_large_station() ?
"MML" :
"MMS";
94 unsigned int station_phi = (
unsigned int)elink->elinkId()->station_phi();
95 unsigned int multi_layer = (
unsigned int)elink->elinkId()->multi_layer();
96 unsigned int gas_gap = (
unsigned int)elink->elinkId()->gas_gap();
100 m_MmIdHelper->get_module_hash(module_ID, module_hashID);
103 if (seeded_mode &&
std::find(rdoIdhVect.begin(), rdoIdhVect.end(), module_hashID) == rdoIdhVect.end())
continue;
105 std::unique_ptr<MM_RawDataCollection>& rdo = rdo_map[module_hashID];
106 if (!rdo) rdo = std::make_unique<MM_RawDataCollection>(module_hashID);
109 const std::vector<Muon::nsw::VMMChannel *>&
channels = elink->get_channels();
111 unsigned int channel_number =
channel->channel_number();
112 if (channel_number == 0)
continue;
113 Identifier channel_ID = m_MmIdHelper->channelID(module_ID, multi_layer, gas_gap, channel_number);
116 std::optional<Identifier> correctedChannelId = mmCablingMap->correctChannel(channel_ID, msgStream());
117 if (!correctedChannelId) {
118 ATH_MSG_DEBUG(
"Channel was shifted outside its connector and is therefore not decoded into and RDO");
121 channel_ID = (*correctedChannelId);
122 channel_number = m_MmIdHelper->channel(channel_ID);
124 if (dcsData && !dcsData->isGood(ctx,channel_ID))
continue;
131 return StatusCode::SUCCESS;