299 eformat::read::FullEventFragment rawEvent(rawEventPtr.get());
302 if (rawEvent.nstatus() > 1) {
304 std::ostringstream
ss;
311 std::vector<eformat::helper::StreamTag> streamTags;
313 eformat::helper::decode(rawEvent.nstream_tag(), rawEvent.stream_tag(), streamTags);
315 catch (
const std::exception& ex) {
316 ATH_MSG_ERROR(
"StreamTag decoding failed, caught an unexpected std::exception " << ex.what());
320 ATH_MSG_ERROR(
"StreamTag decoding failed, caught an unexpected exception");
325 std::vector<eformat::read::ROBFragment> robs;
327 std::vector<uint16_t> resultSizeMap_moduleID;
328 std::vector<uint32_t> resultSizeMap_size;
329 uint32_t totalSizeWords = 0;
331 for (
const eformat::read::ROBFragment& rob : robs) {
332 eformat::helper::SourceIdentifier sid(rob.rob_source_id());
333 if (sid.subdetector_id() != eformat::SubDetector::TDAQ_HLT)
335 const uint16_t module_id = sid.module_id();
336 const uint32_t size = rob.fragment_size_word();
337 totalSizeWords += size;
338 if (!
contains(resultSizeMap_moduleID, module_id)) {
339 resultSizeMap_moduleID.push_back(module_id);
340 resultSizeMap_size.push_back(size);
343 ATH_MSG_ERROR(
"HLT result ROB monitoring found multiple HLT ROBs with the same module ID " << module_id);
347 catch (
const std::exception& ex) {
348 ATH_MSG_ERROR(
"HLT result ROB monitoring failed, caught an unexpected std::exception " << ex.what());
352 ATH_MSG_ERROR(
"HLT result ROB monitoring failed, caught an unexpected exception");
357 std::vector<std::string> sdFromRobList;
358 std::vector<std::string> sdFromSubDetList;
359 std::vector<std::string> streamTagCorrA;
360 std::vector<std::string> streamTagCorrB;
361 std::vector<float> streamResultSize;
362 streamTagCorrA.reserve(streamTags.size() * streamTags.size());
363 streamTagCorrB.reserve(streamTags.size() * streamTags.size());
364 streamResultSize.reserve(streamTags.size());
365 for (
const eformat::helper::StreamTag& st : streamTags) {
366 bool hasHLTSubDet = st.dets.find(eformat::SubDetector::TDAQ_HLT) != st.dets.end();
367 bool includeAll = st.robs.empty() && (st.dets.empty() || hasHLTSubDet);
369 uint32_t sizeWords = includeAll ? totalSizeWords : 0;
370 for (
const eformat::SubDetector sd : st.dets) {
371 const std::string& detName = eformat::helper::SubDetectorDictionary.string(sd);
372 if (!
contains(sdFromSubDetList, detName)) sdFromSubDetList.push_back(detName);
374 for (
const uint32_t robid : st.robs) {
375 eformat::helper::SourceIdentifier sid(robid);
376 const std::string& detName = sid.human_detector();
377 if (!
contains(sdFromRobList, detName)) sdFromRobList.push_back(detName);
378 if (!includeAll && sid.subdetector_id() == eformat::SubDetector::TDAQ_HLT) {
379 if (
const int ix =
index(resultSizeMap_moduleID, sid.module_id()); ix >= 0) {
380 sizeWords += resultSizeMap_size[ix];
383 ATH_MSG_WARNING(
"Stream tag " << st.type <<
"_" << st.name <<
" declares " << sid.human()
384 <<
" in ROB list, but the ROBFragment is missing");
388 streamResultSize.push_back(sizeWords*wordsToKiloBytes);
389 for (
const eformat::helper::StreamTag& st2 : streamTags) {
390 streamTagCorrA.push_back(mon_streamTypeName(st));
391 streamTagCorrB.push_back(mon_streamTypeName(st2));
403 auto monPebRobsNum =
Monitored::Collection(
"StreamTagsPebRobsNum", streamTags, mon_streamPebRobsNum);
404 auto monPebSubDetsNum =
Monitored::Collection(
"StreamTagsPebSubDetsNum", streamTags, mon_streamPebSubDetsNum);
405 auto monSubDetsFromRobList =
Monitored::Collection(
"StreamTagsPebSubDetsFromRobList", sdFromRobList);
406 auto monSubDetsFromSubDetList =
Monitored::Collection(
"StreamTagsPebSubDetsFromSubDetList", sdFromSubDetList);
409 auto monResultSizeFullEvFrag =
Monitored::Scalar<float>(
"ResultSizeFullEvFrag", rawEvent.fragment_size_word()*wordsToKiloBytes);
411 auto monResultCollModuleSize =
Monitored::Collection(
"ResultModuleSize", resultSizeMap_size, [](uint32_t sw){
return sw*wordsToKiloBytes;});
415 monStreamTagCorrB, monStreamIsPeb, monPebRobsNum, monPebSubDetsNum, monSubDetsFromRobList,
416 monSubDetsFromSubDetList, monResultSizeTotal, monResultSizeFullEvFrag, monResultCollModuleID,
417 monResultCollModuleSize, monResultSizeByStream);
428 std::ostringstream
ss;
429 ss <<
"Dumping header of the FullEventFragment with HLT result:" << std::endl;
430 ss <<
"--> status = "
431 << printNWordsHex<uint32_t>(
re->nstatus(),
re->status())
433 ss <<
"--> source_id = " << printWordHex<uint32_t>(
re->source_id()) << std::endl;
434 ss <<
"--> checksum_type = " << printWordHex<uint32_t>(
re->checksum_type()) << std::endl;
435 ss <<
"--> compression_type = " << printWordHex<uint32_t>(
re->compression_type()) << std::endl;
436 ss <<
"--> compression_level = " <<
re->compression_level() << std::endl;
437 ss <<
"--> bc_time_seconds = " <<
re->bc_time_seconds() << std::endl;
438 ss <<
"--> bc_time_nanoseconds = " <<
re->bc_time_nanoseconds() << std::endl;
439 ss <<
"--> global_id = " <<
re->global_id() << std::endl;
440 ss <<
"--> run_type = " <<
re->run_type() << std::endl;
441 ss <<
"--> run_no = " <<
re->run_no() << std::endl;
442 ss <<
"--> lumi_block = " <<
re->lumi_block() << std::endl;
443 ss <<
"--> lvl1_id = " <<
re->lvl1_id() << std::endl;
444 ss <<
"--> bc_id = " <<
re->bc_id() << std::endl;
445 ss <<
"--> lvl1_trigger_type = " << printWordHex<uint8_t>(
re->lvl1_trigger_type()) << std::endl;
446 ss <<
"--> lvl1_trigger_info = "
447 << printNWordsHex<uint32_t>(
re->nlvl1_trigger_info(),
re->lvl1_trigger_info())
449 ss <<
"--> lvl2_trigger_info = "
450 << printNWordsHex<uint32_t>(
re->nlvl2_trigger_info(),
re->lvl2_trigger_info())
452 ss <<
"--> event_filter_info = "
453 << printNWordsHex<uint32_t>(
re->nevent_filter_info(),
re->event_filter_info())
455 ss <<
"--> hlt_info = "
456 << printNWordsHex<uint32_t>(
re->nhlt_info(),
re->hlt_info())
459 std::vector<eformat::helper::StreamTag> stream_tags;
461 eformat::helper::decode(
re->nstream_tag(),
re->stream_tag(), stream_tags);
463 catch (
const std::exception& ex) {
464 ATH_MSG_ERROR(
"StreamTag decoding failed, caught an unexpected std::exception " << ex.what());
468 ATH_MSG_ERROR(
"StreamTag decoding failed, caught an unexpected exception");
471 ss <<
"--> stream_tags = ";
473 for (
const auto& st : stream_tags) {
474 if (first) first=
false;
476 ss <<
"{" << st.name <<
", " << st.type <<
", obeysLB=" << st.obeys_lumiblock <<
", robs=[";
480 ss <<
"]}" << std::endl;
Assign a CLID to EventContext.