21 {
22 const EventContext &ctx = Gaudi::Hive::currentContext();
24 {
25 RpcFlatCableTranslator flatCable{0};
29 return StatusCode::FAILURE;
30 } else if (n > halfCard && !flatCable.mapChannels(n, n - halfCard - 1, msgStream())) {
31 return StatusCode::FAILURE;
32 }
33 }
36 const unsigned forthCh = flatCable.tdcChannel(n, msgStream()).value_or(0);
37 if (const unsigned backCh = flatCable.stripChannel(forthCh, msgStream()).value_or(0);
39 ATH_MSG_FATAL(
"Forward backward conversion of channel " << n <<
" failed. Ended up with " << backCh);
40 return StatusCode::FAILURE;
41 }
42 }
44 }
45
49 return StatusCode::FAILURE;
50 }
51
55 return StatusCode::FAILURE;
56 }
58 unsigned int n_elements{0}, n_success{0};
60
61 const MuonGM::RpcReadoutElement *readEle = detectorMgr->getRpcReadoutElement(*det_itr);
62 if (!readEle) {
64 continue;
65 }
68 continue;
69 }
72
73 for (bool measPhi : {true, false}) {
76 bool is_valid{false};
77 const Identifier chanId = idHelper.
channelID(station_id,
80 gap, measPhi,
strip, is_valid);
81 if (!is_valid) {
83 continue;
84 }
85 bool failure{false};
86
87 ++n_elements;
88 RpcCablingData cabl_data{};
89 if (!
cabling->convert(chanId, cabl_data,
false)) {
91 return StatusCode::FAILURE;
92 }
94 if (!
cabling->getOnlineId(cabl_data, msgStream())) {
95 return StatusCode::FAILURE;
96 }
97 ATH_MSG_DEBUG(
"Offline channel has an associated online channel " << cabl_data);
98 RpcCablingData onl_data{};
100 onl_data.RpcCablingOnlineID::operator=(cabl_data);
101 onl_data.channelId = cabl_data.channelId;
102 if (!
cabling->getOfflineId(onl_data, msgStream())) {
103 return StatusCode::FAILURE;
104 }
105 if (onl_data != cabl_data) {
107 << " -- started with: " << cabl_data << std::endl
108 << " -- got back: " << onl_data);
109 failure = true;
110 }
111 Identifier backChanId{0};
112 if (!
cabling->convert(onl_data, backChanId,
true)) {
113 ATH_MSG_FATAL(
"Failed to translate back the cabling object" << onl_data <<
" to an Identifier");
114 return StatusCode::FAILURE;
115 }
116 if (backChanId != chanId) {
119 failure = true;
120 }
121 n_success += (!failure);
122 if (failure)
123 return StatusCode::FAILURE;
124 }
125 }
126 }
127 }
128 ATH_MSG_INFO(n_success <<
" out of " << n_elements <<
" channels were successfully validated.");
129 return n_success == n_elements ? StatusCode::SUCCESS : StatusCode::FAILURE;
130 }
#define ATH_MSG_VERBOSE(x)
Identifier identify() const override final
Returns the ATLAS Identifier of the MuonReadOutElement.
int getDoubletPhi() const
return DoubletPhi value for the given readout element, be aware that one RE can contain two DoubletPh...
int getDoubletZ() const
return DoubletZ value for the given readout element
int Nstrips(bool measphi) const
returns the number of strips for the phi or eta plane
virtual int numberOfLayers(bool measphi=true) const override final
number of layers in phi/eta projection, same for eta/phi planes
const_id_iterator detectorElement_begin() const
Iterators over full set of ids.
const_id_iterator detectorElement_end() const
SG::ReadCondHandleKey< MuonGM::MuonDetectorManager > m_DetectorManagerKey
SG::ReadCondHandleKey< RpcCablingMap > m_cablingKey
std::set< int > m_cabStat
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
static constexpr uint8_t readStrips
Number of channels covered by one chip.
Identifier channelID(int stationName, int stationEta, int stationPhi, int doubletR, int doubletZ, int doubletPhi, int gasGap, int measuresPhi, int strip) const
Identifier elementID(int stationName, int stationEta, int stationPhi, int doubletR) const
gap(flags, cells_name, *args, **kw)