ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
DataModelTest
DataModelTestDataCommon
src
CondAlg2.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
11
12
13
#include "
CondAlg2.h
"
14
15
16
namespace
DMTest
{
17
18
24
CondAlg2::CondAlg2
(
const
std::string &name, ISvcLocator *pSvcLocator)
25
:
AthCondAlgorithm
(name, pSvcLocator),
26
m_rltestKey
(
"/DMTest/RLTest"
),
27
m_tstestKey
(
"/DMTest/TSTest"
),
28
m_outKey
(
"scond3"
,
"DMTest"
)
29
{
30
declareProperty
(
"RLTestKey"
,
m_rltestKey
);
31
declareProperty
(
"TSTestKey"
,
m_tstestKey
);
32
declareProperty
(
"OutKey"
,
m_outKey
);
33
}
34
35
39
StatusCode
CondAlg2::initialize
()
40
{
41
ATH_CHECK
(
m_rltestKey
.initialize() );
42
ATH_CHECK
(
m_tstestKey
.initialize() );
43
ATH_CHECK
(
m_outKey
.initialize() );
44
return
StatusCode::SUCCESS;
45
}
46
47
51
StatusCode
CondAlg2::execute
(
const
EventContext& ctx)
const
52
{
53
SG::ReadCondHandle<AthenaAttributeList>
rltest (
m_rltestKey
, ctx);
54
int
xint_rl = (**rltest)[
"xint"
].data<
int
>();
55
56
SG::ReadCondHandle<AthenaAttributeList>
tstest (
m_tstestKey
, ctx);
57
int
xint_ts = (**tstest)[
"xint"
].data<
int
>();
58
59
EventIDRange range_rl;
60
ATH_CHECK
( rltest.
range
(range_rl) );
61
62
EventIDRange range_ts;
63
ATH_CHECK
( tstest.range(range_ts) );
64
65
EventIDBase start (range_rl.start().run_number(),
66
range_rl.start().event_number(),
67
range_ts.start().time_stamp(),
68
range_ts.start().time_stamp_ns_offset(),
69
range_rl.start().lumi_block());
70
EventIDBase stop (range_rl.stop().run_number(),
71
range_rl.stop().event_number(),
72
range_ts.stop().time_stamp(),
73
range_ts.stop().time_stamp_ns_offset(),
74
range_rl.stop().lumi_block());
75
76
EventIDRange range (start, stop);
77
78
SG::WriteCondHandle<DMTest::S3>
out (
m_outKey
, ctx);
79
auto
s3 = std::make_unique<DMTest::S3> (xint_rl + xint_ts);
80
ATH_CHECK
( out.record (range, std::move(s3)) );
81
82
ATH_MSG_DEBUG
(
"Recorded '{}' with range ()"
,
83
out.key(),
static_cast<
std::string
>
(range));
84
85
return
StatusCode::SUCCESS;
86
}
87
88
89
}
// 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:43
CondAlg2.h
Testing conditions algorithm taking both RL and TS inputs and producing mixed output.
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::CondAlg2::m_tstestKey
SG::ReadCondHandleKey< AthenaAttributeList > m_tstestKey
Definition
CondAlg2.h:56
DMTest::CondAlg2::initialize
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
Definition
CondAlg2.cxx:39
DMTest::CondAlg2::m_rltestKey
SG::ReadCondHandleKey< AthenaAttributeList > m_rltestKey
Definition
CondAlg2.h:55
DMTest::CondAlg2::execute
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
Definition
CondAlg2.cxx:51
DMTest::CondAlg2::m_outKey
SG::WriteCondHandleKey< DMTest::S3 > m_outKey
Definition
CondAlg2.h:57
DMTest::CondAlg2::CondAlg2
CondAlg2(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
CondAlg2.cxx:24
SG::ReadCondHandle
Definition
ReadCondHandle.h:39
SG::ReadCondHandle::range
bool range(EventIDRange &r)
Definition
ReadCondHandle.h:222
SG::WriteCondHandle
Definition
WriteCondHandle.h:26
DMTest
Definition
B.h:23
Generated on
for ATLAS Offline Software by
1.17.0