Import Geant4 10.6.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2019-06-28 11:59:04 +02:00
parent 28a70706e0
commit d0f911957d
1056 changed files with 95168 additions and 78160 deletions
-1
View File
@@ -239,7 +239,6 @@ foreach(__g4clhep_target G4clhep G4clhep-static)
endif()
endforeach()
#----------------------------------------------------------------------------
# Ensure the header directory gets added to the list of ones to export
#
+16
View File
@@ -16,6 +16,22 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
20 June 2019 - G.Cosmo
- Synchronised with CLHEP-2.4.1.2:
MixMaxRng: throw if seed is zero. Use throw instead of exit() elsewhere.
07 June 2019 - G.Cosmo
- Defaulted operator=() also for Plan3D; fixing deprecation warnings
on gcc-9.1.
- Fixed shadowing compilation warnings in Transform3D as reported on gcc-9.1.
06 June 2019 - G.Cosmo
- Defaulted operator=() for BasicVector3D; fixing deprecation warnings
on gcc-9.1.
23 April 2019 - B.Morgan
- Remove G4MULTITHREADED blocks in Utility module
10 July 2018 - G.Cosmo
- Removed not implemented constructor declaration in MixMaxRng.
@@ -89,9 +89,7 @@ namespace HepGeom {
/**
* Assignment. */
BasicVector3D<T> & operator= (const BasicVector3D<T> & v) {
v_[0] = v.v_[0]; v_[1] = v.v_[1]; v_[2] = v.v_[2]; return *this;
}
BasicVector3D<T> & operator= (const BasicVector3D<T> &) = default;
/**
* Addition. */
BasicVector3D<T> & operator+=(const BasicVector3D<T> & v) {
+1 -3
View File
@@ -67,9 +67,7 @@ namespace HepGeom {
/**
* Assignment. */
Plane3D<T> & operator=(const Plane3D<T> & p) {
a_ = p.a_; b_ = p.b_; c_ = p.c_; d_ = p.d_; return *this;
}
Plane3D<T> & operator=(const Plane3D<T> &) = default;
/**
* Returns the a-coefficient in the plane equation: a*x+b*y+c*z+d=0. */
+15 -15
View File
@@ -214,7 +214,7 @@ namespace HepGeom {
/**
* Constructor: rotation and then translation. */
inline Transform3D(const CLHEP::HepRotation & m, const CLHEP::Hep3Vector & v);
inline Transform3D(const CLHEP::HepRotation & mt, const CLHEP::Hep3Vector & v);
/**
* Constructor: transformation of basis (assumed - no reflection). */
@@ -227,10 +227,10 @@ namespace HepGeom {
/**
* Copy constructor. */
Transform3D(const Transform3D & m)
: xx_(m.xx_), xy_(m.xy_), xz_(m.xz_), dx_(m.dx_),
yx_(m.yx_), yy_(m.yy_), yz_(m.yz_), dy_(m.dy_),
zx_(m.zx_), zy_(m.zy_), zz_(m.zz_), dz_(m.dz_) {}
Transform3D(const Transform3D & mt)
: xx_(mt.xx_), xy_(mt.xy_), xz_(mt.xz_), dx_(mt.dx_),
yx_(mt.yx_), yy_(mt.yy_), yz_(mt.yz_), dy_(mt.dy_),
zx_(mt.zx_), zy_(mt.zy_), zz_(mt.zz_), dz_(mt.dz_) {}
/**
* Destructor.
@@ -285,10 +285,10 @@ namespace HepGeom {
/**
* Assignment. */
Transform3D & operator=(const Transform3D &m) {
xx_= m.xx_; xy_= m.xy_; xz_= m.xz_; dx_= m.dx_;
yx_= m.yx_; yy_= m.yy_; yz_= m.yz_; dy_= m.dy_;
zx_= m.zx_; zy_= m.zy_; zz_= m.zz_; dz_= m.dz_;
Transform3D & operator=(const Transform3D &mt) {
xx_= mt.xx_; xy_= mt.xy_; xz_= mt.xz_; dx_= mt.dx_;
yx_= mt.yx_; yy_= mt.yy_; yz_= mt.yz_; dy_= mt.dy_;
zx_= mt.zx_; zy_= mt.zy_; zz_= mt.zz_; dz_= mt.dz_;
return *this;
}
@@ -378,7 +378,7 @@ namespace HepGeom {
/**
* Constructor from CLHEP::HepRotation. */
inline Rotate3D(const CLHEP::HepRotation &m);
inline Rotate3D(const CLHEP::HepRotation &mt);
/**
* Constructor from angle and axis given by two points.
@@ -621,8 +621,8 @@ namespace HepGeom {
class Reflect3D : public Transform3D {
protected:
Reflect3D(double XX, double XY, double XZ, double DX,
double YX, double YY, double YZ, double DY,
double ZX, double ZY, double ZZ, double DZ)
double YX, double YY, double YZ, double DY,
double ZX, double ZY, double ZZ, double DZ)
: Transform3D(XX,XY,XZ,DX, YX,YY,YZ,DY, ZX,ZY,ZZ,DZ) {}
public:
@@ -639,7 +639,7 @@ namespace HepGeom {
/**
* Constructor from a plane given by its normal and origin. */
inline Reflect3D(const Normal3D<double> & normal,
const Point3D<double> & point);
const Point3D<double> & point);
};
/**
@@ -735,8 +735,8 @@ namespace HepGeom {
/**
* Constructor from a number: sets uniform scaling in all directions. */
Scale3D(double s)
: Transform3D(s,0,0,0, 0,s,0,0, 0,0,s,0) {}
Scale3D(double sc)
: Transform3D(sc,0,0,0, 0,sc,0,0, 0,0,sc,0) {}
};
/**
+12 -12
View File
@@ -26,20 +26,20 @@ const Transform3D::Transform3D_row Transform3D::operator[](int i) const {
}
inline
Transform3D::Transform3D(const CLHEP::HepRotation & m, const CLHEP::Hep3Vector & v) {
xx_= m.xx(); xy_= m.xy(); xz_= m.xz();
yx_= m.yx(); yy_= m.yy(); yz_= m.yz();
zx_= m.zx(); zy_= m.zy(); zz_= m.zz();
Transform3D::Transform3D(const CLHEP::HepRotation & mt, const CLHEP::Hep3Vector & v) {
xx_= mt.xx(); xy_= mt.xy(); xz_= mt.xz();
yx_= mt.yx(); yy_= mt.yy(); yz_= mt.yz();
zx_= mt.zx(); zy_= mt.zy(); zz_= mt.zz();
dx_= v.x(); dy_= v.y(); dz_= v.z();
}
inline
CLHEP::HepRotation
Transform3D::getRotation() const {
CLHEP::HepRotation m;
return m.rotateAxes(CLHEP::Hep3Vector(xx_,yx_,zx_),
CLHEP::Hep3Vector(xy_,yy_,zy_),
CLHEP::Hep3Vector(xz_,yz_,zz_));
CLHEP::HepRotation mt;
return mt.rotateAxes(CLHEP::Hep3Vector(xx_,yx_,zx_),
CLHEP::Hep3Vector(xy_,yy_,zy_),
CLHEP::Hep3Vector(xz_,yz_,zz_));
}
inline
@@ -51,10 +51,10 @@ Transform3D::getTranslation() const {
// I N L I N E S F O R R O T A T I O N
inline
Rotate3D::Rotate3D(const CLHEP::HepRotation & m) {
xx_= m.xx(); xy_= m.xy(); xz_= m.xz();
yx_= m.yx(); yy_= m.yy(); yz_= m.yz();
zx_= m.zx(); zy_= m.zy(); zz_= m.zz();
Rotate3D::Rotate3D(const CLHEP::HepRotation & mt) {
xx_= mt.xx(); xy_= mt.xy(); xz_= mt.xz();
yx_= mt.yx(); yy_= mt.yy(); yz_= mt.yz();
zx_= mt.zx(); zy_= mt.zy(); zz_= mt.zz();
dx_= 0; dy_= 0; dz_= 0;
}
+3 -9
View File
@@ -7,15 +7,9 @@
//
// ======================================================================
#if defined (G4MULTITHREADED)
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7) || __clang__ || WIN32
#include <atomic>
#define CLHEP_ATOMIC_INT_TYPE std::atomic<int>
#else
#define CLHEP_ATOMIC_INT_TYPE int
#endif
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7) || __clang__ || WIN32
#include <atomic>
#define CLHEP_ATOMIC_INT_TYPE std::atomic<int>
#else
#define CLHEP_ATOMIC_INT_TYPE int
#endif
@@ -7,14 +7,8 @@
//
// ======================================================================
#if defined (G4MULTITHREADED)
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7) || __clang__ || WIN32
#define CLHEP_THREAD_LOCAL thread_local
#else
#define CLHEP_THREAD_LOCAL
#endif
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7) || __clang__ || WIN32
#define CLHEP_THREAD_LOCAL thread_local
#else
#define CLHEP_THREAD_LOCAL
#endif
+3 -8
View File
@@ -6,14 +6,9 @@
// Use std::atomic when the compiler declares it uses the C++11 standard
//
// ======================================================================
#if defined (G4MULTITHREADED)
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7) || __clang__ || WIN32
#include <atomic>
#define CLHEP_USE_ATOMIC
#endif
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 7) || __clang__ || WIN32
#include <atomic>
#define CLHEP_USE_ATOMIC
#endif
#endif
+8 -28
View File
@@ -118,12 +118,6 @@ void MixMaxRng::saveStatus( const char filename[] ) const
}
}
#define MIXMAX_ARRAY_INDEX_OUT_OF_BOUNDS 0xFF01
#define MIXMAX_SEED_WAS_ZERO 0xFF02
#define MIXMAX_ERROR_READING_STATE_FILE 0xFF03
#define MIXMAX_ERROR_READING_STATE_COUNTER 0xFF04
#define MIXMAX_ERROR_READING_STATE_CHECKSUM 0xFF05
void MixMaxRng::restoreStatus( const char filename[] )
{
// a function for reading the state from a file
@@ -139,7 +133,7 @@ void MixMaxRng::restoreStatus( const char filename[] )
else
{
fprintf(stderr, "mixmax -> read_state: error reading file %s\n", filename);
exit(MIXMAX_ERROR_READING_STATE_FILE);
throw std::runtime_error("Error in reading state file");
}
myuint_t vecVal;
@@ -147,7 +141,7 @@ void MixMaxRng::restoreStatus( const char filename[] )
if (!fscanf(fin, "%llu", &S.V[0]) )
{
fprintf(stderr, "mixmax -> read_state: error reading file %s\n", filename);
exit(MIXMAX_ERROR_READING_STATE_FILE);
throw std::runtime_error("Error in reading state file");
}
int i;
@@ -156,7 +150,7 @@ void MixMaxRng::restoreStatus( const char filename[] )
if (!fscanf(fin, ", %llu", &vecVal) )
{
fprintf(stderr, "mixmax -> read_state: error reading vector component i=%d from file %s\n", i, filename);
exit(MIXMAX_ERROR_READING_STATE_FILE);
throw std::runtime_error("Error in reading state file");
}
if( vecVal <= MixMaxRng::M61 )
{
@@ -175,7 +169,7 @@ void MixMaxRng::restoreStatus( const char filename[] )
if (!fscanf( fin, "}; counter=%i; ", &counter))
{
fprintf(stderr, "mixmax -> read_state: error reading counter from file %s\n", filename);
exit(MIXMAX_ERROR_READING_STATE_FILE);
throw std::runtime_error("Error in reading state file");
}
if( counter <= rng_get_N() )
{
@@ -186,30 +180,24 @@ void MixMaxRng::restoreStatus( const char filename[] )
fprintf(stderr, "mixmax -> read_state: Invalid counter = %d"
" Must be 0 <= counter < %u\n" , counter, rng_get_N());
print_state();
exit(MIXMAX_ERROR_READING_STATE_COUNTER);
throw std::runtime_error("Error in reading state counter");
}
precalc();
myuint_t sumtot;
if (!fscanf( fin, "sumtot=%llu\n", &sumtot))
{
fprintf(stderr, "mixmax -> read_state: error reading checksum from file %s\n", filename);
exit(MIXMAX_ERROR_READING_STATE_FILE);
throw std::runtime_error("Error in reading state file");
}
if (S.sumtot != sumtot)
{
fprintf(stderr, "mixmax -> checksum error while reading state from file %s - corrupted?\n", filename);
exit(MIXMAX_ERROR_READING_STATE_CHECKSUM);
throw std::runtime_error("Error in reading state checksum");
}
fclose(fin);
}
#undef MIXMAX_ARRAY_INDEX_OUT_OF_BOUNDS
#undef MIXMAX_SEED_WAS_ZERO
#undef MIXMAX_ERROR_READING_STATE_FILE
#undef MIXMAX_ERROR_READING_STATE_COUNTER
#undef MIXMAX_ERROR_READING_STATE_CHECKSUM
void MixMaxRng::showStatus() const
{
std::cout << std::endl;
@@ -576,8 +564,6 @@ void MixMaxRng::seed_vielbein(unsigned int index)
S.counter = N; // set the counter to N if iteration should happen right away
S.sumtot = 1;
}
#define MIXMAX_SEED_WAS_ZERO 0xFF02
void MixMaxRng::seed_spbox(myuint_t seed)
{
@@ -587,11 +573,7 @@ void MixMaxRng::seed_spbox(myuint_t seed)
int i;
myuint_t sumtot=0,ovflow=0;
if (seed == 0)
{
fprintf(stderr, " try seeding with nonzero seed next time!\n");
exit(MIXMAX_SEED_WAS_ZERO);
}
if (seed == 0) throw std::runtime_error("try seeding with nonzero seed next time");
myuint_t l = seed;
@@ -604,8 +586,6 @@ void MixMaxRng::seed_spbox(myuint_t seed)
S.sumtot = MIXMAX_MOD_MERSENNE(MIXMAX_MOD_MERSENNE(sumtot) + (ovflow <<3 ));
}
#undef MIXMAX_SEED_WAS_ZERO
void MixMaxRng::seed_uniquestream( myID_t clusterID, myID_t machineID, myID_t runID, myID_t streamID )
{
seed_vielbein(0);