14#include "hltinterface/DataCollector.h"
20 constexpr float wordsToKiloBytes = 0.001*
sizeof(
uint32_t);
23 switch (getStatus()) {
36: base_class(name, svcLoc) {}
64 return StatusCode::SUCCESS;
81 return StatusCode::SUCCESS;
93 const EventContext* eventContext =
nullptr;
94 if (
m_evtStore->retrieve(eventContext).isFailure()) {
95 ATH_MSG_ERROR(
"Failed to retrieve EventContext from the event store, new event cannot be read");
99 ATH_MSG_DEBUG(
"Reading new event for event context " << *eventContext);
116 status = fetch<hltinterface::DataCollector::Status>([&]{
return hltinterface::DataCollector::instance()->getNext(cache->
rawData); });
120 catch (
const std::exception& ex) {
121 ATH_MSG_ERROR(
"Failed to read new event, caught an unexpected exception: " << ex.what()
122 <<
". Throwing hltonl::Exception::EventSourceCorrupted" );
126 ATH_MSG_ERROR(
"Failed to read new event, caught an unexpected exception. "
127 <<
"Throwing hltonl::Exception::EventSourceCorrupted" );
131 ATH_MSG_DEBUG(
"DataCollector::getNext returned STOP - no more events available");
135 ATH_MSG_DEBUG(
"DataCollector::getNext returned NO_EVENT - no events available temporarily");
141 ATH_MSG_ERROR(
"Unhandled return Status " <<
static_cast<int>(status) <<
" from DataCollector::getNext");
160 std::vector<eformat::read::ROBFragment> robVec;
162 std::vector<std::string> subdetNameVec;
163 for (
const eformat::read::ROBFragment& rob : robVec) {
164 eformat::helper::SourceIdentifier sid(rob.rob_source_id());
165 subdetNameVec.push_back(sid.human_detector());
176 const eformat::helper::SourceIdentifier sid{eformat::SubDetector::TDAQ_CTP,
178 std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> vrobf;
181 ATH_MSG_INFO(
"The CTP ROB fragment 0x" << std::hex << sid.code() << std::dec <<
" is missing. "
182 <<
"Throwing hltonl::Exception::MissingCTPFragment");
185 uint32_t robStatus = vrobf.at(0)->nstatus()>0 ? *(vrobf.at(0)->status()) : 0;
187 std::string hexStatus(8,
char{0});
188 std::to_chars(hexStatus.data(), hexStatus.data()+hexStatus.size(), robStatus, 16);
189 ATH_MSG_INFO(
"The CTP ROB fragment 0x" << std::hex << sid.code() << std::dec <<
" has non-zero status word: 0x"
190 << hexStatus <<
". Throwing hltonl::Exception::BadCTPFragment");
194 vrobf.at(0)->check();
196 catch (
const std::exception& ex) {
197 ATH_MSG_INFO(
"The CTP ROB fragment 0x" << std::hex << sid.code() << std::dec <<
" is corrupted: "
198 << ex.what() <<
". Throwing hltonl::Exception::BadCTPFragment");
211 ATH_MSG_FATAL(
"The method " << __FUNCTION__ <<
" is not implemented for online running");
219 ATH_MSG_FATAL(
"The method " << __FUNCTION__ <<
" is not implemented for online running");
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
Assign a CLID to EventContext.
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
Group of local monitoring quantities and retain correlation when filling histograms
Declare a monitored scalar variable.
Thrown if the CTP ROBFragment for a new event has non-zero status word or other errors.
Thrown if event source throws an exception when new event is requested.
Thrown if the CTP ROBFragment cannot be retrieved for a new event.
Thrown if the event source cannot provide new events temporarily, e.g.
Thrown if all events are already read from the input and another one is requested.
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.