86#include "eformat/Status.h"
96 eformat::helper::SourceIdentifier src(srcid);
97 if (src.human_detector() !=
"UNKNOWN") {
102 eformat::helper::SourceIdentifier src(
static_cast<eformat::SubDetector
>(subdet), 0);
103 if (src.human_detector() !=
"UNKNOWN") {
111 eformat::helper::SourceIdentifier src(
id);
112 ATH_MSG_INFO(
" RobId=0x" << MSG::hex <<
id <<
" -> in Sub Det = " << src.human_detector());
113 for (uint32_t status : status_vec) {
114 eformat::helper::Status tmpstatus(status);
116 << MSG::hex << std::setfill(
'0' ) << std::setw(8) << tmpstatus.code()
117 <<
" Generic Part=0x" << std::setw(4) << tmpstatus.generic()
118 <<
" Specific Part=0x" << std::setw(4) << tmpstatus.specific());
122 ATH_MSG_INFO(
"---> Filter out Sub Detector ROBs by Status Code: # Sub Detectors = " <<
126 eformat::helper::SourceIdentifier src(det, 0);
127 ATH_MSG_INFO(
" SubDetId=0x" << MSG::hex << det <<
" -> " << src.human_detector());
128 for (uint32_t status : status_vec) {
129 eformat::helper::Status tmpstatus(status);
131 MSG::hex << std::setfill(
'0' ) << std::setw(8) << tmpstatus.code() <<
132 " Generic Part=0x" << std::setw(4) << tmpstatus.generic() <<
133 " Specific Part=0x" << std::setw(4) << tmpstatus.specific());
136 return StatusCode::SUCCESS;
147 cache->robmap.clear();
149 cache->currentLvl1ID =
re->lvl1_id();
152 auto iter =
re->child_iter();
155 auto rob = std::make_unique<const ROBF>(fp);
156 const uint32_t
id = rob->source_id();
159 if (rob->nstatus() > 0) {
160 const uint32_t* it_status;
161 rob->status(it_status);
162 eformat::helper::Status tmpstatus(*it_status);
163 ATH_MSG_DEBUG(
"---> ROB Id = 0x" << MSG::hex <<
id << std::setfill(
'0') <<
164 " with Generic Status Code = 0x" << std::setw(4) << tmpstatus.generic() <<
165 " and Specific Status Code = 0x" << std::setw(4) << tmpstatus.specific() << MSG::dec <<
166 " removed for L1 Id = " << cache->currentLvl1ID);
170 ATH_MSG_DEBUG(
"---> Empty ROB Id = 0x" << MSG::hex <<
id << MSG::dec <<
171 " removed for L1 Id = " << cache->currentLvl1ID);
175 const auto& [itr, new_entry] = cache->robmap.insert_or_assign(
id, std::move(rob));
177 ATH_MSG_WARNING(
"ROBDataProviderSvc:: Duplicate ROBID 0x" << MSG::hex <<
id <<
178 " found. " << MSG::dec <<
"Overwriting the previous one.");
183 ", current LVL1 id = " << cache->currentLvl1ID <<
184 ", size of ROB cache = " << cache->robmap.size());
190 VROBFRAG& robFragments,
const std::string_view callerName) {
194 for (uint32_t
id : ids) {
195 const auto map_it = cache->robmap.find(
id);
196 if (map_it != cache->robmap.end()) {
197 robFragments.push_back(map_it->second.get());
199 ATH_MSG_DEBUG(
"Failed to find ROB for id 0x" << MSG::hex <<
id << MSG::dec <<
", Caller Name = " << callerName);
224 const std::function<
void(
const ROBF* )>& fn )
const {
226 fn( el.second.get() );
240 if (rob->nstatus() == 0) {
244 const uint32_t* rob_it_status;
245 rob->status(rob_it_status);
248 eformat::helper::SourceIdentifier src(rob->rob_source_id());
251 if (std::ranges::contains(it->second, *rob_it_status))
257 if (std::ranges::contains(it->second, *rob_it_status))
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_INFO(x,...)
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
virtual uint32_t getEventStatus(const EventContext &ctx) override
Retrieve the status for the event.
virtual void processCachedROBs(const EventContext &ctx, const std::function< void(const ROBF *)> &fn) const override
virtual const RawEvent * getEvent(const EventContext &ctx) override
Retrieve the whole event.
virtual StatusCode initialize() override
Initialize.
std::unordered_map< uint32_t, std::vector< uint32_t > > m_filterRobMap
map of full ROB Source ids and status words to be ignored for the ROB map
virtual void setNextEvent(const EventContext &ctx, const RawEvent *re) override
Add all ROBFragments of a RawEvent to cache.
Gaudi::Property< std::vector< std::pair< int, int > > > m_filterSubDetWithStatus
Gaudi::Property< bool > m_filterEmptyROB
virtual void getROBData(const EventContext &ctx, const std::vector< uint32_t > &robIds, VROBFRAG &robFragments, const std::string_view callerName="UNKNOWN") override
Retrieve ROBFragments for given ROB ids from cache.
bool filterRobWithStatus(const ROBF *rob)
method to filter ROBs with given Status code
virtual void setEventStatus(const EventContext &ctx, uint32_t status) override
Store the status for the event.
Gaudi::Property< std::vector< std::pair< int, int > > > m_filterRobWithStatus
OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment ROBF
ROB Fragment class.
SG::SlotSpecificObj< EventCache > m_eventsCache
std::unordered_map< eformat::SubDetector, std::vector< uint32_t > > m_filterSubDetMap
map of Sub Det Source ids and status words to be ignored for the ROB map
const DataType * PointerType
ROB fragment cache per slot.