ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
HLT
Trigger
TrigControl
TrigExamples
src
MTCalibPebHypoAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MTCalibPebHypoAlg.h
"
6
#include "
TrigCompositeUtils/HLTIdentifier.h
"
7
#include "
AthenaKernel/AthStatusCode.h
"
8
9
// TrigCompositeUtils types used here
10
using
TrigCompositeUtils::Decision
;
11
using
TrigCompositeUtils::DecisionContainer
;
12
using
TrigCompositeUtils::DecisionID
;
13
using
TrigCompositeUtils::DecisionIDContainer
;
14
15
// TrigCompositeUtils methods used here
16
using
TrigCompositeUtils::createAndStore
;
17
using
TrigCompositeUtils::decisionIDs
;
18
using
TrigCompositeUtils::newDecisionIn
;
19
using
TrigCompositeUtils::hypoAlgNodeName
;
20
21
// =============================================================================
22
// Standard constructor
23
// =============================================================================
24
MTCalibPebHypoAlg::MTCalibPebHypoAlg
(
const
std::string& name, ISvcLocator* svcLoc)
25
:
HypoBase
(name, svcLoc) {}
26
27
// =============================================================================
28
// Standard destructor
29
// =============================================================================
30
MTCalibPebHypoAlg::~MTCalibPebHypoAlg
() {}
31
32
// =============================================================================
33
// Implementation of AthReentrantAlgorithm::initialize
34
// =============================================================================
35
StatusCode
MTCalibPebHypoAlg::initialize
() {
36
ATH_MSG_INFO
(
"Initialising "
<< name());
37
ATH_CHECK
(
m_hypoTools
.retrieve());
38
return
StatusCode::SUCCESS;
39
}
40
41
// =============================================================================
42
// Implementation of AthReentrantAlgorithm::finalize
43
// =============================================================================
44
StatusCode
MTCalibPebHypoAlg::finalize
() {
45
ATH_MSG_INFO
(
"Finalising "
<< name());
46
ATH_CHECK
(
m_hypoTools
.release());
47
return
StatusCode::SUCCESS;
48
}
49
50
// =============================================================================
51
// Implementation of AthReentrantAlgorithm::execute
52
// =============================================================================
53
StatusCode
MTCalibPebHypoAlg::execute
(
const
EventContext& eventContext)
const
{
54
ATH_MSG_DEBUG
(
"Executing "
<< name());
55
56
// New output decision container
57
SG::WriteHandle<DecisionContainer>
outputHandle =
createAndStore
(
decisionOutput
(), eventContext);
58
DecisionContainer
* decisions = outputHandle.
ptr
();
59
60
// Create new decision (DecisionContainer* decisions owns the new object)
61
Decision
* newd =
newDecisionIn
(decisions,
hypoAlgNodeName
());
62
63
// Prepare input for hypo tools
64
MTCalibPebHypoTool::Input
toolInput(newd, eventContext);
65
66
// Call the hypo tools
67
for
(
const
auto
& tool:
m_hypoTools
) {
68
ATH_MSG_DEBUG
(
"Calling "
<< tool);
69
StatusCode
sc
= tool->decide(toolInput);
70
if
(
sc
==
Athena::Status::TIMEOUT
) {
71
ATH_MSG_ERROR
(
"Timeout reached in hypo tool "
<< tool->name());
72
return
sc
;
73
}
74
else
ATH_CHECK
(
sc
);
75
}
76
77
ATH_MSG_DEBUG
(
"Exiting with "
<< outputHandle->size() <<
" decisions"
);
78
79
for
(
auto
outh: *outputHandle) {
80
DecisionIDContainer
objDecisions;
81
decisionIDs
(outh, objDecisions);
82
ATH_MSG_DEBUG
(
"Number of positive decisions for this input: "
<< objDecisions.size());
83
for
(
DecisionID
id
: objDecisions ) {
84
ATH_MSG_DEBUG
(
" --- found new decision "
<<
HLT::Identifier
(
id
));
85
}
86
}
87
88
return
StatusCode::SUCCESS;
89
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
AthStatusCode.h
sc
static Double_t sc
Definition
LArPhysWaveHECTool.cxx:37
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
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
hypoAlgNodeName
const std::string & hypoAlgNodeName()
Definition
TrigCompositeUtils.h:428
decisionIDs
void decisionIDs(const Decision *d, DecisionIDContainer &id)
Extracts DecisionIDs stored in the Decision object.
Definition
TrigCompositeUtilsRoot.cxx:65
MTCalibPebHypoAlg.h
HLTIdentifier.h
HLT::Identifier
Definition
TrigCompositeUtils/TrigCompositeUtils/HLTIdentifier.h:19
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::HypoBase
HypoBase(const std::string &name, ISvcLocator *pSvcLocator)
constructor, to be called by sub-class constructors
Definition
HypoBase.cxx:12
MTCalibPebHypoAlg::execute
virtual StatusCode execute(const EventContext &eventContext) const override
Definition
MTCalibPebHypoAlg.cxx:53
MTCalibPebHypoAlg::m_hypoTools
ToolHandleArray< MTCalibPebHypoTool > m_hypoTools
Definition
MTCalibPebHypoAlg.h:27
MTCalibPebHypoAlg::initialize
virtual StatusCode initialize() override
Definition
MTCalibPebHypoAlg.cxx:35
MTCalibPebHypoAlg::~MTCalibPebHypoAlg
virtual ~MTCalibPebHypoAlg()
Standard destructor.
Definition
MTCalibPebHypoAlg.cxx:30
MTCalibPebHypoAlg::MTCalibPebHypoAlg
MTCalibPebHypoAlg(const std::string &name, ISvcLocator *svcLoc)
Standard constructor.
Definition
MTCalibPebHypoAlg.cxx:24
MTCalibPebHypoAlg::finalize
virtual StatusCode finalize() override
Definition
MTCalibPebHypoAlg.cxx:44
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::ptr
pointer_type ptr()
Dereference the pointer.
Athena::Status::TIMEOUT
@ TIMEOUT
Timeout during event processing.
Definition
AthStatusCode.h:23
TrigCompositeUtils::DecisionID
unsigned int DecisionID
Definition
TrigComposite_v1.h:27
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::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
MTCalibPebHypoTool::Input
Definition
MTCalibPebHypoTool.h:35
Generated on
for ATLAS Offline Software by
1.17.0