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;
225 lockedHist->Fill( id2bin->second,
static_cast<double>(
row) );
232 return StatusCode::SUCCESS;
251 m_countHistogram->Fill(id2bin->second,
static_cast<double>(
row));
255 return StatusCode::SUCCESS;
259 for (
const std::string&
seq : sequences) {
263 return StatusCode::SUCCESS;
269 int rowWithSteps =
row;
277 m_countHistogram->Fill(
bin, rowWithSteps);
278 m_passHistogram->Fill(
bin, rowWithSteps);
283 return StatusCode::SUCCESS;
290 ATH_MSG_WARNING(
"Timer is already running. UpdateAfterFork incident called more than once?");
311 [[maybe_unused]]
static const bool sanityCheckDone = [&] {
312 if (l1Decisions->
at(
INPUT-1)->name() ==
"l1seeded" &&
313 l1Decisions->
at(
AFTER_PS-1)->name() ==
"unprescaled") {
316 throw GaudiException(
m_l1DecisionsKey.key() +
" does not contain the expected entries",
317 name(), StatusCode::FAILURE);
328 m_passHistogram->Fill(1,
static_cast<double>(
index));
331 return StatusCode::SUCCESS;
340 std::vector<TrigCompositeUtils::DecisionID> stepSum;
341 std::set<std::string> stepSequences;
343 ctool->getDecisions( stepSum, stepSequences, context );
344 ATH_MSG_DEBUG(
" Step " <<
step <<
" decisions (for decisions): " << stepSum.size() );
350 stepSequences.clear();
356 ctool->getDecisions( stepSum, context );
357 ATH_MSG_DEBUG(
" Step " <<
step <<
" decisions (for features): " << stepSum.size() );
367 if (!decisionObject) {
368 ATH_MSG_WARNING(
"Unable to locate trigger navigation terminus node. Cannot tell which chains passed the event.");
376 if (!expressDecisionObject) {
377 ATH_MSG_WARNING(
"Unable to locate trigger navigation express terminus node. Cannot tell which chains passed the express stream in this event.");
398 if (!finalIDs.empty()) {
399 m_passHistogram->Fill(1,
static_cast<double>(countOutputRow));
402 if (!expressFinalIDs.empty()) {
403 m_passHistogram->Fill(1,
static_cast<double>(countExpressRow));
407 return StatusCode::SUCCESS;
419 return hltMenuHandle->
size() + 1;
427 TAxis*
x =
hist->GetXaxis();
428 x->SetBinLabel(1,
"All");
431 std::set<std::string> sortedChainsList;
433 sortedChainsList.insert(
chain.name() );
436 for (
const std::string&
chainName: sortedChainsList ) {
444 x->SetBinLabel(
bin, (
"str_"+
stream.first).c_str());
450 x->SetBinLabel(
bin, (
"str_"+
stream.first).c_str());
456 x->SetBinLabel(
bin, (
"grp_"+
group.first.substr(
group.first.find(
':')+1)).c_str() );
462 TAxis*
y =
hist->GetYaxis();
468 y->SetBinLabel(
y->GetNbins()-1,
"Output");
469 y->SetBinLabel(
y->GetNbins(),
"Express");
471 return StatusCode::SUCCESS;
475 TAxis*
x =
hist->GetXaxis();
479 for (
const std::string& seqName : sequenceSet) {
480 x->SetBinLabel(
bin, seqName.c_str());
485 TAxis*
y =
hist->GetYaxis();
486 y->SetBinLabel(1,
"Rate");
488 return StatusCode::SUCCESS;
493 delete m_bufferHistogram.get();
498 std::unique_ptr<TH2>
h = std::make_unique<TH2F>(histoName.c_str(), histoTitle.c_str(),
x, 1,
x + 1,
y, 1,
y + 1);
499 ATH_CHECK(
histSvc->regShared( registerPath.c_str(), std::move(
h), m_histogram));
501 TH2I * hB =
new TH2I( (histoName +
"Buffer").c_str(), histoTitle.c_str(),
x, 1,
x + 1,
y, 1,
y + 1);
502 m_bufferHistogram.set(hB, &m_mutex);
503 m_bufferHistogram->SetDirectory(0);
505 return StatusCode::SUCCESS;
513 return m_bufferHistogram;
521 m_bufferHistogram->Fill(
x,
y);
542 m_histogram->Reset(
"ICES");
543 m_histogram->Add(m_bufferHistogram.get(), 1./
duration);
544 m_bufferHistogram->Reset(
"ICES");
551 unsigned int newinterval;
552 unsigned int oldinterval;
554 if (m_timeDivider->isPassed(
t, newinterval, oldinterval)) {