Commit 0dd3388e authored by Lynn Garren's avatar Lynn Garren
Browse files

Merge branch 'warnings-gcc11' into 'develop'

Fixed compilation warnings on gcc-11 & added new units/constants

See merge request !12
parents 759c5763 2a67a1b0
18 May 2021 - G.Cosmo
* Fixed compilation warnings on gcc-11 for shadowing in Random headers.
==============================
19.01.21 Release CLHEP-2.4.4.1
==============================
......
......@@ -145,6 +145,7 @@ private:
#if defined __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#pragma GCC diagnostic ignored "-Wuninitialized"
#endif
inline double convert1double(myuint_t u)
{
......
......@@ -65,29 +65,29 @@ public:
// Static methods to shoot random values using the static generator
static long shoot( double m=1.0 );
static long shoot( double mean=1.0 );
static void shootArray ( const int size, long* vect, double m=1.0 );
static void shootArray ( const int size, long* vect, double mean=1.0 );
// Static methods to shoot random values using a given engine
// by-passing the static generator.
static long shoot( HepRandomEngine* anEngine, double m=1.0 );
static long shoot( HepRandomEngine* anEngine, double mean=1.0 );
static void shootArray ( HepRandomEngine* anEngine,
const int size, long* vect, double m=1.0 );
const int size, long* vect, double mean=1.0 );
// Methods using the localEngine to shoot random values, by-passing
// the static generator.
long fire();
long fire( double m );
long fire( double mean );
void fireArray ( const int size, long* vect );
void fireArray ( const int size, long* vect, double m);
void fireArray ( const int size, long* vect, double mean);
double operator()();
double operator()( double m );
double operator()( double mean );
std::string name() const;
HepRandomEngine & engine();
......
......@@ -73,29 +73,29 @@ public:
// Static methods to shoot random values using the static generator
static long shoot( double m=1.0 );
static long shoot( double mean=1.0 );
static void shootArray ( const int size, long* vect, double m=1.0 );
static void shootArray ( const int size, long* vect, double mean=1.0 );
// Static methods to shoot random values using a given engine
// by-passing the static generator.
static long shoot( HepRandomEngine* anEngine, double m=1.0 );
static long shoot( HepRandomEngine* anEngine, double mean=1.0 );
static void shootArray ( HepRandomEngine* anEngine,
const int size, long* vect, double m=1.0 );
const int size, long* vect, double mean=1.0 );
// Methods using the localEngine to shoot random values, by-passing
// the static generator.
long fire();
long fire( double m );
long fire( double mean );
void fireArray ( const int size, long* vect );
void fireArray ( const int size, long* vect, double m);
void fireArray ( const int size, long* vect, double mean);
double operator()();
double operator()( double m );
double operator()( double mean );
std::string name() const;
HepRandomEngine & engine();
......
......@@ -96,7 +96,7 @@ public:
// Static member functions using the static generator
// --------------------------------------------------
static void setTheSeed(long seed, int lux=3);
static void setTheSeed(long seed, int lxr=3);
// (Re)Initializes the generator with a seed.
static long getTheSeed();
......
......@@ -53,8 +53,8 @@ public:
Ranlux64Engine( std::istream& is );
Ranlux64Engine();
Ranlux64Engine( long seed, int lux = 1 );
Ranlux64Engine( int rowIndex, int colIndex, int lux );
Ranlux64Engine( long seed, int lxr = 1 );
Ranlux64Engine( int rowIndex, int colIndex, int lxr );
virtual ~Ranlux64Engine();
// Constructors and destructor
......@@ -65,10 +65,10 @@ public:
void flatArray (const int size, double* vect);
// Fills the array "vect" of specified size with flat random values.
void setSeed(long seed, int lux=1);
void setSeed(long seed, int lxr=1);
// Sets the state of the algorithm according to seed.
void setSeeds(const long * seeds, int lux=1);
void setSeeds(const long * seeds, int lxr=1);
// Sets the state of the algorithm according to the zero terminated
// array of seeds. Only the first seed is used.
......
......@@ -49,8 +49,8 @@ public:
RanluxEngine( std::istream& is );
RanluxEngine();
RanluxEngine( long seed, int lux = 3 );
RanluxEngine( int rowIndex, int colIndex, int lux );
RanluxEngine( long seed, int lxr = 3 );
RanluxEngine( int rowIndex, int colIndex, int lxr );
virtual ~RanluxEngine();
// Constructors and destructor
......@@ -72,10 +72,10 @@ public:
void flatArray (const int size, double* vect);
// Fills the array "vect" of specified size with flat random values.
void setSeed(long seed, int lux=3);
void setSeed(long seed, int lxr=3);
// Sets the state of the algorithm according to seed.
void setSeeds(const long * seeds, int lux=3);
void setSeeds(const long * seeds, int lxr=3);
// Sets the state of the algorithm according to the zero terminated
// array of seeds. Only the first seed is used.
......
2021-05-18 Gabriele Cosmo <Gabriele.Cosmo@cern.ch>
* Updated values in SystemOfUnits.h and PhysicalConstants.h (M.Maire):
Added units: minute, hour, day, year and millielectronvolt.
Added constants: Bohr_magneton and nuclear_magneton.
==============================
19.01.21 Release CLHEP-2.4.4.1
==============================
......
......@@ -33,9 +33,10 @@
// 23.02.96 Created
// 26.03.96 Added constants for standard conditions of temperature
// and pressure; also added Gas threshold.
// 29.04.08 use PDG 2006 values
// 03.11.08 use PDG 2008 values
// 17.07.20 use PDG 2019 values
// 29.04.08 Use PDG 2006 values
// 03.11.08 Use PDG 2008 values
// 17.07.20 Use PDG 2019 values
// 06.05.21 Added Bohr_magneton and nuclear_magneton constants
#ifndef HEP_PHYSICAL_CONSTANTS_H
#define HEP_PHYSICAL_CONSTANTS_H
......@@ -107,6 +108,10 @@ static constexpr double alpha_rcl2 = fine_structure_const
static constexpr double twopi_mc2_rcl2 = twopi*electron_mass_c2
*classic_electr_radius
*classic_electr_radius;
static constexpr double Bohr_magneton = (eplus*hbarc*c_light)/(2*electron_mass_c2);
static constexpr double nuclear_magneton = (eplus*hbarc*c_light)/(2*proton_mass_c2);
//
//
//
......
......@@ -43,6 +43,7 @@
// 19.08.15 added liter and its sub units (mma)
// 12.01.16 added symbols for microsecond (us) and picosecond (ps) (mma)
// 17.07.20 use PDG 2019 value of e_SI
// 06.05.21 added minute, hour, day, year and millielectronvolt (mma)
#ifndef HEP_SYSTEM_OF_UNITS_H
#define HEP_SYSTEM_OF_UNITS_H
......@@ -143,6 +144,11 @@ namespace CLHEP {
static constexpr double microsecond = 1.e-6 *second;
static constexpr double picosecond = 1.e-12*second;
static constexpr double minute = 60*second;
static constexpr double hour = 60*minute;
static constexpr double day = 24*hour;
static constexpr double year = 365*day;
static constexpr double hertz = 1./second;
static constexpr double kilohertz = 1.e+3*hertz;
static constexpr double megahertz = 1.e+6*hertz;
......@@ -170,6 +176,7 @@ namespace CLHEP {
static constexpr double gigaelectronvolt = 1.e+3*megaelectronvolt;
static constexpr double teraelectronvolt = 1.e+6*megaelectronvolt;
static constexpr double petaelectronvolt = 1.e+9*megaelectronvolt;
static constexpr double millielectronvolt = 1.e-9*megaelectronvolt;
static constexpr double joule = electronvolt/e_SI;// joule = 6.24150 e+12 * MeV
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment