Import Geant4 10.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-12-09 12:35:28 +01:00
parent 4ec577e5c4
commit a3452e42ac
3514 changed files with 210500 additions and 89628 deletions
@@ -161,7 +161,7 @@ public:
public:
// Partition :
bool configure(const std::vector<TC>& aEdges) {
bool configure(const std::vector<TC>& a_edges) {
// init :
m_number_of_bins = 0;
m_minimum_value = 0;
@@ -170,17 +170,17 @@ public:
m_bin_width = 0;
m_edges.clear();
// setup :
if(aEdges.size()<=1) return false;
bn_t number = (bn_t)aEdges.size()-1;
if(a_edges.size()<=1) return false;
bn_t number = (bn_t)a_edges.size()-1;
for(bn_t index=0;index<number;index++) {
if((aEdges[index]>=aEdges[index+1])) {
if((a_edges[index]>=a_edges[index+1])) {
return false;
}
}
m_edges = aEdges;
m_edges = a_edges;
m_number_of_bins = number;
m_minimum_value = aEdges[0];
m_maximum_value = aEdges[m_number_of_bins];
m_minimum_value = a_edges[0];
m_maximum_value = a_edges[m_number_of_bins];
m_fixed = false;
return true;
}
@@ -156,10 +156,10 @@ protected:
maxs.push_back(aXmax);
parent::configure(1,nbins,mins,maxs);
}
b1(const std::string& a_title,const std::vector<TC>& aEdges) {
b1(const std::string& a_title,const std::vector<TC>& a_edges) {
parent::m_title = a_title;
std::vector< std::vector<TC> > edges(1);
edges[0] = aEdges;
edges[0] = a_edges;
parent::configure(1,edges);
}
@@ -177,9 +177,9 @@ public:
maxs.push_back(aXmax);
return parent::configure(1,nbins,mins,maxs);
}
bool configure(const std::vector<TC>& aEdges) {
bool configure(const std::vector<TC>& a_edges) {
std::vector< std::vector<TC> > edges(1);
edges[0] = aEdges;
edges[0] = a_edges;
return parent::configure(1,edges);
}
protected:
@@ -302,11 +302,11 @@ protected:
parent::configure(2,nbins,mins,maxs);
}
b2(const std::string& a_title,const std::vector<TC>& aEdgesX,const std::vector<TC>& aEdgesY) {
b2(const std::string& a_title,const std::vector<TC>& a_edges_x,const std::vector<TC>& a_edges_y) {
parent::m_title = a_title;
std::vector< std::vector<TC> > edges(2);
edges[0] = aEdgesX;
edges[1] = aEdgesY;
edges[0] = a_edges_x;
edges[1] = a_edges_y;
parent::configure(2,edges);
}
@@ -328,10 +328,10 @@ public:
return parent::configure(2,nbins,mins,maxs);
}
bool configure(const std::vector<TC>& aEdgesX,const std::vector<TC>& aEdgesY){
bool configure(const std::vector<TC>& a_edges_x,const std::vector<TC>& a_edges_y){
std::vector< std::vector<TC> > edges(2);
edges[0] = aEdgesX;
edges[1] = aEdgesY;
edges[0] = a_edges_x;
edges[1] = a_edges_y;
return parent::configure(2,edges);
}
+12 -12
View File
@@ -328,15 +328,15 @@ public:
}
b3(const std::string& a_title,
const std::vector<TC>& aEdgesX,
const std::vector<TC>& aEdgesY,
const std::vector<TC>& aEdgesZ)
const std::vector<TC>& a_edges_x,
const std::vector<TC>& a_edges_y,
const std::vector<TC>& a_edges_z)
{
parent::m_title = a_title;
std::vector< std::vector<TC> > edges(3);
edges[0] = aEdgesX;
edges[1] = aEdgesY;
edges[2] = aEdgesZ;
edges[0] = a_edges_x;
edges[1] = a_edges_y;
edges[2] = a_edges_z;
parent::configure(3,edges);
}
@@ -363,13 +363,13 @@ public:
return parent::configure(3,nbins,mins,maxs);
}
bool configure(const std::vector<TC>& aEdgesX,
const std::vector<TC>& aEdgesY,
const std::vector<TC>& aEdgesZ){
bool configure(const std::vector<TC>& a_edges_x,
const std::vector<TC>& a_edges_y,
const std::vector<TC>& a_edges_z){
std::vector< std::vector<TC> > edges(3);
edges[0] = aEdgesX;
edges[1] = aEdgesY;
edges[2] = aEdgesZ;
edges[0] = a_edges_x;
edges[1] = a_edges_y;
edges[2] = a_edges_z;
return parent::configure(3,edges);
}
@@ -12,6 +12,7 @@
#include <cmath>
#include <map> //for annotations
#include <ostream>
namespace tools {
namespace histo {
@@ -277,7 +278,7 @@ protected:
return true;
}
bool configure(dim_t a_dim,const std::vector< std::vector<TC> >& aEdges) {
bool configure(dim_t a_dim,const std::vector< std::vector<TC> >& a_edges) {
// Clear :
parent::m_bin_entries.clear();
parent::m_bin_Sw.clear();
@@ -304,7 +305,7 @@ protected:
parent::m_axes.resize(a_dim);
// Setup axes :
for(dim_t iaxis=0;iaxis<a_dim;iaxis++) {
if(!parent::m_axes[iaxis].configure(aEdges[iaxis])) {
if(!parent::m_axes[iaxis].configure(a_edges[iaxis])) {
//m_axes.clear();
return false;
}
@@ -392,6 +393,17 @@ public: //annotations :
return true;
}
void set_annotations(const annotations_t& a_annotations) {parent::m_annotations = a_annotations;}
void hprint_annotations(std::ostream& a_out) {
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;
}
}
protected:
bool is_compatible(const base_histo& a_histo){
if(parent::m_dimension!=a_histo.m_dimension) return false;
@@ -412,8 +424,9 @@ protected:
parent::m_bin_Sx2w[ibin][iaxis] += a_histo.m_bin_Sx2w[ibin][iaxis];
}
}
{dim_t nplane = parent::m_in_range_plane_Sxyw.size();
for(dim_t iplane=0;iplane<nplane;iplane++) parent::m_in_range_plane_Sxyw[iplane] += a_histo.m_in_range_plane_Sxyw[iplane];}
{size_t nplane = parent::m_in_range_plane_Sxyw.size();
for(size_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();
}
@@ -527,8 +540,8 @@ protected:
parent::m_bin_Sx2w[ibin][iaxis] *= a_factor;
}
}
{dim_t nplane = parent::m_in_range_plane_Sxyw.size();
for(dim_t iplane=0;iplane<nplane;iplane++) parent::m_in_range_plane_Sxyw[iplane] *= a_factor;}
{size_t nplane = parent::m_in_range_plane_Sxyw.size();
for(size_t iplane=0;iplane<nplane;iplane++) parent::m_in_range_plane_Sxyw[iplane] *= a_factor;}
parent::update_fast_getters();
return true;
}
@@ -34,7 +34,7 @@ public:
return true;
}
unsigned int entries() const {
return m_histo ? m_histo->all_entries() : m_ws.size();
return m_histo ? m_histo->all_entries() : (unsigned int)m_ws.size();
}
public:
double sum_of_weights() const {
@@ -56,8 +56,8 @@ public:
if(m_histo) {
return m_histo->scale(a_scale);
} else {
unsigned int number = m_ws.size();
for(unsigned int index=0;index<number;index++) m_ws[index] *= a_scale;
size_t number = m_ws.size();
for(size_t index=0;index<number;index++) m_ws[index] *= a_scale;
m_Sw *= a_scale;
m_Sxw *= a_scale;
m_Sx2w *= a_scale;
@@ -132,9 +132,9 @@ public:
return status;
}
bool convert(const std::vector<double>& aEdges) {
bool convert(const std::vector<double>& a_edges) {
if(m_histo) return true;
m_histo = new histo::h1d(base_cloud::title(),aEdges);
m_histo = new histo::h1d(base_cloud::title(),a_edges);
if(!m_histo) return false;
bool status = fill_histogram(*m_histo);
clear();
@@ -146,8 +146,8 @@ public:
return *m_histo;
}
bool fill_histogram(histo::h1d& a_histo) const {
unsigned int number = m_xs.size();
for(unsigned int index=0;index<number;index++) {
size_t number = m_xs.size();
for(size_t index=0;index<number;index++) {
if(!a_histo.fill(m_xs[index],m_ws[index])) return false;
}
return true;
@@ -47,8 +47,8 @@ public:
bool convert(const std::vector<double>&,const std::vector<double>&);
const histo::h2d& histogram() const;
bool fill_histogram(histo::h2d& a_histo) const {
unsigned int number = m_xs.size();
for(unsigned int index=0;index<number;index++) {
size_t number = m_xs.size();
for(size_t index=0;index<number;index++) {
if(!a_histo.fill(m_xs[index],m_ys[index],m_ws[index])) return false;
}
return true;
@@ -248,8 +248,8 @@ bool c2d::scale(double a_scale) {
if(m_histo) {
return m_histo->scale(a_scale);
} else {
unsigned int number = m_ws.size();
for(unsigned int index=0;index<number;index++) m_ws[index] *= a_scale;
size_t number = m_ws.size();
for(size_t index=0;index<number;index++) m_ws[index] *= a_scale;
m_Sw *= a_scale;
m_Sxw *= a_scale;
m_Sx2w *= a_scale;
@@ -305,10 +305,10 @@ bool c2d::fill(double aX,double aY,double aW){
}
inline
bool c2d::convert(const std::vector<double>& aEdgesX,const std::vector<double>& aEdgesY) {
bool c2d::convert(const std::vector<double>& a_edges_x,const std::vector<double>& a_edges_y) {
if(m_histo) return true;
m_histo = new histo::h2d(base_cloud::title(),
aEdgesX,aEdgesY);
a_edges_x,a_edges_y);
if(!m_histo) return false;
bool status = fill_histogram(*m_histo);
clear();
@@ -337,7 +337,7 @@ const h2d& c2d::histogram() const {
inline
unsigned int c2d::entries() const {
return m_histo ? m_histo->all_entries() : m_ws.size();
return m_histo ? m_histo->all_entries() : (unsigned int)m_ws.size();
}
inline
+10 -11
View File
@@ -55,10 +55,9 @@ public:
const std::vector<double>&);
const histo::h3d& histogram() const;
bool fill_histogram(histo::h3d& a_histo) const {
unsigned int number = m_xs.size();
for(unsigned int index=0;index<number;index++) {
if(!a_histo.fill(m_xs[index],m_ys[index],m_zs[index],m_ws[index]))
return false;
size_t number = m_xs.size();
for(size_t index=0;index<number;index++) {
if(!a_histo.fill(m_xs[index],m_ys[index],m_zs[index],m_ws[index])) return false;
}
return true;
}
@@ -307,8 +306,8 @@ bool c3d::scale(double a_scale) {
if(m_histo) {
return m_histo->scale(a_scale);
} else {
unsigned int number = m_ws.size();
for(unsigned int index=0;index<number;index++) m_ws[index] *= a_scale;
size_t number = m_ws.size();
for(size_t index=0;index<number;index++) m_ws[index] *= a_scale;
m_Sw *= a_scale;
m_Sxw *= a_scale;
m_Sx2w *= a_scale;
@@ -403,13 +402,13 @@ bool c3d::fill(double aX,double aY,double aZ,double aW){
inline
bool c3d::convert(
const std::vector<double>& aEdgesX
,const std::vector<double>& aEdgesY
,const std::vector<double>& aEdgesZ
const std::vector<double>& a_edges_x
,const std::vector<double>& a_edges_y
,const std::vector<double>& a_edges_z
) {
if(m_histo) return true;
m_histo = new histo::h3d(base_cloud::title(),
aEdgesX,aEdgesY,aEdgesZ);
a_edges_x,a_edges_y,a_edges_z);
if(!m_histo) return false;
bool status = fill_histogram(*m_histo);
clear();
@@ -423,7 +422,7 @@ double c3d::sum_of_weights() const {
inline
unsigned int c3d::entries() const {
return m_histo ? m_histo->all_entries() : m_ws.size();
return m_histo ? m_histo->all_entries() : (unsigned int)m_ws.size();
}
inline
@@ -102,7 +102,7 @@ public:
return *this;
}
public: //AIDA/Idata_point
unsigned int dimension() const {return m_measurements.size();}
size_t dimension() const {return m_measurements.size();}
measurement& coordinate(unsigned int a_coord) {
//WARNING : no check done on a_coord vs m_dim.
return m_measurements[a_coord];
@@ -150,7 +150,7 @@ public:
unsigned int dimension() const {return m_dim;}
void clear() {m_points.clear();}
unsigned int size() const {return m_points.size();}
size_t size() const {return m_points.size();}
const data_point& point(unsigned int a_index) const {
//WARNING : no check done on a_index.
@@ -203,8 +203,8 @@ public:
h1(const std::string& a_title,bn_t aXnumber,TC aXmin,TC aXmax)
:parent(a_title,aXnumber,aXmin,aXmax){}
h1(const std::string& a_title,const std::vector<TC>& aEdges)
:parent(a_title,aEdges){}
h1(const std::string& a_title,const std::vector<TC>& a_edges)
:parent(a_title,a_edges){}
virtual ~h1(){}
public:
@@ -23,8 +23,8 @@ public:
h1d(const std::string& a_title,unsigned int aXnumber,double aXmin,double aXmax)
:parent(a_title,aXnumber,aXmin,aXmax){}
h1d(const std::string& a_title,const std::vector<double>& aEdges)
:parent(a_title,aEdges){}
h1d(const std::string& a_title,const std::vector<double>& a_edges)
:parent(a_title,a_edges){}
virtual ~h1d(){}
public:
@@ -24,8 +24,8 @@ public:
h1df(const std::string& a_title,unsigned int aXnumber,float aXmin,float aXmax)
:parent(a_title,aXnumber,aXmin,aXmax){}
h1df(const std::string& a_title,const std::vector<double>& aEdges)
:parent(a_title,aEdges){}
h1df(const std::string& a_title,const std::vector<double>& a_edges)
:parent(a_title,a_edges){}
virtual ~h1df(){}
public:
@@ -160,8 +160,8 @@ public:
h2(const std::string& a_title,bn_t aXnumber,TC aXmin,TC aXmax,bn_t aYnumber,TC aYmin,TC aYmax)
:parent(a_title,aXnumber,aXmin,aXmax,aYnumber,aYmin,aYmax)
{}
h2(const std::string& a_title,const std::vector<TC>& aEdgesX,const std::vector<TC>& aEdgesY)
:parent(a_title,aEdgesX,aEdgesY)
h2(const std::string& a_title,const std::vector<TC>& a_edges_x,const std::vector<TC>& a_edges_y)
:parent(a_title,a_edges_x,a_edges_y)
{}
virtual ~h2(){}
@@ -24,9 +24,9 @@ public:
:parent(a_title,aXnumber,aXmin,aXmax,aYnumber,aYmin,aYmax)
{}
h2d(const std::string& a_title,
const std::vector<double>& aEdgesX,
const std::vector<double>& aEdgesY)
:parent(a_title,aEdgesX,aEdgesY)
const std::vector<double>& a_edges_x,
const std::vector<double>& a_edges_y)
:parent(a_title,a_edges_x,a_edges_y)
{}
virtual ~h2d(){}
@@ -27,9 +27,9 @@ public:
:parent(a_title,aXnumber,aXmin,aXmax,aYnumber,aYmin,aYmax)
{}
h2df(const std::string& a_title,
const std::vector<double>& aEdgesX,
const std::vector<double>& aEdgesY)
:parent(a_title,aEdgesX,aEdgesY)
const std::vector<double>& a_edges_x,
const std::vector<double>& a_edges_y)
:parent(a_title,a_edges_x,a_edges_y)
{}
virtual ~h2df(){}
@@ -197,10 +197,10 @@ public:
{}
h3(const std::string& a_title,
const std::vector<TC>& aEdgesX,
const std::vector<TC>& aEdgesY,
const std::vector<TC>& aEdgesZ)
:parent(a_title,aEdgesX,aEdgesY,aEdgesZ)
const std::vector<TC>& a_edges_x,
const std::vector<TC>& a_edges_y,
const std::vector<TC>& a_edges_z)
:parent(a_title,a_edges_x,a_edges_y,a_edges_z)
{}
virtual ~h3(){}
@@ -28,10 +28,10 @@ public:
{}
h3d(const std::string& a_title,
const std::vector<double>& aEdgesX,
const std::vector<double>& aEdgesY,
const std::vector<double>& aEdgesZ)
:parent(a_title,aEdgesX,aEdgesY,aEdgesZ)
const std::vector<double>& a_edges_x,
const std::vector<double>& a_edges_y,
const std::vector<double>& a_edges_z)
:parent(a_title,a_edges_x,a_edges_y,a_edges_z)
{}
virtual ~h3d(){}
@@ -31,10 +31,10 @@ public:
{}
h3df(const std::string& a_title,
const std::vector<double>& aEdgesX,
const std::vector<double>& aEdgesY,
const std::vector<double>& aEdgesZ)
:parent(a_title,aEdgesX,aEdgesY,aEdgesZ)
const std::vector<double>& a_edges_x,
const std::vector<double>& a_edges_y,
const std::vector<double>& a_edges_z)
:parent(a_title,a_edges_x,a_edges_y,a_edges_z)
{}
virtual ~h3df(){}
@@ -279,8 +279,8 @@ public:
m_bin_Sv2w.resize(parent::m_bin_number,0);
}
p1(const std::string& a_title,const std::vector<TC>& aEdges)
:parent(a_title,aEdges)
p1(const std::string& a_title,const std::vector<TC>& a_edges)
:parent(a_title,a_edges)
,m_cut_v(false)
,m_min_v(0)
,m_max_v(0)
@@ -289,8 +289,8 @@ public:
m_bin_Sv2w.resize(parent::m_bin_number,0);
}
p1(const std::string& a_title,const std::vector<TC>& aEdges,TV aVmin,TV aVmax)
:parent(a_title,aEdges)
p1(const std::string& a_title,const std::vector<TC>& a_edges,TV aVmin,TV aVmax)
:parent(a_title,a_edges)
,m_cut_v(true)
,m_min_v(aVmin)
,m_max_v(aVmax)
@@ -330,8 +330,8 @@ public:
m_max_v = 0;
return true;
}
bool configure(const std::vector<TC>& aEdges) {
if(!parent::configure(aEdges)) return false;
bool configure(const std::vector<TC>& a_edges) {
if(!parent::configure(a_edges)) return false;
m_bin_Svw.clear();
m_bin_Sv2w.clear();
m_bin_Svw.resize(parent::m_bin_number,0);
@@ -352,8 +352,8 @@ public:
m_max_v = aVmax;
return true;
}
bool configure(const std::vector<TC>& aEdges,TV aVmin,TV aVmax) {
if(!parent::configure(aEdges)) return false;
bool configure(const std::vector<TC>& a_edges,TV aVmin,TV aVmax) {
if(!parent::configure(a_edges)) return false;
m_bin_Svw.clear();
m_bin_Sv2w.clear();
m_bin_Svw.resize(parent::m_bin_number,0);
@@ -26,12 +26,12 @@ public:
:parent(a_title,aXnumber,aXmin,aXmax,aVmin,aVmax)
{}
p1d(const std::string& a_title,const std::vector<double>& aEdges)
:parent(a_title,aEdges)
p1d(const std::string& a_title,const std::vector<double>& a_edges)
:parent(a_title,a_edges)
{}
p1d(const std::string& a_title,const std::vector<double>& aEdges,double aVmin,double aVmax)
:parent(a_title,aEdges,aVmin,aVmax)
p1d(const std::string& a_title,const std::vector<double>& a_edges,double aVmin,double aVmax)
:parent(a_title,a_edges,aVmin,aVmax)
{}
virtual ~p1d(){}
+10 -10
View File
@@ -217,9 +217,9 @@ public:
}
p2(const std::string& a_title,
const std::vector<TC>& aEdgesX,
const std::vector<TC>& aEdgesY)
:parent(a_title,aEdgesX,aEdgesY)
const std::vector<TC>& a_edges_x,
const std::vector<TC>& a_edges_y)
:parent(a_title,a_edges_x,a_edges_y)
,m_cut_v(false)
,m_min_v(0)
,m_max_v(0)
@@ -229,10 +229,10 @@ public:
}
p2(const std::string& a_title,
const std::vector<TC>& aEdgesX,
const std::vector<TC>& aEdgesY,
const std::vector<TC>& a_edges_x,
const std::vector<TC>& a_edges_y,
TV aVmin,TV aVmax)
:parent(a_title,aEdgesX,aEdgesY)
:parent(a_title,a_edges_x,a_edges_y)
,m_cut_v(true)
,m_min_v(aVmin)
,m_max_v(aVmax)
@@ -272,8 +272,8 @@ public:
m_max_v = 0;
return true;
}
bool configure(const std::vector<TC>& aEdgesX,const std::vector<TC>& aEdgesY) {
if(!parent::configure(aEdgesX,aEdgesY)) return false;
bool configure(const std::vector<TC>& a_edges_x,const std::vector<TC>& a_edges_y) {
if(!parent::configure(a_edges_x,a_edges_y)) return false;
m_bin_Svw.clear();
m_bin_Sv2w.clear();
m_bin_Svw.resize(parent::m_bin_number,0);
@@ -294,8 +294,8 @@ public:
m_max_v = aVmax;
return true;
}
bool configure(const std::vector<TC>& aEdgesX,const std::vector<TC>& aEdgesY,TV aVmin,TV aVmax) {
if(!parent::configure(aEdgesX,aEdgesY)) return false;
bool configure(const std::vector<TC>& a_edges_x,const std::vector<TC>& a_edges_y,TV aVmin,TV aVmax) {
if(!parent::configure(a_edges_x,a_edges_y)) return false;
m_bin_Svw.clear();
m_bin_Sv2w.clear();
m_bin_Svw.resize(parent::m_bin_number,0);
@@ -32,16 +32,16 @@ public:
{}
p2d(const std::string& a_title,
const std::vector<double>& aEdgesX,
const std::vector<double>& aEdgesY)
:parent(a_title,aEdgesX,aEdgesY)
const std::vector<double>& a_edges_x,
const std::vector<double>& a_edges_y)
:parent(a_title,a_edges_x,a_edges_y)
{}
p2d(const std::string& a_title,
const std::vector<double>& aEdgesX,
const std::vector<double>& aEdgesY,
const std::vector<double>& a_edges_x,
const std::vector<double>& a_edges_y,
double aVmin,double aVmax)
:parent(a_title,aEdgesX,aEdgesY,aVmin,aVmax)
:parent(a_title,a_edges_x,a_edges_y,aVmin,aVmax)
{}
virtual ~p2d(){}