ATLAS Offline Software
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 // =============================================================================
20 L1TopoOnlineMonitorHypo::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 // =============================================================================
34 StatusCode 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 }
L1TopoOnlineMonitorHypoTool::InputVector
std::vector< std::pair< TrigCompositeUtils::Decision *, const TrigCompositeUtils::Decision * > > InputVector
Definition: L1TopoOnlineMonitorHypoTool.h:25
TrigCompositeUtils::DecisionContainer
xAOD::TrigCompositeContainer DecisionContainer
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigCompositeContainer.h:21
TrigCompositeUtils::newDecisionIn
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.
Definition: TrigCompositeUtilsRoot.cxx:46
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
TrigCompositeUtils::hypoAlgNodeName
const std::string & hypoAlgNodeName()
Definition: TrigCompositeUtilsRoot.cxx:906
HypoBase::decisionInput
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:16
TrigCompositeUtils::createAndStore
SG::WriteHandle< DecisionContainer > createAndStore(const SG::WriteHandleKey< DecisionContainer > &key, const EventContext &ctx)
Creates and right away records the DecisionContainer with the key.
Definition: TrigCompositeUtilsRoot.cxx:30
HypoBase::decisionOutput
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:20
L1TopoOnlineMonitorHypo::execute
virtual StatusCode execute(const EventContext &eventContext) const override
Definition: L1TopoOnlineMonitorHypo.cxx:34
L1TopoOnlineMonitorHypo.h
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
HypoBase::hypoBaseOutputProcessing
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:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
L1TopoOnlineMonitorHypo::m_hypoTools
ToolHandleArray< L1TopoOnlineMonitorHypoTool > m_hypoTools
Definition: L1TopoOnlineMonitorHypo.h:25
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
xAOD::decisions
decisions
Definition: TrigComposite_v1.cxx:81
L1TopoOnlineMonitorHypo::initialize
virtual StatusCode initialize() override
Definition: L1TopoOnlineMonitorHypo.cxx:26
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
HypoBase
Hypothesis algorithms take the output of reco algorithms and the decision from the preceeding InputMa...
Definition: HypoBase.h:13
TrigCompositeUtils::Decision
xAOD::TrigComposite Decision
Definition: Event/xAOD/xAODTrigger/xAODTrigger/TrigComposite.h:20
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
L1TopoOnlineMonitorHypoTool.h
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
L1TopoOnlineMonitorHypo::L1TopoOnlineMonitorHypo
L1TopoOnlineMonitorHypo(const std::string &name, ISvcLocator *svcLoc)
Definition: L1TopoOnlineMonitorHypo.cxx:20