282 eformat::read::FullEventFragment rawEvent(rawEventPtr.get());
285 if (rawEvent.nstatus() > 1) {
287 std::ostringstream
ss;
294 std::vector<eformat::helper::StreamTag> streamTags;
296 eformat::helper::decode(rawEvent.nstream_tag(), rawEvent.stream_tag(), streamTags);
298 catch (
const std::exception& ex) {
299 ATH_MSG_ERROR(
"StreamTag decoding failed, caught an unexpected std::exception " << ex.what());
303 ATH_MSG_ERROR(
"StreamTag decoding failed, caught an unexpected exception");
308 std::vector<eformat::read::ROBFragment> robs;
310 std::vector<uint16_t> resultSizeMap_moduleID;
311 std::vector<uint32_t> resultSizeMap_size;
312 uint32_t totalSizeWords = 0;
314 for (
const eformat::read::ROBFragment& rob : robs) {
315 eformat::helper::SourceIdentifier sid(rob.rob_source_id());
316 if (sid.subdetector_id() != eformat::SubDetector::TDAQ_HLT)
318 const uint16_t module_id = sid.module_id();
319 const uint32_t size = rob.fragment_size_word();
320 totalSizeWords += size;
321 if (!
contains(resultSizeMap_moduleID, module_id)) {
322 resultSizeMap_moduleID.push_back(module_id);
323 resultSizeMap_size.push_back(size);
326 ATH_MSG_ERROR(
"HLT result ROB monitoring found multiple HLT ROBs with the same module ID " << module_id);
330 catch (
const std::exception& ex) {
331 ATH_MSG_ERROR(
"HLT result ROB monitoring failed, caught an unexpected std::exception " << ex.what());
335 ATH_MSG_ERROR(
"HLT result ROB monitoring failed, caught an unexpected exception");
340 std::vector<std::string> sdFromRobList;
341 std::vector<std::string> sdFromSubDetList;
342 std::vector<std::string> streamTagCorrA;
343 std::vector<std::string> streamTagCorrB;
344 std::vector<float> streamResultSize;
345 streamTagCorrA.reserve(streamTags.size() * streamTags.size());
346 streamTagCorrB.reserve(streamTags.size() * streamTags.size());
347 streamResultSize.reserve(streamTags.size());
348 for (
const eformat::helper::StreamTag& st : streamTags) {
349 bool hasHLTSubDet = st.dets.find(eformat::SubDetector::TDAQ_HLT) != st.dets.end();
350 bool includeAll = st.robs.empty() && (st.dets.empty() || hasHLTSubDet);
352 uint32_t sizeWords = includeAll ? totalSizeWords : 0;
353 for (
const eformat::SubDetector sd : st.dets) {
354 const std::string& detName = eformat::helper::SubDetectorDictionary.string(sd);
355 if (!
contains(sdFromSubDetList, detName)) sdFromSubDetList.push_back(detName);
357 for (
const uint32_t robid : st.robs) {
358 eformat::helper::SourceIdentifier sid(robid);
359 const std::string& detName = sid.human_detector();
360 if (!
contains(sdFromRobList, detName)) sdFromRobList.push_back(detName);
361 if (!includeAll && sid.subdetector_id() == eformat::SubDetector::TDAQ_HLT) {
362 if (
const int ix =
index(resultSizeMap_moduleID, sid.module_id()); ix >= 0) {
363 sizeWords += resultSizeMap_size[ix];
366 ATH_MSG_WARNING(
"Stream tag " << st.type <<
"_" << st.name <<
" declares " << sid.human()
367 <<
" in ROB list, but the ROBFragment is missing");
371 streamResultSize.push_back(sizeWords*wordsToKiloBytes);
372 for (
const eformat::helper::StreamTag& st2 : streamTags) {
373 streamTagCorrA.push_back(mon_streamTypeName(st));
374 streamTagCorrB.push_back(mon_streamTypeName(st2));
386 auto monPebRobsNum =
Monitored::Collection(
"StreamTagsPebRobsNum", streamTags, mon_streamPebRobsNum);
387 auto monPebSubDetsNum =
Monitored::Collection(
"StreamTagsPebSubDetsNum", streamTags, mon_streamPebSubDetsNum);
388 auto monSubDetsFromRobList =
Monitored::Collection(
"StreamTagsPebSubDetsFromRobList", sdFromRobList);
389 auto monSubDetsFromSubDetList =
Monitored::Collection(
"StreamTagsPebSubDetsFromSubDetList", sdFromSubDetList);
392 auto monResultSizeFullEvFrag =
Monitored::Scalar<float>(
"ResultSizeFullEvFrag", rawEvent.fragment_size_word()*wordsToKiloBytes);
394 auto monResultCollModuleSize =
Monitored::Collection(
"ResultModuleSize", resultSizeMap_size, [](uint32_t sw){
return sw*wordsToKiloBytes;});
398 monStreamTagCorrB, monStreamIsPeb, monPebRobsNum, monPebSubDetsNum, monSubDetsFromRobList,
399 monSubDetsFromSubDetList, monResultSizeTotal, monResultSizeFullEvFrag, monResultCollModuleID,
400 monResultCollModuleSize, monResultSizeByStream);
411 std::ostringstream
ss;
412 ss <<
"Dumping header of the FullEventFragment with HLT result:" << std::endl;
413 ss <<
"--> status = "
414 << printNWordsHex<uint32_t>(
re->nstatus(),
re->status())
416 ss <<
"--> source_id = " << printWordHex<uint32_t>(
re->source_id()) << std::endl;
417 ss <<
"--> checksum_type = " << printWordHex<uint32_t>(
re->checksum_type()) << std::endl;
418 ss <<
"--> compression_type = " << printWordHex<uint32_t>(
re->compression_type()) << std::endl;
419 ss <<
"--> compression_level = " <<
re->compression_level() << std::endl;
420 ss <<
"--> bc_time_seconds = " <<
re->bc_time_seconds() << std::endl;
421 ss <<
"--> bc_time_nanoseconds = " <<
re->bc_time_nanoseconds() << std::endl;
422 ss <<
"--> global_id = " <<
re->global_id() << std::endl;
423 ss <<
"--> run_type = " <<
re->run_type() << std::endl;
424 ss <<
"--> run_no = " <<
re->run_no() << std::endl;
425 ss <<
"--> lumi_block = " <<
re->lumi_block() << std::endl;
426 ss <<
"--> lvl1_id = " <<
re->lvl1_id() << std::endl;
427 ss <<
"--> bc_id = " <<
re->bc_id() << std::endl;
428 ss <<
"--> lvl1_trigger_type = " << printWordHex<uint8_t>(
re->lvl1_trigger_type()) << std::endl;
429 ss <<
"--> lvl1_trigger_info = "
430 << printNWordsHex<uint32_t>(
re->nlvl1_trigger_info(),
re->lvl1_trigger_info())
432 ss <<
"--> lvl2_trigger_info = "
433 << printNWordsHex<uint32_t>(
re->nlvl2_trigger_info(),
re->lvl2_trigger_info())
435 ss <<
"--> event_filter_info = "
436 << printNWordsHex<uint32_t>(
re->nevent_filter_info(),
re->event_filter_info())
438 ss <<
"--> hlt_info = "
439 << printNWordsHex<uint32_t>(
re->nhlt_info(),
re->hlt_info())
442 std::vector<eformat::helper::StreamTag> stream_tags;
444 eformat::helper::decode(
re->nstream_tag(),
re->stream_tag(), stream_tags);
446 catch (
const std::exception& ex) {
447 ATH_MSG_ERROR(
"StreamTag decoding failed, caught an unexpected std::exception " << ex.what());
451 ATH_MSG_ERROR(
"StreamTag decoding failed, caught an unexpected exception");
454 ss <<
"--> stream_tags = ";
456 for (
const auto& st : stream_tags) {
457 if (first) first=
false;
459 ss <<
"{" << st.name <<
", " << st.type <<
", obeysLB=" << st.obeys_lumiblock <<
", robs=[";
463 ss <<
"]}" << std::endl;
Assign a CLID to EventContext.