ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
DataModelTest
DataModelTestDataCommon
src
xAODTestReadSymlinkTool.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 "
xAODTestReadSymlinkTool.h
"
13
#include "
StoreGate/ReadHandle.h
"
14
15
16
namespace
DMTest
{
17
18
19
xAODTestReadSymlinkTool::xAODTestReadSymlinkTool
(
const
std::string&
type
,
20
const
std::string& name,
21
const
IInterface* parent)
22
: base_class (
type
, name, parent)
23
{
24
declareProperty (
"Key"
,
m_objKey
);
25
declareProperty (
"S1Key"
,
m_s1Key
=
"S2"
);
26
declareProperty (
"S2Key"
,
m_s2Key
=
"S2"
);
27
declareProperty (
"AliasKey"
,
m_aliasKey
=
"S2alias"
);
28
}
29
30
31
StatusCode
xAODTestReadSymlinkTool::initialize
()
32
{
33
ATH_CHECK
(
m_objKey
.initialize() );
34
ATH_CHECK
(
m_s1Key
.initialize() );
35
ATH_CHECK
(
m_s2Key
.initialize() );
36
ATH_CHECK
(
m_aliasKey
.initialize() );
37
return
StatusCode::SUCCESS;
38
}
39
40
41
StatusCode
xAODTestReadSymlinkTool::doit
(
const
EventContext& ctx)
const
42
{
43
SG::ReadHandle<SG::AuxElement>
c (
m_objKey
, ctx);
44
SG::ReadHandle<DMTest::S1>
s1 (
m_s1Key
, ctx);
45
SG::ReadHandle<DMTest::S2>
s2 (
m_s2Key
, ctx);
46
SG::ReadHandle<DMTest::S2>
alias (
m_aliasKey
, ctx);
47
48
static
const
SG::Accessor<int>
anInt (
"anInt"
);
49
ATH_MSG_INFO
(
"From tool: C (as AuxElement): {}; S {}"
, anInt (*c), s2->m_x );
50
if
(s2.cptr() != s1.cptr() || s2.cptr() != alias.cptr())
51
ATH_MSG_ERROR
(
" S objects mismatch! "
);
52
return
StatusCode::SUCCESS;
53
}
54
55
56
}
// namespace DMTest
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x,...)
Definition
AthMsgStreamMacros.h:47
ATH_MSG_INFO
#define ATH_MSG_INFO(x,...)
Definition
AthMsgStreamMacros.h:45
ReadHandle.h
Handle class for reading from StoreGate.
DMTest::xAODTestReadSymlinkTool::xAODTestReadSymlinkTool
xAODTestReadSymlinkTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
Definition
xAODTestReadSymlinkTool.cxx:19
DMTest::xAODTestReadSymlinkTool::m_aliasKey
SG::ReadHandleKey< DMTest::S2 > m_aliasKey
Definition
xAODTestReadSymlinkTool.h:63
DMTest::xAODTestReadSymlinkTool::initialize
virtual StatusCode initialize() override
Tool initialization; called at the beginning of the job.
Definition
xAODTestReadSymlinkTool.cxx:31
DMTest::xAODTestReadSymlinkTool::doit
virtual StatusCode doit(const EventContext &ctx) const override
Tool event processing.
Definition
xAODTestReadSymlinkTool.cxx:41
DMTest::xAODTestReadSymlinkTool::m_objKey
SG::ReadHandleKey< SG::AuxElement > m_objKey
Definition
xAODTestReadSymlinkTool.h:59
DMTest::xAODTestReadSymlinkTool::m_s2Key
SG::ReadHandleKey< DMTest::S2 > m_s2Key
Definition
xAODTestReadSymlinkTool.h:62
DMTest::xAODTestReadSymlinkTool::m_s1Key
SG::ReadHandleKey< DMTest::S1 > m_s1Key
Definition
xAODTestReadSymlinkTool.h:61
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition
Control/AthContainers/AthContainers/Accessor.h:68
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:66
DMTest
Definition
B.h:23
type
xAODTestReadSymlinkTool.h
Test reading via a symlink, as a tool.
Generated on
for ATLAS Offline Software by
1.17.0