Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 
13 
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 }
columnar::IColumnarTool
an interface for tools that operate on columnar data
Definition: IColumnarTool.h:214
DeMoUpdate.column
dictionary column
Definition: DeMoUpdate.py:1110
IColumnarTool.h
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
MakeNewFileFromOldAndSubstitution.newName
dictionary newName
Definition: ICHEP2016/MakeNewFileFromOldAndSubstitution.py:95
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
CxxUtils::to
CONT to(RANGE &&r)
Definition: ranges.h:39
columnar
Definition: ClusterDef.h:16
ColumnarToolHelpers.h
ColumnInfo.h
python.difftuple.renames
dictionary renames
Definition: difftuple.py:25