51 const std::vector<IdentifierHash>& rdoIdhVect,
52 std::unordered_map<
IdentifierHash, std::unique_ptr<STGC_RawDataCollection>>& rdo_map)
const
58 }
catch (
const eformat::Issue &ex) {
60 return StatusCode::SUCCESS;
68 return StatusCode::FAILURE;
70 dcsData = readCondHandle.
cptr();
78 return StatusCode::FAILURE;
80 sTgcCablingMap = readCondHandle.
cptr();
85 if (!muonGeoMgrHandle.
isValid()) {
86 ATH_MSG_FATAL(
"Failed to retrieve the detector manager from the conditions store");
87 return StatusCode::FAILURE;
93 bool seeded_mode(!rdoIdhVect.empty());
97 const std::vector<Muon::nsw::NSWElink *>& elinks = common_decoder.
get_elinks();
99 if (elinks.empty())
return StatusCode::SUCCESS;
103 for (
auto* elink : elinks) {
106 if (elink->isNull())
continue;
110 const char* station_name = elink->elinkId()->is_large_station() ?
"STL" :
"STS";
111 int station_eta = (int)elink->elinkId()->station_eta();
112 unsigned int station_phi = (
unsigned int)elink->elinkId()->station_phi();
113 unsigned int multi_layer = (
unsigned int)elink->elinkId()->multi_layer();
114 unsigned int gas_gap = (
unsigned int)elink->elinkId()->gas_gap();
121 if (seeded_mode && std::find(rdoIdhVect.begin(), rdoIdhVect.end(), module_hashID) == rdoIdhVect.end())
continue;
122 std::unique_ptr<STGC_RawDataCollection>& rdo = rdo_map[module_hashID];
123 if (!rdo) rdo = std::make_unique<STGC_RawDataCollection>(module_hashID);
126 const std::vector<Muon::nsw::VMMChannel*>& channels = elink->get_channels();
127 for (
auto *channel : channels) {
128 unsigned int channel_number = channel->channel_number();
129 unsigned int channel_type = channel->channel_type();
130 if (channel_number == 0)
continue;
133 if (sTgcCablingMap) {
134 std::optional<Identifier> correctedChannelId = sTgcCablingMap->
correctChannel(channel_ID, msgStream());
135 if (!correctedChannelId) {
136 ATH_MSG_DEBUG(
"Channel was shifted outside its connector and is therefore not decoded into and RDO");
139 channel_ID = (*correctedChannelId);
141 bool isOuterQ1{
false};
142 if(std::abs(station_eta)==1 && dcsData){
144 if (!roElement->
stripPosition(channel_ID, localPos))
continue;
145 isOuterQ1 = !(roElement->
isEtaZero(channel_ID, localPos));
148 if (dcsData && !dcsData->
isGood(ctx, channel_ID, isOuterQ1))
continue;
149 bool timeAndChargeInCounts =
true;
150 rdo->push_back(
new STGC_RawData(channel_ID, channel->rel_bcid(), channel->tdo(), channel->pdo(),
false,timeAndChargeInCounts));
154 return StatusCode::SUCCESS;
virtual StatusCode fillCollection(const EventContext &ctx, const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &, const std::vector< IdentifierHash > &, std::unordered_map< IdentifierHash, std::unique_ptr< STGC_RawDataCollection > > &rdo_map) const override
Convert ROBFragments to RDOs.
bool isGood(const EventContext &ctx, const Identifier &channelId, bool issTgcQ1OuterHv=false) const
Returns whether the channel is alive, i.e. DCS state on, etc...