ATLAS Offline Software
Loading...
Searching...
No Matches
ReadTriggerDecision.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7ReadTriggerDecision::ReadTriggerDecision(const std::string &name, ISvcLocator *pSvcLocator)
8 : AthReentrantAlgorithm(name, pSvcLocator) {
9}
10
11// Initialise: run once at the start of the event
13
14 // Initialise the tool handle
15 ATH_CHECK(m_trigDec.retrieve());
16
17 // Initialise counter
19
20 return StatusCode::SUCCESS;
21}
22
23StatusCode ReadTriggerDecision::execute(const EventContext& /* ctx */) const {
24
25 // Here we check whether the trigger named by the user fired for this event
26 // and increment the counter if it did.
28
29 // One can get a list of all of the triggers available in the event
30 // by doing:
31 // const Trig::ChainGroup* chain = m_trigDec->getChainGroup("HLT.*");
32 // const std::vector<std::string> fired_triggers = chain->getListOfTriggers();
33 // See https://twiki.cern.ch/twiki/bin/viewauth/Atlas/TrigDecisionTool#Athena
34 // for more details
35
36 return StatusCode::SUCCESS;
37
38}
39
40// Print the contents of the map
42 ATH_MSG_INFO("==========================");
43 ATH_MSG_INFO("SUMMARY OF TRIGGER COUNTS:");
44 ATH_MSG_INFO("==========================");
45 ATH_MSG_INFO("Trigger with name " << m_triggerName << " fired for " << std::to_string(m_triggerCounter) << " events");
46
47 return StatusCode::SUCCESS;
48}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
An algorithm that can be simultaneously executed in multiple threads.
virtual StatusCode finalize() override
Gaudi::Property< std::string > m_triggerName
Name of the trigger to count.
PublicToolHandle< Trig::TrigDecisionTool > m_trigDec
Tool handle for the trigger decision tool.
std::atomic< unsigned int > m_triggerCounter
Integer counter for the requested trigger.
ReadTriggerDecision(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &ctx) const override
virtual StatusCode initialize() override