ATLAS Offline Software
Loading...
Searching...
No Matches
L1TopoOnlineMonitorHypo.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
6
7// TrigCompositeUtils types used here
10
11// TrigCompositeUtils methods used here
15
16
17// =============================================================================
18// Standard constructor
19// =============================================================================
20L1TopoOnlineMonitorHypo::L1TopoOnlineMonitorHypo(const std::string& name, ISvcLocator* svcLoc)
21: HypoBase(name, svcLoc) {}
22
23// =============================================================================
24// Implementation of AthReentrantAlgorithm::initialize
25// =============================================================================
27 ATH_CHECK(m_hypoTools.retrieve());
28 return StatusCode::SUCCESS;
29}
30
31// =============================================================================
32// Implementation of AthReentrantAlgorithm::execute
33// =============================================================================
34StatusCode L1TopoOnlineMonitorHypo::execute(const EventContext& eventContext) const {
35 // ---------------------------------------------------------------------------
36 // Retrieve previous decisions
37 // ---------------------------------------------------------------------------
38 SG::ReadHandle<DecisionContainer> previousDecisionsHandle = SG::makeHandle(decisionInput(), eventContext);
39 ATH_CHECK(previousDecisionsHandle.isValid());
40 ATH_MSG_DEBUG("Running with " << previousDecisionsHandle->size() << " previous decisions");
41
42 // ---------------------------------------------------------------------------
43 // Prepare new decisions linked to the previous and the tool input vector
44 // ---------------------------------------------------------------------------
47 for (const Decision* previousDecision: *previousDecisionsHandle) {
48 pairedDecisions.emplace_back(
49 newDecisionIn(decisions.ptr(), previousDecision, hypoAlgNodeName(), eventContext),
50 previousDecision);
51 }
52
53 // ---------------------------------------------------------------------------
54 // Call the hypo tools
55 // ---------------------------------------------------------------------------
56 for (const auto& tool: m_hypoTools) {
57 ATH_MSG_DEBUG("Calling " << tool.typeAndName());
58 ATH_CHECK(tool->decide(pairedDecisions, eventContext));
59 }
60
61 // ---------------------------------------------------------------------------
62 // Print the passing decisions
63 // ---------------------------------------------------------------------------
64 ATH_CHECK(decisions.isValid());
65 ATH_MSG_DEBUG("Exit with " << decisions->size() << " decisions");
67
68 return StatusCode::SUCCESS;
69}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
Decision * newDecisionIn(DecisionContainer *dc, const std::string &name="")
Helper method to create a Decision object, place it in the container and return a pointer to it.
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
const std::string & hypoAlgNodeName()
const SG::ReadHandleKey< TrigCompositeUtils::DecisionContainer > & decisionInput() const
methods for derived classes to access handles of the base class input other read/write handles may be...
Definition HypoBase.cxx:18
const SG::WriteHandleKey< TrigCompositeUtils::DecisionContainer > & decisionOutput() const
methods for derived classes to access handles of the base class output other read/write handles may b...
Definition HypoBase.cxx:22
StatusCode hypoBaseOutputProcessing(SG::WriteHandle< TrigCompositeUtils::DecisionContainer > &outputHandle, MSG::Level lvl=MSG::DEBUG) const
Base class function to be called once slice specific code has finished. Handles debug printing and va...
Definition HypoBase.cxx:35
HypoBase(const std::string &name, ISvcLocator *pSvcLocator)
constructor, to be called by sub-class constructors
Definition HypoBase.cxx:12
std::vector< std::pair< TrigCompositeUtils::Decision *, const TrigCompositeUtils::Decision * > > InputVector
L1TopoOnlineMonitorHypo(const std::string &name, ISvcLocator *svcLoc)
virtual StatusCode initialize() override
virtual StatusCode execute(const EventContext &eventContext) const override
ToolHandleArray< L1TopoOnlineMonitorHypoTool > m_hypoTools
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Decision * newDecisionIn(DecisionContainer *dc, const std::string &name)
Helper method to create a Decision object, place it in the container and return a pointer to it.
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
const std::string & hypoAlgNodeName()