ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaExamples
AthExHive
src
condEx
AlgT.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
AlgT.h
"
6
#include "
StoreGate/ReadHandle.h
"
7
#include "
StoreGate/WriteHandle.h
"
8
9
AlgT::AlgT
(
const
std::string& name,
10
ISvcLocator* pSvcLocator ) :
11
::
AthAlgorithm
( name, pSvcLocator )
12
{}
13
14
//---------------------------------------------------------------------------
15
16
StatusCode
AlgT::initialize
() {
17
ATH_MSG_DEBUG
(
"initialize "
<< name());
18
19
if
(
m_rdh1
.key() !=
""
)
ATH_CHECK
(
m_rdh1
.initialize() );
20
ATH_CHECK
(
m_wrh1
.initialize() );
21
ATH_CHECK
(
m_evt
.initialize() );
22
23
ATH_CHECK
(
m_tool1
.retrieve() );
24
ATH_CHECK
(
m_tool2
.retrieve() );
25
ATH_CHECK
(
m_tool3
.retrieve() );
26
27
return
StatusCode::SUCCESS;
28
}
29
30
//---------------------------------------------------------------------------
31
32
StatusCode
AlgT::execute
(
const
EventContext& ctx) {
33
34
ATH_MSG_DEBUG
(
"execute "
<< name());
35
36
SG::ReadHandle<xAOD::EventInfo>
evt(
m_evt
, ctx);
37
ATH_MSG_INFO
(
" EventInfo: r: "
<< evt->runNumber()
38
<<
" e: "
<< evt->eventNumber() );
39
40
41
SG::WriteHandle<HiveDataObj>
wh1(
m_wrh1
, ctx);
42
ATH_CHECK
( wh1.
record
( std::make_unique<HiveDataObj> (10000 + evt->eventNumber())));
43
44
ATH_MSG_INFO
(
" write: "
<< wh1.
key
() <<
" = "
<< wh1->val() );
45
46
47
ATH_CHECK
(
m_tool1
->doSomething(ctx));
48
ATH_CHECK
(
m_tool2
->doSomething(ctx));
49
ATH_CHECK
(
m_tool3
->doSomething(ctx));
50
51
52
return
StatusCode::SUCCESS;
53
54
}
55
AlgT.h
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition
AthMsgStreamMacros.h:31
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
ReadHandle.h
Handle class for reading from StoreGate.
WriteHandle.h
Handle class for recording to StoreGate.
AlgT::initialize
virtual StatusCode initialize() override
Definition
AlgT.cxx:16
AlgT::execute
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
Definition
AlgT.cxx:32
AlgT::m_tool1
ToolHandle< IHiveTool > m_tool1
Definition
AlgT.h:37
AlgT::m_tool2
ToolHandle< IHiveTool > m_tool2
Definition
AlgT.h:38
AlgT::m_wrh1
SG::WriteHandleKey< HiveDataObj > m_wrh1
Definition
AlgT.h:34
AlgT::AlgT
AlgT(const std::string &name, ISvcLocator *pSvcLocator)
Definition
AlgT.cxx:9
AlgT::m_tool3
ToolHandle< IHiveTool > m_tool3
Definition
AlgT.h:39
AlgT::m_evt
SG::ReadHandleKey< xAOD::EventInfo > m_evt
Definition
AlgT.h:32
AlgT::m_rdh1
SG::ReadHandleKey< HiveDataObj > m_rdh1
Definition
AlgT.h:33
AthAlgorithm::AthAlgorithm
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
AthAlgorithm.cxx:10
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::VarHandleBase::key
virtual const std::string & key() const override final
Return the StoreGate ID for the referenced object.
Definition
AthToolSupport/AsgDataHandles/Root/VarHandleBase.cxx:64
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.
Generated on
for ATLAS Offline Software by
1.17.0