ATLAS Offline Software
Loading...
Searching...
No Matches
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
16namespace DMTest {
17
18
24CondAlg2::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
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
51StatusCode CondAlg2::execute (const EventContext& ctx) const
52{
54 int xint_rl = (**rltest)["xint"].data<int>();
55
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
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
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
Testing conditions algorithm taking both RL and TS inputs and producing mixed output.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Base class for conditions algorithms.
SG::ReadCondHandleKey< AthenaAttributeList > m_tstestKey
Definition CondAlg2.h:56
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
Definition CondAlg2.cxx:39
SG::ReadCondHandleKey< AthenaAttributeList > m_rltestKey
Definition CondAlg2.h:55
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
Definition CondAlg2.cxx:51
SG::WriteCondHandleKey< DMTest::S3 > m_outKey
Definition CondAlg2.h:57
CondAlg2(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition CondAlg2.cxx:24
bool range(EventIDRange &r)
Definition B.h:23