ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
Columnar
ColumnarToolWrapper
Root
ColumnarToolHelpers.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
7
8
//
9
// includes
10
//
11
12
#include <
ColumnarToolWrapper/ColumnarToolHelpers.h
>
13
14
#include <
ColumnarInterfaces/ColumnInfo.h
>
15
#include <
ColumnarInterfaces/IColumnarTool.h
>
16
17
//
18
// method implementations
19
//
20
21
namespace
columnar
22
{
23
void
renameContainers
(
IColumnarTool
& tool,
const
std::vector<std::pair<std::string,std::string>>& renames)
24
{
25
if
(!renames.empty())
26
{
27
auto
columnInfo = tool.getColumnInfo ();
28
for
(
auto
& [from, to] : renames)
29
{
30
for
(
auto
& column : columnInfo)
31
{
32
if
(column.name.starts_with (from) && (column.name.size() == from.size() || column.name[from.size()] ==
'.'
))
33
{
34
std::string newName = to + column.name.substr (from.size());
35
tool.renameColumn (column.name, newName);
36
}
37
}
38
}
39
}
40
}
41
}
ColumnInfo.h
ColumnarToolHelpers.h
IColumnarTool.h
columnar::IColumnarTool
an interface for tools that operate on columnar data
Definition
IColumnarTool.h:190
columnar
Definition
ClusterDef.h:16
columnar::renameContainers
void renameContainers(IColumnarTool &tool, const std::vector< std::pair< std::string, std::string > > &renames)
rename containers in the columnar tool
Definition
ColumnarToolHelpers.cxx:23
Generated on
for ATLAS Offline Software by
1.17.0