ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaExamples
AthExHive
src
HiveAlgF.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 "
HiveAlgF.h
"
6
7
HiveAlgF::HiveAlgF
(
const
std::string& name,
8
ISvcLocator* pSvcLocator ) :
9
::
HiveAlgBase
( name, pSvcLocator )
10
{
11
}
12
13
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
14
HiveAlgF::~HiveAlgF
() =
default
;
15
16
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
17
StatusCode
HiveAlgF::initialize
() {
18
ATH_MSG_DEBUG
(
"initialize "
<< name());
19
20
ATH_CHECK
(
m_rdh1
.initialize() );
21
ATH_CHECK
(
m_rdh2
.initialize() );
22
ATH_CHECK
(
m_rdh3
.initialize() );
23
ATH_CHECK
(
m_rdh4
.initialize() );
24
ATH_CHECK
(
m_rdh5
.initialize() );
25
ATH_CHECK
(
m_rdh6
.initialize() );
26
27
// initialize base class
28
return
HiveAlgBase::initialize
();
29
}
30
31
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
32
StatusCode
HiveAlgF::execute
(
const
EventContext& ctx)
const
{
33
34
ATH_MSG_DEBUG
(
"execute "
<< name());
35
36
sleep
(ctx);
37
38
SG::ReadHandle<HiveDataObj>
rdh1{
m_rdh1
, ctx};
39
if
(!rdh1.
isValid
()) {
40
ATH_MSG_ERROR
(
"Could not retrieve HiveDataObj with key "
<< rdh1.
key
());
41
return
StatusCode::FAILURE;
42
}
43
44
SG::ReadHandle<HiveDataObj>
rdh2{
m_rdh2
, ctx};
45
if
(!rdh2.
isValid
()) {
46
ATH_MSG_ERROR
(
"Could not retrieve HiveDataObj with key "
<< rdh2.
key
());
47
return
StatusCode::FAILURE;
48
}
49
50
SG::ReadHandle<HiveDataObj>
rdh3{
m_rdh3
, ctx};
51
if
(!rdh3.
isValid
()) {
52
ATH_MSG_ERROR
(
"Could not retrieve HiveDataObj with key "
<< rdh3.
key
());
53
return
StatusCode::FAILURE;
54
}
55
56
SG::ReadHandle<HiveDataObj>
rdh4{
m_rdh4
, ctx};
57
if
(!rdh4.
isValid
()) {
58
ATH_MSG_ERROR
(
"Could not retrieve HiveDataObj with key "
<< rdh4.
key
());
59
return
StatusCode::FAILURE;
60
}
61
62
SG::ReadHandle<HiveDataObj>
rdh5{
m_rdh5
, ctx};
63
if
(!rdh5.
isValid
()) {
64
ATH_MSG_ERROR
(
"Could not retrieve HiveDataObj with key "
<< rdh5.
key
());
65
return
StatusCode::FAILURE;
66
}
67
68
SG::ReadHandle<HiveDataObj>
rdh6{
m_rdh6
, ctx};
69
if
(!rdh6.
isValid
()) {
70
ATH_MSG_ERROR
(
"Could not retrieve HiveDataObj with key "
<< rdh6.
key
());
71
return
StatusCode::FAILURE;
72
}
73
74
ATH_MSG_INFO
(
" read: "
<< rdh1.
key
() <<
" = "
<< rdh1->val() );
75
ATH_MSG_INFO
(
" read: "
<< rdh2.
key
() <<
" = "
<< rdh2->val() );
76
ATH_MSG_INFO
(
" read: "
<< rdh3.
key
() <<
" = "
<< rdh3->val() );
77
78
ATH_MSG_INFO
(
"test: "
<< ctx.eventID().event_number() <<
" "
79
<< rdh1->val() + rdh2->val() + rdh3->val()
80
<<
" "
<< rdh1->val()
81
<<
" "
<< rdh2->val()
82
<<
" "
<< rdh3->val()
83
<<
" "
<< rdh4->val()
84
<<
" "
<< rdh5->val()
85
<<
" "
<< rdh6->val()
86
);
87
88
return
StatusCode::SUCCESS;
89
90
}
91
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
HiveAlgF.h
Simple Algorithm that reads 6 HiveDataObjs created by HiveAlgA, HiveAlgB, HiveAlgC,...
HiveAlgBase::HiveAlgBase
HiveAlgBase(const std::string &name, ISvcLocator *pSvcLocator)
Definition
HiveAlgBase.cxx:12
HiveAlgBase::sleep
unsigned int sleep(const EventContext &ctx) const
Definition
HiveAlgBase.cxx:40
HiveAlgBase::initialize
virtual StatusCode initialize() override
Definition
HiveAlgBase.cxx:23
HiveAlgF::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
HiveAlgF.cxx:32
HiveAlgF::m_rdh2
SG::ReadHandleKey< HiveDataObj > m_rdh2
Definition
HiveAlgF.h:37
HiveAlgF::m_rdh1
SG::ReadHandleKey< HiveDataObj > m_rdh1
Definition
HiveAlgF.h:36
HiveAlgF::m_rdh5
SG::ReadHandleKey< HiveDataObj > m_rdh5
Definition
HiveAlgF.h:40
HiveAlgF::m_rdh6
SG::ReadHandleKey< HiveDataObj > m_rdh6
Definition
HiveAlgF.h:41
HiveAlgF::m_rdh3
SG::ReadHandleKey< HiveDataObj > m_rdh3
Definition
HiveAlgF.h:38
HiveAlgF::m_rdh4
SG::ReadHandleKey< HiveDataObj > m_rdh4
Definition
HiveAlgF.h:39
HiveAlgF::HiveAlgF
HiveAlgF(const std::string &name, ISvcLocator *pSvcLocator)
Definition
HiveAlgF.cxx:7
HiveAlgF::~HiveAlgF
~HiveAlgF()
HiveAlgF::initialize
virtual StatusCode initialize() override
Definition
HiveAlgF.cxx:17
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:67
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
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
Generated on
for ATLAS Offline Software by
1.17.0