ATLAS Offline Software
L1InfoHypo.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include "AthLinks/ElementLink.h"
8 
9 #include "IL1InfoHypoTool.h"
10 #include "L1InfoHypo.h"
11 
12 
13 L1InfoHypo::L1InfoHypo(const std::string& name, ISvcLocator* pSvcLocator)
14  : ::HypoBase(name, pSvcLocator) {}
15 
16 
18  ATH_CHECK( m_hypoTools.retrieve() );
20 
21  return StatusCode::SUCCESS;
22 }
23 
24 
25 StatusCode L1InfoHypo::execute(const EventContext& context) const {
26 
27  // Retrieve previous (L1 decision) decision
28  ATH_MSG_DEBUG("Retrieving L1 decision \"" << decisionInput().key() << "\"");
29 
31 
32  auto previousDecisionsHandle = SG::makeHandle( decisionInput(), context );
33  ATH_CHECK( previousDecisionsHandle.isValid() );
34  ATH_MSG_DEBUG( "Running with "<< previousDecisionsHandle->size() <<" previous decisions");
35 
38 
40 
41  std::vector<IL1InfoHypoTool::L1Info> hypoToolInput;
42  for (const TrigCompositeUtils::Decision* previousDecision: *previousDecisionsHandle) {
43 
45 
46  TrigCompositeUtils::DecisionIDContainer previousDecisionIDs;
47  TrigCompositeUtils::decisionIDs(previousDecision, previousDecisionIDs);
48 
49  // Set dummy feature link
52 
53  hypoToolInput.push_back( IL1InfoHypoTool::L1Info{ &*roib, previousDecisionIDs, d } );
54  }
55 
56  for ( auto & tool: m_hypoTools ) {
57  ATH_CHECK( tool->decide( hypoToolInput ) );
58  }
59 
60  ATH_CHECK( hypoBaseOutputProcessing(outputHandle) );
61 
62  return StatusCode::SUCCESS;
63 }
L1InfoHypo::L1InfoHypo
L1InfoHypo(const std::string &name, ISvcLocator *pSvcLocator)
Definition: L1InfoHypo.cxx:13
RoIBResult.h
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
hist_file_dump.d
d
Definition: hist_file_dump.py:137
TrigCompositeUtils::hypoAlgNodeName
const std::string & hypoAlgNodeName()
Definition: TrigCompositeUtilsRoot.cxx:904
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
L1InfoHypo::m_hypoTools
ToolHandleArray< IL1InfoHypoTool > m_hypoTools
Definition: L1InfoHypo.h:26
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
L1InfoHypo::execute
virtual StatusCode execute(const EventContext &context) const override
Definition: L1InfoHypo.cxx:25
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
TrigCompositeUtils.h
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
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
TrigCompositeUtils::decisionToElementLink
ElementLink< DecisionContainer > decisionToElementLink(const Decision *d, const EventContext &ctx)
Takes a raw pointer to a Decision and returns an ElementLink to the Decision.
Definition: TrigCompositeUtilsRoot.cxx:122
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
xAOD::TrigComposite_v1
Class used to describe composite objects in the HLT.
Definition: TrigComposite_v1.h:52
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
xAOD::decisions
decisions
Definition: TrigComposite_v1.cxx:101
TrigCompositeUtils::featureString
const std::string & featureString()
Definition: TrigCompositeUtilsRoot.cxx:884
IL1InfoHypoTool::L1Info
Definition: IL1InfoHypoTool.h:17
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
HypoBase
Hypothesis algorithms take the output of reco algorithms and the decision from the preceeding InputMa...
Definition: HypoBase.h:13
L1InfoHypo::m_RoIBResultKey
SG::ReadHandleKey< ROIB::RoIBResult > m_RoIBResultKey
Definition: L1InfoHypo.h:28
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
IL1InfoHypoTool.h
L1InfoHypo::initialize
virtual StatusCode initialize() override
Definition: L1InfoHypo.cxx:17
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
TrigCompositeUtils::DecisionIDContainer
std::set< DecisionID > DecisionIDContainer
Definition: TrigComposite_v1.h:28
TrigCompositeUtils::decisionIDs
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
Definition: TrigCompositeUtilsRoot.cxx:67
L1InfoHypo.h
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37