EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dfe::NamedTupleRootReader< NamedTuple > Class Template Reference

Read records from a ROOT TTree. More...

#include <acts/blob/sPHENIX/thirdparty/dfelibs/dfe/dfe_io_root.hpp>

Public Member Functions

 NamedTupleRootReader ()=delete
 
 NamedTupleRootReader (const NamedTupleRootReader &)=delete
 
 NamedTupleRootReader (NamedTupleRootReader &&)=delete
 
NamedTupleRootReaderoperator= (const NamedTupleRootReader &)=delete
 
NamedTupleRootReaderoperator= (NamedTupleRootReader &&)=delete
 
 NamedTupleRootReader (const std::string &path, const std::string &tree_name)
 
 NamedTupleRootReader (TDirectory *dir, const std::string &tree_name)
 
 ~NamedTupleRootReader ()
 Write the tree and close the owned file.
 
bool read (NamedTuple &record)
 

Private Types

using Tuple = typename NamedTuple::Tuple
 

Private Member Functions

template<std::size_t... I>
void setup_branches (std::index_sequence< I...>)
 

Private Attributes

TFile * m_file
 
TTree * m_tree
 
int64_t m_next
 
Tuple m_data
 

Detailed Description

template<typename NamedTuple>
class dfe::NamedTupleRootReader< NamedTuple >

Read records from a ROOT TTree.

Definition at line 83 of file dfe_io_root.hpp.

View newest version in sPHENIX GitHub at line 83 of file dfe_io_root.hpp

Member Typedef Documentation

template<typename NamedTuple >
using dfe::NamedTupleRootReader< NamedTuple >::Tuple = typename NamedTuple::Tuple
private

Definition at line 115 of file dfe_io_root.hpp.

View newest version in sPHENIX GitHub at line 115 of file dfe_io_root.hpp

Constructor & Destructor Documentation

template<typename NamedTuple >
dfe::NamedTupleRootReader< NamedTuple >::NamedTupleRootReader ( )
delete
template<typename NamedTuple >
dfe::NamedTupleRootReader< NamedTuple >::NamedTupleRootReader ( const NamedTupleRootReader< NamedTuple > &  )
delete
template<typename NamedTuple >
dfe::NamedTupleRootReader< NamedTuple >::NamedTupleRootReader ( NamedTupleRootReader< NamedTuple > &&  )
delete
template<typename NamedTuple >
dfe::NamedTupleRootReader< NamedTuple >::NamedTupleRootReader ( const std::string &  path,
const std::string &  tree_name 
)
inline

Open a file at the given path.

Parameters
pathPath to the input file
tree_nameName of the input tree within the file

Definition at line 249 of file dfe_io_root.hpp.

View newest version in sPHENIX GitHub at line 249 of file dfe_io_root.hpp

References dfe::NamedTupleRootReader< NamedTuple >::m_file, dfe::NamedTupleRootReader< NamedTuple >::m_tree, dfe::NamedTupleRootReader< NamedTuple >::setup_branches(), and value.

+ Here is the call graph for this function:

template<typename NamedTuple >
dfe::NamedTupleRootReader< NamedTuple >::NamedTupleRootReader ( TDirectory *  dir,
const std::string &  tree_name 
)
inline

Open a tree from a ROOT directory.

Parameters
dirInput directory for the tree
tree_nameName of the input tree relative to the directory

When the reader is created with an existing ROOT directory, the user is responsible for ensuring the underlying file is closed.

Definition at line 266 of file dfe_io_root.hpp.

View newest version in sPHENIX GitHub at line 266 of file dfe_io_root.hpp

References dfe::NamedTupleRootReader< NamedTuple >::m_tree, dfe::NamedTupleRootReader< NamedTuple >::setup_branches(), and value.

+ Here is the call graph for this function:

template<typename NamedTuple >
dfe::NamedTupleRootReader< NamedTuple >::~NamedTupleRootReader ( )
inline

Write the tree and close the owned file.

Definition at line 326 of file dfe_io_root.hpp.

View newest version in sPHENIX GitHub at line 326 of file dfe_io_root.hpp

Member Function Documentation

template<typename NamedTuple >
NamedTupleRootReader& dfe::NamedTupleRootReader< NamedTuple >::operator= ( const NamedTupleRootReader< NamedTuple > &  )
delete
template<typename NamedTuple >
NamedTupleRootReader& dfe::NamedTupleRootReader< NamedTuple >::operator= ( NamedTupleRootReader< NamedTuple > &&  )
delete
template<typename NamedTuple >
bool dfe::NamedTupleRootReader< NamedTuple >::read ( NamedTuple &  record)
inline

Read the next record from the file.

Returns
true if a record was successfully read
false if no more records are available

Definition at line 336 of file dfe_io_root.hpp.

View newest version in sPHENIX GitHub at line 336 of file dfe_io_root.hpp

References m_data.

template<typename NamedTuple >
template<std::size_t... I>
void dfe::NamedTupleRootReader< NamedTuple >::setup_branches ( std::index_sequence< I...>  )
inlineprivate

Definition at line 312 of file dfe_io_root.hpp.

View newest version in sPHENIX GitHub at line 312 of file dfe_io_root.hpp

References nlohmann::detail::get(), dfe::io_root_impl::get_address(), I, m_data, eicpy.verify::names, value, and nlohmann::detail::void().

Referenced by dfe::NamedTupleRootReader< NamedTuple >::NamedTupleRootReader().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

template<typename NamedTuple >
Tuple dfe::NamedTupleRootReader< NamedTuple >::m_data
private

Definition at line 120 of file dfe_io_root.hpp.

View newest version in sPHENIX GitHub at line 120 of file dfe_io_root.hpp

template<typename NamedTuple >
TFile* dfe::NamedTupleRootReader< NamedTuple >::m_file
private

Definition at line 117 of file dfe_io_root.hpp.

View newest version in sPHENIX GitHub at line 117 of file dfe_io_root.hpp

Referenced by dfe::NamedTupleRootReader< NamedTuple >::NamedTupleRootReader().

template<typename NamedTuple >
int64_t dfe::NamedTupleRootReader< NamedTuple >::m_next
private

Definition at line 119 of file dfe_io_root.hpp.

View newest version in sPHENIX GitHub at line 119 of file dfe_io_root.hpp

template<typename NamedTuple >
TTree* dfe::NamedTupleRootReader< NamedTuple >::m_tree
private

Definition at line 118 of file dfe_io_root.hpp.

View newest version in sPHENIX GitHub at line 118 of file dfe_io_root.hpp

Referenced by dfe::NamedTupleRootReader< NamedTuple >::NamedTupleRootReader().


The documentation for this class was generated from the following file: