Import Geant4 10.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2017-12-08 12:52:30 +01:00
parent 98e455a940
commit fc6af9e721
2166 changed files with 276760 additions and 100873 deletions
@@ -9,6 +9,9 @@
#include "cids"
#include <ostream>
#include "forit"
namespace tools {
class column_booking {
@@ -68,6 +71,15 @@ public:
m_columns.push_back(column_booking(a_name,_cid(T()),0));
}
template <class T>
void add_column_vec(const std::string& a_name) {
m_columns.push_back(column_booking(a_name,_cid_std_vector<T>(),0));
}
template <class T>
void add_column(const std::string& a_name,T& a_user) {
m_columns.push_back(column_booking(a_name,_cid(T()),(void*)&a_user));
}
template <class T>
void add_column(const std::string& a_name,std::vector<T>& a_user_vec) {
m_columns.push_back(column_booking(a_name,_cid_std_vector<T>(),(void*)&a_user_vec));
}
@@ -79,6 +91,37 @@ public:
void set_name(const std::string& a_s) {m_name = a_s;}
void set_title(const std::string& a_s) {m_title = a_s;}
bool has_similar_layout(std::ostream& a_out,const ntuple_booking& a_nbk) {
if(m_columns.size()!=a_nbk.m_columns.size()) {
a_out << "tools::ntuple_booking::has_similar_layout :"
<< " bookings have not the same number of columns."
<< " (" << m_columns.size() << " != " << a_nbk.m_columns.size() << ")."
<< std::endl;
return false;
}
std::vector<column_booking>::const_iterator ait = a_nbk.m_columns.begin();
tools_vforit(tools::column_booking,m_columns,it) {
if((*it).name()!=(*ait).name()) {
a_out << "tools::ntuple_booking::has_similar_layout :"
<< " columns don't have same name."
<< " (" << (*it).name() << " != " << (*ait).name() << ")."
<< std::endl;
return false;
}
if((*it).cls_id()!=(*ait).cls_id()) {
a_out << "tools::ntuple_booking::has_similar_layout :"
<< " columns don't have same class id."
<< " (" << (*it).cls_id() << " != " << (*ait).cls_id() << ")."
<< std::endl;
return false;
}
ait++;
}
return true;
}
protected:
std::string m_name;
std::string m_title;