Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
CLHEP
CLHEP
Commits
cd7b1047
Commit
cd7b1047
authored
Jun 20, 2019
by
Lynn Garren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changes from geant4
parent
25289013
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
46 additions
and
63 deletions
+46
-63
ChangeLog
ChangeLog
+11
-0
Geometry/Geometry/BasicVector3D.h
Geometry/Geometry/BasicVector3D.h
+1
-3
Geometry/Geometry/Plane3D.h
Geometry/Geometry/Plane3D.h
+1
-3
Geometry/Geometry/Transform3D.h
Geometry/Geometry/Transform3D.h
+12
-12
Geometry/Geometry/Transform3D.icc
Geometry/Geometry/Transform3D.icc
+12
-12
Geometry/src/Transform3D.cc
Geometry/src/Transform3D.cc
+1
-4
Random/Random/MixMaxRng.h
Random/Random/MixMaxRng.h
+1
-2
Random/src/MixMaxRng.cc
Random/src/MixMaxRng.cc
+7
-27
No files found.
ChangeLog
View file @
cd7b1047
2019-06-20 Gabriele Cosmo <Gabriele.Cosmo@cern.ch>
* Random/Random/MixMaxRng.h: removed not implemented constructor declaration.
* Random/src/MixMaxRng.cc: use throw instead of exit()
* Geometry/Geometry/BasicVector3D.h, Geometry/Geometry/Plane3D.h:
defaulted operator=(); fixing deprecation warnings on gcc-9.1.
* Geometry/Geometry/Transform3D.h, icc: fixed shadowing compilation
warnings as reported on gcc-9.1.
* Geometry/src/Transform3D.cc: fixed typo in printout.
==============================
19.06.19 Release CLHEP-2.4.1.1
==============================
...
...
Geometry/Geometry/BasicVector3D.h
View file @
cd7b1047
...
...
@@ -91,9 +91,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
)
{
...
...
Geometry/Geometry/Plane3D.h
View file @
cd7b1047
...
...
@@ -69,9 +69,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. */
...
...
Geometry/Geometry/Transform3D.h
View file @
cd7b1047
...
...
@@ -216,7 +216,7 @@ namespace HepGeom {
/**
* Constructor: rotation and then translation. */
inline
Transform3D
(
const
CLHEP
::
HepRotation
&
m
,
const
CLHEP
::
Hep3Vector
&
v
);
inline
Transform3D
(
const
CLHEP
::
HepRotation
&
m
t
,
const
CLHEP
::
Hep3Vector
&
v
);
/**
* Constructor: transformation of basis (assumed - no reflection). */
...
...
@@ -229,10 +229,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
&
m
t
)
:
xx_
(
m
t
.
xx_
),
xy_
(
m
t
.
xy_
),
xz_
(
m
t
.
xz_
),
dx_
(
m
t
.
dx_
),
yx_
(
m
t
.
yx_
),
yy_
(
m
t
.
yy_
),
yz_
(
m
t
.
yz_
),
dy_
(
m
t
.
dy_
),
zx_
(
m
t
.
zx_
),
zy_
(
m
t
.
zy_
),
zz_
(
m
t
.
zz_
),
dz_
(
m
t
.
dz_
)
{}
/**
* Destructor.
...
...
@@ -287,10 +287,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
&
m
t
)
{
xx_
=
m
t
.
xx_
;
xy_
=
m
t
.
xy_
;
xz_
=
m
t
.
xz_
;
dx_
=
m
t
.
dx_
;
yx_
=
m
t
.
yx_
;
yy_
=
m
t
.
yy_
;
yz_
=
m
t
.
yz_
;
dy_
=
m
t
.
dy_
;
zx_
=
m
t
.
zx_
;
zy_
=
m
t
.
zy_
;
zz_
=
m
t
.
zz_
;
dz_
=
m
t
.
dz_
;
return
*
this
;
}
...
...
@@ -380,7 +380,7 @@ namespace HepGeom {
/**
* Constructor from CLHEP::HepRotation. */
inline
Rotate3D
(
const
CLHEP
::
HepRotation
&
m
);
inline
Rotate3D
(
const
CLHEP
::
HepRotation
&
m
t
);
/**
* Constructor from angle and axis given by two points.
...
...
@@ -737,8 +737,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
s
c
)
:
Transform3D
(
s
c
,
0
,
0
,
0
,
0
,
s
c
,
0
,
0
,
0
,
0
,
s
c
,
0
)
{}
};
/**
...
...
Geometry/Geometry/Transform3D.icc
View file @
cd7b1047
...
...
@@ -27,20 +27,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 & m
t
, const CLHEP::Hep3Vector & v) {
xx_= m
t
.xx(); xy_= m
t
.xy(); xz_= m
t
.xz();
yx_= m
t
.yx(); yy_= m
t
.yy(); yz_= m
t
.yz();
zx_= m
t
.zx(); zy_= m
t
.zy(); zz_= m
t
.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 m
t
;
return m
t
.rotateAxes(CLHEP::Hep3Vector(xx_,yx_,zx_),
CLHEP::Hep3Vector(xy_,yy_,zy_),
CLHEP::Hep3Vector(xz_,yz_,zz_));
}
inline
...
...
@@ -52,10 +52,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 & m
t
) {
xx_= m
t
.xx(); xy_= m
t
.xy(); xz_= m
t
.xz();
yx_= m
t
.yx(); yy_= m
t
.yy(); yz_= m
t
.yz();
zx_= m
t
.zx(); zy_= m
t
.zy(); zz_= m
t
.zz();
dx_= 0; dy_= 0; dz_= 0;
}
...
...
Geometry/src/Transform3D.cc
View file @
cd7b1047
...
...
@@ -13,12 +13,9 @@
#include <iostream>
#include <cmath> // double std::abs()
#include <stdlib.h> // int std::abs()
#include "CLHEP/Geometry/defs.h"
#include "CLHEP/Geometry/Transform3D.h"
using
std
::
abs
;
namespace
HepGeom
{
const
Transform3D
Transform3D
::
Identity
=
Transform3D
();
...
...
@@ -47,7 +44,7 @@ namespace HepGeom {
if
(
j
==
2
)
{
return
0.0
;
}
if
(
j
==
3
)
{
return
1.0
;
}
}
std
::
cerr
<<
"Transform3D subscripting: bad ind
e
ces "
std
::
cerr
<<
"Transform3D subscripting: bad ind
i
ces "
<<
"("
<<
i
<<
","
<<
j
<<
")"
<<
std
::
endl
;
return
0.0
;
}
...
...
Random/Random/MixMaxRng.h
View file @
cd7b1047
...
...
@@ -56,9 +56,8 @@ public:
MixMaxRng
(
std
::
istream
&
is
);
MixMaxRng
();
MixMaxRng
(
long
seed
);
MixMaxRng
(
int
rowIndex
,
int
colIndex
);
~
MixMaxRng
();
// Constructor and destructor.
// Constructor
s
and destructor.
MixMaxRng
(
const
MixMaxRng
&
rng
);
MixMaxRng
&
operator
=
(
const
MixMaxRng
&
rng
);
...
...
Random/src/MixMaxRng.cc
View file @
cd7b1047
...
...
@@ -119,12 +119,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
...
...
@@ -140,7 +134,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
;
...
...
@@ -148,7 +142,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
;
...
...
@@ -157,7 +151,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
)
{
...
...
@@ -176,7 +170,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
()
)
{
...
...
@@ -187,30 +181,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
;
...
...
@@ -577,8 +565,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
)
{
...
...
@@ -589,10 +575,6 @@ void MixMaxRng::seed_spbox(myuint_t seed)
myuint_t
sumtot
=
0
,
ovflow
=
0
;
if
(
seed
==
0
)
throw
std
::
runtime_error
(
"try seeding with nonzero seed next time"
);
// {
//fprintf(stderr, " try seeding with nonzero seed next time!\n");
//exit(MIXMAX_SEED_WAS_ZERO);
// }
myuint_t
l
=
seed
;
...
...
@@ -605,8 +587,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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment