ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaExamples
AthExHive
src
loopTest
HiveAlgM.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 "
HiveAlgM.h
"
6
#include <thread>
7
#include <chrono>
8
#include <memory>
9
10
HiveAlgM::HiveAlgM
(
const
std::string& name,
11
ISvcLocator* pSvcLocator ) :
12
::
HiveAlgBase
( name, pSvcLocator )
13
{}
14
15
HiveAlgM::~HiveAlgM
() {}
16
17
StatusCode
HiveAlgM::initialize
() {
18
ATH_MSG_DEBUG
(
"initialize "
<< name());
19
20
ATH_CHECK
(
m_rdh1
.initialize() );
21
ATH_CHECK
(
m_rdh2
.initialize() );
22
23
return
HiveAlgBase::initialize
();
24
}
25
26
StatusCode
HiveAlgM::execute
(
const
EventContext& ctx)
const
{
27
28
ATH_MSG_DEBUG
(
"execute "
<< name());
29
30
sleep
(ctx);
31
32
SG::ReadHandle<HiveDataObj>
rdh1{
m_rdh1
, ctx};
33
if
(!rdh1.
isValid
()) {
34
ATH_MSG_ERROR
(
"Could not retrieve HiveDataObj with key "
<< rdh1.
key
());
35
return
StatusCode::FAILURE;
36
}
37
38
SG::ReadHandle<HiveDataObj>
rdh2{
m_rdh2
, ctx};
39
if
(!rdh2.
isValid
()) {
40
ATH_MSG_ERROR
(
"Could not retrieve HiveDataObj with key "
<< rdh2.
key
());
41
return
StatusCode::FAILURE;
42
}
43
44
ATH_MSG_INFO
(
" read: "
<< rdh1.
key
() <<
" = "
<< rdh1->val() );
45
ATH_MSG_INFO
(
" read: "
<< rdh2.
key
() <<
" = "
<< rdh2->val() );
46
47
if
( rdh2->val() != (rdh1->val() +
m_off
) ) {
48
ATH_MSG_ERROR
(rdh2.
key
() <<
" != "
<< rdh1.
key
() <<
" + "
<< (
int
)
m_off
);
49
}
else
{
50
ATH_MSG_INFO
(
"loop is ok"
);
51
}
52
53
return
StatusCode::SUCCESS;
54
55
}
56
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
HiveAlgM.h
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
HiveAlgM::m_rdh1
SG::ReadHandleKey< HiveDataObj > m_rdh1
Definition
HiveAlgM.h:31
HiveAlgM::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
HiveAlgM.cxx:26
HiveAlgM::m_rdh2
SG::ReadHandleKey< HiveDataObj > m_rdh2
Definition
HiveAlgM.h:32
HiveAlgM::initialize
virtual StatusCode initialize() override
Definition
HiveAlgM.cxx:17
HiveAlgM::m_off
Gaudi::Property< int > m_off
Definition
HiveAlgM.h:30
HiveAlgM::HiveAlgM
HiveAlgM(const std::string &name, ISvcLocator *pSvcLocator)
Definition
HiveAlgM.cxx:10
HiveAlgM::~HiveAlgM
~HiveAlgM()
Definition
HiveAlgM.cxx:15
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