Parse the truncation debug information, fill monitoring histograms, fill and record the debug info collection.
537 {
538
540 ATH_MSG_ERROR(
"HLT result truncation on total size! Limit of "
542 << " MB exceeded. Flagging all module IDs as truncated.");
545 }
546 }
547
548 for (const auto& [id, truncationInfoVec] : truncationInfoMap) {
550
552 debugInfoCont.
push_back(debugInfoThisModule);
553 xAOD::TrigComposite::Accessor<uint16_t> moduleId("moduleId");
554 xAOD::TrigComposite::Accessor<uint32_t>
totalSize(
"totalSize");
555 xAOD::TrigComposite::Accessor<std::vector<std::string>> typeNameVec("typeName");
556 xAOD::TrigComposite::Accessor<std::vector<uint32_t>> sizeVec("size");
557 xAOD::TrigComposite::Accessor<std::vector<char>> isRecordedVec("isRecorded");
558 std::pair<std::string, size_t> largestRecorded{"None", 0};
559 std::pair<std::string, size_t> largestDropped{"None", 0};
560 std::pair<std::string, size_t> firstDropped{"None", 0};
561 moduleId(*debugInfoThisModule) =
id;
563 bool severeTruncation = false;
564 bool truncated = false;
566
567 sizeSum += truncationInfo.size;
568 typeNameVec(*debugInfoThisModule).push_back(truncationInfo.addrPtr->persTypeName());
569 sizeVec(*debugInfoThisModule).push_back(truncationInfo.size);
570 isRecordedVec(*debugInfoThisModule).push_back(static_cast<char>(truncationInfo.recorded));
571 if (truncationInfo.recorded && truncationInfo.size > largestRecorded.second) {
572 largestRecorded = {truncationInfo.addrPtr->persTypeName(), truncationInfo.size};
573 }
574 if (!truncationInfo.recorded && truncationInfo.size > largestDropped.second) {
575 largestDropped = {truncationInfo.addrPtr->persTypeName(), truncationInfo.size};
576 }
577 if (!truncationInfo.recorded && !truncated) {
578 firstDropped = {truncationInfo.addrPtr->persTypeName(), truncationInfo.size};
579 truncated = true;
580 }
581
582 if (!truncationInfo.recorded) {
584 }
585 }
586 totalSize(*debugInfoThisModule) = sizeSum;
587 msg(severeTruncation ? MSG::ERROR : MSG::WARNING)
588 << "HLT result truncation" << (severeTruncation ? "." : " in low priority collections.")
589 << " Module ID: " << id << ", limit: "
591 << sizeSum/1024. << " kB, largest recorded collection: " << largestRecorded.first
592 << " (" << largestRecorded.second/1024. << " kB), largest dropped collection: "
593 << largestDropped.first << " (" << largestDropped.second/1024. << " kB), "
594 << " first dropped collection: " <<firstDropped.first << " (" << firstDropped.second/1024. << " kB)"
596
597 using namespace TrigCompositeUtils;
600 if (terminus) {
601 std::stringstream
ss;
602 ss <<
"Passing chains in this event: ";
604 ss << HLT::Identifier(chainID).name() <<
", ";
606 }
608 }
609
610 const std::string
prefix = severeTruncation ?
"" :
"Allowed";
611 auto monModuleId = Monitored::Scalar<int>(prefix+"Truncation_ModuleId", id);
612 auto monTotalSize = Monitored::Scalar<float>(prefix+"Truncation_TotalSize", sizeSum/1024.);
613 auto monLargestName = Monitored::Scalar<std::string>(
614 prefix+"Truncation_LargestName",
615 largestRecorded.second > largestDropped.second ? largestRecorded.first : largestDropped.first);
616 auto monLargestSize = Monitored::Scalar<float>(
617 prefix+"Truncation_LargestSize",
618 largestRecorded.second > largestDropped.second ? largestRecorded.second/1024. : largestDropped.second/1024.);
619 auto mon = Monitored::Group(
m_monTool, monModuleId, monTotalSize, monLargestName, monLargestSize);
620 }
621 }
622
623 if (!debugInfoCont.
empty()) {
624 std::vector<Address> debugInfoAddressVec;
625 const std::string debugInfoID = std::string(
"xAOD::TrigCompositeContainer#")+
m_debugInfoWHKey.key()+
";0";
626 const std::string debugInfoAuxID = std::string(
"xAOD::TrigCompositeAuxContainer#")+
m_debugInfoWHKey.key()+
"Aux.;0";
629 std::vector<uint32_t>
buffer;
630 for (
const Address& address : debugInfoAddressVec) {
634
635 }
636 }
637 return StatusCode::SUCCESS;
638}
char data[hepevt_bytes_allocation_ATLAS]
xAOD::TrigComposite Decision
void decisionIDs(const Decision *d, DecisionIDContainer &id)
Extracts DecisionIDs stored in the Decision object.
static unsigned int totalSize(const MultiDimArray< T, N > &ht)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
bool empty() const noexcept
Returns true if the collection is empty.
void addTruncatedModuleId(const uint16_t moduleId, bool severeTruncation=true)
Add module ID to the list of truncated results.
void addSerialisedData(const uint16_t moduleId, const std::vector< uint32_t > &data)
Append serialised data (copy of input) for a given moduleId, doesn't remove existing data.
const Decision * getTerminusNode(SG::ReadHandle< DecisionContainer > &container)
TrigComposite_v1 TrigComposite
Declare the latest version of the class.