Definition at line 28 of file ntuple.
◆ ntuple() [1/3]
tools::waxml::ntuple::ntuple |
( |
std::ostream & |
a_writer, |
|
|
unsigned int |
a_spaces = 0 |
|
) |
| |
|
inline |
Definition at line 268 of file ntuple.
270 for(
unsigned int i=0;i<a_spaces;i++)
m_spaces +=
" ";
◆ ntuple() [2/3]
tools::waxml::ntuple::ntuple |
( |
std::ostream & |
a_writer, |
|
|
std::ostream & |
a_out, |
|
|
const ntuple_booking & |
a_bkg, |
|
|
unsigned int |
a_spaces = 0 |
|
) |
| |
|
inline |
Definition at line 272 of file ntuple.
277 for(
unsigned int i=0;i<a_spaces;i++)
m_spaces +=
" ";
279 const std::vector<column_booking>& cols = a_bkg.columns();
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());
291 }
else if((*it).cls_id()==_cid_std_vector<int>()) {
292 std::vector<int>* vec = (std::vector<int>*)(*it).user_obj();
294 create_column<int>((*it).name(),*vec);
296 a_out <<
"tools::waxml::ntuple :"
297 <<
" for std::vector column " << sout((*it).name())
298 <<
", the user vector pointer is null."
303 }
else if((*it).cls_id()==_cid_std_vector<float>()) {
304 std::vector<float>* vec = (std::vector<float>*)(*it).user_obj();
306 create_column<float>((*it).name(),*vec);
308 a_out <<
"tools::waxml::ntuple :"
309 <<
" for std::vector column " << sout((*it).name())
310 <<
", the user vector pointer is null."
315 }
else if((*it).cls_id()==_cid_std_vector<double>()) {
316 std::vector<double>* vec = (std::vector<double>*)(*it).user_obj();
318 create_column<double>((*it).name(),*vec);
320 a_out <<
"tools::waxml::ntuple :"
321 <<
" for std::vector column " << sout((*it).name())
322 <<
", the user vector pointer is null."
329 a_out <<
"tools::waxml::ntuple :"
330 <<
" for column " << sout((*it).name())
331 <<
", type with cid " << (*it).cls_id() <<
" not yet handled."
◆ ~ntuple()
virtual tools::waxml::ntuple::~ntuple |
( |
| ) |
|
|
inlinevirtual |
◆ ntuple() [3/3]
tools::waxml::ntuple::ntuple |
( |
const ntuple & |
a_from | ) |
|
|
inlineprotected |
◆ add_row()
bool tools::waxml::ntuple::add_row |
( |
| ) |
|
|
inline |
Definition at line 432 of file ntuple.
433 if(
m_cols.empty())
return false;
440 }
else if(sub_ntuple*
sub = id_cast<iobj,sub_ntuple>(*(*it))){
445 }
else if(leaf* lf = id_cast<iobj,leaf>(*(*it))){
449 <<
" value=" << sout(_sv)
450 <<
"/>" << std::endl;
◆ booking()
std::string tools::waxml::ntuple::booking |
( |
bool |
a_xml_esc | ) |
const |
|
inline |
◆ columns()
const std::vector<iobj*>& tools::waxml::ntuple::columns |
( |
| ) |
const |
|
inline |
◆ create_column() [1/2]
template<class T >
column<T>* tools::waxml::ntuple::create_column |
( |
const std::string & |
a_name, |
|
|
const T & |
a_def = T() |
|
) |
| |
|
inline |
Definition at line 355 of file ntuple.
356 if(find_named<iobj>(
m_cols,a_name))
return 0;
357 column<T>* col =
new column<T>(a_name,a_def);
◆ create_column() [2/2]
template<class T >
std_vector_column<T>* tools::waxml::ntuple::create_column |
( |
const std::string & |
a_name, |
|
|
std::vector< T > & |
a_user_vec |
|
) |
| |
|
inline |
Definition at line 364 of file ntuple.
365 if(find_named<iobj>(
m_cols,a_name))
return 0;
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);
◆ create_sub_ntuple()
sub_ntuple* tools::waxml::ntuple::create_sub_ntuple |
( |
const std::string & |
a_name | ) |
|
|
inline |
Definition at line 381 of file ntuple.
382 if(find_named<iobj>(
m_cols,a_name))
return 0;
384 for(
unsigned int i=0;i<10;i++) spaces +=
" ";
385 sub_ntuple* col =
new sub_ntuple(a_name,
m_spaces+spaces);
◆ find_column()
template<class T >
column<T>* tools::waxml::ntuple::find_column |
( |
const std::string & |
a_name | ) |
|
|
inline |
Definition at line 375 of file ntuple.
376 iobj* col = find_named<iobj>(
m_cols,a_name);
378 return id_cast<iobj, column<T> >(*col);
◆ get_booking()
static void tools::waxml::ntuple::get_booking |
( |
const std::vector< iobj * > & |
a_cols, |
|
|
bool |
a_xml_esc, |
|
|
std::string & |
a_string |
|
) |
| |
|
inlinestaticprotected |
Definition at line 469 of file ntuple.
474 if(it!=a_cols.begin()) a_string +=
",";
476 std::string sname = (*it)->name();
477 if(a_xml_esc) sname =
to_xml(sname);
480 a_string +=
"ITuple " + (*it)->name() +
" = {" + vlf->aida_type() +
" " + sname +
"}";
482 }
else if(sub_ntuple*
sub = id_cast<iobj,sub_ntuple>(*(*it))){
483 a_string += (*it)->aida_type() +
" " + sname +
" = ";
486 }
else if(leaf* lf = id_cast<iobj,leaf>(*(*it))){
487 a_string += (*it)->aida_type() +
" " + sname +
" = " + lf->s_def();
◆ is_std_vector_column()
static leaf* tools::waxml::ntuple::is_std_vector_column |
( |
iobj & |
a_obj | ) |
|
|
inlinestatic |
Definition at line 260 of file ntuple.
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);
◆ operator=()
ntuple& tools::waxml::ntuple::operator= |
( |
const ntuple & |
a_from | ) |
|
|
inlineprotected |
◆ s_aida_type() [1/4]
static const std::string& tools::waxml::ntuple::s_aida_type |
( |
const std::string & |
| ) |
|
|
inlinestaticprotected |
Definition at line 73 of file ntuple.
74 static const std::string s_v(
"string");
◆ s_aida_type() [2/4]
static const std::string& tools::waxml::ntuple::s_aida_type |
( |
double |
| ) |
|
|
inlinestaticprotected |
Definition at line 69 of file ntuple.
70 static const std::string s_v(
"double");
◆ s_aida_type() [3/4]
static const std::string& tools::waxml::ntuple::s_aida_type |
( |
float |
| ) |
|
|
inlinestaticprotected |
Definition at line 65 of file ntuple.
66 static const std::string s_v(
"float");
◆ s_aida_type() [4/4]
static const std::string& tools::waxml::ntuple::s_aida_type |
( |
int |
| ) |
|
|
inlinestaticprotected |
Definition at line 61 of file ntuple.
62 static const std::string s_v(
"int");
◆ s_aida_type_ituple()
static const std::string& tools::waxml::ntuple::s_aida_type_ituple |
( |
| ) |
|
|
inlinestaticprotected |
Definition at line 78 of file ntuple.
79 static const std::string s_v(
"ITuple");
◆ write_header()
void tools::waxml::ntuple::write_header |
( |
const std::string & |
a_path, |
|
|
const std::string & |
a_name, |
|
|
const std::string & |
a_title |
|
) |
| |
|
inline |
Definition at line 391 of file ntuple.
395 <<
" path=" << sout(
to_xml(a_path))
396 <<
" name=" << sout(
to_xml(a_name))
397 <<
" title=" << sout(
to_xml(a_title))
406 <<
" name=" << sout(
to_xml((*it)->name()))
407 <<
" type=" << sout(
"ITuple")
408 <<
" booking=\"{" << vlf->aida_type() <<
" " <<
to_xml((*it)->name())
410 <<
"/>" << std::endl;
411 }
else if(sub_ntuple*
sub = id_cast<iobj,sub_ntuple>(*(*it))){
413 <<
" name=" << sout(
to_xml((*it)->name()))
414 <<
" type=" << sout(
"ITuple")
415 <<
" booking=" << sout(
sub->booking(
true))
416 <<
"/>" << std::endl;
417 }
else if( id_cast<iobj,leaf>(*(*it))){
419 <<
" name=" << sout(
to_xml((*it)->name()))
420 <<
" type=" << sout((*it)->aida_type())
422 <<
"/>" << std::endl;
◆ write_trailer()
void tools::waxml::ntuple::write_trailer |
( |
| ) |
|
|
inline |
◆ m_cols
std::vector<iobj*> tools::waxml::ntuple::m_cols |
|
protected |
◆ m_spaces
std::string tools::waxml::ntuple::m_spaces |
|
protected |
◆ m_writer
std::ostream& tools::waxml::ntuple::m_writer |
|
protected |
The documentation for this class was generated from the following file:
- /Users/barrand/private/dev/softinex/g4tools/g4tools/tools/waxml/ntuple