g4tools  5.4.0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tools::wroot::mt_ntuple_row_wise Class Reference
Inheritance diagram for tools::wroot::mt_ntuple_row_wise:
Inheritance graph
[legend]
Collaboration diagram for tools::wroot::mt_ntuple_row_wise:
Collaboration graph
[legend]

Public Member Functions

virtual bool add_row (imutex &a_mutex, ifile &a_main_file)
 
virtual bool end_fill (imutex &a_mutex, ifile &a_main_file)
 
 mt_ntuple_row_wise (std::ostream &a_out, bool a_byte_swap, uint32 a_compression, seek a_seek_directory, branch &a_main_branch, const std::string &a_name, const std::string &a_title, uint32 a_basket_size, bool a_verbose)
 
 mt_ntuple_row_wise (std::ostream &a_out, bool a_byte_swap, uint32 a_compression, seek a_seek_directory, branch &a_main_branch, uint32 a_basket_size, const ntuple_booking &a_bkg, bool a_verbose)
 
virtual ~mt_ntuple_row_wise ()
 
- Public Member Functions inherited from tools::wroot::base_pntuple_row_wise
 base_pntuple_row_wise (std::ostream &a_out, bool a_byte_swap, uint32 a_compression, seek a_seek_directory, const std::string &a_name, const std::string &a_title, uint32 a_basket_size, bool a_verbose)
 
 base_pntuple_row_wise (std::ostream &a_out, bool a_byte_swap, uint32 a_compression, seek a_seek_directory, uint32 a_basket_size, const ntuple_booking &a_bkg, bool a_verbose)
 
virtual ~base_pntuple_row_wise ()
 
template<class T >
column_ref< T > * create_column_ref (const std::string &a_name, const T &a_ref)
 
template<class T >
column< T > * create_column (const std::string &a_name, const T &a_def=T())
 
column_string_ref * create_column_string_ref (const std::string &a_name, const std::string &a_ref)
 
column_string * create_column_string (const std::string &a_name, const std::string &a_def=std::string())
 
column_vector_string_ref * create_column_vector_string_ref (const std::string &a_name, const std::vector< std::string > &a_ref, char a_sep)
 
column_vector_string * create_column_vector_string (const std::string &a_name, const std::vector< std::string > &a_def, char a_sep)
 
template<class T >
std_vector_column_ref< T > * create_column_vector_ref (const std::string &a_name, const std::vector< T > &a_ref)
 
template<class T >
std_vector_column< T > * create_column_vector (const std::string &a_name, const std::vector< T > &a_def=std::vector< T >())
 
- Public Member Functions inherited from tools::wroot::base_pntuple
 base_pntuple (std::ostream &a_out, seek a_seek_directory, const std::string &a_name, const std::string &a_title)
 
virtual ~base_pntuple ()
 
const std::vector< icol * > & columns () const
 
template<class T >
column_ref< T > * find_column_ref (const std::string &a_name)
 
template<class T >
column< T > * find_column (const std::string &a_name)
 
column_string_ref * find_column_string_ref (const std::string &a_name)
 
column_string * find_column_string (const std::string &a_name)
 
template<class T >
std_vector_column_ref< T > * find_column_vector_ref (const std::string &a_name)
 
template<class T >
std_vector_column< T > * find_column_vector (const std::string &a_name)
 
column_vector_string_ref * find_column_vector_string_ref (const std::string &a_name)
 
column_vector_string * find_column_vector_string (const std::string &a_name)
 
void print_columns (std::ostream &a_out)
 
- Public Member Functions inherited from tools::wroot::imt_ntuple
virtual ~imt_ntuple ()
 

Protected Member Functions

 mt_ntuple_row_wise (const mt_ntuple_row_wise &a_from)
 
mt_ntuple_row_wiseoperator= (const mt_ntuple_row_wise &a_from)
 
bool end_leaves (imutex &a_mutex) const
 
