ATLAS Offline Software
Loading...
Searching...
No Matches
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$
13
14
15#include "CondAlg1.h"
16
17
18namespace DMTest {
19
20
26CondAlg1::CondAlg1 (const std::string &name, ISvcLocator *pSvcLocator)
27 : AthCondAlgorithm (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{
41 ATH_CHECK( m_attrListKey.initialize() );
42 ATH_CHECK( m_scondKey.initialize() );
43 return StatusCode::SUCCESS;
44}
45
46
50StatusCode 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
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
Testing conditions algorithms.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Base class for conditions algorithms.
SG::ReadCondHandleKey< AthenaAttributeList > m_attrListKey
Definition CondAlg1.h:51
SG::WriteCondHandleKey< DMTest::S2 > m_scondKey
Definition CondAlg1.h:52
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
Definition CondAlg1.cxx:50
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
Definition CondAlg1.cxx:39
CondAlg1(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition CondAlg1.cxx:26
bool range(EventIDRange &r)
const std::string & key() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
Definition B.h:23