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 | Public Attributes | List of all members
columnar::PhysliteTestHelpers::ColumnDataVector< T > Struct Template Referencefinal
Inheritance diagram for columnar::PhysliteTestHelpers::ColumnDataVector< T >:
Collaboration diagram for columnar::PhysliteTestHelpers::ColumnDataVector< T >:

Public Member Functions

 ColumnDataVector (const std::string &val_columnName, const std::string &val_branchName)
 
virtual bool connect (TTree *tree, std::unordered_map< std::string, const PhysliteTestHelpers::IColumnData * > &sizeColumns, std::unordered_map< std::string, ColumnInfo > &requestedColumns) override
 
virtual std::size_t getSize () const override
 
virtual void setData (ColumnarToolWrapperData &tool, Long64_t entry) override
 

Public Attributes

std::string columnName
 
std::string branchName
 
std::string offsetName
 
const PhysliteTestHelpers::IColumnDatasizeColumn = nullptr
 
std::array< ColumnarOffsetType, 2 > offsets = {0, 0}
 
std::vector< T > * data = nullptr
 
TBranch * branch = nullptr
 
Benchmark benchmark
 

Detailed Description

template<typename T>
struct columnar::PhysliteTestHelpers::ColumnDataVector< T >

Definition at line 174 of file ColumnarPhysliteTest.cxx.

Constructor & Destructor Documentation

◆ ColumnDataVector()

template<typename T >
columnar::PhysliteTestHelpers::ColumnDataVector< T >::ColumnDataVector ( const std::string &  val_columnName,
const std::string &  val_branchName 
)
inline

Definition at line 185 of file ColumnarPhysliteTest.cxx.

186  : columnName (val_columnName), branchName (val_branchName), benchmark (columnName) {}

Member Function Documentation

◆ connect()

template<typename T >
virtual bool columnar::PhysliteTestHelpers::ColumnDataVector< T >::connect ( TTree *  tree,
std::unordered_map< std::string, const PhysliteTestHelpers::IColumnData * > &  sizeColumns,
std::unordered_map< std::string, ColumnInfo > &  requestedColumns 
)
inlineoverridevirtual

Implements columnar::PhysliteTestHelpers::IColumnData.

Definition at line 188 of file ColumnarPhysliteTest.cxx.

189  {
190  auto iter = requestedColumns.find (columnName);
191  if (iter == requestedColumns.end())
192  return false;
193 
194  branch = tree->GetBranch (branchName.c_str());
195  if (!branch)
196  throw std::runtime_error ("failed to get branch: " + branchName);
197  branch->SetAddress (&data);
198 
199  offsetName = iter->second.offsetName;
200  if (offsetName.empty())
201  throw std::runtime_error ("missing offset column for: " + columnName);
202 
203  requestedColumns.erase (iter);
204 
205  if (auto sizeIter = sizeColumns.find (offsetName); sizeIter != sizeColumns.end())
206  sizeColumn = sizeIter->second;
207  else
208  sizeColumns.emplace (offsetName, this);
209 
210  iter = requestedColumns.find (offsetName);
211  if (iter == requestedColumns.end())
212  offsetName.clear();
213  else
214  requestedColumns.erase (iter);
215 
216  return true;
217  }

◆ getSize()

template<typename T >
virtual std::size_t columnar::PhysliteTestHelpers::ColumnDataVector< T >::getSize ( ) const
inlineoverridevirtual

Implements columnar::PhysliteTestHelpers::IColumnData.

Definition at line 219 of file ColumnarPhysliteTest.cxx.

220  {
221  return data->size();
222  }

◆ setData()

template<typename T >
virtual void columnar::PhysliteTestHelpers::ColumnDataVector< T >::setData ( ColumnarToolWrapperData tool,
Long64_t  entry 
)
inlineoverridevirtual

Implements columnar::PhysliteTestHelpers::IColumnData.

Definition at line 224 of file ColumnarPhysliteTest.cxx.

225  {
226  benchmark.startTimer ();
227  branch->GetEntry (entry);
228  benchmark.stopTimer ();
229  tool.setColumn (columnName, data->size(), data->data());
230  if (!offsetName.empty())
231  {
232  offsets[1] = data->size();
233  tool.setColumn (offsetName, offsets.size(), offsets.data());
234  }
235  if (sizeColumn && sizeColumn->getSize() != data->size())
236  throw std::runtime_error ("size mismatch: " + columnName);
237  }

Member Data Documentation

◆ benchmark

template<typename T >
Benchmark columnar::PhysliteTestHelpers::ColumnDataVector< T >::benchmark

Definition at line 183 of file ColumnarPhysliteTest.cxx.

◆ branch

template<typename T >
TBranch* columnar::PhysliteTestHelpers::ColumnDataVector< T >::branch = nullptr

Definition at line 182 of file ColumnarPhysliteTest.cxx.

◆ branchName

template<typename T >
std::string columnar::PhysliteTestHelpers::ColumnDataVector< T >::branchName

Definition at line 177 of file ColumnarPhysliteTest.cxx.

◆ columnName

template<typename T >
std::string columnar::PhysliteTestHelpers::ColumnDataVector< T >::columnName

Definition at line 176 of file ColumnarPhysliteTest.cxx.

◆ data

template<typename T >
std::vector<T>* columnar::PhysliteTestHelpers::ColumnDataVector< T >::data = nullptr

Definition at line 181 of file ColumnarPhysliteTest.cxx.

◆ offsetName

template<typename T >
std::string columnar::PhysliteTestHelpers::ColumnDataVector< T >::offsetName

Definition at line 178 of file ColumnarPhysliteTest.cxx.

◆ offsets

template<typename T >
std::array<ColumnarOffsetType, 2> columnar::PhysliteTestHelpers::ColumnDataVector< T >::offsets = {0, 0}

Definition at line 180 of file ColumnarPhysliteTest.cxx.

◆ sizeColumn

Definition at line 179 of file ColumnarPhysliteTest.cxx.


The documentation for this struct was generated from the following file:
tree
TChain * tree
Definition: tile_monitor.h:30
columnar::PhysliteTestHelpers::ColumnDataVector::offsets
std::array< ColumnarOffsetType, 2 > offsets
Definition: ColumnarPhysliteTest.cxx:180
columnar::PhysliteTestHelpers::ColumnDataVector::data
std::vector< T > * data
Definition: ColumnarPhysliteTest.cxx:181
columnar::PhysliteTestHelpers::ColumnDataVector::offsetName
std::string offsetName
Definition: ColumnarPhysliteTest.cxx:178
columnar::PhysliteTestHelpers::ColumnDataVector::branch
TBranch * branch
Definition: ColumnarPhysliteTest.cxx:182
columnar::PhysliteTestHelpers::ColumnDataVector::benchmark
Benchmark benchmark
Definition: ColumnarPhysliteTest.cxx:183
columnar::PhysliteTestHelpers::IColumnData::getSize
virtual std::size_t getSize() const =0
columnar::PhysliteTestHelpers::ColumnDataVector::branchName
std::string branchName
Definition: ColumnarPhysliteTest.cxx:177
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
columnar::PhysliteTestHelpers::ColumnDataVector::sizeColumn
const PhysliteTestHelpers::IColumnData * sizeColumn
Definition: ColumnarPhysliteTest.cxx:179
columnar::PhysliteTestHelpers::ColumnDataVector::columnName
std::string columnName
Definition: ColumnarPhysliteTest.cxx:176