ATLAS Offline Software
MbtsHypoAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "MbtsHypoAlg.h"
14 
15 MbtsHypoAlg::MbtsHypoAlg(const std::string &name, ISvcLocator *pSvcLocator)
16  : ::HypoBase(name, pSvcLocator)
17 {
18 }
19 
21 {
22  ATH_CHECK(m_hypoTools.retrieve());
23  ATH_CHECK(m_MbtsBitsKey.initialize());
24  ATH_CHECK(m_hypoTools.retrieve());
25  return StatusCode::SUCCESS;
26 }
27 
28 StatusCode MbtsHypoAlg::execute(const EventContext &context) const
29 {
30  ATH_MSG_DEBUG("Executing ...");
31 
32  SG::ReadHandle<DecisionContainer> previousDecisionsHandle = SG::makeHandle(decisionInput(), context);
33  ATH_CHECK(previousDecisionsHandle.isValid());
34  auto bitsHandle = SG::makeHandle(m_MbtsBitsKey, context);
36  TrigCompositeUtils::decisionIDs(previousDecisionsHandle->at(0), prev);
37 
38  ATH_MSG_DEBUG("Obtained input");
39 
41  auto decisions = outputHandle.ptr();
44  d->setObjectLink(featureString(), ElementLink<xAOD::TrigT2MbtsBitsContainer>(*bitsHandle, 0, context));
45  MbtsHypoTool::MbtsHypoInfo info = {prev, bitsHandle.cptr()->at(0), d};
46 
47  for (const auto &tool : m_hypoTools)
48  {
49  ATH_CHECK(tool->decide(info));
50  }
51 
52  return StatusCode::SUCCESS;
53 }
grepfile.info
info
Definition: grepfile.py:38
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
hist_file_dump.d
d
Definition: hist_file_dump.py:137
TrigCompositeUtils::hypoAlgNodeName
const std::string & hypoAlgNodeName()
Definition: TrigCompositeUtilsRoot.cxx:906
MbtsHypoAlg::initialize
virtual StatusCode initialize() override
Definition: MbtsHypoAlg.cxx:20
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
MbtsHypoAlg::MbtsHypoAlg
MbtsHypoAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MbtsHypoAlg.cxx:15
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
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
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
MbtsHypoAlg.h
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
MbtsHypoAlg::execute
virtual StatusCode execute(const EventContext &context) const override
Definition: MbtsHypoAlg.cxx:28
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
xAOD::decisions
decisions
Definition: TrigComposite_v1.cxx:81
TrigCompositeUtils::featureString
const std::string & featureString()
Definition: TrigCompositeUtilsRoot.cxx:886
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
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
MbtsHypoAlg::m_MbtsBitsKey
SG::ReadHandleKey< xAOD::TrigT2MbtsBitsContainer > m_MbtsBitsKey
Definition: MbtsHypoAlg.h:28
MbtsHypoAlg::m_hypoTools
ToolHandleArray< MbtsHypoTool > m_hypoTools
Definition: MbtsHypoAlg.h:27
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
TrigCompositeUtils::linkToPrevious
void linkToPrevious(Decision *d, const std::string &previousCollectionKey, size_t previousIndex)
Links to the previous object, location of previous 'seed' decision supplied by hand.
Definition: TrigCompositeUtilsRoot.cxx:139
MbtsHypoTool::MbtsHypoInfo
Definition: MbtsHypoTool.h:24
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
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37