36 return StatusCode::SUCCESS;
49 std::unordered_map<std::string,std::string> mapStrNameToTypeName;
52 mapStrNameToTypeName.insert({
stream.getAttribute(
"name"),
stream.getAttribute(
"type")+
"_"+
stream.getAttribute(
"name")});
55 ATH_MSG_ERROR(
"Exception reading stream tag configuration from the HLT menu: " << ex.what());
56 return StatusCode::FAILURE;
60 for (
const std::string&
group :
chain.groups()) {
62 if (
group.starts_with(
"RATE")){
70 if (
it==mapStrNameToTypeName.cend()) {
72 <<
" is missing from menu streams definition");
73 return StatusCode::FAILURE;
75 if (
it->second ==
"express_express") {
87 const int x {
nBinsX(hltMenuHandle)};
90 std::unique_ptr<TH2> hSA = std::make_unique<TH2I>(
"SignatureAcceptance",
"Raw acceptance of signatures in;chain;step",
x, 1,
x + 1,
y, 1,
y + 1);
91 std::unique_ptr<TH2> hDC = std::make_unique<TH2I>(
"DecisionCount",
"Positive decisions count per step;chain;step",
x, 1,
x + 1,
y, 1,
y + 1);
111 std::set<std::string> sequencesSet;
113 ctool->getSequencesNames(sequencesSet);
115 const int xc = sequencesSet.size();
118 const std::string outputSequenceName =
std::format(
"SequencesExecutionRate{:d}s",
m_duration.value());
126 return StatusCode::SUCCESS;
134 ATH_MSG_INFO(
"No chains configured, no counts to print" );
135 return StatusCode::SUCCESS;
142 std::unordered_map<std::string, std::set<int>> chainToStepsId;
145 for (
const std::string& seqName :
chain.sequencers()){
147 std::smatch stepNameMatch;
148 std::regex_search(seqName.begin(), seqName.end(), stepNameMatch,
std::regex(
"[Ss]tep[0-9]+"));
150 std::string stepName = stepNameMatch[0];
151 stepName[0] = std::toupper(stepName[0]);
154 chainToStepsId[
chain.name()].insert(nstep);
162 auto collToString = [&](
int xbin,
const LockedHandle<TH2>&
hist,
int startOfset=0,
int endOffset=0){
164 const int stepsSize =
hist->GetYaxis()->GetNbins() -
N_BINS;
165 for (
int ybin = 1; ybin <=
hist->GetYaxis()->GetNbins()-endOffset; ++ybin) {
166 if (ybin > startOfset) {
169 const std::string
chainName = m_passHistogram->GetXaxis()->GetBinLabel(xbin);
171 if (ybin < 3 || ybin > stepsSize + 2 || chainToStepsId[
chainName].
contains(ybin - 2)) {
172 v +=
std::format(
"{:<11d}",
static_cast<int>(
hist->GetBinContent(xbin, ybin)));
186 for (
int bin = 1;
bin <= m_passHistogram->GetYaxis()->GetNbins()-
N_BINS; ++
bin) {
192 ATH_MSG_INFO(
"Chains passing step (1st row events & 2nd row decision counts):");
200 for (
int bin = 1;
bin <= (*m_passHistogram)->GetXaxis()->GetNbins(); ++
bin) {
201 const std::string
chainName = m_passHistogram->GetXaxis()->GetBinLabel(
bin);
213 return StatusCode::SUCCESS;
224 histogram->Fill( id2bin->second,
static_cast<double>(
row) );
227 return StatusCode::SUCCESS;
246 m_countHistogram->Fill(id2bin->second,
static_cast<double>(
row));
250 return StatusCode::SUCCESS;
254 for (
const std::string&
seq : sequences) {
258 return StatusCode::SUCCESS;
264 int rowWithSteps =
row;
272 m_countHistogram->Fill(
bin, rowWithSteps);
273 m_passHistogram->Fill(
bin, rowWithSteps);
278 return StatusCode::SUCCESS;
285 ATH_MSG_WARNING(
"Timer is already running. UpdateAfterFork incident called more than once?");
306 [[maybe_unused]]
static const bool sanityCheckDone = [&] {
307 if (l1Decisions->
at(
INPUT-1)->name() ==
"l1seeded" &&
308 l1Decisions->
at(
AFTER_PS-1)->name() ==
"unprescaled") {
311 throw GaudiException(
m_l1DecisionsKey.key() +
" does not contain the expected entries",
312 name(), StatusCode::FAILURE);
323 m_passHistogram->Fill(1,
static_cast<double>(
index));
326 return StatusCode::SUCCESS;
335 std::vector<TrigCompositeUtils::DecisionID> stepSum;
336 std::set<std::string> stepSequences;
338 ctool->getDecisions( stepSum, stepSequences, context );
339 ATH_MSG_DEBUG(
" Step " <<
step <<
" decisions (for decisions): " << stepSum.size() );
345 stepSequences.clear();
351 ctool->getDecisions( stepSum, context );
352 ATH_MSG_DEBUG(
" Step " <<
step <<
" decisions (for features): " << stepSum.size() );
362 if (!decisionObject) {
363 ATH_MSG_WARNING(
"Unable to locate trigger navigation terminus node. Cannot tell which chains passed the event.");
371 if (!expressDecisionObject) {
372 ATH_MSG_WARNING(
"Unable to locate trigger navigation express terminus node. Cannot tell which chains passed the express stream in this event.");
393 if (!finalIDs.empty()) {
394 m_passHistogram->Fill(1,
static_cast<double>(countOutputRow));
397 if (!expressFinalIDs.empty()) {
398 m_passHistogram->Fill(1,
static_cast<double>(countExpressRow));
402 return StatusCode::SUCCESS;
414 return hltMenuHandle->
size() + 1;
422 TAxis*
x =
hist->GetXaxis();
423 x->SetBinLabel(1,
"All");
426 std::set<std::string> sortedChainsList;
428 sortedChainsList.insert(
chain.name() );
431 for (
const std::string&
chainName: sortedChainsList ) {
439 x->SetBinLabel(
bin, (
"str_"+
stream.first).c_str());
445 x->SetBinLabel(
bin, (
"str_"+
stream.first).c_str());
451 x->SetBinLabel(
bin, (
"grp_"+
group.first.substr(
group.first.find(
':')+1)).c_str() );
457 TAxis*
y =
hist->GetYaxis();
463 y->SetBinLabel(
y->GetNbins()-1,
"Output");
464 y->SetBinLabel(
y->GetNbins(),
"Express");
466 return StatusCode::SUCCESS;
470 TAxis*
x =
hist->GetXaxis();
474 for (
const std::string& seqName : sequenceSet) {
475 x->SetBinLabel(
bin, seqName.c_str());
480 TAxis*
y =
hist->GetYaxis();
481 y->SetBinLabel(1,
"Rate");
483 return StatusCode::SUCCESS;
488 delete m_bufferHistogram.get();
493 std::unique_ptr<TH2>
h = std::make_unique<TH2F>(histoName.c_str(), histoTitle.c_str(),
x, 1,
x + 1,
y, 1,
y + 1);
494 ATH_CHECK(
histSvc->regShared( registerPath.c_str(), std::move(
h), m_histogram));
496 TH2I * hB =
new TH2I( (histoName +
"Buffer").c_str(), histoTitle.c_str(),
x, 1,
x + 1,
y, 1,
y + 1);
497 m_bufferHistogram.set(hB, &m_mutex);
498 m_bufferHistogram->SetDirectory(0);
500 return StatusCode::SUCCESS;
508 return m_bufferHistogram;
516 m_bufferHistogram->Fill(
x,
y);
537 m_histogram->Reset(
"ICES");
538 m_histogram->Add(m_bufferHistogram.get(), 1./
duration);
539 m_bufferHistogram->Reset(
"ICES");
546 unsigned int newinterval;
547 unsigned int oldinterval;
549 if (m_timeDivider->isPassed(
t, newinterval, oldinterval)) {