ATLAS Offline Software
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 48 of file ColumnarMemoryTest.h.

Constructor & Destructor Documentation

◆ ColumnarTestToolHandle()

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

Public Members

Definition at line 46 of file ColumnarMemoryTest.cxx.

48  {
49  m_tool = dynamic_cast<IColumnarTool*> (&val_tool);
50  if (m_tool == nullptr)
51  throw std::runtime_error ("tool does not implement IColumnarTool");
52  m_systTool = dynamic_cast<CP::ISystematicsTool*> (m_tool);
53  }

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 77 of file ColumnarMemoryTest.cxx.

79  {
80  // by convention setting a systematic on a non-systematics tool
81  // will do nothing
82  if (m_systTool == nullptr)
83  return;
85  throw std::runtime_error ("failed to apply systematic variation");
86  }

◆ getColumnInfo()

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

get the expected column info

Definition at line 90 of file ColumnarMemoryTest.cxx.

92  {
93  if (!m_toolWrapper)
94  throw std::runtime_error ("tool not initialized");
95  return m_toolWrapper->getColumnInfo ();
96  }

◆ getColumnNames()

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

get the expected column names

Definition at line 100 of file ColumnarMemoryTest.cxx.

102  {
103  if (!m_toolWrapper)
104  throw std::runtime_error ("tool not initialized");
105  return m_toolWrapper->getColumnNames ();
106  }

◆ getRecommendedSystematics()

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

get the recommended systematics

Definition at line 110 of file ColumnarMemoryTest.cxx.

112  {
113  if (!m_systTool)
114  return {""};
115  std::vector<std::string> result;
117  result.push_back (sys.name());
118  return result;
119  }

◆ getTool()

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

get the contained tool

Definition at line 133 of file ColumnarMemoryTest.cxx.

135  {
136  return m_tool;
137  }

◆ getToolWrapper()

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

get the tool wrapper

Definition at line 123 of file ColumnarMemoryTest.cxx.

125  {
126  if (!m_toolWrapper)
127  throw std::runtime_error ("tool not initialized");
128  return *m_toolWrapper;
129  }

◆ initialize()

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

initialize the tool

Definition at line 69 of file ColumnarMemoryTest.cxx.

71  {
72  m_toolWrapper = std::make_shared<ColumnarToolWrapper> (m_tool);
73  }

◆ 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 57 of file ColumnarMemoryTest.cxx.

59  {
61  if (m_toolWrapper)
62  {
63  m_toolWrapper = std::make_shared<ColumnarToolWrapper> (m_tool);
64  }
65  }

Member Data Documentation

◆ m_systTool

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

Definition at line 89 of file ColumnarMemoryTest.h.

◆ m_tool

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

Private Members

Definition at line 88 of file ColumnarMemoryTest.h.

◆ m_toolWrapper

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

Definition at line 91 of file ColumnarMemoryTest.h.


The documentation for this class was generated from the following files:
CaloCondBlobAlgs_fillNoiseFromASCII.sysName
sysName
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:92
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:89
CP::SystematicSet
Class to wrap a set of SystematicVariations.
Definition: SystematicSet.h:31
columnar::ColumnarMemoryTest::ColumnarTestToolHandle::m_tool
IColumnarTool * m_tool
Definition: ColumnarMemoryTest.h:88
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:91
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:23