ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaExamples
AthExHive
src
condEx
AlgC.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 "
AlgC.h
"
6
#include "
StoreGate/ReadHandle.h
"
7
#include "
StoreGate/ReadCondHandle.h
"
8
9
//---------------------------------------------------------------------------
10
11
StatusCode
AlgC::initialize
() {
12
ATH_MSG_DEBUG
(
"initialize "
<< name());
13
14
ATH_CHECK
(
m_rdh1
.initialize());
15
ATH_CHECK
(
m_rch
.initialize());
16
17
ATH_MSG_INFO
(
"m_rdh1 id: "
<<
m_rdh1
.fullKey() );
18
ATH_MSG_INFO
(
"m_rch id: "
<<
m_rch
.fullKey() );
19
20
21
return
StatusCode::SUCCESS;
22
}
23
24
//---------------------------------------------------------------------------
25
26
StatusCode
AlgC::execute
(
const
EventContext& ctx)
const
{
27
ATH_MSG_DEBUG
(
"execute "
<< name());
28
29
SG::ReadHandle<HiveDataObj>
rh1(
m_rdh1
, ctx);
30
if
(!rh1.
isValid
()) {
31
ATH_MSG_ERROR
(
"Could not retrieve HiveDataObj with key "
<<
m_rdh1
.key());
32
return
StatusCode::FAILURE;
33
}
34
35
ATH_MSG_INFO
(
" read: "
<< rh1.
key
() <<
" = "
<< rh1->val() );
36
37
SG::ReadCondHandle<CondDataObj>
rch(
m_rch
, ctx);
38
const
CondDataObj
*cdo = *rch;
39
if
(cdo != 0) {
40
ATH_MSG_INFO
(
" read CH: "
<< rch.
key
() <<
" = "
<< *cdo );
41
}
else
{
42
ATH_MSG_ERROR
(
" CDO ptr for "
<< rch.
key
() <<
" == zero"
);
43
}
44
45
return
StatusCode::SUCCESS;
46
47
}
48
AlgC.h
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
ReadCondHandle.h
ReadHandle.h
Handle class for reading from StoreGate.
AlgC::m_rdh1
SG::ReadHandleKey< HiveDataObj > m_rdh1
Definition
AlgC.h:25
AlgC::m_rch
SG::ReadCondHandleKey< CondDataObj > m_rch
Definition
AlgC.h:27
AlgC::initialize
virtual StatusCode initialize() override
Definition
AlgC.cxx:11
AlgC::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
AlgC.cxx:26
CondDataObj
Definition
CondDataObj.h:8
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
SG::ReadCondHandle::key
const std::string & key() const
Definition
ReadCondHandle.h:59
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