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
-12
View File
@@ -162,10 +162,8 @@ public:
TO joffset = ibin;
TN _entries = 0;
for(jbin=0;jbin<ybins;jbin++) {
//joffset = ibin + jbin * parent::m_axes[1].m_offset;
offset = joffset;
for(kbin=0;kbin<zbins;kbin++) {
//offset = joffset + kbin * parent::m_axes[2].m_offset;
_entries += parent::m_bin_entries[offset];
offset += zoffset;
}
@@ -187,10 +185,8 @@ public:
TO joffset = jbin * yoffset;
TN _entries = 0;
for(ibin=0;ibin<xbins;ibin++) {
//joffset = ibin + jbin * parent::m_axes[1].m_offset;
offset = joffset;
for(kbin=0;kbin<zbins;kbin++) {
//offset = joffset + kbin * parent::m_axes[2].m_offset;
_entries += parent::m_bin_entries[offset];
offset += zoffset;
}
@@ -212,10 +208,8 @@ public:
TO koffset = kbin * zoffset;
TN _entries = 0;
for(ibin=0;ibin<xbins;ibin++) {
//koffset = ibin + kbin * parent::m_axes[2].m_offset;
offset = koffset;
for(jbin=0;jbin<ybins;jbin++) {
//offset = koffset + jbin * parent::m_axes[1].m_offset;
_entries += parent::m_bin_entries[offset];
offset += yoffset;
}
@@ -236,10 +230,8 @@ public:
TO joffset = ibin;
TW sw = 0;
for(bn_t jbin=0;jbin<ybins;jbin++) {
//joffset = ibin + jbin * parent::m_axes[1].m_offset;
TO offset = joffset;
for(bn_t kbin=0;kbin<zbins;kbin++) {
//offset = joffset + kbin * parent::m_axes[2].m_offset;
sw += this->get_bin_height(offset);
offset += zoffset;
}
@@ -259,10 +251,8 @@ public:
TO joffset = jbin * yoffset;
TW sw = 0;
for(bn_t ibin=0;ibin<xbins;ibin++) {
//joffset = ibin + jbin * parent::m_axes[1].m_offset;
TO offset = joffset;
for(bn_t kbin=0;kbin<zbins;kbin++) {
//offset = joffset + kbin * parent::m_axes[2].m_offset;
sw += this->get_bin_height(offset);
offset += zoffset;
}
@@ -282,10 +272,8 @@ public:
TO koffset = kbin * zoffset;
TW sw = 0;
for(bn_t ibin=0;ibin<xbins;ibin++) {
//koffset = ibin + kbin * parent::m_axes[2].m_offset;
TO offset = koffset;
for(bn_t jbin=0;jbin<ybins;jbin++) {
//offset = koffset + jbin * parent::m_axes[1].m_offset;
sw += this->get_bin_height(offset);
offset += yoffset;
}
-13
View File
@@ -7,10 +7,6 @@
#include <string>
#include <vector>
#ifdef TOOLS_MEM
#include "../mem"
#endif
namespace tools {
namespace histo {
@@ -24,14 +20,8 @@ protected:
:m_limit(aLimit)
,m_Sw(0)
{
#ifdef TOOLS_MEM
mem::increment(s_class().c_str());
#endif
}
virtual ~base_cloud(){
#ifdef TOOLS_MEM
mem::decrement(s_class().c_str());
#endif
}
public:
base_cloud(const base_cloud& a_from)
@@ -40,9 +30,6 @@ public:
,m_Sw(a_from.m_Sw)
,m_ws(a_from.m_ws)
{
#ifdef TOOLS_MEM
mem::increment(s_class().c_str());
#endif
}
base_cloud& operator=(const base_cloud& a_from){
+2 -49
View File
@@ -4,10 +4,6 @@
#ifndef tools_histo_base_histo
#define tools_histo_base_histo
#ifdef TOOLS_MEM
#include "../mem"
#endif
#include "histo_data"
#include <cmath>
@@ -45,32 +41,21 @@ protected:
virtual TH get_bin_height(TO) const = 0; //histo/profile
protected:
void base_from_data(const hd_t& a_from) {parent::operator=(a_from);}
#ifdef tools_histo_base_histo //for backward compatibility with tools
hd_t base_get_data() const {
hd_t hd;
hd = *this;
return hd;
}
#endif
public:
const hd_t& dac() const {return *this;} //data accessor.
protected:
base_histo():parent() {
#ifdef TOOLS_MEM
mem::increment(s_class().c_str());
#endif
}
protected:
virtual ~base_histo() {
#ifdef TOOLS_MEM
mem::decrement(s_class().c_str());
#endif
}
protected:
base_histo(const base_histo& a_from):parent(a_from) {
#ifdef TOOLS_MEM
mem::increment(s_class().c_str());
#endif
}
base_histo& operator=(const base_histo& a_from) {
@@ -262,31 +247,6 @@ public: //histo_data
}
}
/*
TW get_all_Sw() const {
TW sw = 0;
for(TO ibin=0;ibin<m_bin_number;ibin++) sw += m_bin_Sw[ibin];
return sw;
}
TN get_all_entries() const {
TN number = 0;
for(TO ibin=0;ibin<m_bin_number;ibin++) {
number += m_bin_entries[ibin];
}
return number;
}
// for tools/wroot/streamers :
TN get_entries() const {
TN number = 0;
for(TO ibin=0;ibin<m_bin_number;ibin++) {
if(!histo::is_out(m_axes,ibin)) {
number += m_bin_entries[ibin];
}
}
return number;
}
*/
protected:
enum {AxisX=0,AxisY=1,AxisZ=2};
@@ -333,7 +293,7 @@ protected:
parent::m_dimension = a_dim;
base_allocate(); //set m_bin_number.
base_allocate();
return true;
}
@@ -366,14 +326,13 @@ protected:
// Setup axes :
for(dim_t iaxis=0;iaxis<a_dim;iaxis++) {
if(!parent::m_axes[iaxis].configure(a_edges[iaxis])) {
//m_axes.clear();
return false;
}
}
parent::m_dimension = a_dim;
base_allocate(); //set m_bin_number.
base_allocate();
return true;
}
@@ -459,7 +418,6 @@ public: //annotations :
a_out << " * ANNOTATIONS :" << std::endl;
annotations_t::const_iterator it;
for(it=parent::m_annotations.begin();it!=parent::m_annotations.end();++it) {
//out << " * (" << index << ") "
a_out << " * " << (*it).first << " = " << (*it).second << std::endl;
}
}
@@ -505,7 +463,6 @@ protected:
}
}
//{for(dim_t iplane=0;iplane<nplane;iplane++) parent::m_in_range_plane_Sxyw[iplane] ??? a_histo.m_in_range_plane_Sxyw[iplane];}
parent::update_fast_getters();
}
@@ -538,8 +495,6 @@ protected:
}
}
//{for(dim_t iplane=0;iplane<nplane;iplane++) parent::m_in_range_plane_Sxyw[iplane] ??? a_histo.m_in_range_plane_Sxyw[iplane];}
parent::update_fast_getters();
return true;
}
@@ -583,8 +538,6 @@ protected:
}
}
//{for(dim_t iplane=0;iplane<nplane;iplane++) parent::m_in_range_plane_Sxyw[iplane] ??? a_histo.m_in_range_plane_Sxyw[iplane];}
parent::update_fast_getters();
return true;
}
+2 -2
View File
@@ -82,8 +82,8 @@ public:
return m_histo->fill(aX,aW);
} else {
if(m_xs.size()) {
m_lower_x = mn<double>(aX,m_lower_x);
m_upper_x = mx<double>(aX,m_upper_x);
m_lower_x = min_of<double>(aX,m_lower_x);
m_upper_x = max_of<double>(aX,m_upper_x);
} else {
m_lower_x = aX;
m_upper_x = aX;
+4 -4
View File
@@ -280,15 +280,15 @@ bool c2d::fill(double aX,double aY,double aW){
return m_histo->fill(aX,aY,aW);
} else {
if(m_xs.size()) {
m_lower_x = mn<double>(aX,m_lower_x);
m_upper_x = mx<double>(aX,m_upper_x);
m_lower_x = min_of<double>(aX,m_lower_x);
m_upper_x = max_of<double>(aX,m_upper_x);
} else {
m_lower_x = aX;
m_upper_x = aX;
}
if(m_ys.size()) {
m_lower_y = mn<double>(aY,m_lower_y);
m_upper_y = mx<double>(aY,m_upper_y);
m_lower_y = min_of<double>(aY,m_lower_y);
m_upper_y = max_of<double>(aY,m_upper_y);
} else {
m_lower_y = aY;
m_upper_y = aY;
+6 -6
View File
@@ -362,22 +362,22 @@ bool c3d::fill(double aX,double aY,double aZ,double aW){
return m_histo->fill(aX,aY,aZ,aW);
} else {
if(m_xs.size()) {
m_lower_x = mn<double>(aX,m_lower_x);
m_upper_x = mx<double>(aX,m_upper_x);
m_lower_x = min_of<double>(aX,m_lower_x);
m_upper_x = max_of<double>(aX,m_upper_x);
} else {
m_lower_x = aX;
m_upper_x = aX;
}
if(m_ys.size()) {
m_lower_y = mn<double>(aY,m_lower_y);
m_upper_y = mx<double>(aY,m_upper_y);
m_lower_y = min_of<double>(aY,m_lower_y);
m_upper_y = max_of<double>(aY,m_upper_y);
} else {
m_lower_y = aY;
m_upper_y = aY;
}
if(m_zs.size()) {
m_lower_z = mn<double>(aZ,m_lower_z);
m_upper_z = mx<double>(aZ,m_upper_z);
m_lower_z = min_of<double>(aZ,m_lower_z);
m_upper_z = max_of<double>(aZ,m_upper_z);
} else {
m_lower_z = aZ;
m_upper_z = aZ;
+2 -27
View File
@@ -10,10 +10,6 @@
#include <string>
#include "../mnmx"
#ifdef TOOLS_MEM
#include "../mem"
#endif
namespace tools {
namespace histo {
@@ -24,23 +20,14 @@ class measurement {
}
public:
measurement():m_value(0),m_error_plus(0),m_error_minus(0){
#ifdef TOOLS_MEM
mem::increment(s_class().c_str());
#endif
}
measurement(double a_value,double a_error_plus,double a_error_minus)
:m_value(a_value)
,m_error_plus(a_error_plus)
,m_error_minus(a_error_minus)
{
#ifdef TOOLS_MEM
mem::increment(s_class().c_str());
#endif
}
virtual ~measurement(){
#ifdef TOOLS_MEM
mem::decrement(s_class().c_str());
#endif
}
public:
measurement(const measurement& a_from)
@@ -48,9 +35,6 @@ public:
,m_error_plus(a_from.m_error_plus)
,m_error_minus(a_from.m_error_minus)
{
#ifdef TOOLS_MEM
mem::increment(s_class().c_str());
#endif
}
measurement& operator=(const measurement& a_from) {
if(&a_from==this) return *this;
@@ -79,22 +63,13 @@ class data_point {
}
public:
data_point(unsigned int a_dim):m_measurements(a_dim){
#ifdef TOOLS_MEM
mem::increment(s_class().c_str());
#endif
}
virtual ~data_point() {
#ifdef TOOLS_MEM
mem::decrement(s_class().c_str());
#endif
}
public:
data_point(const data_point& a_from)
:m_measurements(a_from.m_measurements)
{
#ifdef TOOLS_MEM
mem::increment(s_class().c_str());
#endif
}
data_point& operator=(const data_point& a_from) {
if(&a_from==this) return *this;
@@ -186,7 +161,7 @@ public:
a_value = (*it).coordinate(a_coord).value();
++it;
for(;it!=m_points.end();++it) {
a_value = mn<double>(a_value,(*it).coordinate(a_coord).value());
a_value = min_of<double>(a_value,(*it).coordinate(a_coord).value());
}
return true;
}
@@ -200,7 +175,7 @@ public:
a_value = (*it).coordinate(a_coord).value();
++it;
for(;it!=m_points.end();++it) {
a_value = mx<double>(a_value,(*it).coordinate(a_coord).value());
a_value = max_of<double>(a_value,(*it).coordinate(a_coord).value());
}
return true;
}
-7
View File
@@ -239,13 +239,6 @@ public:
public: //CERN-ROOT API
bool Fill(TC aX,TC aY,TC aZ,TW aWeight = 1) {return fill(aX,aY,aZ,aWeight);}
public:
/*
// Slices :
h2d* slice_xy(int aKbeg,int aKend) const;
h2d* slice_yz(int aIbeg,int aIend) const;
h2d* slice_xz(int aJbeg,int aJend) const;
*/
public:
h3(const std::string& a_title,
bn_t aXnumber,TC aXmin,TC aXmax,
+1 -18
View File
@@ -20,9 +20,6 @@ namespace histo {
/////////////////////////////////////////////////////////////////////////////
inline bool axis_dui_pack(impi& a_mpi,const axis<double,unsigned int>& a_axis) {
//typedef double TC;
//typedef unsigned int TO;
//typedef unsigned int bn_t;
if(!a_mpi.pack(a_axis.m_offset)) return false; //TO
if(!a_mpi.pack(a_axis.m_number_of_bins)) return false; //bn_t
if(!a_mpi.pack(a_axis.m_minimum_value)) return false; //TC
@@ -34,11 +31,6 @@ inline bool axis_dui_pack(impi& a_mpi,const axis<double,unsigned int>& a_axis) {
}
inline bool histo_data_duiuid_pack(impi& a_mpi,const histo_data<double,unsigned int,unsigned int,double>& a_hd) {
//typedef double TC;
//typedef unsigned int TO;
//typedef unsigned int TN;
//typedef double TW;
//typedef unsigned int dim_t;
typedef unsigned int num_t;
if(!a_mpi.spack(a_hd.m_title)) return false;
@@ -65,7 +57,7 @@ inline bool histo_data_duiuid_pack(impi& a_mpi,const histo_data<double,unsigned
// Annotations :
{if(!a_mpi.pack((num_t)a_hd.m_annotations.size())) return false; //num_t
tools_mforcit(std::string,std::string,a_hd.m_annotations,it) {
for(auto it = a_hd.m_annotations.cbegin(); it != a_hd.m_annotations.cend(); ++it) {
if(!a_mpi.spack((*it).first)) return false;
if(!a_mpi.spack((*it).second)) return false;
}}
@@ -86,10 +78,6 @@ inline bool histo_data_duiuid_pack(impi& a_mpi,const histo_data<double,unsigned
/////////////////////////////////////////////////////////////////////////////
inline bool axis_dui_unpack(impi& a_mpi,axis<double,unsigned int>& a_axis) {
//typedef double TC;
//typedef unsigned int TO;
//typedef unsigned int bn_t;
if(!a_mpi.unpack(a_axis.m_offset)) return false; //TO
if(!a_mpi.unpack(a_axis.m_number_of_bins)) return false; //bn_t
if(!a_mpi.unpack(a_axis.m_minimum_value)) return false; //TC
@@ -102,11 +90,6 @@ inline bool axis_dui_unpack(impi& a_mpi,axis<double,unsigned int>& a_axis) {
}
inline bool histo_data_duiuid_unpack(impi& a_mpi,histo_data<double,unsigned int,unsigned int,double>& a_hd) {
//typedef double TC;
//typedef unsigned int TO;
//typedef unsigned int TN;
//typedef double TW;
//typedef unsigned int dim_t;
typedef unsigned int num_t;
if(!a_mpi.sunpack(a_hd.m_title)) return false;
@@ -9,7 +9,6 @@
#include "axes"
#include "../eqT"
//#include "../vmanip" //vequ
namespace tools {
namespace histo {
@@ -122,7 +121,6 @@ public:
if(m_dimension!=a_from.m_dimension) return false;
if(m_bin_number!=a_from.m_bin_number) return false;
if(m_bin_entries!=a_from.m_bin_entries) return false;
//if(!vequ(m_bin_entries,a_from.m_bin_entries)) return false;
if(!vectors_are_equal(m_bin_Sw,a_from.m_bin_Sw,a_prec,a_fabs)) return false;
if(!vectors_are_equal(m_bin_Sw2,a_from.m_bin_Sw2,a_prec,a_fabs)) return false;
if(!vecvecs_are_equal(m_bin_Sxw,a_from.m_bin_Sxw,a_prec,a_fabs)) return false;
@@ -147,22 +145,15 @@ public:
if(m_title!=a_from.m_title) return false;
if(m_dimension!=a_from.m_dimension) return false;
if(m_bin_number!=a_from.m_bin_number) return false;
//if(m_bin_entries!=a_from.m_bin_entries) return false;
if(!vectors_are_equal(m_bin_Sw,a_from.m_bin_Sw,a_prec,a_fabs)) return false;
if(a_cmp_bin_Sw2) if(!vectors_are_equal(m_bin_Sw2,a_from.m_bin_Sw2,a_prec,a_fabs)) return false;
//if(!vecvecs_are_equal(m_bin_Sxw,a_from.m_bin_Sxw,a_prec,a_fabs)) return false;
//if(!vecvecs_are_equal(m_bin_Sx2w,a_from.m_bin_Sx2w,a_prec,a_fabs)) return false;
if(m_axes!=a_from.m_axes) return false;
if(!vectors_are_equal(m_in_range_plane_Sxyw,a_from.m_in_range_plane_Sxyw,a_prec,a_fabs)) return false;
//if(m_annotations!=a_from.m_annotations) return false;
if(m_all_entries!=a_from.m_all_entries) return false;
//if(m_in_range_entries!=a_from.m_in_range_entries) return false;
if(!numbers_are_equal(m_in_range_Sw,a_from.m_in_range_Sw,a_prec,a_fabs)) return false;
if(!numbers_are_equal(m_in_range_Sw2,a_from.m_in_range_Sw2,a_prec,a_fabs)) return false;
//if(!vectors_are_equal(m_in_range_Sxw,a_from.m_in_range_Sxw,a_prec,a_fabs)) return false;
//if(!vectors_are_equal(m_in_range_Sx2w,a_from.m_in_range_Sx2w,a_prec,a_fabs)) return false;
return true;
}
-1
View File
@@ -72,7 +72,6 @@ public:
TV sv2w = m_bin_Sv2w[offset]; //ROOT err2
TV _mean = (svw / sw); //ROOT contsum
TV _rms = ::sqrt(::fabs((sv2w/sw) - _mean * _mean)); //ROOT eprim
// rms = get_bin_rms_value.
return _rms/::sqrt(sw); //ROOT kERRORMEAN mode returned value
}
-1
View File
@@ -64,7 +64,6 @@ public:
TV sv2w = m_bin_Sv2w[offset]; //ROOT err2
TV mean = (svw / sw); //ROOT contsum
TV rms = ::sqrt(::fabs((sv2w/sw) - mean * mean)); //ROOT eprim
// rms = get_bin_rms_value.
return rms/::sqrt(sw); //ROOT kERRORMEAN mode returned value
}