Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
columnar::ColumnarMemoryTest::ColumnarTestToolHandle Class Referencefinal

a handle to a columnar tool for running tests More...

#include <ColumnarMemoryTest.h>

Collaboration diagram for columnar::ColumnarMemoryTest::ColumnarTestToolHandle:

Public Member Functions

 ColumnarTestToolHandle (asg::AsgTool &val_tool)
 
void renameContainers (const std::vector< std::pair< std::string, std::string >> &renames)
 rename the columns the tool uses More...
 
void initialize ()
 initialize the tool More...
 
void applySystematicVariation (const std::string &sysName)
 set the tool to apply the given systematic variation More...
 
std::vector< ColumnInfogetColumnInfo () const
 get the expected column info More...
 
std::vector< std::string > getColumnNames () const
 get the expected column names More...
 
std::vector< std::string > getRecommendedSystematics () const
 get the recommended systematics More...
 
const ColumnarToolWrappergetToolWrapper () const
 get the tool wrapper More...
 
IColumnarToolgetTool ()
 get the contained tool More...
 

Private Attributes

IColumnarToolm_tool = nullptr
 
CP::ISystematicsToolm_systTool = nullptr
 
std::shared_ptr< const ColumnarToolWrapperm_toolWrapper
 

Detailed Description

a handle to a columnar tool for running tests

This used to be shared with the python bindings, but there are sufficient differences between testing and python bindings to split the two.

Definition at line 46 of file ColumnarMemoryTest.h.

Constructor & Destructor Documentation

◆ ColumnarTestToolHandle()

columnar::ColumnarMemoryTest::ColumnarTestToolHandle::ColumnarTestToolHandle ( asg::AsgTool val_tool)
explicit

Public Members

Definition at line 60 of file ColumnarMemoryTest.cxx.

62  {
63  m_tool = dynamic_cast<IColumnarTool*> (&val_tool);
64  if (m_tool == nullptr)
65  throw std::runtime_error ("tool does not implement IColumnarTool");
66  m_systTool = dynamic_cast<CP::ISystematicsTool*> (m_tool);
67  }

Member Function Documentation

◆ applySystematicVariation()

void columnar::ColumnarMemoryTest::ColumnarTestToolHandle::applySystematicVariation ( const std::string &  sysName)

set the tool to apply the given systematic variation

Definition at line 91 of file ColumnarMemoryTest.cxx.

93  {
94  // by convention setting a systematic on a non-systematics tool
95  // will do nothing
96  if (m_systTool == nullptr)
97  return;
99  throw std::runtime_error ("failed to apply systematic variation");
100  }

◆ getColumnInfo()

std::vector< ColumnInfo > columnar::ColumnarMemoryTest::ColumnarTestToolHandle::getColumnInfo ( ) const

get the expected column info

Definition at line 104 of file ColumnarMemoryTest.cxx.

106  {
107  if (!m_toolWrapper)
108  throw std::runtime_error ("tool not initialized");
109  return m_toolWrapper->getColumnInfo ();
110  }

◆ getColumnNames()

std::vector< std::string > columnar::ColumnarMemoryTest::ColumnarTestToolHandle::getColumnNames ( ) const

get the expected column names

Definition at line 114 of file ColumnarMemoryTest.cxx.

116  {
117  if (!m_toolWrapper)
118  throw std::runtime_error ("tool not initialized");
119  return m_toolWrapper->getColumnNames ();
120  }

◆ getRecommendedSystematics()

std::vector< std::string > columnar::ColumnarMemoryTest::ColumnarTestToolHandle::getRecommendedSystematics ( ) const

get the recommended systematics

Definition at line 124 of file ColumnarMemoryTest.cxx.

126  {
127  if (!m_systTool)
128  return {""};
129  std::vector<std::string> result;
131  result.push_back (sys.name());
132  return result;
133  }

◆ getTool()

IColumnarTool * columnar::ColumnarMemoryTest::ColumnarTestToolHandle::getTool ( )

get the contained tool

Definition at line 147 of file ColumnarMemoryTest.cxx.

149  {
150  return m_tool;
151  }

◆ getToolWrapper()

const ColumnarToolWrapper & columnar::ColumnarMemoryTest::ColumnarTestToolHandle::getToolWrapper ( ) const

get the tool wrapper

Definition at line 137 of file ColumnarMemoryTest.cxx.

139  {
140  if (!m_toolWrapper)
141  throw std::runtime_error ("tool not initialized");
142  return *m_toolWrapper;
143  }

◆ initialize()

void columnar::ColumnarMemoryTest::ColumnarTestToolHandle::initialize ( )

initialize the tool

Definition at line 83 of file ColumnarMemoryTest.cxx.

85  {
86  m_toolWrapper = std::make_shared<ColumnarToolWrapper> (m_tool);
87  }

◆ renameContainers()

void columnar::ColumnarMemoryTest::ColumnarTestToolHandle::renameContainers ( const std::vector< std::pair< std::string, std::string >> &  renames)

rename the columns the tool uses

Definition at line 71 of file ColumnarMemoryTest.cxx.

73  {
75  if (m_toolWrapper)
76  {
77  m_toolWrapper = std::make_shared<ColumnarToolWrapper> (m_tool);
78  }
79  }

Member Data Documentation

◆ m_systTool

CP::ISystematicsTool* columnar::ColumnarMemoryTest::ColumnarTestToolHandle::m_systTool = nullptr
private

Definition at line 87 of file ColumnarMemoryTest.h.

◆ m_tool

IColumnarTool* columnar::ColumnarMemoryTest::ColumnarTestToolHandle::m_tool = nullptr
private

Private Members

Definition at line 86 of file ColumnarMemoryTest.h.

◆ m_toolWrapper

std::shared_ptr<const ColumnarToolWrapper> columnar::ColumnarMemoryTest::ColumnarTestToolHandle::m_toolWrapper
private

Definition at line 89 of file ColumnarMemoryTest.h.


The documentation for this class was generated from the following files:
CaloCondBlobAlgs_fillNoiseFromASCII.sysName
sysName
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:93
get_generator_info.result
result
Definition: get_generator_info.py:21
CP::make_systematics_vector
std::vector< CP::SystematicSet > make_systematics_vector(const SystematicSet &systematics)
utility functions for working with systematics
Definition: SystematicsUtil.cxx:25
columnar::ColumnarMemoryTest::ColumnarTestToolHandle::m_systTool
CP::ISystematicsTool * m_systTool
Definition: ColumnarMemoryTest.h:87
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
columnar::ColumnarMemoryTest::ColumnarTestToolHandle::m_tool
IColumnarTool * m_tool
Definition: ColumnarMemoryTest.h:86
mapkey::sys
@ sys
Definition: TElectronEfficiencyCorrectionTool.cxx:42
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
CP::IReentrantSystematicsTool::recommendedSystematics
virtual SystematicSet recommendedSystematics() const =0
the list of all systematics this tool recommends to use
columnar::ColumnarMemoryTest::ColumnarTestToolHandle::m_toolWrapper
std::shared_ptr< const ColumnarToolWrapper > m_toolWrapper
Definition: ColumnarMemoryTest.h:89
CP::ISystematicsTool
Interface for all CP tools supporting systematic variations.
Definition: ISystematicsTool.h:32
CP::ISystematicsTool::applySystematicVariation
virtual StatusCode applySystematicVariation(const SystematicSet &systConfig)=0
effects: configure this tool for the given list of systematic variations.
python.difftuple.renames
dictionary renames
Definition: difftuple.py:25