6 #include "GaudiKernel/PhysicalConstants.h"
17 ATH_MSG_ERROR(
"Neither legacy or xAOD::Rpcs shall be translated.");
18 return StatusCode::FAILURE;
28 return StatusCode::SUCCESS;
34 const size_t modHashMax{
m_idHelperSvc->rpcIdHelper().module_hash_max()};
41 ATH_CHECK(writeHandle.record(std::make_unique<RpcDigitContainer>(modHashMax)));
43 for (
size_t coll_hash = 0; coll_hash < modHashMax; ++coll_hash) {
44 if (tempOut[coll_hash] && tempOut[coll_hash]->
size()) {
45 ATH_CHECK(writeHandle->addCollection(tempOut[coll_hash].release(), coll_hash));
50 return StatusCode::SUCCESS;
56 return StatusCode::SUCCESS;
60 ATH_MSG_DEBUG(
"Retrieved " << rdoContainer->size() <<
" RPC RDOs.");
64 for (
const RpcPad* rdoColl : *rdoContainer) {
65 ATH_MSG_DEBUG(
" Number of CMs in this Pad " << rdoColl->size());
67 uint16_t padId = rdoColl->onlineId();
68 uint16_t sectorId = rdoColl->sector();
73 uint16_t cmaId = coinMatrix->onlineId();
77 std::vector<std::unique_ptr<RpcDigit>> digitVec{
m_rpcRdoDecoderTool->getDigit(rpcChan, sectorId,
81 if (digitVec.empty())
continue;
84 for (std::unique_ptr<RpcDigit>& newDigit : digitVec) {
86 std::unique_ptr<RpcDigitCollection>& digitColl = container[collHash];
88 digitColl = std::make_unique<RpcDigitCollection>(
m_idHelperSvc->chamberId(newDigit->identify()),
91 digitColl->
push_back(std::move(newDigit));
96 return StatusCode::SUCCESS;
101 return StatusCode::SUCCESS;
109 return StatusCode::FAILURE;
112 if (!muonDetMgr.isValid()) {
113 ATH_MSG_FATAL(
"Failed to retrieve the readout geometry "<<muonDetMgr.fullKey());
114 return StatusCode::FAILURE;
120 ATH_MSG_VERBOSE(
"Convert RDO tdcSector: "<<
static_cast<int>(rdo->tdcsector())<<
", tdc:"
121 <<
static_cast<int>(rdo->tdc())<<
" channel: "<<
static_cast<int>(rdo->channel()) <<
", time: "
122 <<rdo->time()<<
", ToT: "<<rdo->timeoverthr());
127 convObj.tdcSector = rdo->tdcsector();
128 convObj.tdc = rdo->tdc();
129 convObj.channelId = rdo->channel();
131 if (!
cabling->getOfflineId(convObj, msgStream())) {
133 return StatusCode::FAILURE;
136 if (!
cabling->convert(convObj, chanId)) {
137 return StatusCode::FAILURE;
141 std::unique_ptr<RpcDigitCollection>& coll = digit_map[modHash];
144 coll = std::make_unique<RpcDigitCollection>(id_helper.
elementID(chanId), modHash);
148 const float digit_time = rdo->time();
150 + inverseSpeedOfLight * (muonDetMgr->getRpcReadoutElement(chanId)->stripPos(chanId)).
mag() : rdo->timeoverthr() ;
152 std::unique_ptr<RpcDigit>
digit = std::make_unique<RpcDigit>(chanId, digit_time, ToT, convObj.stripSide());
155 return StatusCode::SUCCESS;