- Protected Member Functions inherited from tools::wroot::base_pntuple_row_wise
 base_pntuple_row_wise (const base_pntuple_row_wise &a_from)
 
base_pntuple_row_wiseoperator= (const base_pntuple_row_wise &)
 
- Protected Member Functions inherited from tools::wroot::base_pntuple
 base_pntuple (const base_pntuple &a_from)
 
base_pntupleoperator= (const base_pntuple &)
 

Protected Attributes

branchm_main_branch
 
- Protected Attributes inherited from tools::wroot::base_pntuple_row_wise
branch m_row_wise_branch
 
- Protected Attributes inherited from tools::wroot::base_pntuple
std::ostream & m_out
 
seek m_seek_directory
 
std::string m_name
 
std::string m_title
 
std::vector< icol * > m_cols
 

Detailed Description

Definition at line 16 of file mt_ntuple_row_wise.

Constructor & Destructor Documentation

◆ mt_ntuple_row_wise() [1/3]

tools::wroot::mt_ntuple_row_wise::mt_ntuple_row_wise ( std::ostream &  a_out,
bool  a_byte_swap,
uint32  a_compression,
seek  a_seek_directory,
branch a_main_branch,
const std::string &  a_name,
const std::string &  a_title,
uint32  a_basket_size,
bool  a_verbose 
)
inline

Definition at line 33 of file mt_ntuple_row_wise.

38  :parent(a_out,a_byte_swap,a_compression,a_seek_directory,a_name,a_title,a_basket_size,a_verbose)
39  ,m_main_branch(a_main_branch)
40  {}

◆ mt_ntuple_row_wise() [2/3]

tools::wroot::mt_ntuple_row_wise::mt_ntuple_row_wise ( std::ostream &  a_out,
bool  a_byte_swap,
uint32  a_compression,
seek  a_seek_directory,
branch a_main_branch,
uint32  a_basket_size,
const ntuple_booking a_bkg,
bool  a_verbose 
)
inline

Definition at line 42 of file mt_ntuple_row_wise.

46  :parent(a_out,a_byte_swap,a_compression,a_seek_directory,a_basket_size,a_bkg,a_verbose)
47  ,m_main_branch(a_main_branch)
48  {}

◆ ~mt_ntuple_row_wise()

virtual tools::wroot::mt_ntuple_row_wise::~mt_ntuple_row_wise ( )
inlinevirtual

Definition at line 50 of file mt_ntuple_row_wise.

50 {}

◆ mt_ntuple_row_wise() [3/3]

tools::wroot::mt_ntuple_row_wise::mt_ntuple_row_wise ( const mt_ntuple_row_wise a_from)
inlineprotected

Definition at line 52 of file mt_ntuple_row_wise.

53  :imt_ntuple(a_from)
54  ,parent(a_from)
55  ,m_main_branch(a_from.m_main_branch)
56  {}

Member Function Documentation

◆ add_row()

virtual bool tools::wroot::mt_ntuple_row_wise::add_row ( imutex a_mutex,
ifile a_main_file 
)
inlinevirtual

Implements tools::wroot::imt_ntuple.

Definition at line 19 of file mt_ntuple_row_wise.

19  {
20  if(m_cols.empty()) return false;
21  tools_vforit(icol*,m_cols,it) (*it)->add();
22  mt_basket_add _badd(a_mutex,a_main_file,m_main_branch);
23  if(!m_row_wise_branch.pfill(_badd,0)) return false;
24  tools_vforit(icol*,m_cols,it) (*it)->set_def();
25  return true;
26  }

◆ end_fill()

virtual bool tools::wroot::mt_ntuple_row_wise::end_fill ( imutex a_mutex,
ifile a_main_file 
)
inlinevirtual

Implements tools::wroot::imt_ntuple.

Definition at line 27 of file mt_ntuple_row_wise.

27  {
28  mt_basket_add _badd(a_mutex,a_main_file,m_main_branch);
29  if(!m_row_wise_branch.end_pfill(_badd)) return false;
30  return end_leaves(a_mutex);
31  }

