ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
xAOD
xAODTriggerCnv
src
TrigDecisionCnvAlg.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
6
// Gaudi/Athena include(s):
7
#include "
AthenaKernel/errorcheck.h
"
8
9
// Local include(s):
10
#include "
TrigDecisionCnvAlg.h
"
11
12
namespace
xAODMaker
{
13
14
TrigDecisionCnvAlg::TrigDecisionCnvAlg
(
const
std::string& name,
15
ISvcLocator* svcLoc )
16
:
AthReentrantAlgorithm
( name, svcLoc ) {
17
}
18
19
20
TrigDecisionCnvAlg::~TrigDecisionCnvAlg
() {
21
}
22
23
24
StatusCode
TrigDecisionCnvAlg::initialize
() {
25
26
// Greet the user:
27
ATH_MSG_INFO
(
"Initializing"
);
28
ATH_MSG_DEBUG
(
" AOD Key: "
<<
m_aodKey
);
29
ATH_MSG_DEBUG
(
"xAOD Key: "
<<
m_xaodKey
);
30
31
CHECK
(
m_eventInfoKey
.initialize(
SG::AllowEmpty
) );
32
CHECK
(
m_aodKey
.initialize() );
33
CHECK
(
m_xaodKey
.initialize() );
34
35
// Retrieve the converter tool:
36
CHECK
(
m_cnvTool
.retrieve() );
37
38
// Return gracefully:
39
return
StatusCode::SUCCESS;
40
}
41
42
StatusCode
TrigDecisionCnvAlg::execute
(
const
EventContext& ctx)
const
{
43
44
// Retrieve the AOD object:
45
SG::ReadHandle<TrigDec::TrigDecision>
aodRH{
m_aodKey
, ctx};
46
CHECK
( aodRH.
isValid
() );
47
const
TrigDec::TrigDecision
* aod = aodRH.
cptr
();
48
49
// trigger Info
50
const
TriggerInfo
* trigInfo =
nullptr
;
51
if
(not
m_eventInfoKey
.empty()) {
52
SG::ReadHandle<EventInfo>
eiRH{
m_eventInfoKey
, ctx};
53
trigInfo = eiRH.
isValid
() ? eiRH.
cptr
()->trigger_info() :
nullptr
;
54
}
55
56
// Create the xAOD object and its auxiliary store:
57
std::unique_ptr<xAOD::TrigDecisionAuxInfo> aux = std::make_unique<xAOD::TrigDecisionAuxInfo>();
58
std::unique_ptr<xAOD::TrigDecision> xaod = std::make_unique<xAOD::TrigDecision>();
59
xaod->setStore( aux.get() );
60
61
// Fill the xAOD object:
62
CHECK
(
m_cnvTool
->convert( aod, xaod.get(), trigInfo ) );
63
64
// Record the xAOD objects:
65
SG::WriteHandle<xAOD::TrigDecision>
writeHandle{
m_xaodKey
, ctx};
66
CHECK
( writeHandle.
record
(std::move(xaod), std::move(aux)));
67
68
// Return gracefully:
69
return
StatusCode::SUCCESS;
70
}
71
72
}
// namespace xAODMaker
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
errorcheck.h
Helpers for checking error return status codes and reporting errors.
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition
Control/AthenaKernel/AthenaKernel/errorcheck.h:422
TrigDecisionCnvAlg.h
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
SG::WriteHandle
Definition
StoreGate/StoreGate/WriteHandle.h:73
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
TrigDec::TrigDecision
The TrigDecision is an object which merges trigger informations from various levels.
Definition
Trigger/TrigEvent/TrigDecisionEvent/TrigDecisionEvent/TrigDecision.h:47
TriggerInfo
This class contains trigger related information.
Definition
TriggerInfo.h:77
xAODMaker::TrigDecisionCnvAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Function executing the algorithm.
Definition
TrigDecisionCnvAlg.cxx:42
xAODMaker::TrigDecisionCnvAlg::m_eventInfoKey
SG::ReadHandleKey< EventInfo > m_eventInfoKey
Definition
TrigDecisionCnvAlg.h:56
xAODMaker::TrigDecisionCnvAlg::m_xaodKey
SG::WriteHandleKey< xAOD::TrigDecision > m_xaodKey
Definition
TrigDecisionCnvAlg.h:58
xAODMaker::TrigDecisionCnvAlg::initialize
virtual StatusCode initialize() override
Function initialising the algorithm.
Definition
TrigDecisionCnvAlg.cxx:24
xAODMaker::TrigDecisionCnvAlg::m_cnvTool
ToolHandle< ITrigDecisionCnvTool > m_cnvTool
Definition
TrigDecisionCnvAlg.h:60
xAODMaker::TrigDecisionCnvAlg::TrigDecisionCnvAlg
TrigDecisionCnvAlg(const std::string &name, ISvcLocator *svcLoc)
Regular Algorithm constructor.
Definition
TrigDecisionCnvAlg.cxx:14
xAODMaker::TrigDecisionCnvAlg::~TrigDecisionCnvAlg
virtual ~TrigDecisionCnvAlg()
Definition
TrigDecisionCnvAlg.cxx:20
xAODMaker::TrigDecisionCnvAlg::m_aodKey
SG::ReadHandleKey< TrigDec::TrigDecision > m_aodKey
Definition
TrigDecisionCnvAlg.h:57
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:27
xAODMaker
Definition
StoreGateSvc.h:70
Generated on
for ATLAS Offline Software by
1.17.0