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

Write records into a ROOT TTree. More...

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

Public Member Functions

 NamedTupleRootWriter ()=delete
 
 NamedTupleRootWriter (const NamedTupleRootWriter &)=delete
 
 NamedTupleRootWriter (NamedTupleRootWriter &&)=delete
 
NamedTupleRootWriteroperator= (const NamedTupleRootWriter &)=delete
 
NamedTupleRootWriteroperator= (NamedTupleRootWriter &&)=delete
 
 NamedTupleRootWriter (const std::string &path, const std::string &tree_name)
 
 NamedTupleRootWriter (TDirectory *dir, const std::string &tree_name)
 
 ~NamedTupleRootWriter ()
 Write the tree and close the owned file.
 
void append (const NamedTuple &record)
 Append a record to the file.
 

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
 
Tuple m_data
 

Detailed Description

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

Write records into a ROOT TTree.

Definition at line 42 of file dfe_io_root.hpp.

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

Member Typedef Documentation

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

Definition at line 71 of file dfe_io_root.hpp.

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

Constructor & Destructor Documentation

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

Create a file at the given path. Overwrites existing data.

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

Definition at line 129 of file dfe_io_root.hpp.

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

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

+ Here is the call graph for this function:

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

Create a tree in a ROOT directory. Overwrites existing data.

Parameters
dirOutput directory for the tree
tree_nameName of the output tree relative to the directory

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

Definition at line 146 of file dfe_io_root.hpp.

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

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

+ Here is the call graph for this function:

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

Write the tree and close the owned file.

Definition at line 225 of file dfe_io_root.hpp.

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

Member Function Documentation

template<typename NamedTuple >
void dfe::NamedTupleRootWriter< NamedTuple >::append ( const NamedTuple &  record)
inline

Append a record to the file.

Definition at line 239 of file dfe_io_root.hpp.

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

References m_data.

template<typename NamedTuple >
NamedTupleRootWriter& dfe::NamedTupleRootWriter< NamedTuple >::operator= ( const NamedTupleRootWriter< NamedTuple > &  )
delete
template<typename NamedTuple >
NamedTupleRootWriter& dfe::NamedTupleRootWriter< NamedTuple >::operator= ( NamedTupleRootWriter< NamedTuple > &&  )
delete
template<typename NamedTuple >
template<std::size_t... I>
void dfe::NamedTupleRootWriter< NamedTuple >::setup_branches ( std::index_sequence< I...>  )
inlineprivate

Definition at line 205 of file dfe_io_root.hpp.

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

References I, m_data, and void().

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

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

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

Definition at line 75 of file dfe_io_root.hpp.

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

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

Definition at line 73 of file dfe_io_root.hpp.

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

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

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

Definition at line 74 of file dfe_io_root.hpp.

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

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


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