Import Geant4 11.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2025-12-05 08:54:02 +01:00
parent a499fb82e9
commit b4a16de652
6484 changed files with 232674 additions and 221097 deletions
+5 -44
View File
@@ -6,6 +6,7 @@
#include "leaf"
#include "basket"
#include "../cmemT"
#include "../forit"
#include "imutex"
@@ -14,13 +15,6 @@ namespace tools {
namespace wroot {
class branch : public virtual ibo {
//static uint32 kDoNotProcess() {return (1<<10);} // Active bit for branches
#ifdef TOOLS_MEM
static const std::string& s_class() {
static const std::string s_v("tools::wroot::branch");
return s_v;
}
#endif
public: //ibo
virtual const std::string& store_cls() const {
static const std::string s_v("TBranch");
@@ -57,22 +51,6 @@ public: //ibo
if(!m_leaves.stream(a_buffer)) return false;
if(!m_baskets.stream(a_buffer)) return false;
/*
{uint32 remaining_baskets = 0;
for(uint32 i=0;i<m_max_baskets;i++) {
if(m_baskets[i]) {
m_out << "debug : remaining basket : index " << i << ", bytes = " << m_baskets[i]->number_of_bytes()
<< std::endl;
remaining_baskets++;
}
}
m_out << "tools::wroot::branch::stream :"
<< " write_basket = " << m_write_basket
<< ", max_baskets = " << m_max_baskets
<< ", remaining_baskets = " << remaining_baskets << "."
<< std::endl;}
*/
// See TStreamerInfo::ReadBuffer::WriteBasicPointer
if(!a_buffer.write((char)1)) return false;
if(!a_buffer.write_fast_array(fBasketBytes,m_max_baskets)) return false;
@@ -81,7 +59,6 @@ public: //ibo
char isBigFile = 1;
//GB : begin
//if(fTree.directory().file().end()>RIO_START_BIG_FILE()) isBigFile = 2;
{for(uint32 i=0;i<m_max_baskets;i++) {
if(fBasketSeek[i]>START_BIG_FILE()) {
isBigFile = 2;
@@ -124,9 +101,6 @@ public:
,m_name(a_name)
,m_title(a_title)
,fAutoDelete(false)
//,m_branches(true)
//,m_leaves(true)
,fCompress(a_compression)
,m_basket_size(32000)
,m_write_basket(0)
@@ -139,9 +113,6 @@ public:
,fBasketEntry(0)
,fBasketSeek(0)
{
#ifdef TOOLS_MEM
mem::increment(s_class().c_str());
#endif
m_baskets.resize(m_max_baskets,0);
fBasketBytes = new uint32[m_max_baskets];
fBasketEntry = new uint32[m_max_baskets];
@@ -156,20 +127,12 @@ public:
fBasketEntry[m_write_basket] = (uint32)m_entry_number;
}
virtual ~branch(){
// {for(uint32 i=0;i<=m_write_basket;i++) {
// m_out << " " << i << ", " << fBasketEntry[i] << std::endl;
// }}
delete [] fBasketBytes;
delete [] fBasketEntry;
delete [] fBasketSeek;
fBasketBytes = 0;
fBasketEntry = 0;
fBasketSeek = 0;
#ifdef TOOLS_MEM
mem::decrement(s_class().c_str());
#endif
}
protected:
branch(const branch& a_from)
@@ -288,8 +251,6 @@ public:
return false;
}
//FIXME if (TestBit(kDoNotProcess)) return 0;
basket* bk = m_baskets[m_write_basket];
if(!bk) {
m_out << "tools::wroot::branch::fill :"
@@ -513,7 +474,7 @@ protected:
if(m_write_basket>=m_max_baskets) {
//Increase BasketEntry buffer of a minimum of 10 locations
// and a maximum of 50 per cent of current size
uint32 newsize = mx<uint32>(10,uint32(1.5*m_max_baskets));
uint32 newsize = max_of<uint32>(10,uint32(1.5*m_max_baskets));
if(newsize>=START_BIG_FILE()) {
//we are going to have pb with uint32[] indexing.
m_out << "tools::wroot::branch::add_basket :"
@@ -528,15 +489,15 @@ protected:
m_baskets.resize(newsize,0);
if(!realloc<uint32>(fBasketBytes,newsize,m_max_baskets,true)) {
if(!cmem_realloc<uint32>(fBasketBytes,newsize,m_max_baskets,true)) {
m_out << "tools::wroot::branch::add_basket : realloc failed." << std::endl;
return false;
}
if(!realloc<uint32>(fBasketEntry,newsize,m_max_baskets,true)){
if(!cmem_realloc<uint32>(fBasketEntry,newsize,m_max_baskets,true)){
m_out << "tools::wroot::branch::add_basket : realloc failed." << std::endl;
return false;
}
if(!realloc<seek>(fBasketSeek,newsize,m_max_baskets,true)){
if(!cmem_realloc<seek>(fBasketSeek,newsize,m_max_baskets,true)){
m_out << "tools::wroot::branch::add_basket : realloc failed." << std::endl;
return false;
}