12 #include "GaudiKernel/MsgStream.h"
13 #include "Identifier/Identifier.h"
38 ATH_CHECK(m_detectorManagerKey.initialize());
39 ATH_CHECK(m_cscPrdKey.initialize(!m_cscPrdKey.empty()));
40 ATH_CHECK(m_mmPrdKey.initialize(!m_mmPrdKey.empty()));
41 ATH_CHECK(m_stgcPrdKey.initialize(!m_stgcPrdKey.empty()));
43 return StatusCode::SUCCESS;
49 if (m_idHelperSvc->isRpc(
id))
51 else if (m_idHelperSvc->isTgc(
id))
53 else if (m_idHelperSvc->isMdt(
id))
55 else if (m_idHelperSvc->isMM(
id))
57 else if (m_idHelperSvc->issTgc(
id))
59 else if (m_idHelperSvc->isCsc(
id))
62 if (
type == TypeUnknown) {
63 ATH_MSG_ERROR(
"Type does not match known concrete type of MuonSpectrometer! Dumping RoT:" << rioOnTrack);
66 <<
"MM=" <<
MM <<
")");
77 ATH_MSG_ERROR(
"Could not find detector element for " << m_idHelperSvc->toString(
id));
82 if (m_fixTGCs && m_idHelperSvc->isTgc(
id) && !rioOnTrack.
prepRawData()) {
87 el.resetWithKeyAndIndex(m_tgcPrdKey.key(),
el.index());
91 return std::pair<const Trk::TrkDetElementBase*, const Trk::PrepRawData*>(detEl, prd);
97 prepareRIO_OnTrackElementLink<const Muon::MdtPrepDataContainer, Muon::MdtDriftCircleOnTrack>(mdt);
102 prepareRIO_OnTrackElementLink<const Muon::CscPrepDataContainer, Muon::CscClusterOnTrack>(csc);
107 prepareRIO_OnTrackElementLink<const Muon::RpcPrepDataContainer, Muon::RpcClusterOnTrack>(rpc);
112 prepareRIO_OnTrackElementLink<const Muon::TgcPrepDataContainer, Muon::TgcClusterOnTrack>(tgc);
117 prepareRIO_OnTrackElementLink<const Muon::sTgcPrepDataContainer, Muon::sTgcClusterOnTrack>(stgc);
122 prepareRIO_OnTrackElementLink<const Muon::MMPrepDataContainer, Muon::MMClusterOnTrack>(
mm);
130 prepareRIO_OnTrackElementLink<const Muon::MdtPrepDataContainer, Muon::MdtDriftCircleOnTrack>(mdt,
key,
index);
135 prepareRIO_OnTrackElementLink<const Muon::CscPrepDataContainer, Muon::CscClusterOnTrack>(csc,
key,
index);
140 prepareRIO_OnTrackElementLink<const Muon::RpcPrepDataContainer, Muon::RpcClusterOnTrack>(rpc,
key,
index);
145 prepareRIO_OnTrackElementLink<const Muon::TgcPrepDataContainer, Muon::TgcClusterOnTrack>(tgc,
key,
index);
150 prepareRIO_OnTrackElementLink<const Muon::sTgcPrepDataContainer, Muon::sTgcClusterOnTrack>(stgc,
key,
index);
155 prepareRIO_OnTrackElementLink<const Muon::MMPrepDataContainer, Muon::MMClusterOnTrack>(
mm,
key,
index);
161 std::pair<const Trk::TrkDetElementBase*, const Trk::PrepRawData*> pair = getLinks(*RoT);
166 return getDetectorElement(
id);
170 const EventContext& ctx = Gaudi::Hive::currentContext();
173 if (!muonMgrHandle.isValid()) {
174 ATH_MSG_ERROR(
"Failed to retrieve the Muon detector manager from the conditions store");
177 muonMgr = muonMgrHandle.cptr();
181 if (m_idHelperSvc->isRpc(
id)) {
182 detEl = muonMgr->getRpcReadoutElement(
id);
183 }
else if (m_idHelperSvc->isCsc(
id)) {
184 detEl = muonMgr->getCscReadoutElement(
id);
185 }
else if (m_idHelperSvc->isTgc(
id)) {
186 detEl = muonMgr->getTgcReadoutElement(
id);
187 }
else if (m_idHelperSvc->isMdt(
id)) {
188 detEl = muonMgr->getMdtReadoutElement(
id);
189 }
else if (m_idHelperSvc->issTgc(
id)) {
190 detEl = muonMgr->getsTgcReadoutElement(
id);
191 }
else if (m_idHelperSvc->isMM(
id)) {
192 detEl = muonMgr->getMMReadoutElement(
id);
194 if (!detEl)
ATH_MSG_ERROR(
"Could not find detector element for Identifier: " << m_idHelperSvc->toString(
id));
199 const EventContext& ctx = Gaudi::Hive::currentContext();
200 if (m_idHelperSvc->isMdt(
id)) {
201 return getLink(
id, idHash, m_mdtPrdKey, ctx);
202 }
else if (m_idHelperSvc->isRpc(
id)) {
203 return getLink(
id, idHash, m_rpcPrdKey, ctx);
204 }
else if (m_idHelperSvc->isTgc(
id)) {
205 return getLink(
id, idHash, m_tgcPrdKey, ctx);
206 }
else if (m_idHelperSvc->isMM(
id)) {
207 return getLink(
id, idHash, m_mmPrdKey, ctx);
208 }
else if (m_idHelperSvc->issTgc(
id)) {
209 return getLink(
id, idHash, m_stgcPrdKey, ctx);
211 ATH_MSG_ERROR(
"The given Identifier is not a muon one " << m_idHelperSvc->toString(
id));
215 template <
class CONT>
219 if (!handle.isValid()) {
226 auto ptr = handle->indexFindPtr(idHash);
234 for (
const auto& collIt : *
ptr) {
235 if (collIt->identify() ==
id)
return collIt;