Import Geant4 11.3.0 source tree
This commit is contained in:
+2
-1
@@ -5,6 +5,7 @@
|
||||
#define tools_path
|
||||
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
namespace tools {
|
||||
|
||||
@@ -28,7 +29,7 @@ inline void nosuffix(const std::string& a_string,std::string& a_value,bool a_bac
|
||||
std::string _s = a_string.substr(pos,a_string.size()-pos);
|
||||
std::string::size_type dot_pos = a_back?_s.rfind('.'):_s.find('.');
|
||||
if(dot_pos==std::string::npos) {
|
||||
a_value = _s;
|
||||
a_value = std::move(_s);
|
||||
} else {
|
||||
a_value = _s.substr(0,dot_pos);
|
||||
}
|
||||
|
||||
+9
-8
@@ -22,6 +22,7 @@
|
||||
#endif
|
||||
|
||||
#include <istream>
|
||||
#include <utility>
|
||||
|
||||
namespace tools {
|
||||
namespace rcsv {
|
||||
@@ -196,7 +197,7 @@ public:
|
||||
}
|
||||
planes.push_back(value);
|
||||
}
|
||||
hdata.m_in_range_plane_Sxyw = planes;
|
||||
hdata.m_in_range_plane_Sxyw = std::move(planes);
|
||||
|
||||
} else if(_words[0]=="#bin_number") {
|
||||
if(_words.size()!=2) {
|
||||
@@ -335,8 +336,8 @@ public:
|
||||
tools::histo::profile_data<double,unsigned int,unsigned int,double,double> pdata(hdata); //to be filled correctly.
|
||||
if(is_profile) {
|
||||
pdata.m_is_profile = true;
|
||||
pdata.m_bin_Svw = _bin_Svw;
|
||||
pdata.m_bin_Sv2w = _bin_Sv2w;
|
||||
pdata.m_bin_Svw = std::move(_bin_Svw);
|
||||
pdata.m_bin_Sv2w = std::move(_bin_Sv2w);
|
||||
pdata.m_cut_v = _cut_v;
|
||||
pdata.m_min_v = _min_v;
|
||||
pdata.m_max_v = _max_v;
|
||||
@@ -359,7 +360,7 @@ public:
|
||||
<< ", mean " << h->mean() << ", rms " << h->rms()
|
||||
<< std::endl;
|
||||
}
|
||||
a_class = _class;
|
||||
a_class = std::move(_class);
|
||||
a_obj = h;
|
||||
|
||||
} else if(_class==tools::histo::h2d::s_class()) {
|
||||
@@ -380,7 +381,7 @@ public:
|
||||
<< ", mean_y " << h->mean_y() << ", rms_y " << h->rms_y()
|
||||
<< std::endl;
|
||||
}
|
||||
a_class = _class;
|
||||
a_class = std::move(_class);
|
||||
a_obj = h;
|
||||
|
||||
} else if(_class==tools::histo::h3d::s_class()) {
|
||||
@@ -402,7 +403,7 @@ public:
|
||||
<< ", mean_z " << h->mean_z() << ", rms_z " << h->rms_z()
|
||||
<< std::endl;
|
||||
}
|
||||
a_class = _class;
|
||||
a_class = std::move(_class);
|
||||
a_obj = h;
|
||||
|
||||
} else if(_class==tools::histo::p1d::s_class()) {
|
||||
@@ -422,7 +423,7 @@ public:
|
||||
<< ", mean " << h->mean() << ", rms " << h->rms()
|
||||
<< std::endl;
|
||||
}
|
||||
a_class = _class;
|
||||
a_class = std::move(_class);
|
||||
a_obj = h;
|
||||
|
||||
} else if(_class==tools::histo::p2d::s_class()) {
|
||||
@@ -443,7 +444,7 @@ public:
|
||||
<< ", mean_y " << h->mean_y() << ", rms_y " << h->rms_y()
|
||||
<< std::endl;
|
||||
}
|
||||
a_class = _class;
|
||||
a_class = std::move(_class);
|
||||
a_obj = h;
|
||||
|
||||
/*
|
||||
|
||||
+3
-1
@@ -36,6 +36,8 @@
|
||||
#include "mem"
|
||||
#endif
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace tools {
|
||||
namespace rcsv {
|
||||
|
||||
@@ -599,7 +601,7 @@ public:
|
||||
if(!read_commented_header(a_out,m_reader,_title,_sep,_vec_sep,_cols)) return false;
|
||||
|
||||
m_sep = _sep;
|
||||
m_title = _title;
|
||||
m_title = std::move(_title);
|
||||
|
||||
tools_vforcit(col_desc,_cols,it) {
|
||||
const std::string& type = (*it).first;
|
||||
|
||||
+2
-1
@@ -16,6 +16,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <ostream>
|
||||
#include <utility>
|
||||
|
||||
// in TOOLS_STL, we don't have (yet) a performant map.
|
||||
|
||||
@@ -242,7 +243,7 @@ protected:
|
||||
return false;
|
||||
}
|
||||
|
||||
a_class = scls;
|
||||
a_class = std::move(scls);
|
||||
a_bcnt = (first_int & ~kByteCountMask());
|
||||
|
||||
if(m_verbose) {
|
||||
|
||||
+5
-5
@@ -28,7 +28,7 @@
|
||||
|
||||
#include <list>
|
||||
#include <cmath> //::log10, ::fabs.
|
||||
//#include "../rtausmed"
|
||||
#include <utility>
|
||||
|
||||
namespace tools {
|
||||
namespace rroot {
|
||||
@@ -155,7 +155,7 @@ inline bool TH_read_1D(buffer& a_buffer,hd_data& a_data,
|
||||
std::string title;
|
||||
if(!Named_stream(a_buffer,name,title)) return false;
|
||||
|
||||
a_data.m_title = title;
|
||||
a_data.m_title = std::move(title);
|
||||
|
||||
{short color,style,width;
|
||||
if(!AttLine_stream(a_buffer,color,style,width)) return false;}
|
||||
@@ -436,7 +436,7 @@ inline histo::h1d* TH1D_stream(buffer& a_buffer){
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TH1D")) return 0;
|
||||
|
||||
unsigned int binn = data.m_bin_number;
|
||||
data.m_bin_Sw = bins;
|
||||
data.m_bin_Sw = std::move(bins);
|
||||
|
||||
data.m_bin_entries.resize(binn,0);
|
||||
{std::vector<double> empty;
|
||||
@@ -555,7 +555,7 @@ inline histo::h2d* TH2D_stream(buffer& a_buffer){
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TH2D")) return 0;
|
||||
|
||||
unsigned int binn = data.m_bin_number;
|
||||
data.m_bin_Sw = bins;
|
||||
data.m_bin_Sw = std::move(bins);
|
||||
|
||||
data.m_bin_entries.resize(binn,0);
|
||||
{std::vector<double> empty;
|
||||
@@ -614,7 +614,7 @@ inline histo::h3d* TH3D_stream(buffer& a_buffer){
|
||||
if(!a_buffer.check_byte_count(_s,_c,"TH3D")) return 0;
|
||||
|
||||
unsigned int binn = data.m_bin_number;
|
||||
data.m_bin_Sw = bins;
|
||||
data.m_bin_Sw = std::move(bins);
|
||||
|
||||
data.m_bin_entries.resize(binn,0);
|
||||
{std::vector<double> empty;
|
||||
|
||||
+1
-1
@@ -845,7 +845,7 @@ protected:
|
||||
float b = first_overlap-a*first_scale;
|
||||
//float wanted_scale = -b/a; //zero overlap.
|
||||
float wanted_gap = width.value()*labels_gap.value();
|
||||
float wanted_scale = (-wanted_gap-b)/a;
|
||||
float wanted_scale = (a==0.0f) ? 1 : (-wanted_gap-b)/a; //a==0.0f should not happen.
|
||||
if(wanted_scale<=0) wanted_scale = 1; // this if() should not happen.
|
||||
wanted_scale /= second_scale;
|
||||
{tools_vforcit(matrix*,m_labels_mtxs,it) {
|
||||
|
||||
+4
-2
@@ -39,6 +39,8 @@
|
||||
#include "../sys/atime"
|
||||
#endif
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace tools {
|
||||
namespace sg {
|
||||
|
||||
@@ -5348,7 +5350,7 @@ protected: //vis bins
|
||||
_ws.push_back(value);
|
||||
}
|
||||
}
|
||||
ws = _ws;
|
||||
ws = std::move(_ws);
|
||||
linen = ws.size()/2;
|
||||
}
|
||||
|
||||
@@ -7181,7 +7183,7 @@ protected: //rep
|
||||
yy = verify_log(yy,ymin,dy,ylog);
|
||||
v.push_back(vec3f(xx,yy,a_zz+zz));
|
||||
}
|
||||
contourVector.push_back(v);
|
||||
contourVector.push_back(std::move(v));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-1
@@ -19,6 +19,8 @@
|
||||
#include "../colorf"
|
||||
#include "../S_STRING"
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace tools {
|
||||
namespace sg {
|
||||
|
||||
@@ -558,7 +560,7 @@ public:
|
||||
tools_vforcit(std::string,strings.values(),it) {
|
||||
std::string scut;
|
||||
m_base_text->truncate(*it,th,fw,scut);
|
||||
labcut.push_back(scut);
|
||||
labcut.push_back(std::move(scut));
|
||||
}
|
||||
m_base_text->strings = labcut;}
|
||||
}
|
||||
|
||||
+2
-1
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <utility>
|
||||
|
||||
#include "forit"
|
||||
|
||||
@@ -37,7 +38,7 @@ inline bool replace(std::string& a_string,const std::string& a_old,const std::st
|
||||
status = true;
|
||||
}
|
||||
}
|
||||
a_string = snew;
|
||||
a_string = std::move(snew);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ protected:
|
||||
tess_contour(const tess_contour& a_from):m_out(a_from.m_out),m_triangles(a_from.m_triangles){}
|
||||
tess_contour& operator=(const tess_contour&){return *this;}
|
||||
public:
|
||||
void getFilledArea(const std::vector<std::vector<vec3f> > aContour) {
|
||||
void getFilledArea(const std::vector<std::vector<vec3f> >& aContour) {
|
||||
m_triangles.clear();
|
||||
m_combine_tmps.clear();
|
||||
m_error = false;
|
||||
|
||||
+4
-4
@@ -6,12 +6,12 @@
|
||||
|
||||
#define TOOLS_MAJOR_VERSION 6
|
||||
#define TOOLS_MINOR_VERSION 3
|
||||
#define TOOLS_PATCH_VERSION 0
|
||||
#define TOOLS_VERSION "6.3.0"
|
||||
#define TOOLS_VERSION_VRP "v6r3p0"
|
||||
#define TOOLS_PATCH_VERSION 3
|
||||
#define TOOLS_VERSION "6.3.3"
|
||||
#define TOOLS_VERSION_VRP "v6r3p3"
|
||||
|
||||
namespace tools {
|
||||
inline unsigned int version() {return 60300;}
|
||||
inline unsigned int version() {return 60303;}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+1
-10
@@ -183,6 +183,7 @@ public:
|
||||
uint32 last() const {return m_last;}
|
||||
|
||||
void set_nev(uint32 a_last,uint32 a_nev_buf_size,uint32 a_nev,const int* a_entry_offset,const int* a_displacement) {
|
||||
//used in mpi_create_basket.
|
||||
m_last = a_last;
|
||||
m_nev_buf_size = a_nev_buf_size;
|
||||
m_nev = a_nev;
|
||||
@@ -306,16 +307,6 @@ public:
|
||||
bool kdelete = false;
|
||||
a_file.compress_buffer(m_data,kbuf,klen,kdelete);
|
||||
|
||||
if(klen>m_object_size) {
|
||||
m_out << "tools::wroot::basket::write_on_file :"
|
||||
<< " compression anomaly "
|
||||
<< " m_object_size " << m_object_size
|
||||
<< " klen " << klen
|
||||
<< std::endl;
|
||||
if(kdelete) delete [] kbuf;
|
||||
return false;
|
||||
}
|
||||
|
||||
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."
|
||||
|
||||
+2
-2
@@ -151,13 +151,13 @@ public:
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool write_array(const std::vector<T> a_v) {
|
||||
bool write_array(const std::vector<T>& a_v) {
|
||||
if(!write((uint32)a_v.size())) return false;
|
||||
return write_fast_array(a_v);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
bool write_array2(const std::vector< std::vector<T> > a_v) {
|
||||
bool write_array2(const std::vector< std::vector<T> >& a_v) {
|
||||
if(!write((uint32)a_v.size())) return false;
|
||||
for(unsigned int index=0;index<a_v.size();index++) {
|
||||
if(!write_array(a_v[index])) return false;
|
||||
|
||||
@@ -399,7 +399,7 @@
|
||||
protected:
|
||||
std_vector_column_ref(const std_vector_column_ref& a_from)
|
||||
:icol(a_from)
|
||||
,m_branch(a_from.m_barnch)
|
||||
,m_branch(a_from.m_branch)
|
||||
,m_ref(a_from.m_ref)
|
||||
,m_leaf(0)
|
||||
,m_leaf_count(0)
|
||||
|
||||
+23
-10
@@ -167,7 +167,7 @@ public: //ifile
|
||||
}
|
||||
virtual uint32 compression() const {return m_compress;}
|
||||
virtual void compress_buffer(const buffer& a_buffer,char*& a_kbuf,uint32& a_klen,bool& a_kdel) {
|
||||
//NOTE : if(kdelete) delete [] kbuf;
|
||||
//NOTE: if(kdelete) delete [] kbuf;
|
||||
|
||||
a_kbuf = 0;
|
||||
a_klen = 0;
|
||||
@@ -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::file::compress_buffer :"
|
||||
// << " zlib ziper not found."
|
||||
// << std::endl;
|
||||
a_kbuf = (char*)a_buffer.buf();
|
||||
@@ -188,7 +188,8 @@ public: //ifile
|
||||
const uint32 kMAXBUF = 0xffffff;
|
||||
const uint32 HDRSIZE = 9;
|
||||
uint32 nbuffers = nbytes/kMAXBUF;
|
||||
uint32 buflen = nbytes+HDRSIZE*(nbuffers+1);
|
||||
uint32 buf_out_size = kMAXBUF+HDRSIZE+kMAXBUF/2;
|
||||
uint32 buflen = (nbuffers+1)*buf_out_size;
|
||||
a_kbuf = new char[buflen];
|
||||
a_kdel = true;
|
||||
char* src = (char*)a_buffer.buf();
|
||||
@@ -197,19 +198,30 @@ public: //ifile
|
||||
for(uint32 i=0;i<=nbuffers;i++) {
|
||||
uint32 bufmax = ((i == nbuffers) ? nbytes - nzip : kMAXBUF);
|
||||
uint32 nout;
|
||||
if(!zip(m_out,func,cxlevel,bufmax,src,bufmax,tgt,nout)) {
|
||||
if(!zip(m_out,func,cxlevel,bufmax,src,buf_out_size,tgt,nout)) {
|
||||
delete [] a_kbuf;
|
||||
a_kbuf = (char*)a_buffer.buf();
|
||||
a_klen = a_buffer.length();
|
||||
a_kdel = false;
|
||||
break;
|
||||
return;
|
||||
}
|
||||
tgt += nout; //nout includes HDRSIZE
|
||||
a_klen += nout;
|
||||
src += kMAXBUF;
|
||||
nzip += kMAXBUF;
|
||||
}
|
||||
//::printf("debug : compress : end : %u %u\n",nbytes,klen);
|
||||
if(a_klen>=a_buffer.length()) {
|
||||
//NOTE: It is in the ROOT/IO specification (see ROOT/TKey.cxx/TKey::ReadObj() code) that some data compressions
|
||||
// are detected at read time by checking that "fObjlen > fNbytes-fKeylen", that is to say that
|
||||
// the overall output size (fNbytes-fKeylen) is stricly lower than the input size (fObjlen).
|
||||
// By using the zlib-ng compression library, we saw that we may fall on cases where the overall
|
||||
// output size (a_klen here at this point) may be equal to the input size (a_buffer.lengt()) which
|
||||
// induces problem when reading back the data with ROOT. Then the upper test checks and protects against that.
|
||||
delete [] a_kbuf;
|
||||
a_kbuf = (char*)a_buffer.buf();
|
||||
a_klen = a_buffer.length();
|
||||
a_kdel = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
a_kbuf = (char*)a_buffer.buf();
|
||||
@@ -714,14 +726,14 @@ protected:
|
||||
const uint32 HDRSIZE = 9;
|
||||
|
||||
if(a_tgtsize<HDRSIZE) {
|
||||
a_out << "tools::wroot::directory::zip :"
|
||||
a_out << "tools::wroot::file::zip :"
|
||||
<< " target buffer too small."
|
||||
<< std::endl;
|
||||
a_irep = 0;
|
||||
return false;
|
||||
}
|
||||
if(a_srcsize>0xffffff) {
|
||||
a_out << "tools::wroot::directory::zip :"
|
||||
a_out << "tools::wroot::file::zip :"
|
||||
<< " source buffer too big."
|
||||
<< std::endl;
|
||||
a_irep = 0;
|
||||
@@ -733,14 +745,15 @@ protected:
|
||||
a_srcsize,a_src,
|
||||
a_tgtsize,a_tgt+HDRSIZE,
|
||||
out_size)) {
|
||||
a_out << "tools::wroot::directory::zip :"
|
||||
a_out << "tools::wroot::file::zip :"
|
||||
<< " zipper failed."
|
||||
<< std::endl;
|
||||
a_irep = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
if((HDRSIZE+out_size)>a_tgtsize) {
|
||||
a_out << "tools::wroot::directory::zip :"
|
||||
a_out << "tools::wroot::file::zip :"
|
||||
<< " target buffer overflow."
|
||||
<< std::endl;
|
||||
a_irep = 0;
|
||||
|
||||
+2
-1
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <utility>
|
||||
|
||||
namespace tools {
|
||||
namespace xml {
|
||||
@@ -301,7 +302,7 @@ public: //used in BatchLab::XML_DataReader.
|
||||
bins[iaxis] = num;
|
||||
mns[iaxis] = mn;
|
||||
mxs[iaxis] = mx;
|
||||
edges[iaxis] = borders;
|
||||
edges[iaxis] = std::move(borders);
|
||||
if(variableBins) isVariableBins = true;
|
||||
found++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user