|
static const std::string & | s_class () |
|
static const std::string & | s_class () |
|
Definition at line 28 of file ntuple.
◆ ntuple() [1/2]
tools::rroot::ntuple::ntuple |
( |
tree & |
a_tree | ) |
|
|
inline |
◆ ~ntuple()
virtual tools::rroot::ntuple::~ntuple |
( |
| ) |
|
|
inlinevirtual |
Definition at line 493 of file ntuple.
494 safe_clear<read::icol>(
m_cols);
496 mem::decrement(
s_class().c_str());
◆ ntuple() [2/2]
tools::rroot::ntuple::ntuple |
( |
const ntuple & |
a_from | ) |
|
|
inlineprotected |
Definition at line 500 of file ntuple.
501 :parent(a_from),
m_tree(a_from.m_tree){
503 mem::increment(
s_class().c_str());
◆ columns()
virtual const std::vector<read::icol*>& tools::rroot::ntuple::columns |
( |
| ) |
const |
|
inlinevirtual |
◆ find_icol()
virtual read::icol* tools::rroot::ntuple::find_icol |
( |
const std::string & |
a_name | ) |
|
|
inlinevirtual |
◆ get_row()
bool tools::rroot::ntuple::get_row |
( |
| ) |
const |
|
inline |
Definition at line 720 of file ntuple.
723 if(!(*it)->fetch_entry()) {
724 m_tree.
out() <<
"tools::rroot::ntuple::get_row : fetch_entry() failed for leaf " << (*it)->name() << std::endl;
◆ initialize()
bool tools::rroot::ntuple::initialize |
( |
std::ostream & |
a_out, |
|
|
const ntuple_binding & |
a_bd = ntuple_binding() , |
|
|
bool |
a_enforce_double = false |
|
) |
| |
|
inline |
Definition at line 508 of file ntuple.
509 safe_clear<read::icol>(
m_cols);
511 std::vector<base_leaf*> leaves;
514 base_leaf* bl = (*it);
515 if(find_named<read::icol>(
m_cols,bl->name())) {
516 a_out <<
"tools::rroot::ntuple::initialize :"
517 <<
" column with name " << sout(bl->name())
518 <<
" already exists."
520 safe_clear<read::icol>(
m_cols);
525 a_out <<
"tools::rroot::ntuple::initialize :"
526 <<
" can't find branch of leaf " << sout(bl->name()) <<
"."
528 safe_clear<read::icol>(
m_cols);
537 #define TOOLS_RROOT_NTUPLE_CREATE_COL(a__type) \
538 if(leaf<a__type>* lf_##a__type = safe_cast<base_leaf, leaf<a__type> >(*bl) ){\
539 cid user_cid;void* user_obj;\
540 a_bd.find_user_obj(bl->name(),user_cid,user_obj);\
541 typedef leaf<a__type> leaf_t;\
543 if(a_enforce_double) {\
544 column<double,leaf_t>* col = new column<double,leaf_t>(m_tree.file(),*_branch,*lf_##a__type,m_index);\
545 m_cols.push_back(col);\
547 column<a__type,leaf_t>* col = new column<a__type,leaf_t>(m_tree.file(),*_branch,*lf_##a__type,m_index);\
548 m_cols.push_back(col);\
551 const base_leaf* lfc = bl->leaf_count();\
554 if(user_cid!=_cid_std_vector<a__type>()) {\
555 a_out << "tools::rroot::ntuple::initialize :"\
556 << " for leaf with name " << sout(bl->name())\
557 << ", user variable type is not a std::vector of " << #a__type << "."\
559 safe_clear<read::icol>(m_cols);\
562 std::vector<a__type>* user_var = (std::vector<a__type>*)user_obj;\
563 std_vector_column_ref<a__type>* col = new std_vector_column_ref<a__type>\
564 (m_tree.file(),*_branch,*lf_##a__type,m_index,*user_var);\
565 m_cols.push_back(col);\
568 if(user_cid!=_cid(a__type())) {\
569 a_out << "tools::rroot::ntuple::initialize :"\
570 << " for leaf with name " << sout(bl->name())\
571 << ", user variable type is not a " << #a__type << "."\
573 safe_clear<read::icol>(m_cols);\
576 a__type* user_var = (a__type*)user_obj;\
577 column_ref<a__type,leaf_t>* col =\
578 new column_ref<a__type,leaf_t>(m_tree.file(),*_branch,*lf_##a__type,m_index,*user_var);\
579 m_cols.push_back(col);\
592 else if(leaf_string* ls = safe_cast<base_leaf, leaf_string >(*bl) ){
594 cid user_cid;
void* user_obj;
595 if(!a_bd.find_user_obj(bl->name(),user_cid,user_obj)) {
598 }
else if(user_cid==_cid_std_vector<std::string>()) {
599 std::vector<std::string>* user_var = (std::vector<std::string>*)user_obj;
601 column_vector_string_ref* col =
new column_vector_string_ref(
m_tree.
file(),*_branch,*ls,
m_index,*user_var,
sep);
607 }
else if(user_cid==
_cid(std::string())) {
608 std::string* user_var = (std::string*)user_obj;
610 column_string_ref* col =
new column_string_ref(
m_tree.
file(),*_branch,*ls,
m_index,*user_var);
617 a_out <<
"tools::rroot::ntuple::initialize :"
618 <<
" for leaf with name " << sout(ls->name())
619 <<
", user variable type is not a std::string or a std::vector<std::string>."
620 <<
". It's class id is " << user_cid <<
"."
622 safe_clear<read::icol>(
m_cols);
626 }
else if(leaf_element* le = safe_cast<base_leaf,leaf_element>(*bl) ){
628 branch_element* be = safe_cast<branch,branch_element>(*_branch);
630 a_out <<
"tools::rroot::ntuple::initialize : branch is not a branch_element." << std::endl;
631 safe_clear<read::icol>(
m_cols);
635 #define TOOLS_RROOT_NTUPLE_CREATE_VEC_COL(a__name,a__type) \
636 if(be->class_name()==a__name) {\
638 typedef a__type el_t;\
639 std::vector<el_t>* user_var = a_bd.find_vector_variable<el_t>(bl->name());\
641 typedef column_element_ref< stl_vector<el_t> , std::vector<el_t> > ce_t;\
642 ce_t* col = new ce_t(m_tree.file(),*be,*le,m_index,*user_var);\
643 m_cols.push_back(col);\
645 typedef column_element< stl_vector<el_t> , std::vector<el_t> > ce_t;\
646 ce_t* col = new ce_t(m_tree.file(),*be,*le,m_index);\
647 m_cols.push_back(col);\
673 a_out <<
"tools::rroot::ntuple::initialize :"
674 <<
" WARNING : leaf element"
675 <<
" with name " << sout(bl->name())
676 <<
",title " << sout(bl->title())
677 <<
" br_elem class name " << be->class_name() <<
"."
678 <<
" entries " << be->entry_number() <<
"."
683 a_out <<
"tools::rroot::ntuple::initialize :"
684 <<
" WARNING : column type not yet handled for leaf"
685 <<
" with name " << sout(bl->name())
686 <<
" and title " << sout(bl->title()) <<
"."
687 <<
" s_cls() is " << sout(bl->s_cls()) <<
"."
694 #undef TOOLS_RROOT_NTUPLE_CREATE_VEC_COL
695 #undef TOOLS_RROOT_NTUPLE_CREATE_COL
697 size_t num =
m_cols.size();
699 a_out <<
"tools::rroot::ntuple::initialize :"
706 if(!find_named<read::icol>(
m_cols,(*it).name())) {
707 a_out <<
"tools::rroot::ntuple::initialize :"
708 <<
" warning : for column binding with name " << sout((*it).name()) <<
", no ntuple column found."
◆ next()
virtual bool tools::rroot::ntuple::next |
( |
| ) |
|
|
inlinevirtual |
◆ number_of_entries()
virtual bool tools::rroot::ntuple::number_of_entries |
( |
uint64 & |
a_value | ) |
const |
|
inlinevirtual |
◆ operator=()
◆ s_class()
static const std::string& tools::rroot::ntuple::s_class |
( |
| ) |
|
|
inlinestatic |
Definition at line 31 of file ntuple.
32 static const std::string s_v(
"tools::rroot::ntuple");
◆ s_cls()
virtual const std::string& tools::rroot::ntuple::s_cls |
( |
| ) |
const |
|
inlinevirtual |
◆ start()
virtual void tools::rroot::ntuple::start |
( |
| ) |
|
|
inlinevirtual |
◆ title()
virtual const std::string& tools::rroot::ntuple::title |
( |
| ) |
const |
|
inlinevirtual |
◆ m_cols
std::vector<read::icol*> tools::rroot::ntuple::m_cols |
|
protected |
◆ m_index
int64 tools::rroot::ntuple::m_index |
|
protected |
◆ m_tree
tree& tools::rroot::ntuple::m_tree |
|
protected |
The documentation for this class was generated from the following file:
- /Users/barrand/private/dev/softinex/g4tools/g4tools/tools/rroot/ntuple