ATLAS Offline Software
Loading...
Searching...
No Matches
CondAlg1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
10
11
12#include "CondAlg1.h"
13
14
15namespace DMTest {
16
17
23CondAlg1::CondAlg1 (const std::string &name, ISvcLocator *pSvcLocator)
24 : AthCondAlgorithm (name, pSvcLocator),
25 m_attrListKey ("/DMTest/TestAttrList"),
26 m_scondKey ("scond", "DMTest")
27{
28 declareProperty ("AttrListKey", m_attrListKey);
29 declareProperty ("SCondKey", m_scondKey);
30}
31
32
37{
38 ATH_CHECK( m_attrListKey.initialize() );
39 ATH_CHECK( m_scondKey.initialize() );
40 return StatusCode::SUCCESS;
41}
42
43
47StatusCode CondAlg1::execute (const EventContext& ctx) const
48{
50 int xint = (**attrList)["xint"].data<int>();
51
52 EventIDRange range;
53 ATH_CHECK( attrList.range(range) );
54
56 auto s2 = std::make_unique<DMTest::S2> (xint*100);
57 ATH_CHECK( scond.record (range, std::move(s2) ) );
58
59 ATH_MSG_DEBUG("Recorded '{}' with range {}",
60 scond.key(), static_cast<std::string>(range));
61
62 return StatusCode::SUCCESS;
63}
64
65
66} // 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:47
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
Definition CondAlg1.cxx:36
CondAlg1(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition CondAlg1.cxx:23
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