diff --git a/math/genvector/inc/Math/GenVector/LorentzRotation.h b/math/genvector/inc/Math/GenVector/LorentzRotation.h index 1a7cc64b7de9a4165fab91d202d53403fd806753..b9dab83e3216f4074b9b3009e7055323c93e803e 100644 --- a/math/genvector/inc/Math/GenVector/LorentzRotation.h +++ b/math/genvector/inc/Math/GenVector/LorentzRotation.h @@ -78,15 +78,19 @@ public: template<class IT> LorentzRotation(IT begin, IT end) { SetComponents(begin,end); } + // The compiler-generated and dtor are OK but we have implementwd the copy-ctor and + // assignment operators since we have a template assignment + + /** + Copy constructor + */ + LorentzRotation( LorentzRotation const & r ) { + *this = r; + } + /** Construct from a pure boost */ - -//explicit LorentzRotation( Boost const & ) {} // TODO -//explicit LorentzRotation( BoostX const & ) {} // TODO -//explicit LorentzRotation( BoostY const & ) {} // TODO -//explicit LorentzRotation( BoostZ const & ) {} // TODO - explicit LorentzRotation( Boost const & b ) { b.GetLorentzRotation( fM+0 ); } explicit LorentzRotation( BoostX const & bx ) { bx.GetLorentzRotation( fM+0 ); } explicit LorentzRotation( BoostY const & by ) { by.GetLorentzRotation( fM+0 ); } @@ -125,8 +129,7 @@ public: const Foreign4Vector& v2, const Foreign4Vector& v3, const Foreign4Vector& v4 ) { SetComponents(v1, v2, v3, v4); } - - // The compiler-generated copy ctor, copy assignment, and dtor are OK. + /** Raw constructor from sixteen Scalar components (without any checking) @@ -142,6 +145,18 @@ public: tx, ty, tz, tt); } + /** + Assign from another LorentzRotation + */ + LorentzRotation & + operator=( LorentzRotation const & rhs ) { + SetComponents( rhs.fM[0], rhs.fM[1], rhs.fM[2], rhs.fM[3], + rhs.fM[4], rhs.fM[5], rhs.fM[6], rhs.fM[7], + rhs.fM[8], rhs.fM[9], rhs.fM[10], rhs.fM[11], + rhs.fM[12], rhs.fM[13], rhs.fM[14], rhs.fM[15] ); + return *this; + } + /** Assign from a pure boost */ @@ -180,7 +195,13 @@ public: */ template<class ForeignMatrix> LorentzRotation & - operator=(const ForeignMatrix & m) { SetComponents(m); return *this; } + operator=(const ForeignMatrix & m) { + SetComponents( m(0,0), m(0,1), m(0,2), m(0,3), + m(1,0), m(1,1), m(1,2), m(1,3), + m(2,0), m(2,1), m(2,2), m(2,3), + m(3,0), m(3,1), m(3,2), m(3,3) ); + return *this; + } /** Re-adjust components to eliminate small deviations from a perfect diff --git a/math/genvector/inc/Math/GenVector/Rotation3D.h b/math/genvector/inc/Math/GenVector/Rotation3D.h index 5eee64af4977af12a3f426bd3a5444200d36cec3..d6594e01c6ceabce98aaee75e7f10a6cc0d67190 100644 --- a/math/genvector/inc/Math/GenVector/Rotation3D.h +++ b/math/genvector/inc/Math/GenVector/Rotation3D.h @@ -161,15 +161,9 @@ public: */ Rotation3D & operator=( Rotation3D const & rhs ) { - fM[0] = rhs.fM[0]; - fM[1] = rhs.fM[1]; - fM[2] = rhs.fM[2]; - fM[3] = rhs.fM[3]; - fM[4] = rhs.fM[4]; - fM[5] = rhs.fM[5]; - fM[6] = rhs.fM[6]; - fM[7] = rhs.fM[7]; - fM[8] = rhs.fM[8]; + SetComponents( rhs.fM[0], rhs.fM[1], rhs.fM[2], + rhs.fM[3], rhs.fM[4], rhs.fM[5], + rhs.fM[6], rhs.fM[7], rhs.fM[8] ); return *this; } diff --git a/math/genvector/test/coordinates3D.cxx b/math/genvector/test/coordinates3D.cxx index d823a627701461184b9ca06f92d5dac5d47f1052..574a14db398fc2cb6ce07e2937983c2111c8ed55 100644 --- a/math/genvector/test/coordinates3D.cxx +++ b/math/genvector/test/coordinates3D.cxx @@ -254,7 +254,7 @@ int test3D ( const DisplacementVector3D<C> & v, double ticks ) { -int main () { +int coordinates3D () { int ret = 0; ret |= test3D (XYZVector ( 0.0, 0.0, 0.0 ) ,2 ); @@ -303,3 +303,7 @@ int main () { return ret; } + +int main() { + return coordinates3D(); +} diff --git a/math/genvector/test/coordinates4D.cxx b/math/genvector/test/coordinates4D.cxx index be625e5529c83de17ef8a570bf34af36de8c11c2..1d36f2baa237ead44e053a6bc373804af9fb5050 100644 --- a/math/genvector/test/coordinates4D.cxx +++ b/math/genvector/test/coordinates4D.cxx @@ -213,7 +213,7 @@ int test4D ( const LorentzVector<C> & v, double ticks ) { } -int main () { +int coordinates4D () { int ret = 0; ret |= test4D (XYZTVector ( 0.0, 0.0, 0.0, 0.0 ) , 1 ); @@ -238,3 +238,6 @@ int main () { return ret; } +int main() { + return coordinates4D(); +}