ATLAS Offline Software
CondAlg1.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$
15 #include "CondAlg1.h"
16 
17 
18 namespace DMTest {
19 
20 
26 CondAlg1::CondAlg1 (const std::string &name, ISvcLocator *pSvcLocator)
27  : AthReentrantAlgorithm (name, pSvcLocator),
28  m_attrListKey ("/DMTest/TestAttrList"),
29  m_scondKey ("scond", "DMTest")
30 {
31  declareProperty ("AttrListKey", m_attrListKey);
32  declareProperty ("SCondKey", m_scondKey);
33 }
34 
35 
40 {
43  return StatusCode::SUCCESS;
44 }
45 
46 
50 StatusCode CondAlg1::execute (const EventContext& ctx) const
51 {
53  int xint = (**attrList)["xint"].data<int>();
54 
55  EventIDRange range;
56  ATH_CHECK( attrList.range(range) );
57 
59  auto s2 = std::make_unique<DMTest::S2> (xint*100);
60  ATH_CHECK( scond.record (range, std::move(s2) ) );
61 
62  ATH_MSG_DEBUG("Recorded '" << scond.key() << "' with range " << range);
63 
64  return StatusCode::SUCCESS;
65 }
66 
67 
68 } // 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
DMTest::CondAlg1::m_scondKey
SG::WriteCondHandleKey< DMTest::S2 > m_scondKey
Definition: CondAlg1.h:52
SG::ReadCondHandle::range
bool range(EventIDRange &r)
Definition: ReadCondHandle.h:224
SG::WriteCondHandle::record
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
Definition: WriteCondHandle.h:157
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
CondAlg1.h
Testing conditions algorithms.
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
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DMTest::CondAlg1::m_attrListKey
SG::ReadCondHandleKey< AthenaAttributeList > m_attrListKey
Definition: CondAlg1.h:51
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
SG::WriteCondHandle::key
const std::string & key() const
Definition: WriteCondHandle.h:40
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
ReadCellNoiseFromCoolCompare.s2
s2
Definition: ReadCellNoiseFromCoolCompare.py:379
DMTest::CondAlg1::execute
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
Definition: CondAlg1.cxx:50
DMTest::CondAlg1::initialize
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
Definition: CondAlg1.cxx:39
DMTest::CondAlg1::CondAlg1
CondAlg1(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition: CondAlg1.cxx:26
SG::WriteCondHandle
Definition: WriteCondHandle.h:26
DMTest
Definition: B.h:23