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
+36 -64
View File
@@ -27,7 +27,40 @@
namespace tools {
namespace rroot {
//doc
//
// A ROOT file is a suite of consecutive data records with the following
// format (see also the TKey class);
// TKey ---------------------
// byte 1->4 Nbytes = Length of compressed object (in bytes)
// 5->6 Version = TKey version identifier
// 7->10 ObjLen = Length of uncompressed object
// 11->14 Datime = Date and time when object was written to file
// 15->16 KeyLen = Length of the key structure (in bytes)
// 17->18 Cycle = Cycle of key
// 19->22 SeekKey = Pointer to record itself (consistency check)
// 23->26 SeekPdir = Pointer to directory header
// 27->27 lname = Number of bytes in the class name
// 28->.. ClassName = Object Class Name
// ..->.. lname = Number of bytes in the object name
// ..->.. Name = lName bytes with the name of the object
// ..->.. lTitle = Number of bytes in the object title
// ..->.. Title = Title of the object
// -----> DATA = Data bytes associated to the object
//
// The first data record starts at byte fBEGIN (currently set to kBegin)
// Bytes 1->kBegin contain the file description:
// byte 1->4 "root" = Root file identifier
// 5->8 fVersion = File format version
// 9->12 fBEGIN = Pointer to first data record
// 13->16 fEND = Pointer to first free word at the EOF
// 17->20 fSeekFree = Pointer to FREE data record
// 21->24 fNbytesFree = Number of bytes in FREE data record
// 25->28 nfree = Number of free data records
// 29->32 fNbytesName = Number of bytes in TNamed at creation time
// 33->33 fUnits = Number of bytes for file pointers
// 34->37 fCompress = Zip compression level
//
class file : public virtual ifile {
file& get_me() {return *this;} //_MSC_VER : to avoid warning about the usage of "this" in the constructor.
static int not_open() {return -1;}
@@ -132,10 +165,6 @@ public:
,m_nbytes_info(0)
,m_nbytes_name(0)
{
#ifdef TOOLS_MEM
mem::increment(s_class().c_str());
#endif
m_file = _open(a_path.c_str(),
#if defined(_MSC_VER) || defined(__MINGW32__)
O_RDONLY | O_BINARY,S_IREAD | S_IWRITE
@@ -153,9 +182,6 @@ public:
}
virtual ~file() {
close();
#ifdef TOOLS_MEM
mem::decrement(s_class().c_str());
#endif
}
protected:
file(const file& a_from)
@@ -166,9 +192,6 @@ protected:
,m_streamer_fac(a_from.m_out)
,m_streamer_infos(m_streamer_fac)
{
#ifdef TOOLS_MEM
mem::increment(s_class().c_str());
#endif
}
file& operator=(const file&){return *this;}
public:
@@ -236,22 +259,7 @@ protected:
<< std::endl;
return false;
}
/*
fRootDirectory->setSeekDirectory(fBEGIN);
// Read Free segments structure if file is writable :
if (fWritable) {
if (fSeekFree > fBEGIN) {
if(!readFreeSegments()) {
m_out << "tools::rroot::file::initialize : Cannot read free segments."
<< std::endl;
return false;
}
} else {
m_out << "tools::rroot::file::initialize : file \"" << fName
<< "\" probably not closed, cannot read free segments" << std::endl;
}
}
*/
// Read Directory info :
uint32 nbytes = m_nbytes_name + m_root_directory.record_size(m_version);
char* header = new char[nbytes];
@@ -425,7 +433,6 @@ protected:
{int v;
if(!rb.read(v)) return false;
m_nbytes_name = v;}
//m_out << "debug : 1002 " << m_nbytes_name << std::endl;
{char fUnits;
if(!rb.read(fUnits)) return false;}
{int fCompress;
@@ -438,7 +445,6 @@ protected:
m_seek_info = i;}
}
if(!rb.read(m_nbytes_info)) return false;
//m_out << "debug : seek_info " << m_seek_info << " nbytes_info " << m_nbytes_info << std::endl;
return true;
}
@@ -506,7 +512,6 @@ protected:
seek m_seek_info; //Location on disk of StreamerInfo record
uint32 m_nbytes_free; //Number of bytes for free segments structure
uint32 m_nbytes_info; //Number of bytes for StreamerInfo record
//int nfree
uint32 m_nbytes_name; //Number of bytes in TNamed at creation time
};
@@ -515,37 +520,4 @@ protected:
#endif
//doc
//
// A ROOT file is a suite of consecutive data records with the following
// format (see also the TKey class);
// TKey ---------------------
// byte 1->4 Nbytes = Length of compressed object (in bytes)
// 5->6 Version = TKey version identifier
// 7->10 ObjLen = Length of uncompressed object
// 11->14 Datime = Date and time when object was written to file
// 15->16 KeyLen = Length of the key structure (in bytes)
// 17->18 Cycle = Cycle of key
// 19->22 SeekKey = Pointer to record itself (consistency check)
// 23->26 SeekPdir = Pointer to directory header
// 27->27 lname = Number of bytes in the class name
// 28->.. ClassName = Object Class Name
// ..->.. lname = Number of bytes in the object name
// ..->.. Name = lName bytes with the name of the object
// ..->.. lTitle = Number of bytes in the object title
// ..->.. Title = Title of the object
// -----> DATA = Data bytes associated to the object
//
// The first data record starts at byte fBEGIN (currently set to kBegin)
// Bytes 1->kBegin contain the file description:
// byte 1->4 "root" = Root file identifier
// 5->8 fVersion = File format version
// 9->12 fBEGIN = Pointer to first data record
// 13->16 fEND = Pointer to first free word at the EOF
// 17->20 fSeekFree = Pointer to FREE data record
// 21->24 fNbytesFree = Number of bytes in FREE data record
// 25->28 nfree = Number of free data records
// 29->32 fNbytesName = Number of bytes in TNamed at creation time
// 33->33 fUnits = Number of bytes for file pointers
// 34->37 fCompress = Zip compression level
//