ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
DataModelTest
DataModelTestDataCommon
src
CondAlg1.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
/*
5
*/
6
// $Id$
13
14
15
#include "
CondAlg1.h
"
16
17
18
namespace
DMTest
{
19
20
26
CondAlg1::CondAlg1
(
const
std::string &name, ISvcLocator *pSvcLocator)
27
:
AthCondAlgorithm
(name, pSvcLocator),
28
m_attrListKey
(
"/DMTest/TestAttrList"
),
29
m_scondKey
(
"scond"
,
"DMTest"
)
30
{
31
declareProperty
(
"AttrListKey"
,
m_attrListKey
);
32
declareProperty
(
"SCondKey"
,
m_scondKey
);
33
}
34
35
39
StatusCode
CondAlg1::initialize
()
40
{
41
ATH_CHECK
(
m_attrListKey
.initialize() );
42
ATH_CHECK
(
m_scondKey
.initialize() );
43
return
StatusCode::SUCCESS;
44
}
45
46
50
StatusCode
CondAlg1::execute
(
const
EventContext& ctx)
const
51
{
52
SG::ReadCondHandle<AthenaAttributeList>
attrList (
m_attrListKey
, ctx);
53
int
xint = (**attrList)[
"xint"
].data<
int
>();
54
55
EventIDRange range;
56
ATH_CHECK
( attrList.
range
(range) );
57
58
SG::WriteCondHandle<DMTest::S2>
scond (
m_scondKey
, ctx);
59
auto
s2 = std::make_unique<DMTest::S2> (xint*100);
60
ATH_CHECK
( scond.
record
(range, std::move(s2) ) );
61
62
ATH_MSG_DEBUG
(
"Recorded '"
<< scond.
key
() <<
"' with range "
<< range);
63
64
return
StatusCode::SUCCESS;
65
}
66
67
68
}
// namespace DMTest
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition
AthMsgStreamMacros.h:29
CondAlg1.h
Testing conditions algorithms.
AthCommonAlgorithm< Gaudi::Algorithm >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition
AthCommonDataStore.h:145
AthCondAlgorithm
Base class for conditions algorithms.
Definition
AthCondAlgorithm.h:22
DMTest::CondAlg1::m_attrListKey
SG::ReadCondHandleKey< AthenaAttributeList > m_attrListKey
Definition
CondAlg1.h:51
DMTest::CondAlg1::m_scondKey
SG::WriteCondHandleKey< DMTest::S2 > m_scondKey
Definition
CondAlg1.h:52
DMTest::CondAlg1::execute
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
Definition
CondAlg1.cxx:50
DMTest::CondAlg1::initialize
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
Definition
CondAlg1.cxx:39
DMTest::CondAlg1::CondAlg1
CondAlg1(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
CondAlg1.cxx:26
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
SG::ReadCondHandle::range
bool range(EventIDRange &r)
Definition
ReadCondHandle.h:223
SG::WriteCondHandle
Definition
WriteCondHandle.h:26
SG::WriteCondHandle::key
const std::string & key() const
Definition
WriteCondHandle.h:44
SG::WriteCondHandle::record
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
Definition
WriteCondHandle.h:161
DMTest
Definition
B.h:23
Generated on
for ATLAS Offline Software by
1.17.0