◆ end_leaves()

bool tools::wroot::mt_ntuple_row_wise::end_leaves ( imutex a_mutex) const
inlineprotected

Definition at line 59 of file mt_ntuple_row_wise.

59  {
60  if(m_main_branch.leaves().size()!=m_row_wise_branch.leaves().size()) {
61  m_out << "tools::wroot::mt_ntuple_row_wise::end_leaves :"
62  << " m_main_branch.leaves().size() (" << m_main_branch.leaves().size() << ") != "
63  << "m_row_wise_branch.leaves().size() (" << m_row_wise_branch.leaves().size() << ")."
64  << std::endl;
65  return false;
66  }
67 
68 #include "MT_SET_MAX.icc"
69 
70  std::vector<base_leaf*>::iterator pit = const_cast< std::vector<base_leaf*>& >(m_row_wise_branch.leaves()).begin();
71  tools_vforcit(base_leaf*,m_main_branch.leaves(),mit) {
72  base_leaf* _mleaf = *mit;
73  base_leaf* _pleaf = *pit; pit++; //WARNING.
74 
75  TOOLS_WROOT_MT_NTUPLE_SET_MAX(char)
76  TOOLS_WROOT_MT_NTUPLE_SET_MAX(short)
77  TOOLS_WROOT_MT_NTUPLE_SET_MAX(int)
78  TOOLS_WROOT_MT_NTUPLE_SET_MAX(float)
79  TOOLS_WROOT_MT_NTUPLE_SET_MAX(double)
80 
81  TOOLS_WROOT_MT_NTUPLE_STRING_SET_MAX
82 
83  }
84 #undef TOOLS_WROOT_MT_NTUPLE_SET_MAX
85 #undef TOOLS_WROOT_MT_NTUPLE_STRING_SET_MAX
86 
87  return true;
88  }

◆ operator=()

mt_ntuple_row_wise& tools::wroot::mt_ntuple_row_wise::operator= ( const mt_ntuple_row_wise a_from)
inlineprotected

Definition at line 57 of file mt_ntuple_row_wise.

57 {parent::operator=(a_from);return *this;}

Member Data Documentation

◆ m_main_branch

branch& tools::wroot::mt_ntuple_row_wise::m_main_branch
protected

Definition at line 90 of file mt_ntuple_row_wise.


The documentation for this class was generated from the following file:
tools::wroot::mt_ntuple_row_wise::end_leaves
bool end_leaves(imutex &a_mutex) const
Definition: mt_ntuple_row_wise:59
tools::wroot::base_pntuple_row_wise::operator=
base_pntuple_row_wise & operator=(const base_pntuple_row_wise &)
Definition: base_pntuple_row_wise:156
tools::wroot::base_pntuple::m_out
std::ostream & m_out
Definition: base_pntuple:122
tools::wroot::branch::pfill
bool pfill(iadd_basket &a_badd, uint32 a_nev)
Definition: branch:416
tools::wroot::branch::leaves
const std::vector< base_leaf * > & leaves() const
Definition: branch:243
tools::waxml::begin
void begin(std::ostream &a_writer)
Definition: begend:15
tools::wroot::branch::end_pfill
bool end_pfill(iadd_basket &a_badd)
Definition: branch:478
MT_SET_MAX.icc
tools_vforit
#define tools_vforit(a__T, a__v, a__it)
Definition: forit:13
tools::wroot::base_pntuple_row_wise::m_row_wise_branch
branch m_row_wise_branch
Definition: base_pntuple_row_wise:228
tools::wroot::mt_ntuple_row_wise::m_main_branch
branch & m_main_branch
Definition: mt_ntuple_row_wise:90
tools::wroot::base_pntuple::m_cols
std::vector< icol * > m_cols
Definition: base_pntuple:126
tools_vforcit
#define tools_vforcit(a__T, a__v, a__it)
Definition: forit:7