ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigHypothesis
TrigHypoCommonTools
src
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
5
#include "
TrigCompositeUtils/TrigCompositeUtils.h
"
6
#include "AthLinks/ElementLink.h"
7
#include "
TrigT1Result/RoIBResult.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
17
StatusCode
L1InfoHypo::initialize
() {
18
ATH_CHECK
(
m_hypoTools
.retrieve() );
19
ATH_CHECK
(
m_RoIBResultKey
.initialize() );
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
30
SG::ReadHandle<ROIB::RoIBResult>
roib (
m_RoIBResultKey
, context );
31
32
auto
previousDecisionsHandle =
SG::makeHandle
(
decisionInput
(), context );
33
ATH_CHECK
( previousDecisionsHandle.isValid() );
34
ATH_MSG_DEBUG
(
"Running with "
<< previousDecisionsHandle->size() <<
" previous decisions"
);
35
36
SG::WriteHandle<TrigCompositeUtils::DecisionContainer>
outputHandle
37
=
TrigCompositeUtils::createAndStore
(
decisionOutput
(), context );
38
39
TrigCompositeUtils::DecisionContainer
* decisions = outputHandle.
ptr
();
40
41
std::vector<IL1InfoHypoTool::L1Info> hypoToolInput;
42
for
(
const
TrigCompositeUtils::Decision
* previousDecision: *previousDecisionsHandle) {
43
44
TrigCompositeUtils::Decision
* d =
TrigCompositeUtils::newDecisionIn
( decisions, previousDecision,
TrigCompositeUtils::hypoAlgNodeName
(), context );
45
46
TrigCompositeUtils::DecisionIDContainer
previousDecisionIDs;
47
TrigCompositeUtils::decisionIDs
(previousDecision, previousDecisionIDs);
48
49
// Set dummy feature link
50
ElementLink<TrigCompositeUtils::DecisionContainer>
selfLink =
TrigCompositeUtils::decisionToElementLink
(d, context);
51
d->setObjectLink<
TrigCompositeUtils::DecisionContainer
>(
TrigCompositeUtils::featureString
(), selfLink);
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
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x,...)
Definition
AthMsgStreamMacros.h:43
IL1InfoHypoTool.h
L1InfoHypo.h
RoIBResult.h
TrigCompositeUtils.h
ElementLink
ElementLink implementation for ROOT usage.
Definition
A/AthLinks/ElementLink.h:40
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:18
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:22
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:35
HypoBase::HypoBase
HypoBase(const std::string &name, ISvcLocator *pSvcLocator)
constructor, to be called by sub-class constructors
Definition
HypoBase.cxx:12
L1InfoHypo::m_RoIBResultKey
SG::ReadHandleKey< ROIB::RoIBResult > m_RoIBResultKey
Definition
L1InfoHypo.h:28
L1InfoHypo::m_hypoTools
ToolHandleArray< IL1InfoHypoTool > m_hypoTools
Definition
L1InfoHypo.h:26
L1InfoHypo::initialize
virtual StatusCode initialize() override
Definition
L1InfoHypo.cxx:17
L1InfoHypo::execute
virtual StatusCode execute(const EventContext &context) const override
Definition
L1InfoHypo.cxx:25
L1InfoHypo::L1InfoHypo
L1InfoHypo(const std::string &name, ISvcLocator *pSvcLocator)
Definition
L1InfoHypo.cxx:13
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition
ReadCondHandle.h:268
TrigCompositeUtils::Decision
xAOD::TrigComposite Decision
Definition
TrigComposite.h:20
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:44
TrigCompositeUtils::featureString
const std::string & featureString()
Definition
TrigCompositeUtils.h:422
TrigCompositeUtils::DecisionIDContainer
std::set< DecisionID > DecisionIDContainer
Definition
TrigComposite_v1.h:28
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:28
TrigCompositeUtils::hypoAlgNodeName
const std::string & hypoAlgNodeName()
Definition
TrigCompositeUtils.h:428
TrigCompositeUtils::DecisionContainer
xAOD::TrigCompositeContainer DecisionContainer
Definition
TrigCompositeContainer.h:21
TrigCompositeUtils::decisionIDs
void decisionIDs(const Decision *d, DecisionIDContainer &destination)
Extracts DecisionIDs stored in the Decision object.
Definition
TrigCompositeUtilsRoot.cxx:65
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:123
IL1InfoHypoTool::L1Info
Definition
IL1InfoHypoTool.h:17
Generated on
for ATLAS Offline Software by
1.17.0