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::ColumnDataVectorVector< T > Struct Template Referencefinal
Inheritance diagram for columnar::PhysliteTestHelpers::ColumnDataVectorVector< T >:
Collaboration diagram for columnar::PhysliteTestHelpers::ColumnDataVectorVector< T >:

Public Member Functions

 ColumnDataVectorVector (const std::string &val_columnName, const std::string &val_branchName)
 
virtual bool connect (TTree *tree, std::unordered_map< std::string, const PhysliteTestHelpers::IColumnData * > &, 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
 
std::vector< ColumnarOffsetTypeoffsets
 
std::vector< T > columnData
 
std::vector< std::vector< T > > * branchData = nullptr
 
TBranch * branch = nullptr
 
Benchmark benchmark
 

Detailed Description

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

Definition at line 393 of file ColumnarPhysliteTest.cxx.

Constructor & Destructor Documentation

◆ ColumnDataVectorVector()

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

Definition at line 404 of file ColumnarPhysliteTest.cxx.

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

Member Function Documentation

◆ connect()

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

Implements columnar::PhysliteTestHelpers::IColumnData.

Definition at line 407 of file ColumnarPhysliteTest.cxx.

408  {
409  auto iter = requestedColumns.find (columnName);
410  if (iter == requestedColumns.end())
411  return false;
412 
413  branch = tree->GetBranch (branchName.c_str());
414  if (!branch)
415  throw std::runtime_error ("failed to get branch: " + branchName);
416  branch->SetAddress (&branchData);
417 
418  offsetName = iter->second.offsetName;
419 
420  requestedColumns.erase (iter);
421 
422  iter = requestedColumns.find (offsetName);
423  if (iter == requestedColumns.end())
424  {
425  offsetName.clear();
426  return true;
427  }
428  requestedColumns.erase (iter);
429  return true;
430  }

◆ getSize()

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

Implements columnar::PhysliteTestHelpers::IColumnData.

Definition at line 432 of file ColumnarPhysliteTest.cxx.

433  {
434  return columnData.size();
435  }

◆ setData()

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

Implements columnar::PhysliteTestHelpers::IColumnData.

Definition at line 437 of file ColumnarPhysliteTest.cxx.

438  {
439  benchmark.startTimer ();
440  branch->GetEntry (entry);
441  benchmark.stopTimer ();
442  columnData.clear();
443  offsets.clear();
444  offsets.push_back (0);
445  for (auto& data : *branchData)
446  {
447  columnData.insert (columnData.end(), data.begin(), data.end());
448  offsets.push_back (columnData.size());
449  }
450  tool.setColumn (columnName, columnData.size(), columnData.data());
451  if (!offsetName.empty())
452  tool.setColumn (offsetName, offsets.size(), offsets.data());
453  }

Member Data Documentation

◆ benchmark

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

Definition at line 402 of file ColumnarPhysliteTest.cxx.

◆ branch

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

Definition at line 401 of file ColumnarPhysliteTest.cxx.

◆ branchData

template<typename T >
std::vector<std::vector<T> >* columnar::PhysliteTestHelpers::ColumnDataVectorVector< T >::branchData = nullptr

Definition at line 400 of file ColumnarPhysliteTest.cxx.

◆ branchName

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

Definition at line 396 of file ColumnarPhysliteTest.cxx.

◆ columnData

template<typename T >
std::vector<T> columnar::PhysliteTestHelpers::ColumnDataVectorVector< T >::columnData

Definition at line 399 of file ColumnarPhysliteTest.cxx.

◆ columnName

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

Definition at line 395 of file ColumnarPhysliteTest.cxx.

◆ offsetName

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

Definition at line 397 of file ColumnarPhysliteTest.cxx.

◆ offsets

template<typename T >
std::vector<ColumnarOffsetType> columnar::PhysliteTestHelpers::ColumnDataVectorVector< T >::offsets

Definition at line 398 of file ColumnarPhysliteTest.cxx.


The documentation for this struct was generated from the following file:
columnar::PhysliteTestHelpers::ColumnDataVectorVector::branch
TBranch * branch
Definition: ColumnarPhysliteTest.cxx:401
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
columnar::PhysliteTestHelpers::ColumnDataVectorVector::branchData
std::vector< std::vector< T > > * branchData
Definition: ColumnarPhysliteTest.cxx:400
columnar::PhysliteTestHelpers::ColumnDataVectorVector::offsetName
std::string offsetName
Definition: ColumnarPhysliteTest.cxx:397
tree
TChain * tree
Definition: tile_monitor.h:30
columnar::PhysliteTestHelpers::ColumnDataVectorVector::branchName
std::string branchName
Definition: ColumnarPhysliteTest.cxx:396
columnar::PhysliteTestHelpers::ColumnDataVectorVector::offsets
std::vector< ColumnarOffsetType > offsets
Definition: ColumnarPhysliteTest.cxx:398
GetAllXsec.entry
list entry
Definition: GetAllXsec.py:132
columnar::PhysliteTestHelpers::ColumnDataVectorVector::benchmark
Benchmark benchmark
Definition: ColumnarPhysliteTest.cxx:402
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
columnar::PhysliteTestHelpers::ColumnDataVectorVector::columnName
std::string columnName
Definition: ColumnarPhysliteTest.cxx:395
columnar::PhysliteTestHelpers::ColumnDataVectorVector::columnData
std::vector< T > columnData
Definition: ColumnarPhysliteTest.cxx:399