ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
DataModelTest
DataModelTestDataCommon
src
xAODTestReadCLinks.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 "
xAODTestReadCLinks.h
"
13
#include "
StoreGate/ReadHandle.h
"
14
#include <format>
15
#include <print>
16
#include <sstream>
17
18
19
namespace
{
20
21
22
typedef
ElementLink<DMTest::CVec>
EL
;
23
24
28
std::string formEL (
const
EL
& el)
29
{
30
return
std::format (
"({}:{})"
,
31
el
.dataID(),
32
static_cast<
int
>
(
el
.index()) == -1 ?
"inv"
: std::to_string(
el
.index()));
33
}
34
35
36
}
// anonymous namespace
37
38
39
namespace
DMTest
{
40
41
45
StatusCode
xAODTestReadCLinks::initialize
()
46
{
47
ATH_CHECK
(
m_clinksKey
.initialize (
SG::AllowEmpty
) );
48
ATH_CHECK
(
m_clinksContainerKey
.initialize (
SG::AllowEmpty
) );
49
ATH_CHECK
(
m_clinksAODKey
.initialize (
SG::AllowEmpty
) );
50
return
StatusCode::SUCCESS;
51
}
52
53
57
StatusCode
xAODTestReadCLinks::execute
(
const
EventContext& ctx)
const
58
{
59
if
(!
m_clinksKey
.empty()) {
60
SG::ReadHandle<CLinks>
clinks (
m_clinksKey
, ctx);
61
ATH_MSG_INFO
(
m_clinksKey
.key() );
62
ATH_CHECK
(
dumpCLinks
(*clinks) );
63
}
64
65
if
(!
m_clinksContainerKey
.empty()) {
66
SG::ReadHandle<CLinksContainer>
clinkscont (
m_clinksContainerKey
, ctx);
67
ATH_MSG_INFO
(
m_clinksContainerKey
.key() );
68
for
(
const
CLinks
* clinks : *clinkscont) {
69
ATH_CHECK
(
dumpCLinks
(*clinks) );
70
}
71
}
72
73
if
(!
m_clinksAODKey
.empty()) {
74
SG::ReadHandle<CLinksAOD>
clinksaod (
m_clinksAODKey
, ctx);
75
ATH_MSG_INFO
(
m_clinksAODKey
.key() );
76
77
std::ostringstream ss1;
78
std::print (ss1,
" "
);
79
for
(
const
EL
& el : clinksaod->vel()) {
80
std::print (ss1,
"{} "
, formEL (el));
81
}
82
ATH_MSG_INFO
(ss1.str());
83
84
std::ostringstream ss2;
85
std::print (ss2,
" "
);
86
for
(
const
EL
el : clinksaod->elv()) {
87
std::print (ss2,
"{} "
, formEL (el));
88
}
89
ATH_MSG_INFO
(ss2.str());
90
}
91
92
return
StatusCode::SUCCESS;
93
}
94
95
99
StatusCode
xAODTestReadCLinks::dumpCLinks
(
const
CLinks
& clinks)
const
100
{
101
std::ostringstream
ss
;
102
std::print (
ss
,
" link: {} links: "
, formEL (clinks.
link
()));
103
for
(
const
EL
& el : clinks.
links
()) {
104
std::print (
ss
,
"{} "
, formEL (el));
105
}
106
ATH_MSG_INFO
(
ss
.str() );
107
return
StatusCode::SUCCESS;
108
}
109
110
111
}
// 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
ss
static Double_t ss
Definition
LArPhysWaveHECTool.cxx:37
ReadHandle.h
Handle class for reading from StoreGate.
DMTest::CLinks_v1::link
const ElementLink< CVec > & link() const
DMTest::CLinks_v1::links
const std::vector< ElementLink< CVec > > & links() const
DMTest::xAODTestReadCLinks::m_clinksAODKey
SG::ReadHandleKey< DMTest::CLinksAOD > m_clinksAODKey
Definition
xAODTestReadCLinks.h:63
DMTest::xAODTestReadCLinks::m_clinksContainerKey
SG::ReadHandleKey< DMTest::CLinksContainer > m_clinksContainerKey
Definition
xAODTestReadCLinks.h:60
DMTest::xAODTestReadCLinks::dumpCLinks
StatusCode dumpCLinks(const CLinks &clinks) const
Dump a CLinks object.
Definition
xAODTestReadCLinks.cxx:99
DMTest::xAODTestReadCLinks::execute
virtual StatusCode execute(const EventContext &ctx) const override
Algorithm event processing.
Definition
xAODTestReadCLinks.cxx:57
DMTest::xAODTestReadCLinks::m_clinksKey
SG::ReadHandleKey< DMTest::CLinks > m_clinksKey
Definition
xAODTestReadCLinks.h:57
DMTest::xAODTestReadCLinks::initialize
virtual StatusCode initialize() override
Algorithm initialization; called at the beginning of the job.
Definition
xAODTestReadCLinks.cxx:45
ElementLink
ElementLink implementation for ROOT usage.
Definition
A/AthLinks/ElementLink.h:40
SG::ReadHandle
Definition
StoreGate/StoreGate/ReadHandle.h:66
DMTest
Definition
B.h:23
DMTest::CLinks
CLinks_v1 CLinks
Definition
CLinks.h:23
EL
This module defines the arguments passed from the BATCH driver to the BATCH worker.
Definition
AsgComponentFactories.h:16
SG::AllowEmpty
@ AllowEmpty
Definition
StoreGate/StoreGate/VarHandleKey.h:29
python.getProblemFolderFromLogs.el
dict el
Definition
getProblemFolderFromLogs.py:51
xAODTestReadCLinks.h
Read and dump CLinks/CLinksAOD objects.
Generated on
for ATLAS Offline Software by
1.17.0