14 #include "eformat/SourceIdentifier.h"
15 #include "eformat/Status.h"
22 const std::string&
name,
31 ATH_MSG_DEBUG((
mode==ConversionMode::Encoding ?
"Encoding" :
"Decoding") <<
" ROB IDs: "
32 << MSG::hex <<
m_robIds.value() << MSG::dec);
33 return StatusCode::SUCCESS;
38 const EventContext& eventContext)
const {
40 ATH_MSG_ERROR(
"Conversion from BS to xAOD RoI requested but RoI WriteHandleKey is empty");
41 return StatusCode::FAILURE;
46 auto cont = std::make_unique<xAOD::MuonRoIContainer>();
47 auto auxcont = std::make_unique<xAOD::MuonRoIAuxContainer>();
48 cont->setStore(auxcont.get());
49 ATH_CHECK(handle.record(std::move(cont), std::move(auxcont)));
53 const eformat::helper::SourceIdentifier sid(
m_robIds.value().at(0));
54 auto it = std::find_if(vrobf.begin(), vrobf.end(), [&sid](
const ROBF* rob){return rob->rob_source_id() == sid.code();});
55 if (
it == vrobf.end()) {
56 ATH_MSG_DEBUG(
"No MUCTPI ROB fragment with ID 0x" << std::hex << sid.code() << std::dec
57 <<
" was found, MuonRoIContainer will be empty");
58 return StatusCode::SUCCESS;
63 const uint32_t ndata = rob->rod_ndata();
65 ATH_MSG_DEBUG(
"Starting to decode " << ndata <<
" ROD words");
67 ATH_MSG_DEBUG(
"Muon RoI raw word: 0x" << std::hex << word << std::dec);
71 handle->back()->initialize(word, 99, 99,
"DummyThreshold", 99);
75 return StatusCode::SUCCESS;
80 const EventContext& eventContext) {
86 clearCache(eventContext);
89 ATH_MSG_DEBUG(
"Converting " << muonRoIs->size() <<
" L1 Muon RoIs to ByteStream");
90 uint32_t*
data = newRodData(eventContext, muonRoIs->size());
91 for (
size_t i=0;
i<muonRoIs->size(); ++
i) {
92 data[
i] = muonRoIs->at(
i)->roiWord();
96 const eformat::helper::SourceIdentifier sid(
m_robIds.value().at(0));
97 vrobf.push_back(newRobFragment(eventContext, sid.code(), muonRoIs->size(),
data));
99 return StatusCode::SUCCESS;