ATLAS Offline Software
Loading...
Searching...
No Matches
TrigSignatureMoni.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "TrigSignatureMoni.h"
6
9
10#include <algorithm>
11#include <regex>
12#include <format>
13#include <chrono>
14
16enum BINS {
17 INPUT = 1,
19 OUTPUT = 3,
22};
23
24
26 ATH_CHECK(m_l1DecisionsKey.initialize());
27 ATH_CHECK(m_finalDecisionKey.initialize());
28 ATH_CHECK(m_HLTMenuKey.initialize());
29 ATH_CHECK(m_L1MenuKey.initialize());
32 ATH_CHECK(m_histSvc.retrieve());
33
34 ATH_CHECK(m_incidentSvc.retrieve());
36
37 return StatusCode::SUCCESS;
38}
39
43 ATH_CHECK(hltMenuHandle.isValid());
44
45 // Retrieve chain information from menus
46 m_groupToChainMap.clear();
47 m_streamToChainMap.clear();
48 m_expressChainMap.clear();
49
50 std::unordered_map<std::string,std::string> mapStrNameToTypeName; // e.g. {Main -> physics_Main}
51 try {
52 for (const TrigConf::DataStructure& stream : hltMenuHandle->streams()) {
53 mapStrNameToTypeName.insert({stream.getAttribute("name"), stream.getAttribute("type")+"_"+stream.getAttribute("name")});
54 }
55 } catch (const std::exception& ex) {
56 ATH_MSG_ERROR("Exception reading stream tag configuration from the HLT menu: " << ex.what());
57 return StatusCode::FAILURE;
58 }
59
60 for (const TrigConf::Chain& chain : *hltMenuHandle) {
61 for (const std::string& group : chain.groups()) {
62 // Save chains per RATE group
63 if (group.starts_with( "RATE")){
64 m_groupToChainMap[group].insert(HLT::Identifier(chain.name()));
65 }
66 }
67
68 // Save chain to stream map
69 for (const std::string& streamName : chain.streams()){
70 const auto it = mapStrNameToTypeName.find(streamName);
71 if (it==mapStrNameToTypeName.cend()) {
72 ATH_MSG_ERROR("Stream name " << streamName << " assigned to chain " << chain.name()
73 << " is missing from menu streams definition");
74 return StatusCode::FAILURE;
75 }
76 if (it->second == "express_express") {
77 m_expressChainMap[it->second].insert(HLT::Identifier(chain.name()));
78 } else {
79 m_streamToChainMap[it->second].insert(HLT::Identifier(chain.name()));
80 }
81 }
82 }
83
84 // Prepare the histograms
85
86 // Initialize SignatureAcceptance and DecisionCount histograms that will monitor
87 // chains, groups and sequences per each step
88 const int x {nBinsX(hltMenuHandle)};
89 const int y {nSteps() + N_BINS};
90 ATH_MSG_DEBUG( "Histogram " << x << " x " << y << " bins");
91 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);
92 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);
93
94 ATH_CHECK(m_histSvc->regShared(m_bookingPath + "/" + name() + "/SignatureAcceptance", std::move(hSA), m_passHistogram));
95 ATH_CHECK(m_histSvc->regShared(m_bookingPath + "/" + name() + "/DecisionCount", std::move(hDC), m_countHistogram));
96
97 ATH_CHECK(initHist(m_passHistogram, hltMenuHandle));
98 ATH_CHECK(initHist(m_countHistogram, hltMenuHandle));
99
100 // Initialize Rate histogram to save the rates of positive decisions in given interval
101 // per chain/group/sequence per in, after ps, out steps
102 if ( x > 0 ){
103 const std::string outputRateName = std::format("Rate{:d}s", m_duration.value());
104 m_rateHistogram.init(outputRateName, "Rate of positive decisions;chain;step", x, N_BINS,
105 std::format("{}/{}/{}", m_bookingPath.value(), name(), outputRateName), m_histSvc).ignore();
106 ATH_CHECK(initHist(m_rateHistogram.getHistogram(), hltMenuHandle, false));
107 ATH_CHECK(initHist(m_rateHistogram.getBuffer(), hltMenuHandle, false));
108 }
109
110 // Initialize SequencesExecutionRate histogram to save the rates of sequences execution
111 // Save sequences names to be monitored
112 std::set<std::string> sequencesSet;
113 for (auto& ctool: m_decisionCollectorTools){
114 ctool->getSequencesNames(sequencesSet);
115 }
116 const int xc = sequencesSet.size();
117 const int yc {1}; // Only rate, this histogram is really 1 D
118 if (xc > 0){
119 const std::string outputSequenceName = std::format("SequencesExecutionRate{:d}s", m_duration.value());
120 m_sequenceHistogram.init(outputSequenceName, "Rate of sequences execution;sequence;rate", xc, yc,
121 std::format("{}/{}/{}", m_bookingPath.value(), name(), outputSequenceName), m_histSvc).ignore();
122
123 ATH_CHECK(initSeqHist(m_sequenceHistogram.getHistogram(), sequencesSet));
124 ATH_CHECK(initSeqHist(m_sequenceHistogram.getBuffer(), sequencesSet));
125 }
126
127 return StatusCode::SUCCESS;
128}
129
131 m_rateHistogram.stopTimer();
132 m_sequenceHistogram.stopTimer();
133
134 if (m_chainIDToBinMap.empty()) {
135 ATH_MSG_INFO( "No chains configured, no counts to print" );
136 return StatusCode::SUCCESS;
137 }
138
140 ATH_CHECK(hltMenuHandle.isValid());
141
142 // Retrieve information whether chain was active in Step
143 std::unordered_map<std::string, std::set<int>> chainToStepsId;
144 for (const TrigConf::Chain& chain : *hltMenuHandle){
145 int nstep {1}; // Start from step=1
146 for (const std::string& seqName : chain.sequencers()){
147 // Example sequencer name is "Step1_FastCalo_electron", we need only information about Step + number
148 std::smatch stepNameMatch;
149 std::regex_search(seqName.begin(), seqName.end(), stepNameMatch, std::regex("[Ss]tep[0-9]+"));
150
151 std::string stepName = stepNameMatch[0];
152 stepName[0] = std::toupper(stepName[0]); // Fix "stepX" -> "StepX"
153 // Check that the step name is set with the same position in the execution (empty steps support)
154 if (std::format("Step{:d}", nstep) == stepName) {
155 chainToStepsId[chain.name()].insert(nstep);
156 } else {
157 ATH_MSG_DEBUG("Missing counts for step" << nstep << " in chain " << chain.name());
158 }
159 nstep++;
160 }
161 }
162
163 auto collToString = [&](int xbin, const LockedHandle<TH2>& hist, int startOfset=0, int endOffset=0){
164 std::string v;
165 const int stepsSize = hist->GetYaxis()->GetNbins() - N_BINS;
166 for (int ybin = 1; ybin <= hist->GetYaxis()->GetNbins()-endOffset; ++ybin) {
167 if (ybin > startOfset) {
168 // Skip steps where chain wasn't active
169 // ybins are for all axis labes, steps are in bins from 3 to stepsSize + 2
170 const std::string chainName = m_passHistogram->GetXaxis()->GetBinLabel(xbin);
171
172 if (ybin < 3 || ybin > stepsSize + 2 || chainToStepsId[chainName].contains(ybin - 2)) {
173 v += std::format("{:<11d}", static_cast<int>(hist->GetBinContent(xbin, ybin)));
174 } else {
175 v += std::format("{:<11s}", "-");
176 }
177 } else {
178 v += std::format("{:<11s}", " ");
179 }
180 }
181 return v;
182 };
183
184 std::string v;
185 v += std::format("{:<11s}", "L1");
186 v += std::format("{:<11s}", "AfterPS");
187 for (int bin = 1; bin <= m_passHistogram->GetYaxis()->GetNbins()-N_BINS; ++bin) {
188 v += std::format("Step{:<7d}", bin);
189 }
190 v += std::format("{:<11s}", "Output");
191 v += std::format("{:<11s}", "Express");
192
193 ATH_MSG_INFO("Chains passing step (1st row events & 2nd row decision counts):");
194 ATH_MSG_INFO(std::format("{:<30s}", "ChainName") << v);
195
196 /*
197 comment for future dev:
198 for combined chains we find x2 the number of decisions, because we count both the HypoAlg and the combo Alg decisions
199 */
200
201 for (int bin = 1; bin <= (*m_passHistogram)->GetXaxis()->GetNbins(); ++bin) {
202 const std::string chainName = m_passHistogram->GetXaxis()->GetBinLabel(bin);
203 const std::string chainID = std::to_string(HLT::Identifier(chainName));
204 if (chainName.starts_with( "HLT")) { // print only for chains
205 ATH_MSG_INFO( std::format("{:s} #{:s}", chainName, chainID) );
206 ATH_MSG_INFO( std::format("{:<30s}", std::format("-- #{} Events", chainID)) << collToString( bin, m_passHistogram) );
207 ATH_MSG_INFO( std::format("{:<30s}", std::format("-- #{} Features", chainID)) << collToString( bin, m_countHistogram , 2, 1 ) );
208 }
209 if (chainName.starts_with( "All")){
210 ATH_MSG_INFO( std::format("{:<30s}", chainName) << collToString( bin, m_passHistogram) );
211 }
212 }
213
214 return StatusCode::SUCCESS;
215}
216
217StatusCode TrigSignatureMoni::fillHistogram(const TrigCompositeUtils::DecisionIDContainer& dc, int row, LockedHandle<TH2>& histogram) const {
218
219 // This locks the histogram handle for the entire duration of the function,
220 // which is faster than (un)locking the handle many times during the loop.
221 auto lockedHist = *histogram;
222
223 for (TrigCompositeUtils::DecisionID id : dc) {
224 auto id2bin = m_chainIDToBinMap.find( id );
225 if ( id2bin != m_chainIDToBinMap.end() ) {
226 lockedHist->Fill( id2bin->second, static_cast<double>(row) );
227 }
228 else {
230 ATH_MSG_WARNING( "HLT chain " << HLT::Identifier(id) << " not configured to be monitored" );
231 }
232 }
233 return StatusCode::SUCCESS;
234}
235
237 return fillHistogram(dc, row, m_rateHistogram.getBuffer());
238}
239
241 return fillHistogram(dc, row, m_passHistogram);
242}
243
244StatusCode TrigSignatureMoni::fillDecisionCount(const std::vector<TrigCompositeUtils::DecisionID>& dc, int row) const {
245 for (TrigCompositeUtils::DecisionID id : dc) {
248 auto id2bin = m_chainIDToBinMap.find( chain );
249 if ( id2bin == m_chainIDToBinMap.end()) {
250 ATH_MSG_WARNING("HLT chain " << HLT::Identifier(chain) << " not configured to be monitored");
251 } else {
252 m_countHistogram->Fill(id2bin->second, static_cast<double>(row));
253 }
254 }
255
256 return StatusCode::SUCCESS;
257}
258
259StatusCode TrigSignatureMoni::fillSequences(const std::set<std::string>& sequences) const {
260 for (const std::string& seq : sequences) {
262 }
263
264 return StatusCode::SUCCESS;
265}
266
267StatusCode TrigSignatureMoni::fillStreamsAndGroups(const std::map<std::string, TrigCompositeUtils::DecisionIDContainer>& nameToChainsMap, const TrigCompositeUtils::DecisionIDContainer& dc, int row) const {
268
269 // Adjust bin index for those histograms that monitor all steps
270 int rowWithSteps = row;
271 if (row==OUTPUT || row==EXPRESS) rowWithSteps += m_decisionCollectorTools.size();
272
273 for (const auto& [name, decisions] : nameToChainsMap) {
274 for (TrigCompositeUtils::DecisionID id : dc) {
275 if (decisions.contains(id)) {
276 const double bin = m_nameToBinMap.at(name);
277 m_rateHistogram.fill(bin, row);
278 m_countHistogram->Fill(bin, rowWithSteps);
279 m_passHistogram->Fill(bin, rowWithSteps);
280 break;
281 }
282 }
283 }
284 return StatusCode::SUCCESS;
285}
286
287void TrigSignatureMoni::handle( const Incident& incident ) {
288 // Create and start timer after fork
289 if (incident.type() == AthenaInterprocess::UpdateAfterFork::type()) {
290 if (m_rateHistogram.getTimer() || m_sequenceHistogram.getTimer()) {
291 ATH_MSG_WARNING("Timer is already running. UpdateAfterFork incident called more than once?");
292 return;
293 }
294
295 // Prevent from publishing empty histograms
296 if (nBinsX() > 0) {
298 }
299
300 if (!m_sequenceToBinMap.empty()) {
302 }
303
304 ATH_MSG_DEBUG("Started rate timer");
305 }
306}
307
308StatusCode TrigSignatureMoni::execute( const EventContext& context ) const {
309
311
312 [[maybe_unused]] static const bool sanityCheckDone = [&] {
313 if (l1Decisions->at(INPUT-1)->name() == "l1seeded" &&
314 l1Decisions->at(AFTER_PS-1)->name() == "unprescaled") {
315 return true;
316 }
317 throw GaudiException(m_l1DecisionsKey.key() + " does not contain the expected entries",
318 name(), StatusCode::FAILURE);
319 }();
320
321 auto fillL1 = [&](int index) -> StatusCode {
323 TrigCompositeUtils::decisionIDs(l1Decisions->at(index-1), ids);
324 ATH_MSG_DEBUG( "L1 " << index-1 << " N positive decisions " << ids.size() );
327 ATH_CHECK(fillRate(ids, index));
328 if (!ids.empty()){
329 m_passHistogram->Fill(1, static_cast<double>(index));
330 m_rateHistogram.fill(1, static_cast<double>(index));
331 }
332 return StatusCode::SUCCESS;
333 };
334
335 // Fill histograms with L1 decisions in and after prescale
336 ATH_CHECK(fillL1(INPUT));
337 ATH_CHECK(fillL1(AFTER_PS));
338
339 // Fill HLT steps
340 int step = 0;
341 std::vector<TrigCompositeUtils::DecisionID> stepSum;
342 std::set<std::string> stepSequences;
343 for ( auto& ctool: m_decisionCollectorTools ) {
344 ctool->getDecisions( stepSum, stepSequences, context );
345 ATH_MSG_DEBUG( " Step " << step << " decisions (for decisions): " << stepSum.size() );
346 TrigCompositeUtils::DecisionIDContainer stepUniqueSum( stepSum.begin(), stepSum.end() );
347 ATH_CHECK( fillPassEvents( stepUniqueSum, 3+step ) );
348 ATH_CHECK( fillSequences( stepSequences ) );
349 ++step;
350 stepSum.clear();
351 stepSequences.clear();
352 }
353
354 step = 0;
355 for ( auto& ctool: m_featureCollectorTools ) {
356 stepSum.clear();
357 ctool->getDecisions( stepSum, context );
358 ATH_MSG_DEBUG( " Step " << step << " decisions (for features): " << stepSum.size() );
359 ATH_CHECK( fillDecisionCount( stepSum, 3+step ) );
360 ++step;
361 }
362
363 // Collect the final decisions
365 ATH_CHECK( finalDecisionsHandle.isValid() );
367 const TrigCompositeUtils::Decision* decisionObject = TrigCompositeUtils::getTerminusNode(*finalDecisionsHandle);
368 if (!decisionObject) {
369 ATH_MSG_WARNING("Unable to locate trigger navigation terminus node. Cannot tell which chains passed the event.");
370 } else {
371 TrigCompositeUtils::decisionIDs(decisionObject, finalIDs);
372 }
373
374 // Collect the express stream decisions
376 const TrigCompositeUtils::Decision* expressDecisionObject = TrigCompositeUtils::getExpressTerminusNode(*finalDecisionsHandle);
377 if (!expressDecisionObject) {
378 ATH_MSG_WARNING("Unable to locate trigger navigation express terminus node. Cannot tell which chains passed the express stream in this event.");
379 } else {
380 TrigCompositeUtils::decisionIDs(expressDecisionObject, expressFinalIDs);
381 }
382
383 // Fill the histograms with output counts/rate
384 const int countOutputRow {nSteps() + OUTPUT};
387 ATH_CHECK( fillPassEvents(finalIDs, countOutputRow));
388 ATH_CHECK( fillRate(finalIDs, OUTPUT));
389
390 // Fill the histograms with express counts/rate
391 const int countExpressRow {nSteps() + EXPRESS};
392 // express stream rate is filled into OUTPUT bin on purpose
395 ATH_CHECK( fillPassEvents(expressFinalIDs, countExpressRow));
396 ATH_CHECK( fillRate(expressFinalIDs, EXPRESS));
397
398 // Fill the "All" column in counts/rate histograms
399 if (!finalIDs.empty()) {
400 m_passHistogram->Fill(1, static_cast<double>(countOutputRow));
401 m_rateHistogram.fill(1, static_cast<double>(OUTPUT));
402 }
403 if (!expressFinalIDs.empty()) {
404 m_passHistogram->Fill(1, static_cast<double>(countExpressRow));
405 m_rateHistogram.fill(1, static_cast<double>(EXPRESS));
406 }
407
408 return StatusCode::SUCCESS;
409}
410
412 return nChains(hltMenuHandle) + m_groupToChainMap.size() + m_streamToChainMap.size() + m_expressChainMap.size();
413}
414
416 return m_chainIDToBinMap.size() + m_groupToChainMap.size() + m_streamToChainMap.size() + m_expressChainMap.size() + 1;
417}
418
420 return hltMenuHandle->size() + 1; // Chains + "All"
421}
422
424 return m_decisionCollectorTools.size();
425}
426
427StatusCode TrigSignatureMoni::initHist(LockedHandle<TH2>& hist, SG::ReadHandle<TrigConf::HLTMenu>& hltMenuHandle, bool steps) {
428 TAxis* x = hist->GetXaxis();
429 x->SetBinLabel(1, "All");
430 int bin = 2; // 1 is for total count, (remember bin numbering in ROOT starts from 1)
431
432 std::set<std::string> sortedChainsList;
433 for ( const TrigConf::Chain& chain: *hltMenuHandle ) {
434 sortedChainsList.insert( chain.name() );
435 }
436
437 for ( const std::string& chainName: sortedChainsList ) {
438 x->SetBinLabel( bin, chainName.c_str() );
439 m_chainIDToBinMap[ HLT::Identifier( chainName ).numeric() ] = bin;
440 bin++;
441 }
442
443
444 for ( const auto& stream : m_streamToChainMap){
445 x->SetBinLabel( bin, ("str_"+stream.first).c_str());
446 m_nameToBinMap[ stream.first ] = bin;
447 bin++;
448 }
449
450 for ( const auto& stream : m_expressChainMap){
451 x->SetBinLabel( bin, ("str_"+stream.first).c_str());
452 m_nameToBinMap[ stream.first ] = bin;
453 bin++;
454 }
455
456 for ( const auto& group : m_groupToChainMap){
457 x->SetBinLabel( bin, ("grp_"+group.first.substr(group.first.find(':')+1)).c_str() );
458 m_nameToBinMap[ group.first ] = bin;
459 bin++;
460 }
461
462
463 TAxis* y = hist->GetYaxis();
464 y->SetBinLabel(INPUT, steps ? "L1" : "Input");
465 y->SetBinLabel(AFTER_PS, "AfterPS");
466 for ( size_t i = 0; steps && i < m_decisionCollectorTools.size(); ++i) {
467 y->SetBinLabel(3 + i, std::format("Step {:d}", i).c_str());
468 }
469 y->SetBinLabel(y->GetNbins()-1, "Output"); // Second to last bin
470 y->SetBinLabel(y->GetNbins(), "Express"); // Last bin
471
472 return StatusCode::SUCCESS;
473}
474
475StatusCode TrigSignatureMoni::initSeqHist(LockedHandle<TH2>& hist, std::set<std::string>& sequenceSet) {
476 TAxis* x = hist->GetXaxis();
477 int bin = 1;
478
479 // Set bin labels
480 for (const std::string& seqName : sequenceSet) {
481 x->SetBinLabel(bin, seqName.c_str());
482 m_sequenceToBinMap[seqName] = bin;
483 ++bin;
484 }
485
486 TAxis* y = hist->GetYaxis();
487 y->SetBinLabel(1, "Rate");
488
489 return StatusCode::SUCCESS;
490}
491
492
494 delete m_bufferHistogram.get();
495}
496
497StatusCode TrigSignatureMoni::RateHistogram::init( const std::string& histoName, const std::string& histoTitle,
498 const int x, const int y, const std::string& registerPath, const ServiceHandle<ITHistSvc>& histSvc ){
499 std::unique_ptr<TH2> h = std::make_unique<TH2F>(histoName.c_str(), histoTitle.c_str(), x, 1, x + 1, y, 1, y + 1);
500 ATH_CHECK( histSvc->regShared( registerPath.c_str(), std::move(h), m_histogram));
501
502 TH2I * hB = new TH2I( (histoName + "Buffer").c_str(), histoTitle.c_str(), x, 1, x + 1, y, 1, y + 1);
503 m_bufferHistogram.set(hB, &m_mutex);
504 m_bufferHistogram->SetDirectory(0);
505
506 return StatusCode::SUCCESS;
507}
508
509LockedHandle<TH2> & TrigSignatureMoni::RateHistogram::getHistogram ATLAS_NOT_CONST_THREAD_SAFE () const {
510 return m_histogram;
511}
512
513LockedHandle<TH2> & TrigSignatureMoni::RateHistogram::getBuffer ATLAS_NOT_CONST_THREAD_SAFE () const {
514 return m_bufferHistogram;
515}
516
517std::unique_ptr<Gaudi::Utils::PeriodicAction> & TrigSignatureMoni::RateHistogram::getTimer() {
518 return m_timer;
519}
520
521void TrigSignatureMoni::RateHistogram::fill(const double x, const double y) const {
522 m_bufferHistogram->Fill(x, y);
523}
524
525void TrigSignatureMoni::RateHistogram::startTimer(unsigned int duration, unsigned int intervals) {
526 m_duration = duration;
527 m_timeDivider = std::make_unique<TimeDivider>(intervals, duration, TimeDivider::seconds);
528 // Periodic timer with 1/20 of the integration period
529 m_timer = std::make_unique<Gaudi::Utils::PeriodicAction>(std::bind(&RateHistogram::callback, this),
530 std::chrono::milliseconds(duration*1000/20));
531}
532
534 if (m_timer) {
535 m_timer->stop();
536 time_t t = time(0);
537 unsigned int interval;
538 unsigned int duration = m_timeDivider->forcePassed(t, interval);
539 updatePublished(duration); // Divide by time that really passed not by interval duration
540 }
541
542}
543
544void TrigSignatureMoni::RateHistogram::updatePublished(unsigned int duration) const {
545 m_histogram->Reset("ICES");
546 m_histogram->Add(m_bufferHistogram.get(), 1./duration);
547 m_bufferHistogram->Reset("ICES");
548}
549
550
552 // Ask time divider if we need to switch to new interval
553 time_t t = time(0);
554 unsigned int newinterval;
555 unsigned int oldinterval;
556 if (m_timeDivider->isPassed(t, newinterval, oldinterval)) {
558 }
559}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
BINS
Default bin numbers.
#define y
#define x
std::string histogram
Definition chains.cxx:52
#define ATLAS_NOT_CONST_THREAD_SAFE
Header file for AthHistogramAlgorithm.
static const std::string & type()
Incident type.
Definition Incidents.h:49
TrigCompositeUtils::DecisionID numeric() const
numeric ID
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Base class for Trigger configuration data and wrapper around underlying representation.
void updatePublished(unsigned int duration) const
std::unique_ptr< Gaudi::Utils::PeriodicAction > m_timer
void startTimer(unsigned int duration, unsigned int intervals)
void fill(const double x, const double y) const
StatusCode init(const std::string &histoName, const std::string &histoTitle, const int x, const int y, const std::string &registerPath, const ServiceHandle< ITHistSvc > &histSvc)
std::unique_ptr< Gaudi::Utils::PeriodicAction > & getTimer()
std::unique_ptr< TimeDivider > m_timeDivider
std::unordered_map< std::string, int > m_sequenceToBinMap
Sequence to bin map for sequence histogram.
int nChains(SG::ReadHandle< TrigConf::HLTMenu > &) const
StatusCode initHist(LockedHandle< TH2 > &, SG::ReadHandle< TrigConf::HLTMenu > &, bool=true)
Gaudi::Property< unsigned int > m_intervals
StatusCode fillPassEvents(const TrigCompositeUtils::DecisionIDContainer &, int) const
Gaudi::Property< unsigned int > m_duration
StatusCode initSeqHist(LockedHandle< TH2 > &, std::set< std::string > &)
virtual StatusCode start() override
StatusCode fillRate(const TrigCompositeUtils::DecisionIDContainer &, int) const
std::map< std::string, TrigCompositeUtils::DecisionIDContainer > m_streamToChainMap
Stream name to chain objects map, excluding express.
virtual StatusCode initialize() override
StatusCode fillDecisionCount(const std::vector< TrigCompositeUtils::DecisionID > &, int) const
virtual StatusCode execute(const EventContext &context) const override
RateHistogram m_sequenceHistogram
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > m_l1DecisionsKey
ServiceHandle< ITHistSvc > m_histSvc
std::map< std::string, TrigCompositeUtils::DecisionIDContainer > m_expressChainMap
Stream name to chain objects map, including only express.
StatusCode fillHistogram(const TrigCompositeUtils::DecisionIDContainer &, int, LockedHandle< TH2 > &) const
std::map< std::string, TrigCompositeUtils::DecisionIDContainer > m_groupToChainMap
Group name to chain objects map.
SG::ReadHandleKey< TrigConf::L1Menu > m_L1MenuKey
StatusCode fillSequences(const std::set< std::string > &) const
ServiceHandle< IIncidentSvc > m_incidentSvc
RateHistogram m_rateHistogram
SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > m_finalDecisionKey
Gaudi::Property< std::string > m_bookingPath
std::unordered_map< std::string, int > m_nameToBinMap
Sequence/group/bunchgroup name to bin map.
SG::ReadHandleKey< TrigConf::HLTMenu > m_HLTMenuKey
StatusCode fillStreamsAndGroups(const std::map< std::string, TrigCompositeUtils::DecisionIDContainer > &, const TrigCompositeUtils::DecisionIDContainer &, int) const
virtual StatusCode stop() override
virtual void handle(const Incident &incident) override
ToolHandleArray< DecisionCollectorTool > m_decisionCollectorTools
ToolHandleArray< DecisionCollectorTool > m_featureCollectorTools
std::unordered_map< unsigned int, int > m_chainIDToBinMap
Chain id to histogram bin map.
bool contains(const std::string &s, const std::string &regx)
does a string contain the substring
Definition hcg.cxx:114
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
unsigned int DecisionID
const Decision * getExpressTerminusNode(const DecisionContainer &container)
Returns the express-accept navigation node from a collection or nullptr if missing.
HLT::Identifier getIDFromLeg(const HLT::Identifier &legIdentifier)
Generate the HLT::Identifier which corresponds to the chain name from the leg name.
std::set< DecisionID > DecisionIDContainer
const Decision * getTerminusNode(SG::ReadHandle< DecisionContainer > &container)
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
bool isLegId(const HLT::Identifier &legIdentifier)
Recognise whether the chain ID is a leg ID.
Definition index.py:1