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-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
/*
5
*/
6
// $Id$
14
15
16
#include "
CondAlg2.h
"
17
18
19
namespace
DMTest
{
20
21
27
CondAlg2::CondAlg2
(
const
std::string &name, ISvcLocator *pSvcLocator)
28
:
AthCondAlgorithm
(name, pSvcLocator),
29
m_rltestKey
(
"/DMTest/RLTest"
),
30
m_tstestKey
(
"/DMTest/TSTest"
),
31
m_outKey
(
"scond3"
,
"DMTest"
)
32
{
33
declareProperty
(
"RLTestKey"
,
m_rltestKey
);
34
declareProperty
(
"TSTestKey"
,
m_tstestKey
);
35
declareProperty
(
"OutKey"
,
m_outKey
);
36
}
37
38
42
StatusCode
CondAlg2::initialize
()
43
{
44
ATH_CHECK
(
m_rltestKey
.initialize() );
45
ATH_CHECK
(
m_tstestKey
.initialize() );
46
ATH_CHECK
(
m_outKey
.initialize() );
47
return
StatusCode::SUCCESS;
48
}
49
50
54
StatusCode
CondAlg2::execute
(
const
EventContext& ctx)
const
55
{
56
SG::ReadCondHandle<AthenaAttributeList>
rltest (
m_rltestKey
, ctx);
57
int
xint_rl = (**rltest)[
"xint"
].data<
int
>();
58
59
SG::ReadCondHandle<AthenaAttributeList>
tstest (
m_tstestKey
, ctx);
60
int
xint_ts = (**tstest)[
"xint"
].data<
int
>();
61
62
EventIDRange range_rl;
63
ATH_CHECK
( rltest.
range
(range_rl) );
64
65
EventIDRange range_ts;
66
ATH_CHECK
( tstest.range(range_ts) );
67
68
EventIDBase start (range_rl.start().run_number(),
69
range_rl.start().event_number(),
70
range_ts.start().time_stamp(),
71
range_ts.start().time_stamp_ns_offset(),
72
range_rl.start().lumi_block());
73
EventIDBase stop (range_rl.stop().run_number(),
74
range_rl.stop().event_number(),
75
range_ts.stop().time_stamp(),
76
range_ts.stop().time_stamp_ns_offset(),
77
range_rl.stop().lumi_block());
78
79
EventIDRange range (start, stop);
80
81
SG::WriteCondHandle<DMTest::S3>
out (
m_outKey
, ctx);
82
auto
s3 = std::make_unique<DMTest::S3> (xint_rl + xint_ts);
83
ATH_CHECK
( out.record (range, std::move(s3)) );
84
85
ATH_MSG_DEBUG
(
"Recorded '"
<< out.key() <<
"' with range "
<< range);
86
87
return
StatusCode::SUCCESS;
88
}
89
90
91
}
// 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
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:42
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:54
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:27
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
SG::ReadCondHandle::range
bool range(EventIDRange &r)
Definition
ReadCondHandle.h:223
SG::WriteCondHandle
Definition
WriteCondHandle.h:26
DMTest
Definition
B.h:23
Generated on
for ATLAS Offline Software by
1.17.0