ATLAS Offline Software
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$
16 #include "CondAlg2.h"
17 
18 
19 namespace DMTest {
20 
21 
27 CondAlg2::CondAlg2 (const std::string &name, ISvcLocator *pSvcLocator)
28  : AthReentrantAlgorithm (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 {
47  return StatusCode::SUCCESS;
48 }
49 
50 
54 StatusCode 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
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
PixelModuleFeMask_create_db.stop
int stop
Definition: PixelModuleFeMask_create_db.py:76
SG::ReadCondHandle::range
bool range(EventIDRange &r)
Definition: ReadCondHandle.h:224
CondAlg2.h
Testing conditions algorithm taking both RL and TS inputs and producing mixed output.
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
DMTest::CondAlg2::execute
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
Definition: CondAlg2.cxx:54
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
DMTest::CondAlg2::CondAlg2
CondAlg2(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: CondAlg2.cxx:27
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ReadCellNoiseFromCoolCompare.s3
s3
Definition: ReadCellNoiseFromCoolCompare.py:380
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
DMTest::CondAlg2::m_rltestKey
SG::ReadCondHandleKey< AthenaAttributeList > m_rltestKey
Definition: CondAlg2.h:55
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
DMTest::CondAlg2::m_tstestKey
SG::ReadCondHandleKey< AthenaAttributeList > m_tstestKey
Definition: CondAlg2.h:56
DMTest::CondAlg2::m_outKey
SG::WriteCondHandleKey< DMTest::S3 > m_outKey
Definition: CondAlg2.h:57
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
DMTest::CondAlg2::initialize
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
Definition: CondAlg2.cxx:42
DMTest
Definition: B.h:23