Produce a subset of IAlgExecStateSvc::algExecStates with only non-success StatusCodes and fill relevant histograms.
39 {
40 std::unordered_map<std::string_view, StatusCode> algErrors;
41 bool wasTimeout = false;
42 SmartIF<IAlgManager> algMgr{serviceLocator()->as<IAlgManager>()};
43 for (const IAlgorithm* alg : algMgr->getAlgorithms()) {
44 auto state =
alg->execState(eventContext);
45 if (!state.execStatus().isSuccess() && state.state()!=AlgExecState::State::None) {
46
47 ATH_MSG_DEBUG(
"Algorithm " <<
alg->name() <<
" returned StatusCode " << state.execStatus().message()
48 << " in event " << eventContext.eventID());
49 algErrors[
alg->name()] = state.execStatus();
50 auto monErrorAlgName = Monitored::Scalar<std::string>(
"ErrorAlgName",
alg->name());
51 auto monErrorCode = Monitored::Scalar<std::string>("ErrorCode", state.execStatus().message());
52 auto mon = Monitored::Group(
m_monTool, monErrorAlgName, monErrorCode);
53
55 std::set<std::string> chainNames =
m_algToChainTool->getActiveChainsForAlg(
alg->name(), eventContext);
56
57 std::vector<std::string> chainNamesVec(chainNames.begin(), chainNames.end());
58
60 Monitored::Group(
m_monTool, monErrorChainNames, monErrorCode);
61 }
62
64
65 wasTimeout = true;
66 }
67 }
68 }
69
71 std::string timeoutReport;
72 if (
m_trigCostSvcHandle->generateTimeoutReport(eventContext, timeoutReport) == StatusCode::FAILURE){
74 }
75 else if (timeoutReport.empty()){
76 ATH_MSG_INFO(
"CostMonitoring not active in this event. A list of slow algorithms is not available.");
77 }
78 else {
80 }
81 }
82
83 return algErrors;
84}
@ TIMEOUT
Timeout during event processing.
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.