Import Geant4 10.7.0 source tree

This commit is contained in:
Gabriele Cosmo
2020-12-04 12:30:43 +01:00
parent 67ba86d073
commit dab42d2018
3770 changed files with 226369 additions and 286486 deletions
@@ -24,7 +24,7 @@ class base_pntuple {
static const std::string s_v("tools::wroot::base_pntuple");
return s_v;
}
#endif
#endif
public:
#include "columns.icc"
@@ -56,7 +56,7 @@ protected:
base_pntuple& operator=(const base_pntuple&){return *this;}
public:
const std::vector<icol*>& columns() const {return m_cols;}
template <class T>
column_ref<T>* find_column_ref(const std::string& a_name) {
icol* col = find_named<icol>(m_cols,a_name);
@@ -123,7 +123,7 @@ protected:
seek m_seek_directory;
std::string m_name;
std::string m_title;
std::vector<icol*> m_cols;
std::vector<icol*> m_cols;
};
}}
@@ -62,16 +62,16 @@ public:
,m_file(a_out,a_byte_swap,a_compression,a_verbose)
{
const std::vector<column_booking>& cols = a_bkg.columns();
if(a_basket_sizes.size()!=cols.size()) {
a_out << "tools::wroot::base_pntuple_column_wise :"
<< " a_basket_sizes.size() (" << a_basket_sizes.size() << ") != "
<< "a_bkg.columns().size() (" << a_bkg.columns().size() << ")."
<< std::endl;
return;
return;
}
std::vector<uint32>::const_iterator itb = a_basket_sizes.begin();
tools_vforcit(column_booking,cols,it){
#define TOOLS_WROOT_PNTUPLE_CREATE_COL(a__type) \
@@ -95,7 +95,7 @@ public:
itb++;\
}\
}
#define TOOLS_WROOT_PNTUPLE_CREATE_VEC_COL(a__type) \
if((*it).cls_id()==_cid_std_vector<a__type>()) {\
std::vector<a__type>* vec = (std::vector<a__type>*)(*it).user_obj();\
@@ -121,13 +121,13 @@ public:
itb++;\
}\
}
TOOLS_WROOT_PNTUPLE_CREATE_COL(char)
else TOOLS_WROOT_PNTUPLE_CREATE_COL(short)
else TOOLS_WROOT_PNTUPLE_CREATE_COL(int)
else TOOLS_WROOT_PNTUPLE_CREATE_COL(float)
else TOOLS_WROOT_PNTUPLE_CREATE_COL(double)
else if((*it).cls_id()==_cid(std::string())) {
std::string* user = (std::string*)(*it).user_obj();
if(user) {
@@ -155,7 +155,7 @@ public:
else TOOLS_WROOT_PNTUPLE_CREATE_VEC_COL(int)
else TOOLS_WROOT_PNTUPLE_CREATE_VEC_COL(float)
else TOOLS_WROOT_PNTUPLE_CREATE_VEC_COL(double)
else if((*it).cls_id()==_cid_std_vector<std::string>()) {\
std::vector<std::string>* user = (std::vector<std::string>*)(*it).user_obj();
char sep = '\n';
@@ -181,7 +181,7 @@ public:
}
// no leaf_store_class() defined for the other types.
else {
a_out << "tools::wroot::base_pntuple_column_wise :"
<< " for column " << sout((*it).name())
@@ -191,7 +191,7 @@ public:
safe_clear<icol>(m_cols);
safe_clear<branch>(m_branches);
return;
}
}
#undef TOOLS_WROOT_PNTUPLE_CREATE_COL
#undef TOOLS_WROOT_PNTUPLE_CREATE_VEC_COL
@@ -295,7 +295,7 @@ public:
m_cols.push_back(col);
return col;
}
template <class T>
std_vector_column<T>* create_column_vector(uint32 a_basket_size,const std::string& a_name,const std::vector<T>& a_def = std::vector<T>()) {
if(find_named<icol>(m_cols,a_name)) return 0;
@@ -28,7 +28,7 @@ public:
{
m_row_wise_branch.set_basket_size(a_basket_size);
}
base_pntuple_row_wise(std::ostream& a_out,bool a_byte_swap,uint32 a_compression,seek a_seek_directory,
uint32 a_basket_size,
const ntuple_booking& a_bkg,bool a_verbose)
@@ -36,9 +36,9 @@ public:
,m_row_wise_branch(a_out,a_byte_swap,a_compression,a_seek_directory,"row_wise_branch","row_wise_branch",a_verbose)
{
m_row_wise_branch.set_basket_size(a_basket_size);
const std::vector<column_booking>& cols = a_bkg.columns();
tools_vforcit(column_booking,cols,it){
#define TOOLS_WROOT_PNTUPLE_CREATE_COL(a__type) \
@@ -58,7 +58,7 @@ public:
}\
}\
}
#define TOOLS_WROOT_PNTUPLE_CREATE_VEC_COL(a__type) \
if((*it).cls_id()==_cid_std_vector<a__type>()) {\
std::vector<a__type>* vec = (std::vector<a__type>*)(*it).user_obj();\
@@ -80,13 +80,13 @@ public:
}\
}\
}
TOOLS_WROOT_PNTUPLE_CREATE_COL(char)
else TOOLS_WROOT_PNTUPLE_CREATE_COL(short)
else TOOLS_WROOT_PNTUPLE_CREATE_COL(int)
else TOOLS_WROOT_PNTUPLE_CREATE_COL(float)
else TOOLS_WROOT_PNTUPLE_CREATE_COL(double)
else if((*it).cls_id()==_cid(std::string())) {
std::string* user = (std::string*)(*it).user_obj();
if(user) {
@@ -103,13 +103,13 @@ public:
}
}
}
else TOOLS_WROOT_PNTUPLE_CREATE_VEC_COL(char)
else TOOLS_WROOT_PNTUPLE_CREATE_VEC_COL(short)
else TOOLS_WROOT_PNTUPLE_CREATE_VEC_COL(int)
else TOOLS_WROOT_PNTUPLE_CREATE_VEC_COL(float)
else TOOLS_WROOT_PNTUPLE_CREATE_VEC_COL(double)
else if((*it).cls_id()==_cid_std_vector<std::string>()) {\
std::vector<std::string>* user = (std::vector<std::string>*)(*it).user_obj();
char sep = '\n';
@@ -129,9 +129,9 @@ public:
}
}
}
// no leaf_store_class() defined for the other types.
else {
a_out << "tools::wroot::base_pntuple_row_wise :"
<< " for column " << sout((*it).name())
@@ -141,7 +141,7 @@ public:
safe_clear<icol>(m_cols);
return;
}
#undef TOOLS_WROOT_PNTUPLE_CREATE_COL
#undef TOOLS_WROOT_PNTUPLE_CREATE_VEC_COL
}
@@ -36,29 +36,29 @@ public: //ibo
// Moreover with the today branch code, a
// basket.write_on_file()
// happens only in a branch.fill() that deletes
// the basket just after the call.
// the basket just after the call.
//if(!m_data.length()) {
// // to be sure to not work on a basket already written
// // with write_on_file()
// m_out << "tools::wroot::basket::stream :"
// m_out << "tools::wroot::basket::stream :"
// << " m_data.length() is null."
// << std::endl;
// return false;
//}
if(m_seek_key) {
m_out << "tools::wroot::basket::stream :"
<< " m_seek_key is not null."
m_out << "tools::wroot::basket::stream :"
<< " m_seek_key is not null (" << m_seek_key << ")."
<< std::endl;
return false;
}
if(m_last) {
m_out << "tools::wroot::basket::stream :"
m_out << "tools::wroot::basket::stream :"
<< " m_last is not null."
<< std::endl;
return false;
}
if(!m_entry_offset) {
m_out << "tools::wroot::basket::stream :"
m_out << "tools::wroot::basket::stream :"
<< " m_entry_offset is null."
<< std::endl;
return false;
@@ -82,10 +82,10 @@ public: //ibo
if(!a_buffer.write_array(m_displacement,m_nev)) return false;
}
}
if(m_data.to_displace()) {
if(!const_cast<basket&>(*this).m_data.displace_mapped(m_key_length)) {
m_out << "tools::wroot::basket::stream :"
m_out << "tools::wroot::basket::stream :"
<< " m_data.displace_mapped() failed."
<< std::endl;
return false;
@@ -177,7 +177,7 @@ public:
const int* displacement() const {return m_displacement;}
int* displacement() {return m_displacement;}
uint32 nev_buf_size() const {return m_nev_buf_size;}
uint32 nev() const {return m_nev;}
uint32 last() const {return m_last;}
@@ -186,9 +186,9 @@ public:
m_last = a_last;
m_nev_buf_size = a_nev_buf_size;
m_nev = a_nev;
delete [] m_entry_offset;
delete [] m_entry_offset;
m_entry_offset = 0;
delete [] m_displacement;
delete [] m_displacement;
m_displacement = 0;
if(a_entry_offset && m_nev_buf_size) {
@@ -233,15 +233,15 @@ public:
a_nbytes = 0;
if(m_seek_key) {
m_out << "tools::wroot::basket::write_on_file :"
<< " m_seek_key should be 0."
m_out << "tools::wroot::basket::write_on_file :"
<< " m_seek_key should be 0 (" << m_seek_key << ")."
<< std::endl;
return false;
}
if(m_version>big_file_version_tag()) {
} else {
m_out << "tools::wroot::basket::write_on_file : "
m_out << "tools::wroot::basket::write_on_file : "
<< " we should not pass here (1)."
<< std::endl;
return false;
@@ -251,24 +251,24 @@ public:
// seek_key>START_BIG_FILE. If not doing that we shall
// write a big m_seek_key on a seek32 and then have
// a problem when reading.
//m_out << "tools::wroot::basket::write_on_file : "
//m_out << "tools::wroot::basket::write_on_file : "
// << " WARNING : pos>START_BIG_FILE."
// << std::endl;
m_version += big_file_version_tag();
m_key_length += 8;
if(m_entry_offset) {
for(uint32 i=0;i<m_nev;i++) m_entry_offset[i] += 8;
if(m_displacement) {
//??? Do we have to shift them ?
m_out << "tools::wroot::basket::write_on_file : "
m_out << "tools::wroot::basket::write_on_file : "
<< " displace logic : m_displacement not null."
<< std::endl;
}
}
}
*/
}
@@ -278,19 +278,19 @@ public:
m_last = m_key_length+m_data.length();
if(m_entry_offset) {
if(!m_data.write_array<int>(m_entry_offset,m_nev+1)) { // for the +1 we follow CERN-ROOT/TBasket logic.
delete [] m_entry_offset;
delete [] m_entry_offset;
m_entry_offset = 0;
return false;
}
delete [] m_entry_offset;
delete [] m_entry_offset;
m_entry_offset = 0;
if(m_displacement) {
if(!m_data.write_array<int>(m_displacement,m_nev+1)) {
delete [] m_displacement;
delete [] m_displacement;
m_displacement = 0;
return false;
}
delete [] m_displacement;
delete [] m_displacement;
m_displacement = 0;
}
}
@@ -307,7 +307,7 @@ public:
a_file.compress_buffer(m_data,kbuf,klen,kdelete);
if(klen>m_object_size) {
m_out << "tools::wroot::basket::write_on_file :"
m_out << "tools::wroot::basket::write_on_file :"
<< " compression anomaly "
<< " m_object_size " << m_object_size
<< " klen " << klen
@@ -317,8 +317,8 @@ public:
}
if(!initialize(a_file,klen)) { //it will do a m_seek_key = a_file.END() and then a_file.set_END(...)
m_out << "tools::wroot::basket::write_on_file :"
<< " initialize() failed."
m_out << "tools::wroot::basket::write_on_file :"
<< " initialize() failed."
<< std::endl;
if(kdelete) delete [] kbuf;
return false;
@@ -328,7 +328,7 @@ public:
{buffer bref(m_out,a_file.byte_swap(),256);
if(!_stream_header(bref,a_file.verbose())) return false;
if(bref.length()!=m_key_length) {
m_out << "tools::wroot::basket::write_on_file :"
m_out << "tools::wroot::basket::write_on_file :"
<< " key len anomaly " << bref.length()
<< " m_key_length " << m_key_length
<< std::endl;
@@ -339,10 +339,10 @@ public:
::memcpy(m_buffer+m_key_length,kbuf,klen);
if(kdelete) delete [] kbuf;
uint32 nbytes;
if(!parent::write_file(a_file,nbytes)) return false;
m_data.pos() = m_data.buf(); //empty m_data.
a_nbytes = m_key_length + klen;
@@ -1,48 +0,0 @@
// Copyright (C) 2010, Guy Barrand. All rights reserved.
// See the file tools.license for terms.
#ifndef tools_wroot_basket_add
#define tools_wroot_basket_add
// used in pntuple.
#include "branch"
namespace tools {
namespace wroot {
class basket_add : public virtual branch::iadd_basket {
typedef branch::iadd_basket parent;
public:
virtual bool add_basket(basket& a_basket) {
m_mutex.lock();
uint32 add_bytes,nout;
if(!m_main_branch->add_basket(m_main_file,a_basket,add_bytes,nout)) {
m_mutex.unlock();
return false;
}
m_main_branch->set_tot_bytes(m_main_branch->tot_bytes()+add_bytes);
m_main_branch->set_zip_bytes(m_main_branch->zip_bytes()+nout);
m_mutex.unlock();
return true;
}
public:
basket_add(imutex& a_mutex,ifile& a_main_file)
:m_mutex(a_mutex),m_main_file(a_main_file),m_main_branch(0)
{}
protected:
basket_add(const basket_add& a_from):parent()
,m_mutex(a_from.m_mutex),m_main_file(a_from.m_main_file),m_main_branch(0)
{}
basket_add& operator=(const basket_add&){return *this;}
public:
void set_main_branch(branch* a_main_branch) {m_main_branch = a_main_branch;}
protected:
imutex& m_mutex;
ifile& m_main_file;
branch* m_main_branch;
};
}}
#endif
@@ -89,7 +89,7 @@ public: //ibo
}
}}
//GB : end
if(!a_buffer.write(isBigFile)) return false;
if(isBigFile==2) {
if(!a_buffer.write_fast_array(fBasketSeek,m_max_baskets)) return false;
@@ -120,7 +120,7 @@ public:
:m_out(a_out)
,m_byte_swap(a_byte_swap)
,m_verbose(a_verbose)
,m_seek_directory(a_seek_directory)
,m_seek_directory(a_seek_directory)
,m_name(a_name)
,m_title(a_title)
,fAutoDelete(false)
@@ -175,13 +175,13 @@ protected:
branch(const branch& a_from)
:ibo(a_from)
,m_out(a_from.m_out)
,m_seek_directory(a_from.m_seek_directory)
,m_seek_directory(a_from.m_seek_directory)
{}
branch& operator=(const branch&){return *this;}
public:
const std::string& name() const {return m_name;}
const std::string& title() const {return m_title;}
uint64 entries() const {return m_entries;}
uint64 tot_bytes() const {return m_tot_bytes;}
@@ -211,7 +211,7 @@ public:
////////////////////////////////////////////////
////////////////////////////////////////////////
////////////////////////////////////////////////
template <class T>
leaf<T>* create_leaf(const std::string& a_name){
leaf<T>* lf = new leaf<T>(m_out,a_name);
@@ -243,14 +243,14 @@ public:
const std::vector<base_leaf*>& leaves() const {return m_leaves;}
void reset() {
m_baskets.clear_objs();
m_baskets.clear_objs();
delete [] fBasketBytes;
delete [] fBasketEntry;
delete [] fBasketSeek;
fBasketBytes = 0;
fBasketEntry = 0;
fBasketSeek = 0;
m_max_baskets = 10;
m_write_basket = 0;
@@ -258,7 +258,7 @@ public:
m_entries = 0;
m_tot_bytes = 0;
m_zip_bytes = 0;
m_baskets.resize(m_max_baskets,0);
fBasketBytes = new uint32[m_max_baskets];
fBasketEntry = new uint32[m_max_baskets];
@@ -303,18 +303,18 @@ public:
buf.reset_objs_map();
uint32 lold = buf.length();
bk->update(bk->key_length()+lold);
m_entries++;
m_entry_number++;
if(!fill_leaves(buf)) {
m_out << "tools::wroot::branch::fill :"
<< " fill_leaves() failed."
<< std::endl;
return false;
}
uint32 lnew = buf.length();
uint32 nbytes = lnew - lold;
uint32 nsize = 0;
@@ -324,8 +324,8 @@ public:
// Should we create a new basket?
// Compare expected next size with m_basket_size.
if((lnew+2*nsize+nbytes)>=m_basket_size) {
if(!bk->write_on_file(a_file,m_write_basket,nout)) {//it set bk m_seek_key, set a_file.m_END.
if((lnew+2*nsize+nbytes)>=m_basket_size) {
if(!bk->write_on_file(a_file,m_write_basket,nout)) {//it set bk m_seek_key, set a_file.m_END.
//Does a a_file.set_END().
m_out << "tools::wroot::branch::fill :"
<< " basket.write_on_file() failed."
@@ -431,9 +431,9 @@ public:
}
buffer& buf = bk->datbuf();
uint32 lold = buf.length();
bk->update(bk->key_length()+lold);
//m_entries++; //not used by parallel branches.
@@ -448,7 +448,7 @@ public:
uint32 lnew = buf.length();
uint32 nbytes = lnew - lold;
// Should we create a new basket?
bool store_basket = false;
if(a_nev) {
@@ -471,7 +471,7 @@ public:
m_seek_directory,m_name,m_title,"TBasket",m_basket_size,
main_branch_verbose);
}
return true;
}
@@ -485,7 +485,7 @@ public:
<< std::endl;
return false;
}
buffer& buf = bk->datbuf();
uint32 lold = buf.length();
@@ -499,7 +499,7 @@ public:
} else {
delete bk;
}
m_baskets[m_write_basket] = 0; // no need to recreate a basket since it is end of fill.
return true;
@@ -564,7 +564,7 @@ protected:
seek m_seek_directory;
obj_array<basket> m_baskets;
/// for parallelization :
public:
public:
std::vector<basket*> m_parallel_baskets;
protected:
//Object
@@ -131,7 +131,7 @@ protected:
}
public:
const std::vector<T>& variable() const {return m_ref;}
std::vector<T>& variable() {return const_cast< std::vector<T>& >(m_ref);}
std::vector<T>& variable() {return const_cast< std::vector<T>& >(m_ref);}
protected:
const std::vector<T>& m_ref;
};
@@ -215,7 +215,7 @@ public:
char* opos = m_pos;
m_pos = (char*)(m_buffer+a_pos);
if(m_byte_swap) {
if(!m_wb.write(short(v.vers[1]|kByteCountVMask())))
if(!m_wb.write(short(v.vers[1]|kByteCountVMask())))
{m_pos = opos;return false;}
if(!m_wb.write(v.vers[0])) {m_pos = opos;return false;}
} else {
@@ -254,17 +254,17 @@ public:
if(!expand2(m_size+sizeof(unsigned int))) return false;
}
m_pos += sizeof(unsigned int);
// write class of object first
if(!write_class(a_obj.store_cls())) return false;
// add to map before writing rest of object (to handle self reference)
// (+kMapOffset so it's != kNullTag)
m_objs[(ibo*)&a_obj] = cntpos + kMapOffset();
// let the object write itself :
if(!a_obj.stream(*this)) return false;
// write byte count
if(!set_byte_count_obj(cntpos)) return false;
}
@@ -311,7 +311,7 @@ public:
unsigned int clIdx = id+a_num;
if(!write(uint32(clIdx|kClassMask()))) {m_pos = opos;return false;}
}}
//m_out << "tools::wroot::buffer::displace_mapped :"
// << " obj num " << m_obj_mapped.size()
// << std::endl;
@@ -327,7 +327,7 @@ public:
unsigned int objIdx = id+a_num;
if(!write(objIdx)) {m_pos = opos;return false;}
}}
m_pos = opos;
return true;
}
@@ -41,7 +41,7 @@ public:
#endif
}
protected:
bufobj(const bufobj& a_from): iobject(a_from),buffer(a_from){
bufobj(const bufobj& a_from): iobject(a_from),buffer(a_from){
#ifdef TOOLS_MEM
mem::increment(s_class().c_str());
#endif
@@ -55,7 +55,7 @@
}
public:
const T& variable() const {return m_leaf->variable();}
T& variable() {return m_leaf->variable();}
T& variable() {return m_leaf->variable();}
protected:
branch& m_branch;
leaf_ref<T>* m_leaf;
@@ -169,7 +169,7 @@
}
public:
const std::string& variable() const {return m_leaf->variable();}
std::string& variable() {return m_leaf->variable();}
std::string& variable() {return m_leaf->variable();}
protected:
branch& m_branch;
leaf_string_ref* m_leaf;
@@ -284,7 +284,7 @@
}
public:
const std::vector<std::string>& variable() const {return m_ref;}
std::vector<std::string>& variable() {return const_cast< std::vector<std::string>& >(m_ref);}
std::vector<std::string>& variable() {return const_cast< std::vector<std::string>& >(m_ref);}
protected:
const std::vector<std::string>& m_ref;
char m_sep;
@@ -412,7 +412,7 @@
}
public:
const std::vector<T>& variable() const {return m_ref;}
std::vector<T>& variable() {return const_cast< std::vector<T>& >(m_ref);}
std::vector<T>& variable() {return const_cast< std::vector<T>& >(m_ref);}
protected:
branch& m_branch;
const std::vector<T>& m_ref;
@@ -36,7 +36,7 @@ public: //idir
virtual void append_object(iobject* a_object) {m_objs.push_back(a_object);} //take ownership of a_object
public:
directory(ifile& a_file)
:m_file(a_file)
:m_file(a_file)
,m_parent(0)
,m_is_valid(false)
,m_date_C(0)
@@ -52,7 +52,7 @@ public:
#endif
}
directory(ifile& a_file,const std::string& a_name,const std::string& a_title)
:m_file(a_file)
:m_file(a_file)
,m_parent(0)
,m_is_valid(false)
,m_name(a_name)
@@ -89,7 +89,7 @@ public:
directory* a_parent, //assume a_parent not nul.
const std::string& a_name,
const std::string& a_title)
:m_file(a_file)
:m_file(a_file)
,m_parent(a_parent)
,m_is_valid(false)
,m_name(a_name)
@@ -116,7 +116,7 @@ public:
m_file.out() << "tools::wroot::directory::directory :"
<< " directory name " << sout(m_name)
<< " cannot contain a slash."
<< std::endl;
<< std::endl;
return; //FIXME : throw
}
@@ -160,7 +160,7 @@ public:
<< " key.write_self() failed."
<< std::endl;
return; //FIXME : throw
}
}
uint32 n;
if(!key->write_file(m_file,n)) {
m_file.out() << "tools::wroot::directory::directory :"
@@ -168,7 +168,7 @@ public:
<< " cannot write key to file."
<< std::endl;
return; //FIXME : throw
}
}
m_is_valid = true;
}
@@ -202,13 +202,13 @@ public:
// Create a sub-directory and return a pointer to the created directory.
// Note that the directory name cannot contain slashes.
if(a_name.empty()) {
m_file.out() << "tools::wroot::directory::mkdir :"
<< " directory name cannot be \"\"."
m_file.out() << "tools::wroot::directory::mkdir :"
<< " directory name cannot be \"\"."
<< std::endl;
return 0;
}
if(a_name.find('/')!=std::string::npos) {
m_file.out() << "tools::wroot::directory::mkdir :"
m_file.out() << "tools::wroot::directory::mkdir :"
<< " " << sout(a_name)
<< " cannot contain a slash."
<< std::endl;
@@ -216,7 +216,7 @@ public:
}
directory* dir = new directory(m_file,this,a_name,a_title.empty()?a_name:a_title);
if(!dir->is_valid()) {
m_file.out() << "tools::wroot::directory::mkdir :"
m_file.out() << "tools::wroot::directory::mkdir :"
<< " directory badly created."
<< std::endl;
delete dir;
@@ -267,8 +267,8 @@ public:
if(m_file.verbose()) {
m_file.out() << "tools::wroot::key::to_buffer :"
<< " nbytes keys : " << m_nbytes_keys
<< ", pos keys : " << m_seek_keys
<< " nbytes keys : " << m_nbytes_keys
<< ", pos keys : " << m_seek_keys
<< std::endl;
}
return true;
@@ -318,7 +318,7 @@ public:
<< std::endl;
return false; //it will write keys of objects.
}
a_nbytes = nbytes;
return true;
}
@@ -365,7 +365,7 @@ protected:
key* find_key(const std::string& a_name) {
if(m_file.verbose()) {
m_file.out() << "tools::wroot::directory::find_key :"
m_file.out() << "tools::wroot::directory::find_key :"
<< " " << sout(a_name) << " ..."
<< std::endl;
}
@@ -417,12 +417,12 @@ protected:
{tools_lforit(key*,m_keys,it) {
if(!((*it)->to_buffer(wb,m_file.verbose()))) return false;
}}}
m_seek_keys = headerkey.seek_key();
m_nbytes_keys = headerkey.number_of_bytes();
if(m_file.verbose()) {
m_file.out() << "tools::wroot::directory::write_keys :"
m_file.out() << "tools::wroot::directory::write_keys :"
<< " write header key"
<< " " << sout(m_name)
<< " " << sout(m_title)
@@ -436,11 +436,11 @@ protected:
headerkey.set_cycle(1);
if(!headerkey.write_self(m_file)) {
m_file.out() << "tools::wroot::directory::write_keys :"
m_file.out() << "tools::wroot::directory::write_keys :"
<< " key.write_self() failed."
<< std::endl;
return false;
}
}
uint32 n;
return headerkey.write_file(m_file,n);
@@ -458,7 +458,7 @@ protected:
return false;
}
// do not overwrite the name/title part
seek pointer = m_seek_directory + m_nbytes_name;
seek pointer = m_seek_directory + m_nbytes_name;
//fModified = false;
if(!m_file.set_pos(pointer)) {
delete [] header;
@@ -479,9 +479,9 @@ protected:
bool write_object(iobject& a_obj,uint32& a_nbytes){
buffer bref(m_file.out(),m_file.byte_swap(),256*128); //32768
if(!a_obj.stream(bref)) {
m_file.out() << "tools::wroot::directory::write_object :"
m_file.out() << "tools::wroot::directory::write_object :"
<< " cannot stream object of store class name "
<< " " << sout(a_obj.store_class_name()) << "."
<< " " << sout(a_obj.store_class_name()) << "."
<< std::endl;
a_nbytes = 0;
return false;
@@ -521,22 +521,22 @@ protected:
uint16 cycle = append_key(key);
key->set_cycle(cycle);
if(!key->write_self(m_file)) {
m_file.out() << "tools::wroot::directory::write_object :"
m_file.out() << "tools::wroot::directory::write_object :"
<< " key.write_self() failed."
<< std::endl;
return false;
}
}
//FIXME m_file.sumBuffer(key->object_size()); //uncompressed data size.
if(m_file.verbose()) {
m_file.out() << "tools::wroot::directory::_write_buffer :"
m_file.out() << "tools::wroot::directory::_write_buffer :"
<< " " << sout(a_obj.name()) << "."
<< std::endl;
}
return key->write_file(m_file,a_nbytes);
}
@@ -149,7 +149,7 @@ public:
}
protected: //Named
std::string fName;
std::string fTitle;
std::string fTitle;
protected:
int fType; //element type
int fSize; //sizeof element
@@ -226,7 +226,7 @@ public:
streamer_basic_type(const streamer_basic_type& a_from)
:ibo(a_from),streamer_element(a_from)
{}
streamer_basic_type& operator=(const streamer_basic_type& a_from){
streamer_basic_type& operator=(const streamer_basic_type& a_from){
streamer_element::operator=(a_from);
return *this;
}
@@ -438,7 +438,7 @@ public:
streamer_string(const streamer_string& a_from):ibo(a_from),streamer_element(a_from){}
streamer_string& operator=(const streamer_string& a_from){streamer_element::operator=(a_from);return *this;}
};
class streamer_object : public streamer_element {
public: //ibo
@@ -14,7 +14,7 @@
#include "../platform"
#include "../path"
#include <map>
#include <fcntl.h>
@@ -68,7 +68,7 @@ public: //ifile
if (::lseek(m_file, a_offset, whence) < 0) {
#endif
m_out << "tools::wroot::file::set_pos :"
<< " cannot set position " << a_offset
<< " cannot set position " << a_offset
<< " in file " << sout(m_path) << "."
<< std::endl;
return false;
@@ -103,7 +103,7 @@ public: //ifile
typedef int ssize_t;
#endif
ssize_t siz;
while ((siz = ::write(m_file,a_buffer,a_length)) < 0 &&
while ((siz = ::write(m_file,a_buffer,a_length)) < 0 &&
error_number() == EINTR) reset_error_number();
if(siz < 0) {
@@ -128,9 +128,9 @@ public: //ifile
static const uint32 ROOT_MAJOR_VERSION = 4;
static const uint32 ROOT_MINOR_VERSION = 0;
static const uint32 ROOT_PATCH_VERSION = 0;
return
10000 * ROOT_MAJOR_VERSION +
100 * ROOT_MINOR_VERSION +
return
10000 * ROOT_MAJOR_VERSION +
100 * ROOT_MINOR_VERSION +
ROOT_PATCH_VERSION;
}
@@ -151,7 +151,7 @@ public: //ifile
<< " error in fsync() for file " << sout(m_path) << "."
<< std::endl;
return false;
}
}
#endif
return true;
}
@@ -178,7 +178,7 @@ public: //ifile
if(cxlevel && (nbytes>256)) {
compress_func func;
if(!ziper('Z',func)) {
//m_out << "tools::wroot::directory::write_object :"
//m_out << "tools::wroot::directory::write_object :"
// << " zlib ziper not found."
// << std::endl;
a_kbuf = (char*)a_buffer.buf();
@@ -188,7 +188,7 @@ public: //ifile
const uint32 kMAXBUF = 0xffffff;
const uint32 HDRSIZE = 9;
uint32 nbuffers = nbytes/kMAXBUF;
uint32 buflen = nbytes+HDRSIZE*(nbuffers+1);
uint32 buflen = nbytes+HDRSIZE*(nbuffers+1);
a_kbuf = new char[buflen];
a_kdel = true;
char* src = (char*)a_buffer.buf();
@@ -208,7 +208,7 @@ public: //ifile
a_klen += nout;
src += kMAXBUF;
nzip += kMAXBUF;
}
}
//::printf("debug : compress : end : %u %u\n",nbytes,klen);
}
} else {
@@ -274,14 +274,14 @@ public:
m_free_segs.push_back(new free_seg(m_out,m_BEGIN,START_BIG_FILE()));
// Write Directory info :
uint32 namelen =
key::std_string_record_size(m_path) +
uint32 namelen =
key::std_string_record_size(m_path) +
key::std_string_record_size(m_title);
uint32 nbytes = namelen + m_root_directory.record_size();
wroot::key key(m_out,*this,0,m_path,m_title,"TFile",nbytes); // It does a (*this).set_END().
// m_nbytes_name = start point of directory info from key head.
m_nbytes_name = key.key_length() + namelen;
m_nbytes_name = key.key_length() + namelen;
m_root_directory.set_nbytes_name(m_nbytes_name);
m_root_directory.set_seek_directory(key.seek_key()); //at EOF.
@@ -302,15 +302,15 @@ public:
if(m_verbose) {
m_out << "tools::wroot::file::file :"
<< " write key ("
<< namelen
<< ", "
<< namelen
<< ", "
<< m_root_directory.record_size()
<< ", "
<< ", "
<< nbytes
<< ", "
<< m_nbytes_name
<< ", "
<< key.seek_key()
<< key.seek_key()
<< ")."
<< std::endl;
}
@@ -346,7 +346,7 @@ protected:
:ifile(a_from)
,m_out(a_from.m_out)
,m_root_directory(get_me())
{
{
#ifdef TOOLS_MEM
mem::increment(s_class().c_str());
#endif
@@ -475,7 +475,7 @@ protected:
// false in case of failure.
struct stat finfo;
if (::stat(a_path.c_str(),&finfo) < 0) return false;
#ifdef _MSC_VER
#ifdef _MSC_VER
if (finfo.st_mode & S_IFDIR)
return (::_rmdir(a_path.c_str())==-1 ? false : true);
else
@@ -549,7 +549,7 @@ protected:
buffer bref(m_out,byte_swap(),256);
if(!sinfos.stream(bref)) {
m_out << "tools::wroot::file::write_streamer_infos :"
m_out << "tools::wroot::file::write_streamer_infos :"
<< " cannot stream obj_list<streamer_info>."
<< std::endl;
return false;
@@ -569,7 +569,7 @@ protected:
//key.set_cycle(1);
if(!key.write_self(*this)) {
m_out << "tools::wroot::file::write_streamer_infos :"
m_out << "tools::wroot::file::write_streamer_infos :"
<< " key.write_self() failed."
<< std::endl;
return false;
@@ -597,7 +597,7 @@ protected:
// GAPSIZE = -(Number of bytes occupied by the record).
if(m_free_segs.empty()) {
m_out << "tools::wroot::file::make_free_seg :"
m_out << "tools::wroot::file::make_free_seg :"
<< " free_seg list should not be empty here."
<< std::endl;
return false;
@@ -605,12 +605,12 @@ protected:
free_seg* newfree = add_free(m_free_segs,a_first,a_last);
if(!newfree) {
m_out << "tools::wroot::file::make_free_seg :"
m_out << "tools::wroot::file::make_free_seg :"
<< " add_free failed."
<< std::endl;
return false;
}
seek nfirst = newfree->first();
seek nlast = newfree->last();
@@ -640,7 +640,7 @@ protected:
// Delete old record if it exists :
if(m_seek_free){
if(!make_free_seg(m_seek_free, m_seek_free + m_nbytes_free -1)) {
m_out << "tools::wroot::file::write_free_segments :"
m_out << "tools::wroot::file::write_free_segments :"
<< " key.write_self() failed."
<< std::endl;
return false;
@@ -671,7 +671,7 @@ protected:
//key.set_cycle(1);
if(!key.write_self(*this)) {
m_out << "tools::wroot::file::write_free_segments :"
m_out << "tools::wroot::file::write_free_segments :"
<< " key.write_self() failed."
<< std::endl;
return false;
@@ -706,14 +706,14 @@ protected:
a_out << "tools::wroot::directory::zip :"
<< " target buffer too small."
<< std::endl;
a_irep = 0;
a_irep = 0;
return false;
}
if(a_srcsize>0xffffff) {
a_out << "tools::wroot::directory::zip :"
<< " source buffer too big."
<< std::endl;
a_irep = 0;
a_irep = 0;
return false;
}
@@ -725,14 +725,14 @@ protected:
a_out << "tools::wroot::directory::zip :"
<< " zipper failed."
<< std::endl;
a_irep = 0;
a_irep = 0;
return false;
}
if((HDRSIZE+out_size)>a_tgtsize) {
a_out << "tools::wroot::directory::zip :"
<< " target buffer overflow."
<< std::endl;
a_irep = 0;
a_irep = 0;
return false;
}
@@ -740,11 +740,11 @@ protected:
a_tgt[0] = 'Z'; // Signature ZLib
a_tgt[1] = 'L';
a_tgt[2] = 8; //DEFLATE
a_tgt[3] = (char)(out_size & 0xff);
a_tgt[4] = (char)((out_size >> 8) & 0xff);
a_tgt[5] = (char)((out_size >> 16) & 0xff);
a_tgt[6] = (char)(a_srcsize & 0xff);
a_tgt[7] = (char)((a_srcsize >> 8) & 0xff);
a_tgt[8] = (char)((a_srcsize >> 16) & 0xff);
@@ -45,7 +45,7 @@ public: //ibo
}
public:
virtual void out(std::ostream& a_out) const {
a_out << "streamer_info for class :"
a_out << "streamer_info for class :"
<< " " << fName << ", version=" << fStreamedClassVersion
<< std::endl;
tools_vforcit(streamer_element*,fElements,it) (*it)->out(a_out);
@@ -86,7 +86,7 @@ protected:
fStreamedClassVersion = a_from.fStreamedClassVersion;
fElements = a_from.fElements;
return *this;
}
}
public:
void add(streamer_element* a_elem){fElements.push_back(a_elem);}
protected: //Named
@@ -73,7 +73,7 @@ inline void fill_infos_core(obj_list<streamer_info>& a_infos,std::ostream& a_out
}}
short TNamed_version = 1;
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TNamed");
//base :
@@ -98,7 +98,7 @@ inline void fill_infos_core(obj_list<streamer_info>& a_infos,std::ostream& a_out
<< std::endl;
}}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TStreamerInfo");
//bases :
@@ -126,7 +126,7 @@ inline void fill_infos_core(obj_list<streamer_info>& a_infos,std::ostream& a_out
}
short TStreamerElement_version = 2;
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TStreamerElement");
//bases :
@@ -169,7 +169,7 @@ inline void fill_infos_core(obj_list<streamer_info>& a_infos,std::ostream& a_out
info->add(new streamer_string("fTypeName","Data type name of data member",72));}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TStreamerBase");
//bases :
@@ -185,7 +185,7 @@ inline void fill_infos_core(obj_list<streamer_info>& a_infos,std::ostream& a_out
info->add(new streamer_base("TStreamerElement","base class for one element (data member) to be Streamed",0,TStreamerElement_version));
info->add(new streamer_int("fBaseVersion","version number of the base class",88));}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TStreamerString");
//bases :
@@ -197,7 +197,7 @@ inline void fill_infos_core(obj_list<streamer_info>& a_infos,std::ostream& a_out
// Elements :
info->add(new streamer_base("TStreamerElement","base class for one element (data member) to be Streamed",0,TStreamerElement_version));}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TStreamerBasicType");
//bases :
@@ -209,7 +209,7 @@ inline void fill_infos_core(obj_list<streamer_info>& a_infos,std::ostream& a_out
// Elements :
info->add(new streamer_base("TStreamerElement","base class for one element (data member) to be Streamed",0,TStreamerElement_version));}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TStreamerBasicPointer");
//bases :
@@ -233,7 +233,7 @@ inline void fill_infos_core(obj_list<streamer_info>& a_infos,std::ostream& a_out
info->add(new streamer_string("fCountName","name of data member holding the array count",92));
info->add(new streamer_string("fCountClass","name of the class with the counter",100));}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TStreamerObject");
//bases :
@@ -245,7 +245,7 @@ inline void fill_infos_core(obj_list<streamer_info>& a_infos,std::ostream& a_out
// Elements :
info->add(new streamer_base("TStreamerElement","base class for one element (data member) to be Streamed",0,TStreamerElement_version));}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TStreamerObjectPointer");
//bases :
@@ -257,7 +257,7 @@ inline void fill_infos_core(obj_list<streamer_info>& a_infos,std::ostream& a_out
// Elements :
info->add(new streamer_base("TStreamerElement","base class for one element (data member) to be Streamed",0,TStreamerElement_version));}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TStreamerObjectAny");
//bases :
@@ -269,7 +269,7 @@ inline void fill_infos_core(obj_list<streamer_info>& a_infos,std::ostream& a_out
// Elements :
info->add(new streamer_base("TStreamerElement","base class for one element (data member) to be Streamed",0,TStreamerElement_version));}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TArray");
//members :
@@ -286,7 +286,7 @@ inline void fill_infos_core(obj_list<streamer_info>& a_infos,std::ostream& a_out
//size_TArray = ofs; //8
}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TArrayI");
//base :
@@ -306,7 +306,7 @@ inline void fill_infos_core(obj_list<streamer_info>& a_infos,std::ostream& a_out
//12
}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TArrayD");
//base :
@@ -326,7 +326,7 @@ inline void fill_infos_core(obj_list<streamer_info>& a_infos,std::ostream& a_out
//12
}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TArrayF");
//base :
@@ -449,7 +449,7 @@ inline void fill_infos_graf(obj_list<streamer_info>& a_infos,std::ostream& a_out
const int size_SHORT = 2;
const int size_FLOAT = 4;
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TAttLine");
//members :
@@ -479,7 +479,7 @@ inline void fill_infos_graf(obj_list<streamer_info>& a_infos,std::ostream& a_out
<< std::endl;
}}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TAttFill");
//members :
@@ -502,7 +502,7 @@ inline void fill_infos_graf(obj_list<streamer_info>& a_infos,std::ostream& a_out
<< std::endl;
}}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TAttMarker");
//members :
@@ -555,7 +555,7 @@ inline void fill_infos_tree(obj_list<streamer_info>& a_infos,std::ostream& a_out
short TBranch_version = 8;
short TLeaf_version = 2;
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TTree");
//bases :
@@ -663,7 +663,7 @@ inline void fill_infos_tree(obj_list<streamer_info>& a_infos,std::ostream& a_out
}
//---------------------------------------------------------------------
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TBranch");
//bases :
@@ -751,7 +751,7 @@ inline void fill_infos_tree(obj_list<streamer_info>& a_infos,std::ostream& a_out
info->add(new streamer_object("fBaskets","-> List of baskets of this branch",ofs,"TObjArray"));ofs += size_TObjArray;
ofs += size_INT; //!fNBasketRAM
ofs += size_POINTER; //!*fBasketRAM
info->add(new streamer_basic_pointer("fBasketBytes","[fMaxBaskets] Lenght of baskets on file",ofs,streamer__info::INT,"fMaxBaskets","TBranch",6,"Int_t*"));ofs += size_POINTER;
info->add(new streamer_basic_pointer("fBasketBytes","[fMaxBaskets] Length of baskets on file",ofs,streamer__info::INT,"fMaxBaskets","TBranch",6,"Int_t*"));ofs += size_POINTER;
info->add(new streamer_basic_pointer("fBasketEntry","[fMaxBaskets] Table of first entry in eack basket",ofs,streamer__info::INT,"fMaxBaskets","TBranch",6,"Int_t*"));ofs += size_POINTER;
info->add(new streamer_basic_pointer("fBasketSeek","[fMaxBaskets] Addresses of baskets on file",ofs,streamer__info::INT,"fMaxBaskets","TBranch",6,"Seek_t*"));ofs += size_POINTER;
ofs += size_POINTER; //!*fTree
@@ -764,7 +764,7 @@ inline void fill_infos_tree(obj_list<streamer_info>& a_infos,std::ostream& a_out
<< std::endl;
}}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TBranchObject");
//bases :
@@ -784,7 +784,7 @@ inline void fill_infos_tree(obj_list<streamer_info>& a_infos,std::ostream& a_out
}
//---------------------------------------------------------------------
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TBranchElement");
//bases :
@@ -818,7 +818,7 @@ inline void fill_infos_tree(obj_list<streamer_info>& a_infos,std::ostream& a_out
}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TLeaf");
//bases :
@@ -864,7 +864,7 @@ inline void fill_infos_tree(obj_list<streamer_info>& a_infos,std::ostream& a_out
<< std::endl;
}}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TLeafS");
//bases :
@@ -888,7 +888,7 @@ inline void fill_infos_tree(obj_list<streamer_info>& a_infos,std::ostream& a_out
}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TLeafI");
//bases :
@@ -913,7 +913,7 @@ inline void fill_infos_tree(obj_list<streamer_info>& a_infos,std::ostream& a_out
//size_TLeafI = ofs;
}
{unsigned int check = 0;
{unsigned int check = 0;
//name :
scs(check,"TLeafF");
//bases :
@@ -938,7 +938,7 @@ inline void fill_infos_tree(obj_list<streamer_info>& a_infos,std::ostream& a_out
//size_TLeafF = ofs;
}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TLeafD");
//bases :
@@ -960,10 +960,10 @@ inline void fill_infos_tree(obj_list<streamer_info>& a_infos,std::ostream& a_out
info->add(new streamer_base("TLeaf","Leaf: description of a Branch data type",ofs,TLeaf_version));ofs += size_TLeaf();
info->add(new streamer_double(ofs,"fMinimum","Minimum value if leaf range is specified"));
info->add(new streamer_double(ofs,"fMaximum","Maximum value if leaf range is specified"));
}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TLeafB");
//bases :
@@ -984,10 +984,10 @@ inline void fill_infos_tree(obj_list<streamer_info>& a_infos,std::ostream& a_out
info->add(new streamer_base("TLeaf","Leaf: description of a Branch data type",ofs,TLeaf_version));ofs += size_TLeaf();
info->add(new streamer_basic_type("fMinimum","Minimum value if leaf range is specified",ofs,streamer__info::CHAR,"Char_t"));ofs += size_CHAR;
info->add(new streamer_basic_type("fMaximum","Maximum value if leaf range is specified",ofs,streamer__info::CHAR,"Char_t"));ofs += size_CHAR;
}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TLeafC");
//bases :
@@ -1010,7 +1010,7 @@ inline void fill_infos_tree(obj_list<streamer_info>& a_infos,std::ostream& a_out
info->add(new streamer_int(ofs,"fMinimum","Minimum value if leaf range is specified"));
info->add(new streamer_int(ofs,"fMaximum","Maximum value if leaf range is specified"));}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TLeafObject");
//bases :
@@ -1029,7 +1029,7 @@ inline void fill_infos_tree(obj_list<streamer_info>& a_infos,std::ostream& a_out
info->add(new streamer_base("TLeaf","Leaf: description of a Branch data type",ofs,TLeaf_version));ofs += size_TLeaf();
info->add(new streamer_bool(ofs,"fVirtual","Support for Virtuality"));}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TLeafElement");
//bases :
@@ -1086,7 +1086,7 @@ inline void fill_infos_histo(obj_list<streamer_info>& a_infos,std::ostream& a_ou
short TAttAxis_version = 4;
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TAttAxis");
//members :
@@ -1145,7 +1145,7 @@ inline void fill_infos_histo(obj_list<streamer_info>& a_infos,std::ostream& a_ou
<< std::endl;
}}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TAxis");
//bases :
@@ -1166,7 +1166,7 @@ inline void fill_infos_histo(obj_list<streamer_info>& a_infos,std::ostream& a_ou
scs(check,"fFirst");
scs(check,"Int_t");
scs(check,"fLast");
scs(check,"Int_t");
@@ -1201,7 +1201,7 @@ inline void fill_infos_histo(obj_list<streamer_info>& a_infos,std::ostream& a_ou
}}
short TH1_version = 3;
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TH1");
//bases :
@@ -1295,7 +1295,7 @@ inline void fill_infos_histo(obj_list<streamer_info>& a_infos,std::ostream& a_ou
<< std::endl;
}}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TH1F");
//base :
@@ -1311,7 +1311,7 @@ inline void fill_infos_histo(obj_list<streamer_info>& a_infos,std::ostream& a_ou
int size_TH1D = 0;
short TH1D_version = 1;
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TH1D");
//base :
@@ -1328,7 +1328,7 @@ inline void fill_infos_histo(obj_list<streamer_info>& a_infos,std::ostream& a_ou
//v3-05-07 : 588 = 576 + 12 = ok
}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TProfile");
//base :
@@ -1369,7 +1369,7 @@ inline void fill_infos_histo(obj_list<streamer_info>& a_infos,std::ostream& a_ou
}
short TH2_version = 3;
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TH2");
//bases :
@@ -1403,7 +1403,7 @@ inline void fill_infos_histo(obj_list<streamer_info>& a_infos,std::ostream& a_ou
<< std::endl;
}}
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TH2F");
//base :
@@ -1421,7 +1421,7 @@ inline void fill_infos_histo(obj_list<streamer_info>& a_infos,std::ostream& a_ou
}
short TH2D_version = 3;
{unsigned int check = 0;
{unsigned int check = 0;
//this :
scs(check,"TH2D");
//base :
@@ -214,7 +214,7 @@ public:
<< ", object name : " << sout(m_object_name)
<< ", object title : " << sout(m_object_title)
<< ", object size : " << m_object_size
<< "."
<< "."
<< std::endl;
}
return true;
@@ -94,7 +94,7 @@ public:
void set_max(const T& a_value) {m_max = a_value;}
public:
const T& variable() const {return m_ref;}
T& variable() {return const_cast<T&>(m_ref);}
T& variable() {return const_cast<T&>(m_ref);}
protected:
T m_min; //Minimum value if leaf range is specified
T m_max; //Maximum value if leaf range is specified
@@ -178,7 +178,7 @@ public:
void set_max(int a_value) {m_max = a_value;}
public:
const std::string& variable() const {return m_ref;}
std::string& variable() {return const_cast<std::string&>(m_ref);}
std::string& variable() {return const_cast<std::string&>(m_ref);}
protected:
int m_min; //Minimum value if leaf range is specified
int m_max; //Maximum value if leaf range is specified
@@ -251,12 +251,12 @@ public:
protected:
leaf_std_vector_ref(const leaf_std_vector_ref& a_from):ibo(a_from),parent(a_from),m_ref(a_from.m_ref){}
leaf_std_vector_ref& operator=(const leaf_std_vector_ref&){return *this;}
public:
public:
T get_max() const {return m_max;}
void set_max(const T& a_value) {m_max = a_value;}
public:
const std::vector<T>& variable() const {return m_ref;}
std::vector<T>& variable() {return const_cast< std::vector<T>& >(m_ref);}
std::vector<T>& variable() {return const_cast< std::vector<T>& >(m_ref);}
protected:
T m_min; //Minimum value if leaf range is specified
T m_max; //Maximum value if leaf range is specified
@@ -48,7 +48,7 @@ public:
size_t number = a_v.size();
std::vector<unsigned char> data(number);
for(size_t index=0;index<number;index++) {
data[index] = (unsigned char)a_v[index];
data[index] = (unsigned char)a_v[index];
}
return m_buf.write_array<unsigned char>(data);
}
@@ -78,11 +78,11 @@ public:
return m_buf.write_array2(a_v);
}
virtual bool visit(const std::string&,const istorable& a_v){
virtual bool visit(const std::string&,const istorable& a_v){
// WARNING : can't be called in a object.visit()
// over a a_v being a "super" of "object" .
if(!a_v.visit(*this)) return false;
return true;
return true;
}
public:
member_writer(buffer& a_buf):m_buf(a_buf){}
@@ -10,13 +10,13 @@
namespace tools {
namespace wroot {
inline basket* mpi_create_basket(std::ostream& a_out,impi& a_mpi,bool a_byte_swap,seek a_seek_directory,uint32 a_basket_size) {
inline basket* mpi_create_basket(std::ostream& a_out,impi& a_mpi,bool a_byte_swap,seek a_seek_directory,uint32 a_basket_size) {
std::string oname;
if(!a_mpi.sunpack(oname)) return 0;
std::string otitle;
if(!a_mpi.sunpack(otitle)) return 0;
uint32 last,nev_buf_size,nev;
uint32 last,nev_buf_size,nev;
if(!a_mpi.unpack(last)) return 0;
if(!a_mpi.unpack(nev_buf_size)) return 0;
if(!a_mpi.unpack(nev)) return 0;
@@ -27,7 +27,7 @@ inline basket* mpi_create_basket(std::ostream& a_out,impi& a_mpi,bool a_byte_swa
if(not_null) {
uint32 n;
if(!a_mpi.unpack(n,entry_offset)) return 0;
}}
}}
int* displacement = 0;
{bool not_null;
@@ -35,7 +35,7 @@ inline basket* mpi_create_basket(std::ostream& a_out,impi& a_mpi,bool a_byte_swa
if(not_null) {
uint32 n;
if(!a_mpi.unpack(n,displacement)) {delete [] entry_offset;return 0;}
}}
}}
uint32 _size;
char* _buffer;
@@ -18,7 +18,7 @@ namespace wroot {
class mpi_ntuple_column_wise : public base_pntuple_column_wise, public virtual impi_ntuple {
typedef base_pntuple_column_wise parent;
protected:
protected:
class basket_add : public mpi_basket_add {
typedef mpi_basket_add parent;
public:
@@ -57,7 +57,7 @@ protected:
}
protected:
branch& m_parallel_branch;
std::vector<icol*>& m_cols;
std::vector<icol*>& m_cols;
bool m_row_mode;
};
@@ -76,7 +76,7 @@ public:
tools_vforit(icol*,m_cols,it) (*it)->set_def();
return true;
}
virtual bool end_fill(impi& a_mpi,int a_dest,int a_tag) {
uint32 _icol = 0;
tools_vforit(icol*,m_cols,it) {
@@ -93,7 +93,7 @@ public:
}
if(!status) return false;
}
a_mpi.pack_reset();
if(!a_mpi.pack(mpi_protocol_end_fill())) return false;
if(!a_mpi.pack(m_id)) return false;
@@ -102,7 +102,7 @@ public:
return true;
}
public:
mpi_ntuple_column_wise(uint32 a_id,std::ostream& a_out,
bool a_byte_swap,uint32 a_compression,seek a_seek_directory,
@@ -160,7 +160,7 @@ protected:
a_mpi.pack_reset();
if(!a_mpi.pack(mpi_protocol_baskets())) return false;
if(!a_mpi.pack(a_id)) return false;
bool status = true;
uint32 _icol = 0;
tools_vforit(icol*,a_cols,it) {
@@ -174,10 +174,10 @@ protected:
_icol++;
}
if(!status) return false;
return a_mpi.send_buffer(a_dest,a_tag);
}
static bool flush_remaining_baskets(size_t& a_number,impi& a_mpi,int a_dest,int a_tag,uint32 a_id,std::vector<icol*>& a_cols) {
a_number = 0;
while(ready_to_flush_baskets(a_cols)) {
@@ -194,16 +194,16 @@ protected:
}}
return true;
}
protected:
protected:
bool end_leaves(impi& a_mpi) const {
#include "MPI_SET_MAX.icc"
tools_vforcit(icol*,m_cols,pit) {
base_leaf* _pleaf = (*pit)->get_leaf();
bool set_done = false;
TOOLS_WROOT_MPI_NTUPLE_LEAF_STRING_SET_LENGTH_MAX
if(!set_done) {
if(!a_mpi.pack((uint32)0)) return false;
if(!a_mpi.pack((int)0)) return false;
@@ -27,10 +27,10 @@ public:
tools_vforit(icol*,m_cols,it) (*it)->set_def();
return true;
}
virtual bool end_fill(impi& a_mpi,int a_dest,int a_tag) {
mpi_basket_add _badd(a_mpi,a_dest,a_tag,m_id,0);
if(!m_row_wise_branch.end_pfill(_badd)) return false;
if(!m_row_wise_branch.end_pfill(_badd)) return false;
a_mpi.pack_reset();
if(!a_mpi.pack(mpi_protocol_end_fill())) return false;
@@ -40,7 +40,7 @@ public:
return true;
}
public:
mpi_ntuple_row_wise(uint32 a_id,std::ostream& a_out,
bool a_byte_swap,uint32 a_compression,seek a_seek_directory,
@@ -63,20 +63,20 @@ protected:
mpi_ntuple_row_wise& operator=(const mpi_ntuple_row_wise& a_from){parent::operator=(a_from);return *this;}
protected:
bool end_leaves(impi& a_mpi) const {
#include "MPI_SET_MAX.icc"
tools_vforcit(base_leaf*,m_row_wise_branch.leaves(),pit) {
base_leaf* _pleaf = *pit;
bool set_done = false;
TOOLS_WROOT_MPI_NTUPLE_LEAF_SET_LENGTH_MAX(char)
TOOLS_WROOT_MPI_NTUPLE_LEAF_SET_LENGTH_MAX(short)
TOOLS_WROOT_MPI_NTUPLE_LEAF_SET_LENGTH_MAX(int)
TOOLS_WROOT_MPI_NTUPLE_LEAF_SET_LENGTH_MAX(float)
TOOLS_WROOT_MPI_NTUPLE_LEAF_SET_LENGTH_MAX(double)
TOOLS_WROOT_MPI_NTUPLE_LEAF_STD_VECTOR_SET_LENGTH_MAX(char)
TOOLS_WROOT_MPI_NTUPLE_LEAF_STD_VECTOR_SET_LENGTH_MAX(short)
TOOLS_WROOT_MPI_NTUPLE_LEAF_STD_VECTOR_SET_LENGTH_MAX(int)
@@ -91,7 +91,7 @@ protected:
return false;
}
}
#undef TOOLS_WROOT_MPI_NTUPLE_SET_MAX
#undef TOOLS_WROOT_MPI_NTUPLE_STRING_SET_MAX
@@ -13,28 +13,28 @@ namespace wroot {
inline bool mpi_pack_basket(impi& a_mpi,uint32 a_icol,const basket& a_basket) {
if(!a_mpi.pack(a_icol)) return false;
if(!a_mpi.spack(a_basket.object_name())) return false;
if(!a_mpi.spack(a_basket.object_title())) return false;
if(!a_mpi.pack(a_basket.last())) return false;
if(!a_mpi.pack(a_basket.nev_buf_size())) return false;
if(!a_mpi.pack(a_basket.nev())) return false;
if(a_basket.entry_offset()) {
if(!a_mpi.bpack(true)) return false;
if(!a_mpi.pack(a_basket.nev_buf_size(),a_basket.entry_offset())) return false;
} else {
if(!a_mpi.bpack(false)) return false;
}
if(a_basket.displacement()) {
if(!a_mpi.bpack(true)) return false;
if(!a_mpi.pack(a_basket.nev_buf_size(),a_basket.displacement())) return false;
} else {
if(!a_mpi.bpack(false)) return false;
}
if(!a_mpi.pack(a_basket.datbuf().length(),a_basket.datbuf().buf())) return false;
return true;
}
@@ -15,7 +15,7 @@ namespace wroot {
class mt_ntuple_column_wise : public base_pntuple_column_wise, public virtual imt_ntuple {
typedef base_pntuple_column_wise parent;
protected:
protected:
class basket_add : public mt_basket_add {
typedef mt_basket_add parent;
public:
@@ -64,7 +64,7 @@ protected:
basket_add& operator=(const basket_add&){return *this;}
protected:
branch& m_parallel_branch;
std::vector<icol*>& m_cols;
std::vector<icol*>& m_cols;
std::vector<branch*>& m_main_branches;
bool m_row_mode;
};
@@ -77,8 +77,8 @@ public:
<< " m_main_branches.size() (" << m_main_branches.size() << ") != "
<< "m_cols.size() (" << m_cols.size() << ")."
<< std::endl;
return false;
}
return false;
}
{std::vector<branch*>::const_iterator itb = m_main_branches.begin();
tools_vforit(icol*,m_cols,it) {
branch* main_branch = (*itb);itb++;
@@ -94,8 +94,8 @@ public:
<< " m_main_branches.size() (" << m_main_branches.size() << ") != "
<< "m_cols.size() (" << m_cols.size() << ")."
<< std::endl;
return false;
}
return false;
}
std::vector<branch*>::const_iterator itb = m_main_branches.begin();
tools_vforit(icol*,m_cols,it) {
branch* main_branch = (*itb);itb++;
@@ -130,7 +130,7 @@ public:
m_nev = 0;
}
}
mt_ntuple_column_wise(std::ostream& a_out,bool a_byte_swap,uint32 a_compression,seek a_seek_directory,
std::vector<branch*>& a_main_branches,
const std::vector<uint32>& a_basket_sizes,
@@ -148,7 +148,7 @@ public:
m_nev = 0;
}
}
#ifdef tools_wroot_mt_ntuple_column_wise //g4tools backcomp :
mt_ntuple_column_wise(std::ostream& a_out,bool a_byte_swap,uint32 a_compression,seek a_seek_directory,
std::vector<branch*>& a_main_branches,
@@ -211,7 +211,7 @@ protected:
a_mutex.unlock();
return status;
}
static bool flush_remaining_baskets(size_t& a_number,imutex& a_mutex,ifile& a_main_file,std::vector<icol*>& a_cols,std::vector<branch*>& a_main_branches) {
a_number = 0;
while(ready_to_flush_baskets(a_cols)) {
@@ -228,9 +228,9 @@ protected:
}}
return true;
}
bool end_leaves(imutex& a_mutex) const {
#include "MT_SET_MAX.icc"
std::vector<icol*>::const_iterator pit = m_cols.begin();
@@ -240,18 +240,18 @@ protected:
<< " branch " << (*mit)->name() << " without leaf." << std::endl;
return false;
}
base_leaf* _mleaf = *((*mit)->leaves().begin());
base_leaf* _pleaf = (*pit)->get_leaf(); pit++; //WARNING.
TOOLS_WROOT_MT_NTUPLE_STRING_SET_MAX
}
#undef TOOLS_WROOT_MT_NTUPLE_STRING_SET_MAX
return true;
}
protected:
protected:
std::vector<branch*>& m_main_branches;
bool m_row_mode;
uint32 m_nev;
@@ -25,7 +25,7 @@ public:
return true;
}
virtual bool end_fill(imutex& a_mutex,ifile& a_main_file) {
mt_basket_add _badd(a_mutex,a_main_file,m_main_branch);
mt_basket_add _badd(a_mutex,a_main_file,m_main_branch);
if(!m_row_wise_branch.end_pfill(_badd)) return false;
return end_leaves(a_mutex);
}
@@ -38,7 +38,7 @@ public:
:parent(a_out,a_byte_swap,a_compression,a_seek_directory,a_name,a_title,a_basket_size,a_verbose)
,m_main_branch(a_main_branch)
{}
mt_ntuple_row_wise(std::ostream& a_out,bool a_byte_swap,uint32 a_compression,seek a_seek_directory,
branch& a_main_branch,
uint32 a_basket_size,
@@ -46,7 +46,7 @@ public:
:parent(a_out,a_byte_swap,a_compression,a_seek_directory,a_basket_size,a_bkg,a_verbose)
,m_main_branch(a_main_branch)
{}
virtual ~mt_ntuple_row_wise() {}
protected:
mt_ntuple_row_wise(const mt_ntuple_row_wise& a_from)
@@ -62,7 +62,7 @@ protected:
<< " m_main_branch.leaves().size() (" << m_main_branch.leaves().size() << ") != "
<< "m_row_wise_branch.leaves().size() (" << m_row_wise_branch.leaves().size() << ")."
<< std::endl;
return false;
return false;
}
#include "MT_SET_MAX.icc"
@@ -79,7 +79,7 @@ protected:
TOOLS_WROOT_MT_NTUPLE_SET_MAX(double)
TOOLS_WROOT_MT_NTUPLE_STRING_SET_MAX
}
#undef TOOLS_WROOT_MT_NTUPLE_SET_MAX
#undef TOOLS_WROOT_MT_NTUPLE_STRING_SET_MAX
@@ -47,7 +47,7 @@ public: //ibo
if(!a_buffer.write(nobjects)) return false;
int lowerBound = 0;
if(!a_buffer.write(lowerBound)) return false;
typedef typename std::vector<T*>::const_iterator it_t;
it_t it;
for(it=std::vector<T*>::begin();it!=std::vector<T*>::end();++it) {
@@ -100,7 +100,7 @@ public: //ibo
if(!a_buffer.write(std::string(""))) return false; //fName
int nobjects = int(std::vector<T*>::size());
if(!a_buffer.write(nobjects)) return false;
typedef typename std::vector<T*>::const_iterator it_t;
it_t it;
for(it=std::vector<T*>::begin();it!=std::vector<T*>::end();++it) {
@@ -46,7 +46,7 @@ public:
:tree(a_dir,a_bkg.name(),a_bkg.title()),m_row_wise(a_row_wise),m_row_wise_branch(0)
{
if(m_row_wise) m_row_wise_branch = create_branch("row_wise_branch");
const std::vector<column_booking>& cols = a_bkg.columns();
tools_vforcit(column_booking,cols,it){
@@ -69,7 +69,7 @@ public:
}\
}\
}
#define TOOLS_WROOT_NTUPLE_CREATE_VEC_COL(a__type) \
if((*it).cls_id()==_cid_std_vector<a__type>()) {\
std::vector<a__type>* vec = (std::vector<a__type>*)(*it).user_obj();\
@@ -89,15 +89,15 @@ public:
}\
}\
}
//below types are in sync with rroot/ntuple.
TOOLS_WROOT_NTUPLE_CREATE_COL(char)
else TOOLS_WROOT_NTUPLE_CREATE_COL(short)
else TOOLS_WROOT_NTUPLE_CREATE_COL(int)
else TOOLS_WROOT_NTUPLE_CREATE_COL(float)
else TOOLS_WROOT_NTUPLE_CREATE_COL(double)
else if((*it).cls_id()==_cid(std::string())) {
std::string* user = (std::string*)(*it).user_obj();
if(user) {
@@ -116,7 +116,7 @@ public:
}
}
}
else TOOLS_WROOT_NTUPLE_CREATE_VEC_COL(char)
else TOOLS_WROOT_NTUPLE_CREATE_VEC_COL(short)
else TOOLS_WROOT_NTUPLE_CREATE_VEC_COL(int)
@@ -154,7 +154,7 @@ public:
safe_clear<icol>(m_cols);
safe_clear<branch>(m_branches);
return;
}
}
}
#undef TOOLS_WROOT_NTUPLE_CREATE_VEC_COL
#undef TOOLS_WROOT_NTUPLE_CREATE_COL
@@ -223,7 +223,7 @@ public:
m_cols.push_back(col);
return col;
}
column_vector_string* create_column_vector_string(const std::string& a_name,
const std::vector<std::string>& a_def,char a_sep) {
if(find_named<icol>(m_cols,a_name)) return 0;
@@ -279,7 +279,7 @@ public:
if(!col) return 0;
return id_cast<icol, column<T> >(*col);
}
column_string_ref* find_column_string_ref(const std::string& a_name) {
icol* col = find_named<icol>(m_cols,a_name);
if(!col) return 0;
@@ -324,7 +324,7 @@ public:
a_out << " " << (*it)->name() << std::endl;
}
}
bool add_row() {
if(m_cols.empty()) return false;
tools_vforit(icol*,m_cols,it) (*it)->add();
@@ -341,7 +341,7 @@ public:
tools_vforit(icol*,m_cols,it) (*it)->set_basket_size(a_size);
}
}
///////////////////////////////////////////////////////////////////////////
/// for parallelization : /////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
@@ -377,10 +377,10 @@ public:
m_out << "tools::wroot::ntuple::mpi_add_basket : unpack(icol) failed."<< std::endl;
return false;
}
if(m_row_wise) {
if(m_row_wise) {
if(!m_row_wise_branch) return false;
basket* basket = mpi_create_basket(m_out,a_impi,
m_dir.file().byte_swap(),m_dir.seek_directory(),
m_row_wise_branch->basket_size());
@@ -399,13 +399,13 @@ public:
delete basket;
m_row_wise_branch->set_tot_bytes(m_row_wise_branch->tot_bytes()+add_bytes);
m_row_wise_branch->set_zip_bytes(m_row_wise_branch->zip_bytes()+nout);
} else {
if(icol>=m_cols.size()) {
m_out << "tools::wroot::ntuple::mpi_add_basket : column index " << icol << " >= " << m_cols.size() << std::endl;
return false;
}
branch& _branch = m_cols[icol]->get_branch();
basket* basket = mpi_create_basket(m_out,a_impi,
@@ -429,7 +429,7 @@ public:
}
return true;
}
bool mpi_add_baskets(impi& a_impi) { //column_wise && row_mode only.
uint32 _icol = 0;
tools_vforcit(icol*,m_cols,it) {
@@ -466,9 +466,9 @@ public:
}
return true;
}
bool mpi_end_fill(impi& a_impi) {
#define TOOLS_WROOT_NTUPLE_SET_LEAF_LENGTH_MAX(a__type) \
{leaf_ref<a__type>* _mleaf_ = _mleaf?id_cast<base_leaf, leaf_ref<a__type> >(*_mleaf):0;\
if(_mleaf_) {\
@@ -480,7 +480,7 @@ public:
_mleaf_->set_max(mx(_mx,_mleaf_->get_max()));\
set_done = true;\
}}
#define TOOLS_WROOT_NTUPLE_SET_LEAF_STD_VECTOR_LENGTH_MAX(a__type) \
{leaf_std_vector_ref<a__type>* _mleaf_ = _mleaf?id_cast<base_leaf, leaf_std_vector_ref<a__type> >(*_mleaf):0;\
if(_mleaf_) {\
@@ -492,7 +492,7 @@ public:
_mleaf_->set_max(mx(_mx,_mleaf_->get_max()));\
set_done = true;\
}}
#define TOOLS_WROOT_NTUPLE_SET_LEAF_STRING_LENGTH_MAX \
{leaf_string_ref* _mleaf_ = _mleaf?id_cast<base_leaf,leaf_string_ref>(*_mleaf):0;\
if(_mleaf_) {\
@@ -504,43 +504,43 @@ public:
_mleaf_->set_max(mx(_mx,_mleaf_->get_max()));\
set_done = true;\
}}
if(m_row_wise) {
if(!m_row_wise_branch) return false;
tools_vforcit(base_leaf*,m_row_wise_branch->leaves(),mit) {
base_leaf* _mleaf = *mit;
bool set_done = false;
TOOLS_WROOT_NTUPLE_SET_LEAF_LENGTH_MAX(char)
TOOLS_WROOT_NTUPLE_SET_LEAF_LENGTH_MAX(short)
TOOLS_WROOT_NTUPLE_SET_LEAF_LENGTH_MAX(int)
TOOLS_WROOT_NTUPLE_SET_LEAF_LENGTH_MAX(float)
TOOLS_WROOT_NTUPLE_SET_LEAF_LENGTH_MAX(double)
TOOLS_WROOT_NTUPLE_SET_LEAF_STD_VECTOR_LENGTH_MAX(char)
TOOLS_WROOT_NTUPLE_SET_LEAF_STD_VECTOR_LENGTH_MAX(short)
TOOLS_WROOT_NTUPLE_SET_LEAF_STD_VECTOR_LENGTH_MAX(int)
TOOLS_WROOT_NTUPLE_SET_LEAF_STD_VECTOR_LENGTH_MAX(float)
TOOLS_WROOT_NTUPLE_SET_LEAF_STD_VECTOR_LENGTH_MAX(double)
TOOLS_WROOT_NTUPLE_SET_LEAF_STRING_LENGTH_MAX
if(!set_done) {
m_out << "tools::wroot::ntuple::mpi_end_fill :"
<< " leaf " << _mleaf->name() << " with cid " << _mleaf->id_cls() << " not treated." << std::endl;
return false;
}
}
} else { // column wise :
tools_vforcit(wroot::icol*,m_cols,it) {
base_leaf* _mleaf = (*it)->get_leaf();
bool set_done = false;
TOOLS_WROOT_NTUPLE_SET_LEAF_STRING_LENGTH_MAX
if(!set_done) {
uint32 _len;
if(!a_impi.unpack(_len)) return false;
@@ -549,7 +549,7 @@ public:
}
}
}
#undef TOOLS_WROOT_NTUPLE_SET_LEAF_LENGTH_MAX
#undef TOOLS_WROOT_NTUPLE_SET_LEAF_STD_VECTOR_LENGTH_MAX
#undef TOOLS_WROOT_NTUPLE_SET_LEAF_STRING_LENGTH_MAX
@@ -18,7 +18,7 @@ typedef int seek32;
inline uint32 START_BIG_FILE() {return 2000000000;}
inline uint32 big_file_version_tag() {return 1000;}
inline uint32 big_file_version_tag() {return 1000;}
}}
@@ -76,7 +76,7 @@ inline bool axis_stream(buffer& a_buffer,
if(!a_buffer.write(a_axis.lower_edge())) return false;
if(!a_buffer.write(a_axis.upper_edge())) return false;
// fXbins
// fXbins
//if(a_axis.m_fixed) {
// std::vector<double> v;
// ArrayT<double> dummy(v);
@@ -184,11 +184,11 @@ inline bool TH_write_1D(buffer& a_buffer,
if(!a_buffer.write((double)a_h.get_in_range_Sw2())) return false; //idem
{double value;
a_h.get_ith_axis_Sxw(0,value);
a_h.get_ith_axis_Sxw(0,value);
if(!a_buffer.write(value)) return false;}
{double value;
a_h.get_ith_axis_Sx2w(0,value);
a_h.get_ith_axis_Sx2w(0,value);
if(!a_buffer.write(value)) return false;}
if(!a_buffer.write((double)-1111)) return false; //fMaximum
@@ -199,13 +199,13 @@ inline bool TH_write_1D(buffer& a_buffer,
if(!a_buffer.write_array(a_bin_Sw2)) return false; //fSumw2 TArrayD
// store annotation on fOption
// store annotation on fOption
// but try to fool CERN-ROOT in order that it does not
// understand fOption as.. CERN-ROOT options !
//{std::string opt = " "+fAnnotation;
//{std::string opt = " "+fAnnotation;
// opt[0] = 0; //awfull trick
// if(!a_buffer.write(opt)) return false;} //TString fOption
{std::string opt;
{std::string opt;
if(!a_buffer.write(opt)) return false;} //TString fOption
if(!List_empty_stream(a_buffer)) return false; //*TList fFunctions
@@ -223,11 +223,11 @@ inline bool TH_write_2D(buffer& a_buffer,
if(!a_buffer.write((double)1)) return false; //ScaleFactor
{double value;
a_h.get_ith_axis_Sxw(1,value);
a_h.get_ith_axis_Sxw(1,value);
if(!a_buffer.write(value)) return false;}
{double value;
a_h.get_ith_axis_Sx2w(1,value);
a_h.get_ith_axis_Sx2w(1,value);
if(!a_buffer.write(value)) return false;}
if(!a_buffer.write((double)a_h.Sxyw())) return false; //Tsumwxy
@@ -17,9 +17,9 @@ inline bool to(directory& a_dir,const std::map<std::string,std::string>& a_annot
std::string sas;
tools_mforcit(std::string,std::string,a_annotations,it) {
if(it!=a_annotations.begin()) sas += "\n";
sas += (*it).first;
sas += (*it).first;
sas += "\n";
sas += (*it).second;
sas += (*it).second;
}
std::string key_name = "annotations_"+a_histo_name;
bufobj* bo = new bufobj(a_dir.file().out(),a_dir.file().byte_swap(),256,key_name,"annotations","TNamed");
@@ -164,7 +164,7 @@ inline bool write_histos(directory& a_dir,const std::vector< std::pair<std::stri
<< " WARNING : class " << scls << " not handled."
<< std::endl;
}
}
return true;
}
@@ -76,7 +76,7 @@ public: //iobject
if(!a_buffer.set_byte_count(c)) return false;
return true;
}
}
public: //itree
//virtual void add_tot_bytes(uint32 a_n) {m_tot_bytes += a_n;}
//virtual void add_zip_bytes(uint32 a_n) {m_zip_bytes += a_n;}
@@ -210,7 +210,7 @@ public:
a_nbytes += n;
m_tot_bytes += add_bytes;
m_zip_bytes += nout;
}
}
m_entries++;
@@ -61,8 +61,8 @@ class wbuf {
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////
static const std::string& s_class() {
static const std::string s_v("tools::wroot::wbuf");
return s_v;