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_waxml_ntuple
5 #define tools_waxml_ntuple
6 
7 // A ntuple class to write at the aida tuple format.
8 // Each add_row() write a row at the aida tuple format.
9 
10 #include "../vfind"
11 #include "../vmanip"
12 #include "../sout"
13 #include "../srep"
14 #include "../tos"
15 #include "../forit"
16 
17 #include <ostream>
18 
19 // for sub_ntuple :
20 #include "../scast"
21 #include <sstream>
22 
23 #include "../ntuple_booking"
24 
25 namespace tools {
26 namespace waxml {
27 
28 class ntuple {
29 protected:
30 
31  class iobj {
32  public:
33  virtual ~iobj(){}
34  public:
35  virtual void* cast(cid) const = 0;
36  virtual cid id_cls() const = 0;
37  public:
38  virtual const std::string& name() const = 0;
39  virtual const std::string& aida_type() const = 0;
40  };
41 
42  class leaf : public virtual iobj {
43  public:
44  static cid id_class() {return 100;}
45  public: //iobj
46  virtual void* cast(cid a_class) const {
47  if(void* p = cmp_cast<leaf>(this,a_class)) {return p;}
48  return 0;
49  }
50  virtual cid id_cls() const {return id_class();}
51  public:
52  virtual const std::string& s_def() const = 0;
53  virtual void s_value(std::string&) const = 0;
54  public:
55  leaf(){}
56  virtual ~leaf(){}
57  leaf(const leaf& a_from):iobj(a_from){}
58  leaf& operator=(const leaf&){return *this;}
59  };
60 
61  static const std::string& s_aida_type(int) {
62  static const std::string s_v("int");
63  return s_v;
64  }
65  static const std::string& s_aida_type(float) {
66  static const std::string s_v("float");
67  return s_v;
68  }
69  static const std::string& s_aida_type(double) {
70  static const std::string s_v("double");
71  return s_v;
72  }
73  static const std::string& s_aida_type(const std::string&) {
74  static const std::string s_v("string");
75  return s_v;
76  }
77 
78  static const std::string& s_aida_type_ituple() {
79  static const std::string s_v("ITuple");
80  return s_v;
81  }
82 
83 public:
84  template <class T>
85  class column : public leaf {
86  public:
87  static cid id_class() {return 200+_cid(T());}
88  public: //iobj
89  virtual void* cast(cid a_class) const {
90  if(void* p = cmp_cast< column<T> >(this,a_class)) {return p;}
91  return leaf::cast(a_class);
92  }
93  virtual cid id_cls() const {return id_class();}
94  public:
95  virtual const std::string& name() const {return m_name;}
96  virtual const std::string& aida_type() const {return s_aida_type(T());}
97  public: //leaf
98  virtual const std::string& s_def() const {return m_def;}
99  virtual void s_value(std::string& a_s) const {a_s = tos(m_tmp);}
100  public:
101  column(const std::string& a_name,const T& a_def)
102  :m_name(a_name),m_def(tos(a_def)),m_tmp(a_def)
103  {}
104  virtual ~column(){}
105  protected:
106  column(const column& a_from)
107  :leaf(a_from)
108  ,m_name(a_from.m_name)
109  ,m_def(a_from.m_def)
110  ,m_tmp(a_from.m_tmp)
111  {}
112  column& operator=(const column& a_from){
113  m_name = a_from.m_name;
114  m_def = a_from.m_def;
115  m_tmp = a_from.m_tmp;
116  return *this;
117  }
118  public:
119  bool fill(const T& a_value) {m_tmp = a_value;return true;}
120  protected:
121  std::string m_name;
122  std::string m_def;
123  T m_tmp;
124  };
125 
126 
127  class sub_ntuple : public virtual iobj {
128  public:
129  static cid id_class() {return 300;}
130  public: //iobj
131  virtual void* cast(cid a_class) const {
132  if(void* p = cmp_cast<sub_ntuple>(this,a_class)) {return p;}
133  return 0;
134  }
135  virtual cid id_cls() const {return id_class();}
136  public:
137  virtual const std::string& name() const {return m_name;}
138  virtual const std::string& aida_type() const {return s_aida_type_ituple();}
139  public:
140  sub_ntuple(const std::string& a_name,const std::string& a_spaces)
141  :m_name(a_name),m_spaces(a_spaces){}
142  virtual ~sub_ntuple(){}
143  protected:
144  sub_ntuple(const sub_ntuple& a_from)
145  :iobj(a_from),m_name(a_from.m_name){}
146  sub_ntuple& operator=(const sub_ntuple&){return *this;}
147  public:
148  template <class T>
149  column<T>* create_column(const std::string& a_name,const T& a_def = T()) {
150  if(find_named<iobj>(m_cols,a_name)) return 0;
151  column<T>* col = new column<T>(a_name,a_def);
152  if(!col) return 0;
153  m_cols.push_back(col);
154  return col;
155  }
156 
157  sub_ntuple* create_sub_ntuple(const std::string& a_name){
158  if(find_named<iobj>(m_cols,a_name)) return 0;
159  std::string spaces;
160  for(unsigned int i=0;i<4;i++) spaces += " ";
161  sub_ntuple* col = new sub_ntuple(a_name,m_spaces+spaces);
162  if(!col) return 0;
163  m_cols.push_back(col);
164  return col;
165  }
166 
167 
168  const std::vector<iobj*>& columns() const {return m_cols;}
169 
170  std::string booking(bool a_xml_esc) const {
171  std::string s;
172  get_booking(m_cols,a_xml_esc,s);
173  return s;
174  }
175  void reset() {m_tmp.clear();}
176  const std::string& value() const {return m_tmp;}
177 
178  bool add_row() {
179  if(m_cols.empty()) return false;
180  std::ostringstream sout;
181  sout << m_spaces << "<row>" << std::endl;
182  tools_vforcit(iobj*,m_cols,it) {
183  if(sub_ntuple* sub = id_cast<iobj,sub_ntuple>(*(*it))) {
184  sout << m_spaces << " <entryITuple>" << std::endl;
185  sout << sub->value();
186  sout << m_spaces << " </entryITuple>" << std::endl;
187  sub->reset();
188  } else if(leaf* lf = id_cast<iobj,leaf>(*(*it))){
189  std::string _sv;
190  lf->s_value(_sv);
191  sout << m_spaces << " <entry"
192  << " value=\"" << _sv
193  << "\"/>" << std::endl;
194  }
195  }
196  sout << m_spaces << "</row>" << std::endl;
197 
198  m_tmp += sout.str();
199 
200  return true;
201  }
202  protected:
203  std::string m_name;
204  std::string m_spaces;
205  std::vector<iobj*> m_cols;
206  std::string m_tmp;
207  };
208 
209  template <class T>
210  class std_vector_column : public leaf {
211  public:
212  static cid id_class() {return 200+_cid_std_vector<T>();}
213  public: //iobj
214  virtual void* cast(cid a_class) const {
215  if(void* p = cmp_cast<std_vector_column>(this,a_class)) {return p;}
216  return leaf::cast(a_class);
217  }
218  virtual cid id_cls() const {return id_class();}
219  public:
220  virtual const std::string& name() const {return m_name;}
221  virtual const std::string& aida_type() const {return s_aida_type(T());}
222  public: //leaf
223  virtual const std::string& s_def() const {return m_def;} //not used.
224  virtual void s_value(std::string& a_s) const {
225  std::ostringstream sout;
226  sout << m_spaces << "<entryITuple>" << std::endl;
227  typedef typename std::vector<T>::const_iterator it_t;
228  for(it_t it=m_user_vec.begin();it!=m_user_vec.end();++it) {
229  sout << m_spaces << " <row><entry" << " value=\"" << tos(*it) << "\"/></row>" << std::endl;
230  }
231  sout << m_spaces << "</entryITuple>" << std::endl;
232  a_s = sout.str();
233  }
234  public:
235  std_vector_column(const std::string& a_name,std::vector<T>& a_user_vec,const std::string& a_spaces)
236  :m_name(a_name)
237  ,m_user_vec(a_user_vec)
238  ,m_spaces(a_spaces)
239  {}
240  virtual ~std_vector_column(){}
241  protected:
243  :leaf(a_from)
244  ,m_name(a_from.m_name)
245  ,m_user_vec(a_from.m_user_vec)
246  ,m_spaces(a_from.m_spaces)
247  {}
249  m_name = a_from.m_name;
250  m_spaces = a_from.m_spaces;
251  return *this;
252  }
253  protected:
254  std::string m_name;
255  std::string m_def; //not used;
256  std::vector<T>& m_user_vec;
257  std::string m_spaces;
258  };
259 
260  static leaf* is_std_vector_column(iobj& a_obj) {
261  //200+20+id(basic type) ?
262  int _id = (int)a_obj.id_cls()-220;
263  if((_id<=0)||(_id>=20)) return 0;
264  return id_cast<iobj,leaf>(a_obj);
265  }
266 
267 public:
268  ntuple(std::ostream& a_writer,unsigned int a_spaces = 0)
269  :m_writer(a_writer){
270  for(unsigned int i=0;i<a_spaces;i++) m_spaces += " ";
271  }
272  ntuple(std::ostream& a_writer,
273  std::ostream& a_out,
274  const ntuple_booking& a_bkg,
275  unsigned int a_spaces = 0)
276  :m_writer(a_writer){
277  for(unsigned int i=0;i<a_spaces;i++) m_spaces += " ";
278 
279  const std::vector<column_booking>& cols = a_bkg.columns();
280  tools_vforcit(column_booking,cols,it){
281 
282  if((*it).cls_id()==_cid(int(0))) {
283  create_column<int>((*it).name());
284  } else if((*it).cls_id()==_cid(float(0))) {
285  create_column<float>((*it).name());
286  } else if((*it).cls_id()==_cid(double(0))) {
287  create_column<double>((*it).name());
288  } else if((*it).cls_id()==_cid(std::string())) {
289  create_column<std::string>((*it).name());
290 
291  } else if((*it).cls_id()==_cid_std_vector<int>()) {
292  std::vector<int>* vec = (std::vector<int>*)(*it).user_obj();
293  if(vec) {
294  create_column<int>((*it).name(),*vec);
295  } else {
296  a_out << "tools::waxml::ntuple :"
297  << " for std::vector column " << sout((*it).name())
298  << ", the user vector pointer is null."
299  << std::endl;
300  safe_clear<iobj>(m_cols);
301  return;
302  }
303  } else if((*it).cls_id()==_cid_std_vector<float>()) {
304  std::vector<float>* vec = (std::vector<float>*)(*it).user_obj();
305  if(vec) {
306  create_column<float>((*it).name(),*vec);
307  } else {
308  a_out << "tools::waxml::ntuple :"
309  << " for std::vector column " << sout((*it).name())
310  << ", the user vector pointer is null."
311  << std::endl;
312  safe_clear<iobj>(m_cols);
313  return;
314  }
315  } else if((*it).cls_id()==_cid_std_vector<double>()) {
316  std::vector<double>* vec = (std::vector<double>*)(*it).user_obj();
317  if(vec) {
318  create_column<double>((*it).name(),*vec);
319  } else {
320  a_out << "tools::waxml::ntuple :"
321  << " for std::vector column " << sout((*it).name())
322  << ", the user vector pointer is null."
323  << std::endl;
324  safe_clear<iobj>(m_cols);
325  return;
326  }
327 
328  } else {
329  a_out << "tools::waxml::ntuple :"
330  << " for column " << sout((*it).name())
331  << ", type with cid " << (*it).cls_id() << " not yet handled."
332  << std::endl;
333  //throw
334  safe_clear<iobj>(m_cols);
335  return;
336  }
337  }
338  }
339  virtual ~ntuple() {
340  safe_clear<iobj>(m_cols);
341  }
342 protected:
343  ntuple(const ntuple& a_from)
344  :m_writer(a_from.m_writer)
345  ,m_spaces(a_from.m_spaces)
346  {}
347  ntuple& operator=(const ntuple& a_from){
348  m_spaces = a_from.m_spaces;
349  return *this;
350  }
351 public:
352  const std::vector<iobj*>& columns() const {return m_cols;}
353 
354  template <class T>
355  column<T>* create_column(const std::string& a_name,const T& a_def = T()) {
356  if(find_named<iobj>(m_cols,a_name)) return 0;
357  column<T>* col = new column<T>(a_name,a_def);
358  if(!col) return 0;
359  m_cols.push_back(col);
360  return col;
361  }
362 
363  template <class T>
364  std_vector_column<T>* create_column(const std::string& a_name,std::vector<T>& a_user_vec) {
365  if(find_named<iobj>(m_cols,a_name)) return 0;
366  std::string spaces;
367  for(unsigned int i=0;i<8;i++) spaces += " ";
368  std_vector_column<T>* col = new std_vector_column<T>(a_name,a_user_vec,m_spaces+spaces);
369  if(!col) return 0;
370  m_cols.push_back(col);
371  return col;
372  }
373 
374  template <class T>
375  column<T>* find_column(const std::string& a_name) {
376  iobj* col = find_named<iobj>(m_cols,a_name);
377  if(!col) return 0;
378  return id_cast<iobj, column<T> >(*col);
379  }
380 
381  sub_ntuple* create_sub_ntuple(const std::string& a_name){
382  if(find_named<iobj>(m_cols,a_name)) return 0;
383  std::string spaces;
384  for(unsigned int i=0;i<10;i++) spaces += " ";
385  sub_ntuple* col = new sub_ntuple(a_name,m_spaces+spaces);
386  if(!col) return 0;
387  m_cols.push_back(col);
388  return col;
389  }
390 
391  void write_header(const std::string& a_path,const std::string& a_name,const std::string& a_title){
392 
393  // <tuple> :
394  m_writer << m_spaces << " <tuple"
395  << " path=" << sout(to_xml(a_path))
396  << " name=" << sout(to_xml(a_name))
397  << " title=" << sout(to_xml(a_title))
398  << ">" << std::endl;
399 
400  // <columns> :
401  m_writer << m_spaces << " <columns>" << std::endl;
402 
403  tools_vforcit(iobj*,m_cols,it) {
404  if(leaf* vlf = is_std_vector_column(*(*it))) {
405  m_writer << m_spaces << " <column"
406  << " name=" << sout(to_xml((*it)->name()))
407  << " type=" << sout("ITuple")
408  << " booking=\"{" << vlf->aida_type() << " " << to_xml((*it)->name())
409  << "}\""
410  << "/>" << std::endl;
411  } else if(sub_ntuple* sub = id_cast<iobj,sub_ntuple>(*(*it))){
412  m_writer << m_spaces << " <column"
413  << " name=" << sout(to_xml((*it)->name()))
414  << " type=" << sout("ITuple")
415  << " booking=" << sout(sub->booking(true))
416  << "/>" << std::endl;
417  } else if(/*leaf* lf =*/ id_cast<iobj,leaf>(*(*it))){
418  m_writer << m_spaces << " <column"
419  << " name=" << sout(to_xml((*it)->name()))
420  << " type=" << sout((*it)->aida_type())
421  //<< " default=" << sout(lf->s_def()) //not understood by jas3
422  << "/>" << std::endl;
423  }
424  }
425 
426  m_writer << m_spaces << " </columns>" << std::endl;
427 
428  // rows :
429  m_writer << m_spaces << " <rows>" << std::endl;
430  }
431 
432  bool add_row() {
433  if(m_cols.empty()) return false;
434  m_writer << m_spaces << " <row>" << std::endl;
435  tools_vforcit(iobj*,m_cols,it) {
436  if(leaf* vlf = is_std_vector_column(*(*it))) {
437  std::string _sv;
438  vlf->s_value(_sv);
439  m_writer << _sv;
440  } else if(sub_ntuple* sub = id_cast<iobj,sub_ntuple>(*(*it))){
441  m_writer << m_spaces << " <entryITuple>" << std::endl;
442  m_writer << sub->value();
443  m_writer << m_spaces << " </entryITuple>" << std::endl;
444  sub->reset();
445  } else if(leaf* lf = id_cast<iobj,leaf>(*(*it))){
446  std::string _sv;
447  lf->s_value(_sv);
448  m_writer << m_spaces << " <entry"
449  << " value=" << sout(_sv)
450  << "/>" << std::endl;
451  }
452  }
453  m_writer << m_spaces << " </row>" << std::endl;
454  return true;
455  }
456 
457  void write_trailer() {
458  m_writer << m_spaces << " </rows>" << std::endl;
459  m_writer << m_spaces << " </tuple>" << std::endl;
460  }
461 
462  std::string booking(bool a_xml_esc) const {
463  std::string s;
464  get_booking(m_cols,a_xml_esc,s);
465  return s;
466  }
467 
468 protected:
469  static void get_booking(const std::vector<iobj*>& a_cols,bool a_xml_esc,
470  std::string& a_string) {
471  a_string += "{"; //we need the + because of the tuple in tuple.
472 
473  tools_vforcit(iobj*,a_cols,it) {
474  if(it!=a_cols.begin()) a_string += ",";
475 
476  std::string sname = (*it)->name();
477  if(a_xml_esc) sname = to_xml(sname);
478 
479  if(leaf* vlf = is_std_vector_column(*(*it))) {
480  a_string += "ITuple " + (*it)->name() + " = {" + vlf->aida_type() + " " + sname + "}";
481 
482  } else if(sub_ntuple* sub = id_cast<iobj,sub_ntuple>(*(*it))){
483  a_string += (*it)->aida_type() + " " + sname + " = ";
484 
485  get_booking(sub->columns(),a_xml_esc,a_string);
486  } else if(leaf* lf = id_cast<iobj,leaf>(*(*it))){
487  a_string += (*it)->aida_type() + " " + sname + " = " + lf->s_def();
488  }
489  }
490  a_string += "}";
491  }
492 
493 protected:
494  std::ostream& m_writer;
495  //std::string m_path;
496  //std::string m_name;
497  //std::string m_title;
498  std::string m_spaces;
499  std::vector<iobj*> m_cols;
500 };
501 
502 }}
503 
504 #endif
tools::waxml::ntuple::column::name
virtual const std::string & name() const
Definition: ntuple:95
tools::sub
bool sub(std::vector< T > &a_vec, const std::vector< T > &a_v)
Definition: vmanip:283
tools::waxml::ntuple::std_vector_column
Definition: ntuple:210
tools::waxml::ntuple::std_vector_column::s_def
virtual const std::string & s_def() const
Definition: ntuple:223
tools::waxml::ntuple::std_vector_column::cast
virtual void * cast(cid a_class) const
Definition: ntuple:214
tools::waxml::ntuple::s_aida_type
static const std::string & s_aida_type(const std::string &)
Definition: ntuple:73
tools::waxml::ntuple::booking
std::string booking(bool a_xml_esc) const
Definition: ntuple:462
tools::_cid
cid _cid(byte)
Definition: cids:14
tools::waxml::ntuple::column::m_def
std::string m_def
Definition: ntuple:122
tools::waxml::ntuple::leaf::cast
virtual void * cast(cid a_class) const
Definition: ntuple:46
tools::waxml::ntuple::sub_ntuple
Definition: ntuple:127
tools::waxml::ntuple::std_vector_column::~std_vector_column
virtual ~std_vector_column()
Definition: ntuple:240
tools::waxml::ntuple::iobj::~iobj
virtual ~iobj()
Definition: ntuple:33
tools::waxml::ntuple::ntuple
ntuple(std::ostream &a_writer, std::ostream &a_out, const ntuple_booking &a_bkg, unsigned int a_spaces=0)
Definition: ntuple:272
tools::column_booking
Definition: ntuple_booking:17
tools::waxml::ntuple::std_vector_column::operator=
std_vector_column & operator=(const std_vector_column &a_from)
Definition: ntuple:248
tools::waxml::ntuple::sub_ntuple::aida_type
virtual const std::string & aida_type() const
Definition: ntuple:138
tools::waxml::ntuple::s_aida_type
static const std::string & s_aida_type(float)
Definition: ntuple:65
tools::waxml::ntuple::s_aida_type_ituple
static const std::string & s_aida_type_ituple()
Definition: ntuple:78
tools::waxml::ntuple::leaf::operator=
leaf & operator=(const leaf &)
Definition: ntuple:58
tools::waxml::ntuple::leaf::id_class
static cid id_class()
Definition: ntuple:44
tools::waxml::ntuple::s_aida_type
static const std::string & s_aida_type(int)
Definition: ntuple:61
tools::waxml::ntuple::column::column
column(const std::string &a_name, const T &a_def)
Definition: ntuple:101
tools::waxml::ntuple::column::aida_type
virtual const std::string & aida_type() const
Definition: ntuple:96
tools::waxml::ntuple::sub_ntuple::sub_ntuple
sub_ntuple(const sub_ntuple &a_from)
Definition: ntuple:144
tools::tos
bool tos(const rotf &a_v, std::string &a_s)
Definition: rotf:68
tools::waxml::ntuple::m_spaces
std::string m_spaces
Definition: ntuple:498
tools::waxml::ntuple::create_sub_ntuple
sub_ntuple * create_sub_ntuple(const std::string &a_name)
Definition: ntuple:381
tools::waxml::ntuple::sub_ntuple::~sub_ntuple
virtual ~sub_ntuple()
Definition: ntuple:142
tools::waxml::ntuple::get_booking
static void get_booking(const std::vector< iobj * > &a_cols, bool a_xml_esc, std::string &a_string)
Definition: ntuple:469
tools::waxml::ntuple::std_vector_column::std_vector_column
std_vector_column(const std::string &a_name, std::vector< T > &a_user_vec, const std::string &a_spaces)
Definition: ntuple:235
tools::waxml::ntuple::sub_ntuple::sub_ntuple
sub_ntuple(const std::string &a_name, const std::string &a_spaces)
Definition: ntuple:140
tools::waxml::ntuple::sub_ntuple::id_cls
virtual cid id_cls() const
Definition: ntuple:135
tools::waxml::ntuple::std_vector_column::aida_type
virtual const std::string & aida_type() const
Definition: ntuple:221
tools::waxml::ntuple::column::column
column(const column &a_from)
Definition: ntuple:106
tools::waxml::ntuple::column::id_class
static cid id_class()
Definition: ntuple:87
tools::waxml::ntuple::sub_ntuple::booking
std::string booking(bool a_xml_esc) const
Definition: ntuple:170
tools::waxml::ntuple::sub_ntuple::m_spaces
std::string m_spaces
Definition: ntuple:204
tools::waxml::ntuple::sub_ntuple::m_cols
std::vector< iobj * > m_cols
Definition: ntuple:205
tools::waxml::ntuple::add_row
bool add_row()
Definition: ntuple:432
tools::waxml::ntuple::column::s_value
virtual void s_value(std::string &a_s) const
Definition: ntuple:99
tools::waxml::ntuple::column::m_name
std::string m_name
Definition: ntuple:121
tools::waxml::ntuple::operator=
ntuple & operator=(const ntuple &a_from)
Definition: ntuple:347
tools::waxml::ntuple::ntuple
ntuple(const ntuple &a_from)
Definition: ntuple:343
tools::to_xml
std::string to_xml(const std::string &a_string)
Definition: srep:68
tools::waxml::ntuple::iobj::cast
virtual void * cast(cid) const =0
tools::waxml::ntuple::columns
const std::vector< iobj * > & columns() const
Definition: ntuple:352
tools::waxml::ntuple::leaf::~leaf
virtual ~leaf()
Definition: ntuple:56
tools::waxml::ntuple::leaf::s_value
virtual void s_value(std::string &) const =0
tools::waxml::ntuple::sub_ntuple::cast
virtual void * cast(cid a_class) const
Definition: ntuple:131
tools::sout
Definition: sout:17
tools::waxml::ntuple::leaf::leaf
leaf(const leaf &a_from)
Definition: ntuple:57
tools::waxml::ntuple::sub_ntuple::name
virtual const std::string & name() const
Definition: ntuple:137
tools::waxml::ntuple::sub_ntuple::add_row
bool add_row()
Definition: ntuple:178
tools::waxml::ntuple::sub_ntuple::columns
const std::vector< iobj * > & columns() const
Definition: ntuple:168
tools::waxml::ntuple::std_vector_column::s_value
virtual void s_value(std::string &a_s) const
Definition: ntuple:224
tools::waxml::ntuple::std_vector_column::std_vector_column
std_vector_column(const std_vector_column &a_from)
Definition: ntuple:242
tools::waxml::ntuple::iobj::name
virtual const std::string & name() const =0
tools::waxml::ntuple::sub_ntuple::value
const std::string & value() const
Definition: ntuple:176
tools::waxml::ntuple::column::fill
bool fill(const T &a_value)
Definition: ntuple:119
tools::waxml::ntuple
Definition: ntuple:28
tools::waxml::ntuple::m_writer
std::ostream & m_writer
Definition: ntuple:494
tools::ntuple_booking::columns
const std::vector< column_booking > & columns() const
Definition: ntuple_booking:93
tools::waxml::ntuple::column::m_tmp
T m_tmp
Definition: ntuple:123
tools
inlined C code : ///////////////////////////////////
Definition: aida_ntuple:26
tools::waxml::ntuple::leaf::s_def
virtual const std::string & s_def() const =0
tools::waxml::ntuple::leaf::leaf
leaf()
Definition: ntuple:55
tools::cmp_cast
void * cmp_cast(const TO *a_this, const std::string &a_class)
Definition: scast:15
tools::waxml::ntuple::leaf
Definition: ntuple:42
tools::waxml::ntuple::column::~column
virtual ~column()
Definition: ntuple:104
tools::waxml::ntuple::sub_ntuple::reset
void reset()
Definition: ntuple:175
tools::waxml::ntuple::std_vector_column::id_class
static cid id_class()
Definition: ntuple:212
tools::waxml::ntuple::sub_ntuple::operator=
sub_ntuple & operator=(const sub_ntuple &)
Definition: ntuple:146
tools::waxml::ntuple::find_column
column< T > * find_column(const std::string &a_name)
Definition: ntuple:375
tools::waxml::ntuple::~ntuple
virtual ~ntuple()
Definition: ntuple:339
tools::waxml::ntuple::leaf::id_cls
virtual cid id_cls() const
Definition: ntuple:50
tools::waxml::ntuple::iobj
Definition: ntuple:31
tools::waxml::ntuple::sub_ntuple::id_class
static cid id_class()
Definition: ntuple:129
tools::waxml::ntuple::column::operator=
column & operator=(const column &a_from)
Definition: ntuple:112
tools::waxml::ntuple::sub_ntuple::m_tmp
std::string m_tmp
Definition: ntuple:206
tools::waxml::ntuple::iobj::aida_type
virtual const std::string & aida_type() const =0
tools::waxml::ntuple::std_vector_column::m_name
std::string m_name
Definition: ntuple:254
tools::waxml::ntuple::write_trailer
void write_trailer()
Definition: ntuple:457
tools::waxml::ntuple::column::id_cls
virtual cid id_cls() const
Definition: ntuple:93
tools::waxml::ntuple::column
Definition: ntuple:85
tools_vforcit
#define tools_vforcit(a__T, a__v, a__it)
Definition: forit:7
tools::waxml::ntuple::sub_ntuple::create_column
column< T > * create_column(const std::string &a_name, const T &a_def=T())
Definition: ntuple:149
tools::waxml::ntuple::std_vector_column::name
virtual const std::string & name() const
Definition: ntuple:220
tools::waxml::ntuple::column::cast
virtual void * cast(cid a_class) const
Definition: ntuple:89
tools::waxml::ntuple::create_column
std_vector_column< T > * create_column(const std::string &a_name, std::vector< T > &a_user_vec)
Definition: ntuple:364
tools::waxml::ntuple::sub_ntuple::m_name
std::string m_name
Definition: ntuple:203
tools::waxml::ntuple::m_cols
std::vector< iobj * > m_cols
Definition: ntuple:499
tools::ntuple_booking
Definition: ntuple_booking:49
tools::waxml::ntuple::sub_ntuple::create_sub_ntuple
sub_ntuple * create_sub_ntuple(const std::string &a_name)
Definition: ntuple:157
tools::waxml::ntuple::std_vector_column::m_spaces
std::string m_spaces
Definition: ntuple:257
tools::waxml::ntuple::std_vector_column::id_cls
virtual cid id_cls() const
Definition: ntuple:218
tools::waxml::ntuple::is_std_vector_column
static leaf * is_std_vector_column(iobj &a_obj)
Definition: ntuple:260
tools::waxml::ntuple::s_aida_type
static const std::string & s_aida_type(double)
Definition: ntuple:69
tools::waxml::ntuple::column::s_def
virtual const std::string & s_def() const
Definition: ntuple:98
tools::waxml::ntuple::ntuple
ntuple(std::ostream &a_writer, unsigned int a_spaces=0)
Definition: ntuple:268
tools::waxml::ntuple::std_vector_column::m_user_vec
std::vector< T > & m_user_vec
Definition: ntuple:256
tools::waxml::ntuple::create_column
column< T > * create_column(const std::string &a_name, const T &a_def=T())
Definition: ntuple:355
tools::waxml::ntuple::iobj::id_cls
virtual cid id_cls() const =0
tools::waxml::ntuple::std_vector_column::m_def
std::string m_def
Definition: ntuple:255
tools::cid
unsigned short cid
Definition: cid:9
tools::waxml::ntuple::write_header
void write_header(const std::string &a_path, const std::string &a_name, const std::string &a_title)
Definition: ntuple:391