g4tools  5.4.0
ntuple
Go to the documentation of this file.
1 // Copyright (C) 2010, Guy Barrand. All rights reserved.
2 // See the file tools.license for terms.
3 
4 #ifndef tools_wroot_ntuple
5 #define tools_wroot_ntuple
6 
7 // An ntuple class to write at the CERN-ROOT format.
8 // It inherits wroot::tree and each column is mapped
9 // on a (wroot::branch,wroot::leaf). Each add_row() does a tree::fill().
10 
11 #include "tree"
12 #include "icol"
13 
14 #include "../vfind"
15 #include "../vmanip"
16 #include "../ntuple_booking"
17 #include "../sout"
18 #include "../scast"
19 #include "../forit"
20 
21 // for mpi :
22 #include "mpi_create_basket"
23 
24 #ifdef TOOLS_MEM
25 #include "../mem"
26 #endif
27 
28 namespace tools {
29 namespace wroot {
30 
31 class ntuple : public tree {
32 public:
33 //typedef wroot::icol icol; //for backward compatibility.
34 public:
35 
36 #include "columns.icc"
37 
38 public:
39  ntuple(idir& a_dir,const std::string& a_name,const std::string& a_title,bool a_row_wise = false)
40  :tree(a_dir,a_name,a_title),m_row_wise(a_row_wise),m_row_wise_branch(0)
41  {
42  if(m_row_wise) m_row_wise_branch = create_branch("row_wise_branch");
43  }
44 
45  ntuple(idir& a_dir,const ntuple_booking& a_bkg,bool a_row_wise = false)
46  :tree(a_dir,a_bkg.name(),a_bkg.title()),m_row_wise(a_row_wise),m_row_wise_branch(0)
47  {
48  if(m_row_wise) m_row_wise_branch = create_branch("row_wise_branch");
49 
50  const std::vector<column_booking>& cols = a_bkg.columns();
52 
53 #define TOOLS_WROOT_NTUPLE_CREATE_COL(a__type) \
54  if((*it).cls_id()==_cid(a__type())) {\
55  a__type* user = (a__type*)(*it).user_obj();\
56  if(user) {\
57  if(!create_column_ref<a__type>((*it).name(),*user)) {\
58  m_out << "tools::wroot::ntuple : create_column_ref(" << (*it).name() << ") failed." << std::endl;\
59  safe_clear<icol>(m_cols);\
60  safe_clear<branch>(m_branches);\
61  return;\
62  }\
63  } else {\
64  if(!create_column<a__type>((*it).name())) {\
65  m_out << "tools::wroot::ntuple : create_column(" << (*it).name() << ") failed." << std::endl;\
66  safe_clear<icol>(m_cols);\
67  safe_clear<branch>(m_branches);\
68  return;\
69  }\
70  }\
71  }
72 
73 #define TOOLS_WROOT_NTUPLE_CREATE_VEC_COL(a__type) \
74  if((*it).cls_id()==_cid_std_vector<a__type>()) {\
75  std::vector<a__type>* vec = (std::vector<a__type>*)(*it).user_obj();\
76  if(vec) {\
77  if(!create_column_vector_ref<a__type>((*it).name(),*vec)) {\
78  m_out << "tools::wroot::ntuple : create_column_vector_ref(" << (*it).name() << ") failed." << std::endl;\
79  safe_clear<icol>(m_cols);\
80  safe_clear<branch>(m_branches);\
81  return;\
82  }\
83  } else {\
84  if(!create_column_vector<a__type>((*it).name())) {\
85  m_out << "tools::wroot::ntuple : create_column_vector(" << (*it).name() << ") failed." << std::endl;\
86  safe_clear<icol>(m_cols);\
87  safe_clear<branch>(m_branches);\
88  return;\
89  }\
90  }\
91  }
92 
93  //below types are in sync with rroot/ntuple.
94 
100 
101  else if((*it).cls_id()==_cid(std::string())) {
102  std::string* user = (std::string*)(*it).user_obj();
103  if(user) {
104  if(!create_column_string_ref((*it).name(),*user)) {
105  m_out << "tools::wroot::ntuple : create_column_string_ref(" << (*it).name() << ") failed." << std::endl;
106  safe_clear<icol>(m_cols);
107  safe_clear<branch>(m_branches);
108  return;
109  }
110  } else {
111  if(!create_column_string((*it).name())) {
112  m_out << "tools::wroot::ntuple : create_column_string(" << (*it).name() << ") failed." << std::endl;
113  safe_clear<icol>(m_cols);
114  safe_clear<branch>(m_branches);
115  return;
116  }
117  }
118  }
119 
125 
126  else if((*it).cls_id()==_cid_std_vector<std::string>()) {\
127  std::vector<std::string>* user = (std::vector<std::string>*)(*it).user_obj();
128  char sep = '\n';
129  if(user) {
130  if(!create_column_vector_string_ref((*it).name(),*user,sep)) {
131  m_out << "tools::wroot::ntuple : create_column_vector_string_ref(" << (*it).name() << ") failed." << std::endl;
132  safe_clear<icol>(m_cols);
133  safe_clear<branch>(m_branches);
134  return;
135  }
136  } else {
137  if(!create_column_vector_string((*it).name(),std::vector<std::string>(),sep)) {
138  m_out << "tools::wroot::ntuple : create_column_vector_string(" << (*it).name() << ") failed." << std::endl;
139  safe_clear<icol>(m_cols);
140  safe_clear<branch>(m_branches);
141  return;
142  }
143  }
144  }
145 
146  // no leaf_store_class() defined for the other types.
147 
148  else {
149  m_out << "tools::wroot::ntuple :"
150  << " for column " << sout((*it).name())
151  << ", type with cid " << (*it).cls_id() << " not yet handled."
152  << std::endl;
153  //throw
154  safe_clear<icol>(m_cols);
155  safe_clear<branch>(m_branches);
156  return;
157  }
158  }
159 #undef TOOLS_WROOT_NTUPLE_CREATE_VEC_COL
160 #undef TOOLS_WROOT_NTUPLE_CREATE_COL
161 
162  }
163 
164  virtual ~ntuple() {
165  safe_clear<icol>(m_cols);
166  }
167 protected:
168  ntuple(const ntuple& a_from):iobject(a_from),itree(a_from),tree(a_from),m_row_wise(a_from.m_row_wise){}
169  ntuple& operator=(const ntuple&){return *this;}
170 public:
171  const std::vector<icol*>& columns() const {return m_cols;}
172  std::vector<icol*>& columns() {return m_cols;}
173 
174  template <class T>
175  column_ref<T>* create_column_ref(const std::string& a_name,const T& a_ref) {
176  if(find_named<icol>(m_cols,a_name)) return 0;
178  if(!_branch) return 0;
179  column_ref<T>* col = new column_ref<T>(*_branch,a_name,a_ref);
180  if(!col) return 0;
181  m_cols.push_back(col);
182  return col;
183  }
184 
185  template <class T>
186  column<T>* create_column(const std::string& a_name,const T& a_def = T()) {
187  if(find_named<icol>(m_cols,a_name)) return 0;
189  if(!_branch) return 0;
190  column<T>* col = new column<T>(*_branch,a_name,a_def);
191  if(!col) return 0;
192  m_cols.push_back(col);
193  return col;
194  }
195 
196  column_string_ref* create_column_string_ref(const std::string& a_name,const std::string& a_ref) {
197  if(find_named<icol>(m_cols,a_name)) return 0;
199  if(!_branch) return 0;
200  column_string_ref* col = new column_string_ref(*_branch,a_name,a_ref);
201  if(!col) return 0;
202  m_cols.push_back(col);
203  return col;
204  }
205 
206  column_string* create_column_string(const std::string& a_name,const std::string& a_def = std::string()) {
207  if(find_named<icol>(m_cols,a_name)) return 0;
209  if(!_branch) return 0;
210  column_string* col = new column_string(*_branch,a_name,a_def);
211  if(!col) return 0;
212  m_cols.push_back(col);
213  return col;
214  }
215 
216  column_vector_string_ref* create_column_vector_string_ref(const std::string& a_name,
217  const std::vector<std::string>& a_ref,char a_sep) {
218  if(find_named<icol>(m_cols,a_name)) return 0;
220  if(!_branch) return 0;
221  column_vector_string_ref* col = new column_vector_string_ref(*_branch,a_name,a_ref,a_sep);
222  if(!col) return 0;
223  m_cols.push_back(col);
224  return col;
225  }
226 
227  column_vector_string* create_column_vector_string(const std::string& a_name,
228  const std::vector<std::string>& a_def,char a_sep) {
229  if(find_named<icol>(m_cols,a_name)) return 0;
231  if(!_branch) return 0;
232  column_vector_string* col = new column_vector_string(*_branch,a_name,a_def,a_sep);
233  if(!col) return 0;
234  m_cols.push_back(col);
235  return col;
236  }
237 
238  template <class T>
239  std_vector_column_ref<T>* create_column_vector_ref(const std::string& a_name,const std::vector<T>& a_ref) {
240  if(find_named<icol>(m_cols,a_name)) return 0;
241  branch* _branch = m_row_wise?m_row_wise_branch:create_std_vector_be_ref<T>(a_name,a_ref);
242  if(!_branch) return 0;
243  std_vector_column_ref<T>* col = new std_vector_column_ref<T>(*_branch,a_name,a_ref);
244  if(!col) return 0;
245  m_cols.push_back(col);
246  return col;
247  }
248 
249  template <class T>
250  std_vector_column<T>* create_column_vector(const std::string& a_name,const std::vector<T>& a_def = std::vector<T>()) {
251  if(find_named<icol>(m_cols,a_name)) return 0;
252  if(m_row_wise) {
253  branch* _branch = m_row_wise_branch;
254  std_vector_column<T>* col = new std_vector_column<T>(*_branch,a_name,a_def);
255  if(!col) return 0;
256  m_cols.push_back(col);
257  return col;
258  } else {
259  std_vector_be_pointer<T>* _branch = create_std_vector_be_pointer<T>(a_name,0);
260  if(!_branch) return 0;
261  std_vector_column<T>* col = new std_vector_column<T>(*_branch,a_name,a_def);
262  if(!col) return 0;
263  _branch->set_pointer(&(col->variable()));
264  m_cols.push_back(col);
265  return col;
266  }
267  }
268 
269  template <class T>
270  column_ref<T>* find_column_ref(const std::string& a_name) {
271  icol* col = find_named<icol>(m_cols,a_name);
272  if(!col) return 0;
273  return id_cast<icol, column_ref<T> >(*col);
274  }
275 
276  template <class T>
277  column<T>* find_column(const std::string& a_name) {
278  icol* col = find_named<icol>(m_cols,a_name);
279  if(!col) return 0;
280  return id_cast<icol, column<T> >(*col);
281  }
282 
283  column_string_ref* find_column_string_ref(const std::string& a_name) {
284  icol* col = find_named<icol>(m_cols,a_name);
285  if(!col) return 0;
286  return id_cast<icol, column_string_ref >(*col);
287  }
288 
289  column_string* find_column_string(const std::string& a_name) {
290  icol* col = find_named<icol>(m_cols,a_name);
291  if(!col) return 0;
292  return id_cast<icol, column_string >(*col);
293  }
294 
295  template <class T>
296  std_vector_column_ref<T>* find_column_vector_ref(const std::string& a_name) {
297  icol* col = find_named<icol>(m_cols,a_name);
298  if(!col) return 0;
299  return id_cast<icol, std_vector_column_ref<T> >(*col);
300  }
301 
302  template <class T>
303  std_vector_column<T>* find_column_vector(const std::string& a_name) {
304  icol* col = find_named<icol>(m_cols,a_name);
305  if(!col) return 0;
306  return id_cast<icol, std_vector_column<T> >(*col);
307  }
308 
309  column_vector_string_ref* find_column_vector_string_ref(const std::string& a_name) {
310  icol* col = find_named<icol>(m_cols,a_name);
311  if(!col) return 0;
312  return id_cast<icol, column_vector_string_ref >(*col);
313  }
314 
315  column_vector_string* find_column_vector_string(const std::string& a_name) {
316  icol* col = find_named<icol>(m_cols,a_name);
317  if(!col) return 0;
318  return id_cast<icol, column_vector_string >(*col);
319  }
320 
321  void print_columns(std::ostream& a_out) {
322  a_out << "for ntuple named " << sout(m_name) << ", number of columns " << m_cols.size() << " :" << std::endl;
323  tools_vforit(icol*,m_cols,it) {
324  a_out << " " << (*it)->name() << std::endl;
325  }
326  }
327 
328  bool add_row() {
329  if(m_cols.empty()) return false;
330  tools_vforit(icol*,m_cols,it) (*it)->add();
331  uint32 n;
332  bool status = tree::fill(n);
333  tools_vforit(icol*,m_cols,it) (*it)->set_def();
334  return status;
335  }
336 
337  void set_basket_size(uint32 a_size) {
338  if(m_row_wise) {
340  } else {
341  tools_vforit(icol*,m_cols,it) (*it)->set_basket_size(a_size);
342  }
343  }
344 
349  void get_branches(std::vector<branch*>& a_vec) const {
350  a_vec.clear();
351  tools_vforcit(icol*,m_cols,it) a_vec.push_back(&((*it)->get_branch()));
352  }
353 
355  m_entries = 0; //it should be zero!
356  m_tot_bytes = 0;
357  m_zip_bytes = 0;
358  bool status = true;
359  tools_vforit(icol*,m_cols,it) {
360  if(it==m_cols.begin()) {
361  m_entries = (*it)->get_branch().entries();
362  } else if(m_entries!=(*it)->get_branch().entries()) {
363  m_out << "tools::wroot::ntuple::merge_number_of_entries :"
364  << " branches do not have same number of entries."
365  << std::endl;
366  status = false;
367  }
368  m_tot_bytes += (*it)->get_branch().tot_bytes();
369  m_zip_bytes += (*it)->get_branch().zip_bytes();
370  }
371  return status;
372  }
373 
374  bool mpi_add_basket(impi& a_impi) {
375  uint32 icol; //not used if row_wise.
376  if(!a_impi.unpack(icol)) {
377  m_out << "tools::wroot::ntuple::mpi_add_basket : unpack(icol) failed."<< std::endl;
378  return false;
379  }
380 
381  if(m_row_wise) {
382  if(!m_row_wise_branch) return false;
383 
387  if(!basket) {
388  m_out << "tools::wroot::ntuple::mpi_add_basket : mpi_create_basket() failed."<< std::endl;
389  return false;
390  }
391 
392  uint32 add_bytes,nout;
393  if(!m_row_wise_branch->add_basket(m_dir.file(),*basket,add_bytes,nout)) {
394  m_out << "tools::wroot::ntuple::mpi_add_basket : row wise : branch.add_basket() failed."<< std::endl;
395  delete basket;
396  return false;
397  }
398 
399  delete basket;
402 
403  } else {
404  if(icol>=m_cols.size()) {
405  m_out << "tools::wroot::ntuple::mpi_add_basket : column index " << icol << " >= " << m_cols.size() << std::endl;
406  return false;
407  }
408 
409  branch& _branch = m_cols[icol]->get_branch();
410 
413  _branch.basket_size());
414  if(!basket) {
415  m_out << "tools::wroot::ntuple::mpi_add_basket : mpi_create_basket() failed."<< std::endl;
416  return false;
417  }
418 
419  uint32 add_bytes,nout;
420  if(!_branch.add_basket(m_dir.file(),*basket,add_bytes,nout)) {
421  m_out << "tools::wroot::ntuple::mpi_add_basket : column wise : branch.add_basket() failed."<< std::endl;
422  delete basket;
423  return false;
424  }
425 
426  delete basket;
427  _branch.set_tot_bytes(_branch.tot_bytes()+add_bytes);
428  _branch.set_zip_bytes(_branch.zip_bytes()+nout);
429  }
430  return true;
431  }
432 
433  bool mpi_add_baskets(impi& a_impi) { //column_wise && row_mode only.
434  uint32 _icol = 0;
435  tools_vforcit(icol*,m_cols,it) {
436  uint32 icol;
437  if(!a_impi.unpack(icol)) {
438  m_out << "tools::wroot::ntuple::mpi_add_baskets : unpack(icol) failed."<< std::endl;
439  return false;
440  }
441  if(icol!=_icol) {
442  m_out << "tools::wroot::ntuple::mpi_add_basket : received column index " << icol << ", whilst " << _icol << " expected." << std::endl;
443  return false;
444  }
445  branch& _branch = m_cols[icol]->get_branch();
448  _branch.basket_size());
449  if(!basket) {
450  m_out << "tools::wroot::ntuple::mpi_add_basket : mpi_create_basket() failed."<< std::endl;
451  return false;
452  }
453 
454  uint32 add_bytes,nout;
455  if(!_branch.add_basket(m_dir.file(),*basket,add_bytes,nout)) {
456  m_out << "tools::wroot::ntuple::mpi_add_basket : column wise : branch.add_basket() failed."<< std::endl;
457  delete basket;
458  return false;
459  }
460 
461  delete basket;
462  _branch.set_tot_bytes(_branch.tot_bytes()+add_bytes);
463  _branch.set_zip_bytes(_branch.zip_bytes()+nout);
464 
465  _icol++;
466  }
467  return true;
468  }
469 
470  bool mpi_end_fill(impi& a_impi) {
471 
472 #define TOOLS_WROOT_NTUPLE_SET_LEAF_LENGTH_MAX(a__type) \
473  {leaf_ref<a__type>* _mleaf_ = _mleaf?id_cast<base_leaf, leaf_ref<a__type> >(*_mleaf):0;\
474  if(_mleaf_) {\
475  uint32 _len;\
476  if(!a_impi.unpack(_len)) return false;\
477  a__type _mx;\
478  if(!a_impi.unpack(_mx)) return false;\
479  _mleaf_->set_length(mx(_len,_mleaf_->length()));\
480  _mleaf_->set_max(mx(_mx,_mleaf_->get_max()));\
481  set_done = true;\
482  }}
483 
484 #define TOOLS_WROOT_NTUPLE_SET_LEAF_STD_VECTOR_LENGTH_MAX(a__type) \
485  {leaf_std_vector_ref<a__type>* _mleaf_ = _mleaf?id_cast<base_leaf, leaf_std_vector_ref<a__type> >(*_mleaf):0;\
486  if(_mleaf_) {\
487  uint32 _len;\
488  if(!a_impi.unpack(_len)) return false;\
489  a__type _mx;\
490  if(!a_impi.unpack(_mx)) return false;\
491  _mleaf_->set_length(mx(_len,_mleaf_->length()));\
492  _mleaf_->set_max(mx(_mx,_mleaf_->get_max()));\
493  set_done = true;\
494  }}
495 
496 #define TOOLS_WROOT_NTUPLE_SET_LEAF_STRING_LENGTH_MAX \
497  {leaf_string_ref* _mleaf_ = _mleaf?id_cast<base_leaf,leaf_string_ref>(*_mleaf):0;\
498  if(_mleaf_) {\
499  uint32 _len;\
500  if(!a_impi.unpack(_len)) return false;\
501  int _mx;\
502  if(!a_impi.unpack(_mx)) return false;\
503  _mleaf_->set_length(mx(_len,_mleaf_->length()));\
504  _mleaf_->set_max(mx(_mx,_mleaf_->get_max()));\
505  set_done = true;\
506  }}
507 
508  if(m_row_wise) {
509  if(!m_row_wise_branch) return false;
510 
512  base_leaf* _mleaf = *mit;
513 
514  bool set_done = false;
515 
521 
527 
529 
530  if(!set_done) {
531  m_out << "tools::wroot::ntuple::mpi_end_fill :"
532  << " leaf " << _mleaf->name() << " with cid " << _mleaf->id_cls() << " not treated." << std::endl;
533  return false;
534  }
535  }
536 
537  } else { // column wise :
539  base_leaf* _mleaf = (*it)->get_leaf();
540 
541  bool set_done = false;
543 
544  if(!set_done) {
545  uint32 _len;
546  if(!a_impi.unpack(_len)) return false;
547  int _mx;
548  if(!a_impi.unpack(_mx)) return false;
549  }
550  }
551  }
552 
553 #undef TOOLS_WROOT_NTUPLE_SET_LEAF_LENGTH_MAX
554 #undef TOOLS_WROOT_NTUPLE_SET_LEAF_STD_VECTOR_LENGTH_MAX
555 #undef TOOLS_WROOT_NTUPLE_SET_LEAF_STRING_LENGTH_MAX
556 
557  return true;
558  }
559 
560 protected:
561  std::vector<icol*> m_cols;
563  branch* m_row_wise_branch; //used if row_wise.
564 };
565 
566 }}
567 
568 #endif
tools::wroot::ntuple::create_column_vector
std_vector_column< T > * create_column_vector(const std::string &a_name, const std::vector< T > &a_def=std::vector< T >())
Definition: ntuple:250
tools::wroot::icol
Definition: icol:21
tools::wroot::tree::m_dir
idir & m_dir
Definition: tree:235
TOOLS_WROOT_NTUPLE_SET_LEAF_STRING_LENGTH_MAX
#define TOOLS_WROOT_NTUPLE_SET_LEAF_STRING_LENGTH_MAX
tools::wroot::ntuple::get_branches
void get_branches(std::vector< branch * > &a_vec) const
Definition: ntuple:349
tools::wroot::ntuple
Definition: ntuple:31
tools::_cid
cid _cid(byte)
Definition: cids:14
tools::wroot::ntuple::mpi_add_basket
bool mpi_add_basket(impi &a_impi)
Definition: ntuple:374
tools::wroot::branch::tot_bytes
uint64 tot_bytes() const
Definition: branch:187
tools::wroot::base_leaf::id_cls
virtual cid id_cls() const
Definition: base_leaf:34
tools::wroot::ntuple::find_column
column< T > * find_column(const std::string &a_name)
Definition: ntuple:277
tools::wroot::branch::zip_bytes
uint64 zip_bytes() const
Definition: branch:190
tools::column_booking
Definition: ntuple_booking:17
TOOLS_WROOT_NTUPLE_SET_LEAF_STD_VECTOR_LENGTH_MAX
#define TOOLS_WROOT_NTUPLE_SET_LEAF_STD_VECTOR_LENGTH_MAX(a__type)
tools::wroot::tree::create_branch
branch * create_branch(const std::string &a_name)
Definition: tree:119
tools::wroot::ntuple::find_column_string_ref
column_string_ref * find_column_string_ref(const std::string &a_name)
Definition: ntuple:283
tools::wroot::ntuple::m_row_wise_branch
branch * m_row_wise_branch
Definition: ntuple:563
tools::wroot::iobject
Definition: iobject:17
tools::wroot::ntuple::set_basket_size
void set_basket_size(uint32 a_size)
Definition: ntuple:337
tools::wroot::branch
Definition: branch:16
tools::wroot::idir
Definition: idir:18
mpi_create_basket
tools::wroot::ntuple::get_row_wise_branch
branch * get_row_wise_branch() const
for parallelization : /////////////////////////////////////////////////
Definition: ntuple:348
tools::wroot::ntuple::print_columns
void print_columns(std::ostream &a_out)
Definition: ntuple:321
tools::wroot::branch::leaves
const std::vector< base_leaf * > & leaves() const
Definition: branch:243
tools::wroot::tree::m_tot_bytes
uint64 m_tot_bytes
Definition: tree:243
tools::wroot::idir::file
virtual ifile & file()=0
tools::wroot::ntuple::find_column_vector_string
column_vector_string * find_column_vector_string(const std::string &a_name)
Definition: ntuple:315
tools::wroot::ntuple::find_column_vector
std_vector_column< T > * find_column_vector(const std::string &a_name)
Definition: ntuple:303
tools::wroot::tree::m_out
std::ostream & m_out
Definition: tree:236
tools::wroot::ntuple::create_column_vector_string_ref
column_vector_string_ref * create_column_vector_string_ref(const std::string &a_name, const std::vector< std::string > &a_ref, char a_sep)
Definition: ntuple:216
tools::wroot::ntuple::mpi_add_baskets
bool mpi_add_baskets(impi &a_impi)
Definition: ntuple:433
tools::wroot::ntuple::create_column
column< T > * create_column(const std::string &a_name, const T &a_def=T())
Definition: ntuple:186
tools::wroot::mpi_create_basket
basket * mpi_create_basket(std::ostream &a_out, impi &a_mpi, bool a_byte_swap, seek a_seek_directory, uint32 a_basket_size)
Definition: mpi_create_basket:13
TOOLS_WROOT_NTUPLE_CREATE_VEC_COL
#define TOOLS_WROOT_NTUPLE_CREATE_VEC_COL(a__type)
tools::wroot::ntuple::operator=
ntuple & operator=(const ntuple &)
Definition: ntuple:169
tree
tools::wroot::ntuple::create_column_vector_string
column_vector_string * create_column_vector_string(const std::string &a_name, const std::vector< std::string > &a_def, char a_sep)
Definition: ntuple:227
tools::wroot::ntuple::columns
std::vector< icol * > & columns()
Definition: ntuple:172
tools::wroot::ntuple::~ntuple
virtual ~ntuple()
Definition: ntuple:164
tools::wroot::branch::basket_size
uint32 basket_size() const
Definition: branch:194
tools::wroot::ntuple::m_cols
std::vector< icol * > m_cols
Definition: ntuple:561
tools::sout
Definition: sout:17
tools::wroot::idir::seek_directory
virtual seek seek_directory() const =0
TOOLS_WROOT_NTUPLE_SET_LEAF_LENGTH_MAX
#define TOOLS_WROOT_NTUPLE_SET_LEAF_LENGTH_MAX(a__type)
tools::wroot::ntuple::ntuple
ntuple(idir &a_dir, const std::string &a_name, const std::string &a_title, bool a_row_wise=false)
Definition: ntuple:39
tools::wroot::tree::m_zip_bytes
uint64 m_zip_bytes
Definition: tree:244
tools::wroot::ntuple::create_column_vector_ref
std_vector_column_ref< T > * create_column_vector_ref(const std::string &a_name, const std::vector< T > &a_ref)
Definition: ntuple:239
tools::wroot::base_leaf
Definition: base_leaf:19
TOOLS_WROOT_NTUPLE_CREATE_COL
#define TOOLS_WROOT_NTUPLE_CREATE_COL(a__type)
tools::impi
Definition: impi:14
tools::wroot::std_vector_be_pointer
Definition: branch_element:183
tools::wroot::ntuple::m_row_wise
bool m_row_wise
Definition: ntuple:562
tools::wroot::tree::m_name
std::string m_name
Definition: tree:238
tools_vforit
#define tools_vforit(a__T, a__v, a__it)
Definition: forit:13
tools::wroot::tree::m_entries
uint64 m_entries
Definition: tree:242
tools::wroot::tree
Definition: tree:17
tools::wroot::ntuple::merge_number_of_entries
bool merge_number_of_entries()
Definition: ntuple:354
tools::ntuple_booking::columns
const std::vector< column_booking > & columns() const
Definition: ntuple_booking:93
tools
inlined C code : ///////////////////////////////////
Definition: aida_ntuple:26
tools::wroot::ntuple::ntuple
ntuple(const ntuple &a_from)
Definition: ntuple:168
tools::wroot::ntuple::ntuple
ntuple(idir &a_dir, const ntuple_booking &a_bkg, bool a_row_wise=false)
Definition: ntuple:45
tools::wroot::itree
Definition: itree:17
tools::wroot::ifile::byte_swap
virtual bool byte_swap() const =0
tools::wroot::basket
Definition: basket:14
tools::wroot::branch::set_basket_size
void set_basket_size(uint32 a_size)
Definition: branch:193
tools::wroot::base_leaf::name
const std::string & name() const
Definition: base_leaf:94
tools::wroot::ntuple::find_column_vector_ref
std_vector_column_ref< T > * find_column_vector_ref(const std::string &a_name)
Definition: ntuple:296
tools::wroot::ntuple::find_column_vector_string_ref
column_vector_string_ref * find_column_vector_string_ref(const std::string &a_name)
Definition: ntuple:309
tools::wroot::ntuple::create_column_string_ref
column_string_ref * create_column_string_ref(const std::string &a_name, const std::string &a_ref)
Definition: ntuple:196
tools::wroot::ntuple::create_column_string
column_string * create_column_string(const std::string &a_name, const std::string &a_def=std::string())
Definition: ntuple:206
tools::wroot::branch::add_basket
bool add_basket(ifile &a_file, basket &a_basket, uint32 &a_add_bytes, uint32 &a_nout)
for parallelization : /////////////////////////////////////////////////
Definition: branch:364
tools::wroot::branch::set_zip_bytes
void set_zip_bytes(uint64 a_value)
Definition: branch:191
tools::wroot::std_vector_be_pointer::set_pointer
void set_pointer(std::vector< T > *a_pointer)
Definition: branch_element:237
tools::wroot::tree::name
virtual const std::string & name() const
Definition: tree:25
tools::sep
const std::string & sep()
Definition: sep:11
tools::wroot::ntuple::add_row
bool add_row()
Definition: ntuple:328
columns.icc
tools::wroot::tree::title
virtual const std::string & title() const
Definition: tree:26
tools::wroot::tree::fill
bool fill(uint32 &a_nbytes)
Definition: tree:198
tools::wroot::ntuple::columns
const std::vector< icol * > & columns() const
Definition: ntuple:171
tools_vforcit
#define tools_vforcit(a__T, a__v, a__it)
Definition: forit:7
tools::wroot::ntuple::find_column_ref
column_ref< T > * find_column_ref(const std::string &a_name)
Definition: ntuple:270
tools::wroot::branch::set_tot_bytes
void set_tot_bytes(uint64 a_value)
Definition: branch:188
tools::wroot::ntuple::create_column_ref
column_ref< T > * create_column_ref(const std::string &a_name, const T &a_ref)
Definition: ntuple:175
tools::impi::unpack
virtual bool unpack(char &)=0
tools::uint32
unsigned int uint32
Definition: typedefs:71
tools::ntuple_booking
Definition: ntuple_booking:49
tools::wroot::ntuple::find_column_string
column_string * find_column_string(const std::string &a_name)
Definition: ntuple:289
icol
tools::wroot::ntuple::mpi_end_fill
bool mpi_end_fill(impi &a_impi)
Definition: ntuple:470
tools::wroot::tree::m_branches
obj_array< branch > m_branches
Definition: tree:241