ATLAS Offline Software
Loading...
Searching...
No Matches
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
19namespace DMTest {
20
21
27CondAlg2::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
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
54StatusCode CondAlg2::execute (const EventContext& ctx) const
55{
57 int xint_rl = (**rltest)["xint"].data<int>();
58
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
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
#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:42
SG::ReadCondHandleKey< AthenaAttributeList > m_rltestKey
Definition CondAlg2.h:55
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
Definition CondAlg2.cxx:54
SG::WriteCondHandleKey< DMTest::S3 > m_outKey
Definition CondAlg2.h:57
CondAlg2(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition CondAlg2.cxx:27
bool range(EventIDRange &r)
Definition B.h:23