ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
DataModelTest
DataModelTestDataCommon
src
MetaReaderAlg.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 "
MetaReaderAlg.h
"
13
#include "
DataModelTestDataCommon/S1.h
"
14
#include "
PersistentDataModel/DataHeader.h
"
15
16
namespace
DMTest
{
17
18
24
MetaReaderAlg::MetaReaderAlg
(
const
std::string &name, ISvcLocator *pSvcLocator)
25
:
AthReentrantAlgorithm
(name, pSvcLocator),
26
m_s1Key
(
"MetaS1"
),
27
m_cKey
(
"MetaC"
)
28
{
29
}
30
31
35
StatusCode
MetaReaderAlg::initialize
()
36
{
37
ATH_CHECK
(
m_s1Key
.initialize() );
38
ATH_CHECK
(
m_cKey
.initialize() );
39
return
StatusCode::SUCCESS;
40
}
41
42
47
StatusCode
MetaReaderAlg::execute
(
const
EventContext& ctx)
const
48
{
49
// Get proper dbkey.
50
const
DataHeader
* thisDH =
nullptr
;
51
ATH_CHECK
(
evtStore
()->retrieve(thisDH,
"EventSelector"
) );
52
std::string sid = thisDH->
begin
()->getToken()->dbID().toString();
53
54
// Make a new key with the correct dbkey.
55
SG::ReadMetaHandleKey<DMTest::S1>
s1Key (
m_s1Key
.key(), sid);
56
ATH_CHECK
( s1Key.
initialize
() );
57
SG::ReadMetaHandle<DMTest::S1>
s1 (s1Key, ctx);
58
ATH_MSG_INFO
(
"MetaS1: {}"
, s1->m_x);
59
60
// Make a new key with the correct dbkey.
61
SG::ReadMetaHandleKey<DMTest::C>
cKey (
m_cKey
.key(), sid);
62
ATH_CHECK
( cKey.
initialize
() );
63
SG::ReadMetaHandle<DMTest::C>
c (cKey, ctx);
64
ATH_MSG_INFO
(
"MetaC: {} {}"
, c->anInt(), c->aFloat());
65
return
StatusCode::SUCCESS;
66
}
67
68
69
}
// namespace DMTest
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x,...)
Definition
AthMsgStreamMacros.h:45
DataHeader.h
This file contains the class definition for the DataHeader and DataHeaderElement classes.
MetaReaderAlg.h
S1.h
For symlink tests.
AthCommonAlgorithm< Gaudi::Algorithm >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
Definition
AthCommonDataStore.h:85
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
DMTest::MetaReaderAlg::MetaReaderAlg
MetaReaderAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition
MetaReaderAlg.cxx:24
DMTest::MetaReaderAlg::m_cKey
SG::ReadMetaHandleKey< DMTest::C > m_cKey
Definition
MetaReaderAlg.h:55
DMTest::MetaReaderAlg::m_s1Key
SG::ReadMetaHandleKey< DMTest::S1 > m_s1Key
Definition
MetaReaderAlg.h:54
DMTest::MetaReaderAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm execute method.
Definition
MetaReaderAlg.cxx:47
DMTest::MetaReaderAlg::initialize
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
Definition
MetaReaderAlg.cxx:35
DataHeader
This class provides the layout for summary information stored for data written to POOL.
Definition
DataHeader.h:123
DataHeader::begin
std::vector< DataHeaderElement >::const_iterator begin() const
Definition
DataHeader.cxx:250
SG::MetaHandleKey::initialize
StatusCode initialize()
SG::ReadMetaHandleKey
Definition
ReadMetaHandleKey.h:18
SG::ReadMetaHandle
Definition
ReadMetaHandle.h:26
DMTest
Definition
B.h:23
Generated on
for ATLAS Offline Software by
1.17.0