diff --git a/hist/hist/inc/THistRange.h b/hist/hist/inc/THistRange.h index 20ee906c648e8..7dfe708ccfc43 100644 --- a/hist/hist/inc/THistRange.h +++ b/hist/hist/inc/THistRange.h @@ -45,7 +45,7 @@ class TBinIterator { int fDim; ///< Histogram dimension - /// Compute global bin number given x,y,x bin numbers + /// Compute global bin number given x,y,z bin numbers void SetGlobalBin() { if (fDim == 1) diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/3DConversions.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/3DConversions.h index 4752160be49e3..37988a85db679 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/3DConversions.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/3DConversions.h @@ -59,61 +59,61 @@ void convert(Rotation3D const &from, RotationZYX &to); // ---------------------------------------------------------------------- // conversions from AxisAngle -void convert(AxisAngle const &from, Rotation3D &to); -void convert(AxisAngle const &from, EulerAngles &to); -void convert(AxisAngle const &from, Quaternion &to); -void convert(AxisAngle const &from, RotationZYX &to); +void convert(::ROOT::ROOT_MATH_ARCH::AxisAngle const &from, ::ROOT::ROOT_MATH_ARCH::Rotation3D &to); +void convert(::ROOT::ROOT_MATH_ARCH::AxisAngle const &from, ::ROOT::ROOT_MATH_ARCH::EulerAngles &to); +void convert(::ROOT::ROOT_MATH_ARCH::AxisAngle const &from, ::ROOT::ROOT_MATH_ARCH::Quaternion &to); +void convert(::ROOT::ROOT_MATH_ARCH::AxisAngle const &from, ::ROOT::ROOT_MATH_ARCH::RotationZYX &to); // ---------------------------------------------------------------------- // conversions from EulerAngles -void convert(EulerAngles const &from, Rotation3D &to); -void convert(EulerAngles const &from, AxisAngle &to); -void convert(EulerAngles const &from, Quaternion &to); -void convert(EulerAngles const &from, RotationZYX &to); +void convert(::ROOT::ROOT_MATH_ARCH::EulerAngles const &from, ::ROOT::ROOT_MATH_ARCH::Rotation3D &to); +void convert(::ROOT::ROOT_MATH_ARCH::EulerAngles const &from, ::ROOT::ROOT_MATH_ARCH::AxisAngle &to); +void convert(::ROOT::ROOT_MATH_ARCH::EulerAngles const &from, ::ROOT::ROOT_MATH_ARCH::Quaternion &to); +void convert(::ROOT::ROOT_MATH_ARCH::EulerAngles const &from, ::ROOT::ROOT_MATH_ARCH::RotationZYX &to); // ---------------------------------------------------------------------- // conversions from Quaternion -void convert(Quaternion const &from, Rotation3D &to); -void convert(Quaternion const &from, AxisAngle &to); -void convert(Quaternion const &from, EulerAngles &to); -void convert(Quaternion const &from, RotationZYX &to); +void convert(::ROOT::ROOT_MATH_ARCH::Quaternion const &from, ::ROOT::ROOT_MATH_ARCH::Rotation3D &to); +void convert(::ROOT::ROOT_MATH_ARCH::Quaternion const &from, ::ROOT::ROOT_MATH_ARCH::AxisAngle &to); +void convert(::ROOT::ROOT_MATH_ARCH::Quaternion const &from, ::ROOT::ROOT_MATH_ARCH::EulerAngles &to); +void convert(::ROOT::ROOT_MATH_ARCH::Quaternion const &from, ::ROOT::ROOT_MATH_ARCH::RotationZYX &to); // ---------------------------------------------------------------------- // conversions from RotationZYX -void convert(RotationZYX const &from, Rotation3D &to); -void convert(RotationZYX const &from, AxisAngle &to); -void convert(RotationZYX const &from, EulerAngles &to); -void convert(RotationZYX const &from, Quaternion &to); +void convert(::ROOT::ROOT_MATH_ARCH::RotationZYX const &from, ::ROOT::ROOT_MATH_ARCH::Rotation3D &to); +void convert(::ROOT::ROOT_MATH_ARCH::RotationZYX const &from, ::ROOT::ROOT_MATH_ARCH::AxisAngle &to); +void convert(::ROOT::ROOT_MATH_ARCH::RotationZYX const &from, ::ROOT::ROOT_MATH_ARCH::EulerAngles &to); +void convert(::ROOT::ROOT_MATH_ARCH::RotationZYX const &from, ::ROOT::ROOT_MATH_ARCH::Quaternion &to); // ---------------------------------------------------------------------- // conversions from RotationX -void convert(RotationX const &from, Rotation3D &to); -void convert(RotationX const &from, RotationZYX &to); -void convert(RotationX const &from, AxisAngle &to); -void convert(RotationX const &from, EulerAngles &to); -void convert(RotationX const &from, Quaternion &to); +void convert(::ROOT::ROOT_MATH_ARCH::RotationX const &from, ::ROOT::ROOT_MATH_ARCH::Rotation3D &to); +void convert(::ROOT::ROOT_MATH_ARCH::RotationX const &from, ::ROOT::ROOT_MATH_ARCH::RotationZYX &to); +void convert(::ROOT::ROOT_MATH_ARCH::RotationX const &from, ::ROOT::ROOT_MATH_ARCH::AxisAngle &to); +void convert(::ROOT::ROOT_MATH_ARCH::RotationX const &from, ::ROOT::ROOT_MATH_ARCH::EulerAngles &to); +void convert(::ROOT::ROOT_MATH_ARCH::RotationX const &from, ::ROOT::ROOT_MATH_ARCH::Quaternion &to); // ---------------------------------------------------------------------- // conversions from RotationY -void convert(RotationY const &from, Rotation3D &to); -void convert(RotationY const &from, RotationZYX &to); -void convert(RotationY const &from, AxisAngle &to); -void convert(RotationY const &from, EulerAngles &to); -void convert(RotationY const &from, Quaternion &to); +void convert(::ROOT::ROOT_MATH_ARCH::RotationY const &from, ::ROOT::ROOT_MATH_ARCH::Rotation3D &to); +void convert(::ROOT::ROOT_MATH_ARCH::RotationY const &from, ::ROOT::ROOT_MATH_ARCH::RotationZYX &to); +void convert(::ROOT::ROOT_MATH_ARCH::RotationY const &from, ::ROOT::ROOT_MATH_ARCH::AxisAngle &to); +void convert(::ROOT::ROOT_MATH_ARCH::RotationY const &from, ::ROOT::ROOT_MATH_ARCH::EulerAngles &to); +void convert(::ROOT::ROOT_MATH_ARCH::RotationY const &from, ::ROOT::ROOT_MATH_ARCH::Quaternion &to); // ---------------------------------------------------------------------- // conversions from RotationZ -void convert(RotationZ const &from, Rotation3D &to); -void convert(RotationZ const &from, RotationZYX &to); -void convert(RotationZ const &from, AxisAngle &to); -void convert(RotationZ const &from, EulerAngles &to); -void convert(RotationZ const &from, Quaternion &to); +void convert(::ROOT::ROOT_MATH_ARCH::RotationZ const &from, ::ROOT::ROOT_MATH_ARCH::Rotation3D &to); +void convert(::ROOT::ROOT_MATH_ARCH::RotationZ const &from, ::ROOT::ROOT_MATH_ARCH::RotationZYX &to); +void convert(::ROOT::ROOT_MATH_ARCH::RotationZ const &from, ::ROOT::ROOT_MATH_ARCH::AxisAngle &to); +void convert(::ROOT::ROOT_MATH_ARCH::RotationZ const &from, ::ROOT::ROOT_MATH_ARCH::EulerAngles &to); +void convert(::ROOT::ROOT_MATH_ARCH::RotationZ const &from, ::ROOT::ROOT_MATH_ARCH::Quaternion &to); } // namespace gv_detail } // namespace ROOT_MATH_ARCH diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/3DDistances.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/3DDistances.h index b5cc451100cfc..2c5e5027eaff6 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/3DDistances.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/3DDistances.h @@ -49,95 +49,95 @@ namespace gv_detail { // ---------------------------------------------------------------------- // Distance from Rotation3D -double dist(Rotation3D const &r1, Rotation3D const &r2); -double dist(Rotation3D const &r1, AxisAngle const &r2); -double dist(Rotation3D const &r1, EulerAngles const &r2); -double dist(Rotation3D const &r1, Quaternion const &r2); -double dist(Rotation3D const &r1, RotationZYX const &r2); -double dist(Rotation3D const &r1, RotationX const &r2); -double dist(Rotation3D const &r1, RotationY const &r2); -double dist(Rotation3D const &r1, RotationZ const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::Rotation3D const &r1, ::ROOT::ROOT_MATH_ARCH::Rotation3D const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::Rotation3D const &r1, ::ROOT::ROOT_MATH_ARCH::AxisAngle const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::Rotation3D const &r1, ::ROOT::ROOT_MATH_ARCH::EulerAngles const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::Rotation3D const &r1, ::ROOT::ROOT_MATH_ARCH::Quaternion const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::Rotation3D const &r1, ::ROOT::ROOT_MATH_ARCH::RotationZYX const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::Rotation3D const &r1, ::ROOT::ROOT_MATH_ARCH::RotationX const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::Rotation3D const &r1, ::ROOT::ROOT_MATH_ARCH::RotationY const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::Rotation3D const &r1, ::ROOT::ROOT_MATH_ARCH::RotationZ const &r2); // ---------------------------------------------------------------------- // Distance from AxisAngle -double dist(AxisAngle const &r1, Rotation3D const &r2); -double dist(AxisAngle const &r1, AxisAngle const &r2); -double dist(AxisAngle const &r1, EulerAngles const &r2); -double dist(AxisAngle const &r1, Quaternion const &r2); -double dist(AxisAngle const &r1, RotationZYX const &r2); -double dist(AxisAngle const &r1, RotationX const &r2); -double dist(AxisAngle const &r1, RotationY const &r2); -double dist(AxisAngle const &r1, RotationZ const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::AxisAngle const &r1, ::ROOT::ROOT_MATH_ARCH::Rotation3D const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::AxisAngle const &r1, ::ROOT::ROOT_MATH_ARCH::AxisAngle const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::AxisAngle const &r1, ::ROOT::ROOT_MATH_ARCH::EulerAngles const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::AxisAngle const &r1, ::ROOT::ROOT_MATH_ARCH::Quaternion const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::AxisAngle const &r1, ::ROOT::ROOT_MATH_ARCH::RotationZYX const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::AxisAngle const &r1, ::ROOT::ROOT_MATH_ARCH::RotationX const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::AxisAngle const &r1, ::ROOT::ROOT_MATH_ARCH::RotationY const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::AxisAngle const &r1, ::ROOT::ROOT_MATH_ARCH::RotationZ const &r2); // ---------------------------------------------------------------------- // Distance from EulerAngles -double dist(EulerAngles const &r1, Rotation3D const &r2); -double dist(EulerAngles const &r1, AxisAngle const &r2); -double dist(EulerAngles const &r1, EulerAngles const &r2); -double dist(EulerAngles const &r1, Quaternion const &r2); -double dist(EulerAngles const &r1, RotationZYX const &r2); -double dist(EulerAngles const &r1, RotationX const &r2); -double dist(EulerAngles const &r1, RotationY const &r2); -double dist(EulerAngles const &r1, RotationZ const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::EulerAngles const &r1, ::ROOT::ROOT_MATH_ARCH::Rotation3D const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::EulerAngles const &r1, ::ROOT::ROOT_MATH_ARCH::AxisAngle const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::EulerAngles const &r1, ::ROOT::ROOT_MATH_ARCH::EulerAngles const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::EulerAngles const &r1, ::ROOT::ROOT_MATH_ARCH::Quaternion const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::EulerAngles const &r1, ::ROOT::ROOT_MATH_ARCH::RotationZYX const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::EulerAngles const &r1, ::ROOT::ROOT_MATH_ARCH::RotationX const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::EulerAngles const &r1, ::ROOT::ROOT_MATH_ARCH::RotationY const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::EulerAngles const &r1, ::ROOT::ROOT_MATH_ARCH::RotationZ const &r2); // ---------------------------------------------------------------------- // Distance from Quaternion -double dist(Quaternion const &r1, Rotation3D const &r2); -double dist(Quaternion const &r1, AxisAngle const &r2); -double dist(Quaternion const &r1, EulerAngles const &r2); -double dist(Quaternion const &r1, Quaternion const &r2); -double dist(Quaternion const &r1, RotationZYX const &r2); -double dist(Quaternion const &r1, RotationX const &r2); -double dist(Quaternion const &r1, RotationY const &r2); -double dist(Quaternion const &r1, RotationZ const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::Quaternion const &r1, ::ROOT::ROOT_MATH_ARCH::Rotation3D const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::Quaternion const &r1, ::ROOT::ROOT_MATH_ARCH::AxisAngle const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::Quaternion const &r1, ::ROOT::ROOT_MATH_ARCH::EulerAngles const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::Quaternion const &r1, ::ROOT::ROOT_MATH_ARCH::Quaternion const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::Quaternion const &r1, ::ROOT::ROOT_MATH_ARCH::RotationZYX const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::Quaternion const &r1, ::ROOT::ROOT_MATH_ARCH::RotationX const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::Quaternion const &r1, ::ROOT::ROOT_MATH_ARCH::RotationY const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::Quaternion const &r1, ::ROOT::ROOT_MATH_ARCH::RotationZ const &r2); // ---------------------------------------------------------------------- // Distance from RotationZYX -double dist(RotationZYX const &r1, Rotation3D const &r2); -double dist(RotationZYX const &r1, AxisAngle const &r2); -double dist(RotationZYX const &r1, EulerAngles const &r2); -double dist(RotationZYX const &r1, Quaternion const &r2); -double dist(RotationZYX const &r1, RotationZYX const &r2); -double dist(RotationZYX const &r1, RotationX const &r2); -double dist(RotationZYX const &r1, RotationY const &r2); -double dist(RotationZYX const &r1, RotationZ const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationZYX const &r1, ::ROOT::ROOT_MATH_ARCH::Rotation3D const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationZYX const &r1, ::ROOT::ROOT_MATH_ARCH::AxisAngle const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationZYX const &r1, ::ROOT::ROOT_MATH_ARCH::EulerAngles const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationZYX const &r1, ::ROOT::ROOT_MATH_ARCH::Quaternion const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationZYX const &r1, ::ROOT::ROOT_MATH_ARCH::RotationZYX const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationZYX const &r1, ::ROOT::ROOT_MATH_ARCH::RotationX const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationZYX const &r1, ::ROOT::ROOT_MATH_ARCH::RotationY const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationZYX const &r1, ::ROOT::ROOT_MATH_ARCH::RotationZ const &r2); // ---------------------------------------------------------------------- // Distance from RotationX -double dist(RotationX const &r1, Rotation3D const &r2); -double dist(RotationX const &r1, AxisAngle const &r2); -double dist(RotationX const &r1, EulerAngles const &r2); -double dist(RotationX const &r1, Quaternion const &r2); -double dist(RotationX const &r1, RotationX const &r2); -double dist(RotationX const &r1, RotationY const &r2); -double dist(RotationX const &r1, RotationZ const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationX const &r1, ::ROOT::ROOT_MATH_ARCH::Rotation3D const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationX const &r1, ::ROOT::ROOT_MATH_ARCH::AxisAngle const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationX const &r1, ::ROOT::ROOT_MATH_ARCH::EulerAngles const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationX const &r1, ::ROOT::ROOT_MATH_ARCH::Quaternion const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationX const &r1, ::ROOT::ROOT_MATH_ARCH::RotationX const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationX const &r1, ::ROOT::ROOT_MATH_ARCH::RotationY const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationX const &r1, ::ROOT::ROOT_MATH_ARCH::RotationZ const &r2); // ---------------------------------------------------------------------- // Distance from RotationY -double dist(RotationY const &r1, Rotation3D const &r2); -double dist(RotationY const &r1, AxisAngle const &r2); -double dist(RotationY const &r1, EulerAngles const &r2); -double dist(RotationY const &r1, Quaternion const &r2); -double dist(RotationY const &r1, RotationX const &r2); -double dist(RotationY const &r1, RotationY const &r2); -double dist(RotationY const &r1, RotationZ const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationY const &r1, ::ROOT::ROOT_MATH_ARCH::Rotation3D const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationY const &r1, ::ROOT::ROOT_MATH_ARCH::AxisAngle const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationY const &r1, ::ROOT::ROOT_MATH_ARCH::EulerAngles const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationY const &r1, ::ROOT::ROOT_MATH_ARCH::Quaternion const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationY const &r1, ::ROOT::ROOT_MATH_ARCH::RotationX const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationY const &r1, ::ROOT::ROOT_MATH_ARCH::RotationY const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationY const &r1, ::ROOT::ROOT_MATH_ARCH::RotationZ const &r2); // ---------------------------------------------------------------------- // Distance from RotationZ -double dist(RotationZ const &r1, Rotation3D const &r2); -double dist(RotationZ const &r1, AxisAngle const &r2); -double dist(RotationZ const &r1, EulerAngles const &r2); -double dist(RotationZ const &r1, Quaternion const &r2); -double dist(RotationZ const &r1, RotationX const &r2); -double dist(RotationZ const &r1, RotationY const &r2); -double dist(RotationZ const &r1, RotationZ const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationZ const &r1, ::ROOT::ROOT_MATH_ARCH::Rotation3D const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationZ const &r1, ::ROOT::ROOT_MATH_ARCH::AxisAngle const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationZ const &r1, ::ROOT::ROOT_MATH_ARCH::EulerAngles const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationZ const &r1, ::ROOT::ROOT_MATH_ARCH::Quaternion const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationZ const &r1, ::ROOT::ROOT_MATH_ARCH::RotationX const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationZ const &r1, ::ROOT::ROOT_MATH_ARCH::RotationY const &r2); +double dist(::ROOT::ROOT_MATH_ARCH::RotationZ const &r1, ::ROOT::ROOT_MATH_ARCH::RotationZ const &r2); } // namespace gv_detail } // namespace ROOT_MATH_ARCH diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/AxisAngle.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/AxisAngle.h index 943ad5a596a89..55a07e77c3862 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/AxisAngle.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/AxisAngle.h @@ -29,8 +29,6 @@ #include "MathX/GenVectorX/MathHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - namespace ROOT { namespace ROOT_MATH_ARCH { diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/Boost.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/Boost.h index f99b6a115b03f..2fb1fee13f5a1 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/Boost.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/Boost.h @@ -28,8 +28,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - namespace ROOT { namespace ROOT_MATH_ARCH { diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/BoostX.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/BoostX.h index 7293e0963110b..c56ab13506ac2 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/BoostX.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/BoostX.h @@ -24,8 +24,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - namespace ROOT { namespace ROOT_MATH_ARCH { @@ -127,7 +125,7 @@ class BoostX { /** The beta vector for this boost */ - typedef DisplacementVector3D, DefaultCoordinateSystemTag> XYZVector; + typedef ::ROOT::ROOT_MATH_ARCH::DisplacementVector3D<::ROOT::ROOT_MATH_ARCH::Cartesian3D, ::ROOT::ROOT_MATH_ARCH::DefaultCoordinateSystemTag> XYZVector; XYZVector BetaVector() const; /** @@ -144,7 +142,7 @@ class BoostX { Lorentz transformation operation on a Minkowski ('Cartesian') LorentzVector */ - LorentzVector> operator()(const LorentzVector> &v) const; + LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> operator()(const LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> &v) const; /** Lorentz transformation operation on a LorentzVector in any @@ -153,8 +151,8 @@ class BoostX { template LorentzVector operator()(const LorentzVector &v) const { - LorentzVector> xyzt(v); - LorentzVector> r_xyzt = operator()(xyzt); + LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> xyzt(v); + LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> r_xyzt = operator()(xyzt); return LorentzVector(r_xyzt); } @@ -166,8 +164,8 @@ class BoostX { template Foreign4Vector operator()(const Foreign4Vector &v) const { - LorentzVector> xyzt(v); - LorentzVector> r_xyzt = operator()(xyzt); + LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> xyzt(v); + LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> r_xyzt = operator()(xyzt); return Foreign4Vector(r_xyzt.X(), r_xyzt.Y(), r_xyzt.Z(), r_xyzt.T()); } diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/BoostY.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/BoostY.h index fab0298533d4d..ae2123bd36d7c 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/BoostY.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/BoostY.h @@ -24,8 +24,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - namespace ROOT { namespace ROOT_MATH_ARCH { @@ -127,7 +125,7 @@ class BoostY { /** The beta vector for this boost */ - typedef DisplacementVector3D, DefaultCoordinateSystemTag> XYZVector; + typedef ::ROOT::ROOT_MATH_ARCH::DisplacementVector3D<::ROOT::ROOT_MATH_ARCH::Cartesian3D, ::ROOT::ROOT_MATH_ARCH::DefaultCoordinateSystemTag> XYZVector; XYZVector BetaVector() const; /** @@ -144,7 +142,7 @@ class BoostY { Lorentz transformation operation on a Minkowski ('Cartesian') LorentzVector */ - LorentzVector> operator()(const LorentzVector> &v) const; + LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> operator()(const LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> &v) const; /** Lorentz transformation operation on a LorentzVector in any @@ -153,8 +151,8 @@ class BoostY { template LorentzVector operator()(const LorentzVector &v) const { - LorentzVector> xyzt(v); - LorentzVector> r_xyzt = operator()(xyzt); + LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> xyzt(v); + LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> r_xyzt = operator()(xyzt); return LorentzVector(r_xyzt); } @@ -166,8 +164,8 @@ class BoostY { template Foreign4Vector operator()(const Foreign4Vector &v) const { - LorentzVector> xyzt(v); - LorentzVector> r_xyzt = operator()(xyzt); + LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> xyzt(v); + LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> r_xyzt = operator()(xyzt); return Foreign4Vector(r_xyzt.X(), r_xyzt.Y(), r_xyzt.Z(), r_xyzt.T()); } diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/BoostZ.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/BoostZ.h index fb1a78799ac72..119bdceb9c481 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/BoostZ.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/BoostZ.h @@ -24,8 +24,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - namespace ROOT { namespace ROOT_MATH_ARCH { @@ -127,7 +125,7 @@ class BoostZ { /** The beta vector for this boost */ - typedef DisplacementVector3D, DefaultCoordinateSystemTag> XYZVector; + typedef ::ROOT::ROOT_MATH_ARCH::DisplacementVector3D<::ROOT::ROOT_MATH_ARCH::Cartesian3D, ::ROOT::ROOT_MATH_ARCH::DefaultCoordinateSystemTag> XYZVector; XYZVector BetaVector() const; /** @@ -144,7 +142,7 @@ class BoostZ { Lorentz transformation operation on a Minkowski ('Cartesian') LorentzVector */ - LorentzVector> operator()(const LorentzVector> &v) const; + LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> operator()(const LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> &v) const; /** Lorentz transformation operation on a LorentzVector in any @@ -153,8 +151,8 @@ class BoostZ { template LorentzVector operator()(const LorentzVector &v) const { - LorentzVector> xyzt(v); - LorentzVector> r_xyzt = operator()(xyzt); + LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> xyzt(v); + LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> r_xyzt = operator()(xyzt); return LorentzVector(r_xyzt); } @@ -166,8 +164,8 @@ class BoostZ { template Foreign4Vector operator()(const Foreign4Vector &v) const { - LorentzVector> xyzt(v); - LorentzVector> r_xyzt = operator()(xyzt); + LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> xyzt(v); + LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> r_xyzt = operator()(xyzt); return Foreign4Vector(r_xyzt.X(), r_xyzt.Y(), r_xyzt.Z(), r_xyzt.T()); } diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/Cartesian2D.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/Cartesian2D.h index c822be9f8b7e2..6f3e1b2e6d7af 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/Cartesian2D.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/Cartesian2D.h @@ -24,8 +24,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - namespace ROOT { namespace ROOT_MATH_ARCH { diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/Cartesian3D.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/Cartesian3D.h index 09e109796a72b..4e7908cf00b16 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/Cartesian3D.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/Cartesian3D.h @@ -12,7 +12,7 @@ // Header file for class Cartesian3D // // Created by: Lorenzo Moneta at Mon May 30 11:16:56 2005 -// Major revamp: M. FIschler at Wed Jun 8 2005 +// Major revamp: M. Fischler at Wed Jun 8 2005 // // Last update: $ID: $ // @@ -29,8 +29,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - #include #include diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/Cylindrical3D.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/Cylindrical3D.h index 560922b877f50..6bb7705dd26fd 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/Cylindrical3D.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/Cylindrical3D.h @@ -24,8 +24,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - #include #include diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/CylindricalEta3D.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/CylindricalEta3D.h index eab5cce8eca81..d5d09114e92b4 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/CylindricalEta3D.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/CylindricalEta3D.h @@ -28,8 +28,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - #include #include diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/DisplacementVector2D.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/DisplacementVector2D.h index bb8823fcfa908..1568cd943e5f4 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/DisplacementVector2D.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/DisplacementVector2D.h @@ -33,8 +33,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - namespace ROOT { namespace ROOT_MATH_ARCH { @@ -160,6 +158,7 @@ class DisplacementVector2D { /** get internal data into 2 Scalar numbers. These are for example (x,y) for a cartesian vector or (r,phi) for a polar vector + \note Alternatively, you may use structured bindings: `auto const [a, b] = v`. */ void GetCoordinates(Scalar &a, Scalar &b) const { fCoordinates.GetCoordinates(a, b); } @@ -502,8 +501,31 @@ operator>>(std::basic_istream &is, DisplacementVector2D #endif +// Structured bindings +template +typename CoordSystem::Scalar get(DisplacementVector2D const& p) +{ + static_assert(I < 2); + if constexpr (I == 0) { + return p.x(); + } else { + return p.y(); + } +} + } // namespace ROOT_MATH_ARCH } // namespace ROOT +// Structured bindings +#include +namespace std { + template + struct tuple_size> : integral_constant {}; + template + struct tuple_element> { + static_assert(I < 2); + using type = typename CoordSystem::Scalar; + }; + #endif /* ROOT_MathX_GenVectorX_DisplacementVector2D */ diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/DisplacementVector3D.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/DisplacementVector3D.h index 0fa2dca396112..31e9c9a5948a7 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/DisplacementVector3D.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/DisplacementVector3D.h @@ -12,7 +12,7 @@ // Header source file for class DisplacementVector3D // // Created by: Lorenzo Moneta at Mon May 30 12:21:43 2005 -// Major rewrite: M. FIschler at Wed Jun 8 2005 +// Major rewrite: M. Fischler at Wed Jun 8 2005 // // Last update: $Id$ // @@ -34,8 +34,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - #include namespace ROOT { @@ -218,6 +216,7 @@ class DisplacementVector3D { /** get internal data into 3 Scalar numbers + \note Alternatively, you may use structured bindings: `auto const [a, b, c] = v`. */ void GetCoordinates(Scalar &a, Scalar &b, Scalar &c) const { fCoordinates.GetCoordinates(a, b, c); } @@ -722,8 +721,34 @@ operator>>(std::basic_istream &is, DisplacementVector3D #endif +// Structured bindings +template +typename CoordSystem::Scalar get(DisplacementVector3D const& p) +{ + static_assert(I < 3); + if constexpr (I == 0) { + return p.x(); + } else if constexpr (I == 1) { + return p.y(); + } else { + return p.z(); + } +} + } // namespace ROOT_MATH_ARCH } // namespace ROOT +// Structured bindings +#include +namespace std { + template + struct tuple_size> : integral_constant {}; + template + struct tuple_element> { + static_assert(I < 3); + using type = typename CoordSystem::Scalar; + }; +} + #endif /* ROOT_MathX_GenVectorX_DisplacementVector3D */ diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/EulerAngles.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/EulerAngles.h index bb80e4f48d9c9..40b75f03d324f 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/EulerAngles.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/EulerAngles.h @@ -29,8 +29,6 @@ #include "MathX/GenVectorX/MathHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - namespace ROOT { namespace ROOT_MATH_ARCH { diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/GenVector_exception.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/GenVector_exception.h index f5749d9da9ffb..5368523572151 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/GenVector_exception.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/GenVector_exception.h @@ -34,9 +34,9 @@ inline void GenVector_Throw(const char *); // is not possible because of missing symbols. // This is due to the fact that the Throw function is used in the inline // code bu this function is implemented in the Genvector library. -class GenVector_exception : public std::runtime_error { +class GenVector_exception : public ::std::runtime_error { public: - GenVector_exception(const std::string &s) : runtime_error(s) {} + GenVector_exception(const ::std::string &s) : runtime_error(s) {} // Compiler-generated copy ctor, copy assignment, dtor are fine // Inherited what() from runtime_error is fine diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/LorentzVector.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/LorentzVector.h index 12bc507e3977a..ea5f8b711dc50 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/LorentzVector.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/LorentzVector.h @@ -27,8 +27,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - #include #include @@ -208,6 +206,7 @@ class LorentzVector { /** get internal data into 4 Scalar numbers + \note Alternatively, you may use structured bindings: `auto const [a, b, c, d] = v`. */ void GetCoordinates(Scalar &a, Scalar &b, Scalar &c, Scalar &d) const { fCoordinates.GetCoordinates(a, b, c, d); } @@ -384,16 +383,16 @@ class LorentzVector { dphi += (2 * M_PI) * n; } } - return math_sqrt(delta * delta + dphi * dphi); + return ::ROOT::ROOT_MATH_ARCH::math_sqrt(delta * delta + dphi * dphi); } /** get the spatial components of the Vector in a DisplacementVector based on Cartesian Coordinates */ - DisplacementVector3D> Vect() const + ::ROOT::ROOT_MATH_ARCH::DisplacementVector3D<::ROOT::ROOT_MATH_ARCH::Cartesian3D> Vect() const { - return DisplacementVector3D>(X(), Y(), Z()); + return DisplacementVector3D<::ROOT::ROOT_MATH_ARCH::Cartesian3D>(X(), Y(), Z()); } // ------ Operations combining two Lorentz vectors ------ @@ -585,7 +584,7 @@ class LorentzVector { return ee * ee < pp * pp; } - typedef DisplacementVector3D> BetaVector; + typedef ::ROOT::ROOT_MATH_ARCH::DisplacementVector3D<::ROOT::ROOT_MATH_ARCH::Cartesian3D> BetaVector; /** The beta vector for the boost that would bring this vector into @@ -617,7 +616,7 @@ class LorentzVector { BetaVector BoostToCM(const Other4Vector &v) const { Scalar eSum = E() + v.E(); - DisplacementVector3D> vecSum = Vect() + v.Vect(); + ::ROOT::ROOT_MATH_ARCH::DisplacementVector3D<::ROOT::ROOT_MATH_ARCH::Cartesian3D> vecSum = Vect() + v.Vect(); if (eSum == 0) { if (vecSum.Mag2() == 0) { return BetaVector(); @@ -824,8 +823,8 @@ template typename LorentzVector::Scalar AsymmetryVectorial(LorentzVector const &pp, LorentzVector const &pm) { - ROOT::ROOT_MATH_ARCH::XYVector vp(pp.Px(), pp.Py()); - ROOT::ROOT_MATH_ARCH::XYVector vm(pm.Px(), pm.Py()); + ::ROOT::ROOT_MATH_ARCH::XYVector vp(pp.Px(), pp.Py()); + ::ROOT::ROOT_MATH_ARCH::XYVector vm(pm.Px(), pm.Py()); auto denom = (vp + vm).R(); if (denom == 0.) return -1; @@ -910,16 +909,44 @@ operator>>(std::basic_istream &is, LorentzVector &v) } // op>> <>() #endif +// Structured bindings +template +typename CoordSystem::Scalar get(LorentzVector const& p) +{ + static_assert(I < 4); + if constexpr (I == 0) { + return p.X(); + } else if constexpr (I == 1) { + return p.Y(); + } else if constexpr (I == 2) { + return p.Z(); + } else { + return p.E(); + } +} + } // end namespace ROOT_MATH_ARCH } // end namespace ROOT +// Structured bindings +#include +namespace std { + template + struct ::std::tuple_size> : integral_constant {}; + template + struct ::std::tuple_element> { + static_assert(I < 4); + using type = typename CoordSystem::Scalar; + }; +} + #include namespace cling { template -std::string printValue(const LorentzVector *v) +::std::string printValue(const ROOT::ROOT_MATH_ARCH::LorentzVector *v) { - std::stringstream s; + ::std::stringstream s; s << *v; return s.str(); } diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/Polar2D.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/Polar2D.h index c8ec9c531bff4..ec6b301303d94 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/Polar2D.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/Polar2D.h @@ -27,8 +27,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - namespace ROOT { namespace ROOT_MATH_ARCH { diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/Polar3D.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/Polar3D.h index de66aad3d5618..b4a3280c31391 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/Polar3D.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/Polar3D.h @@ -27,8 +27,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - #include namespace ROOT { diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/PositionVector2D.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/PositionVector2D.h index 28b29d73e6732..28299cf43a4f0 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/PositionVector2D.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/PositionVector2D.h @@ -28,8 +28,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - namespace ROOT { namespace ROOT_MATH_ARCH { diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/PositionVector3D.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/PositionVector3D.h index 4649b669be158..510eed55f9f87 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/PositionVector3D.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/PositionVector3D.h @@ -31,8 +31,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - #include namespace ROOT { diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/PtEtaPhiE4D.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/PtEtaPhiE4D.h index 9bcd199780457..9b865d53044b8 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/PtEtaPhiE4D.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/PtEtaPhiE4D.h @@ -29,8 +29,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - // #define TRACE_CE #ifdef TRACE_CE #include diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/PtEtaPhiM4D.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/PtEtaPhiM4D.h index 7ac3a5440c01b..c7769486fb2c7 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/PtEtaPhiM4D.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/PtEtaPhiM4D.h @@ -28,8 +28,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - // #define TRACE_CE #ifdef TRACE_CE #include diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/PxPyPzE4D.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/PxPyPzE4D.h index 89e960764734c..07b8500bc3a5e 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/PxPyPzE4D.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/PxPyPzE4D.h @@ -24,8 +24,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - #include "MathX/GenVectorX/GenVector_exception.h" #include diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/PxPyPzM4D.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/PxPyPzM4D.h index fb2b0289d48f9..a5465564256bb 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/PxPyPzM4D.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/PxPyPzM4D.h @@ -26,8 +26,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - #include namespace ROOT { diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/Quaternion.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/Quaternion.h index a54a8dd777289..3ed060a06fed4 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/Quaternion.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/Quaternion.h @@ -30,8 +30,6 @@ #include "MathX/GenVectorX/MathHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - namespace ROOT { namespace ROOT_MATH_ARCH { diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/Rotation3D.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/Rotation3D.h index bfdeb99c12a5a..c2163f97431cf 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/Rotation3D.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/Rotation3D.h @@ -43,8 +43,6 @@ #include "MathX/GenVectorX/MathHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - namespace ROOT { namespace ROOT_MATH_ARCH { @@ -110,29 +108,29 @@ class Rotation3D { /** Construct from an AxisAngle */ - explicit Rotation3D(AxisAngle const &a) { gv_detail::convert(a, *this); } + explicit Rotation3D(::ROOT::ROOT_MATH_ARCH::AxisAngle const &a) { gv_detail::convert(a, *this); } /** Construct from EulerAngles */ - explicit Rotation3D(EulerAngles const &e) { gv_detail::convert(e, *this); } + explicit Rotation3D(::ROOT::ROOT_MATH_ARCH::EulerAngles const &e) { gv_detail::convert(e, *this); } /** Construct from RotationZYX */ - explicit Rotation3D(RotationZYX const &e) { gv_detail::convert(e, *this); } + explicit Rotation3D(::ROOT::ROOT_MATH_ARCH::RotationZYX const &e) { gv_detail::convert(e, *this); } /** Construct from a Quaternion */ - explicit Rotation3D(Quaternion const &q) { gv_detail::convert(q, *this); } + explicit Rotation3D(::ROOT::ROOT_MATH_ARCH::Quaternion const &q) { gv_detail::convert(q, *this); } /** Construct from an axial rotation */ - explicit Rotation3D(RotationZ const &r) { gv_detail::convert(r, *this); } - explicit Rotation3D(RotationY const &r) { gv_detail::convert(r, *this); } - explicit Rotation3D(RotationX const &r) { gv_detail::convert(r, *this); } + explicit Rotation3D(::ROOT::ROOT_MATH_ARCH::RotationZ const &r) { gv_detail::convert(r, *this); } + explicit Rotation3D(::ROOT::ROOT_MATH_ARCH::RotationY const &r) { gv_detail::convert(r, *this); } + explicit Rotation3D(::ROOT::ROOT_MATH_ARCH::RotationX const &r) { gv_detail::convert(r, *this); } /** Construct from a linear algebra matrix of size at least 3x3, @@ -192,7 +190,7 @@ class Rotation3D { /** Assign from RotationZYX */ - Rotation3D &operator=(RotationZYX const &r) { return operator=(Rotation3D(r)); } + Rotation3D &operator=(::ROOT::ROOT_MATH_ARCH::RotationZYX const &r) { return operator=(Rotation3D(r)); } /** Assign from a Quaternion @@ -295,7 +293,7 @@ class Rotation3D { template void GetComponents(IT begin) const { - std::copy(fM, fM + 9, begin); + ::std::copy(fM, fM + 9, begin); } /** @@ -393,9 +391,9 @@ class Rotation3D { Rotation operation on a displacement vector in any coordinate system */ template - DisplacementVector3D operator()(const DisplacementVector3D &v) const + ::ROOT::ROOT_MATH_ARCH::DisplacementVector3D operator()(const ::ROOT::ROOT_MATH_ARCH::DisplacementVector3D &v) const { - DisplacementVector3D, U> xyz; + ::ROOT::ROOT_MATH_ARCH::DisplacementVector3D<::ROOT::ROOT_MATH_ARCH::Cartesian3D, U> xyz; xyz.SetXYZ(fM[kXX] * v.X() + fM[kXY] * v.Y() + fM[kXZ] * v.Z(), fM[kYX] * v.X() + fM[kYY] * v.Y() + fM[kYZ] * v.Z(), fM[kZX] * v.X() + fM[kZY] * v.Y() + fM[kZZ] * v.Z()); @@ -406,10 +404,10 @@ class Rotation3D { Rotation operation on a position vector in any coordinate system */ template - PositionVector3D operator()(const PositionVector3D &v) const + ::ROOT::ROOT_MATH_ARCH::PositionVector3D operator()(const ::ROOT::ROOT_MATH_ARCH::PositionVector3D &v) const { - DisplacementVector3D, U> xyz(v); - DisplacementVector3D, U> rxyz = operator()(xyz); + ::ROOT::ROOT_MATH_ARCH::DisplacementVector3D<::ROOT::ROOT_MATH_ARCH::Cartesian3D, U> xyz(v); + ::ROOT::ROOT_MATH_ARCH::DisplacementVector3D<::ROOT::ROOT_MATH_ARCH::Cartesian3D, U> rxyz = operator()(xyz); return PositionVector3D(rxyz); } @@ -419,9 +417,9 @@ class Rotation3D { template LorentzVector operator()(const LorentzVector &v) const { - DisplacementVector3D> xyz(v.Vect()); + ::ROOT::ROOT_MATH_ARCH::DisplacementVector3D<::ROOT::ROOT_MATH_ARCH::Cartesian3D> xyz(v.Vect()); xyz = operator()(xyz); - LorentzVector> xyzt(xyz.X(), xyz.Y(), xyz.Z(), v.E()); + LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> xyzt(xyz.X(), xyz.Y(), xyz.Z(), v.E()); return LorentzVector(xyzt); } @@ -433,8 +431,8 @@ class Rotation3D { template ForeignVector operator()(const ForeignVector &v) const { - DisplacementVector3D> xyz(v); - DisplacementVector3D> rxyz = operator()(xyz); + ::ROOT::ROOT_MATH_ARCH::DisplacementVector3D<::ROOT::ROOT_MATH_ARCH::Cartesian3D> xyz(v); + ::ROOT::ROOT_MATH_ARCH::DisplacementVector3D<::ROOT::ROOT_MATH_ARCH::Cartesian3D> rxyz = operator()(xyz); return ForeignVector(rxyz.X(), rxyz.Y(), rxyz.Z()); } diff --git a/math/experimental/genvectorx/inc/MathX/GenVectorX/eta.h b/math/experimental/genvectorx/inc/MathX/GenVectorX/eta.h index b6df4fe0c32b5..e5ce5c9ba3370 100644 --- a/math/experimental/genvectorx/inc/MathX/GenVectorX/eta.h +++ b/math/experimental/genvectorx/inc/MathX/GenVectorX/eta.h @@ -21,8 +21,6 @@ #include "MathX/GenVectorX/AccHeaders.h" -using namespace ROOT::ROOT_MATH_ARCH; - #include #include diff --git a/math/experimental/genvectorx/inc/MathX/Vector4Dfwd.h b/math/experimental/genvectorx/inc/MathX/Vector4Dfwd.h index 97f7bd10ea2a0..9e4af7fdbd3df 100644 --- a/math/experimental/genvectorx/inc/MathX/Vector4Dfwd.h +++ b/math/experimental/genvectorx/inc/MathX/Vector4Dfwd.h @@ -41,7 +41,7 @@ class PtEtaPhiM4D; // for LorentzVector have only double classes (define the vector in the global ref frame) /** - LorentzVector based on x,y,x,t (or px,py,pz,E) coordinates in double precision with metric (-,-,-,+) + LorentzVector based on x,y,z,t (or px,py,pz,E) coordinates in double precision with metric (-,-,-,+) To use it add the line `#include ` @@ -52,7 +52,7 @@ typedef LorentzVector> XYZTVector; typedef LorentzVector> PxPyPzEVector; /** - LorentzVector based on x,y,x,t (or px,py,pz,E) coordinates in float precision with metric (-,-,-,+) + LorentzVector based on x,y,z,t (or px,py,pz,E) coordinates in float precision with metric (-,-,-,+) To use it add the line `#include ` @@ -61,7 +61,7 @@ typedef LorentzVector> PxPyPzEVector; typedef LorentzVector> XYZTVectorF; /** - LorentzVector based on the x, y, z, and Mass in double precision + LorentzVector based on the x, y, z and Mass in double precision To use it add the line `#include ` diff --git a/math/experimental/genvectorx/src/BoostX.cxx b/math/experimental/genvectorx/src/BoostX.cxx index 91d92a9d465cf..310f706f2ded4 100644 --- a/math/experimental/genvectorx/src/BoostX.cxx +++ b/math/experimental/genvectorx/src/BoostX.cxx @@ -44,7 +44,7 @@ void BoostX::SetComponents(Scalar bx) return; } fBeta = bx; - fGamma = 1.0 / math_sqrt(1.0 - bp2); + fGamma = 1.0 / ::ROOT::ROOT_MATH_ARCH::math_sqrt(1.0 - bp2); } void BoostX::GetComponents(Scalar &bx) const @@ -53,10 +53,10 @@ void BoostX::GetComponents(Scalar &bx) const bx = fBeta; } -DisplacementVector3D> BoostX::BetaVector() const +::ROOT::ROOT_MATH_ARCH::DisplacementVector3D<::ROOT::ROOT_MATH_ARCH::Cartesian3D> BoostX::BetaVector() const { // return beta vector - return DisplacementVector3D>(fBeta, 0.0, 0.0); + return ::ROOT::ROOT_MATH_ARCH::DisplacementVector3D<::ROOT::ROOT_MATH_ARCH::Cartesian3D>(fBeta, 0.0, 0.0); } void BoostX::GetLorentzRotation(Scalar r[]) const @@ -100,12 +100,12 @@ void BoostX::Rectify() SetComponents(beta); } -LorentzVector> BoostX::operator()(const LorentzVector> &v) const +LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> BoostX::operator()(const LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D> &v) const { // apply boost to a LV Scalar x = v.Px(); Scalar t = v.E(); - return LorentzVector>(fGamma * x + fGamma * fBeta * t, v.Py(), v.Pz(), + return LorentzVector<::ROOT::ROOT_MATH_ARCH::PxPyPzE4D>(fGamma * x + fGamma * fBeta * t, v.Py(), v.Pz(), fGamma * fBeta * x + fGamma * t); } diff --git a/math/experimental/genvectorx/test/testGenVectorSYCL.cxx b/math/experimental/genvectorx/test/testGenVectorSYCL.cxx index d99921e7659c4..c3999cbdc1022 100644 --- a/math/experimental/genvectorx/test/testGenVectorSYCL.cxx +++ b/math/experimental/genvectorx/test/testGenVectorSYCL.cxx @@ -150,6 +150,11 @@ int testVector3D() vg3 = vg + vl; vg4 = vg - vl; #endif + // test structured bindings + auto const [x, y, z] = vg; + iret[0] |= (x != vg.x()); + iret[0] |= (y != vg.y()); + iret[0] |= (z != vg.z()); }); }); } @@ -294,6 +299,10 @@ int testVector2D() vg3 = vg + vl; vg4 = vg - vl; #endif + // test structured bindings + auto const [x, y] = vg; + iret[0] |= (x != vg.x()); + iret[0] |= (y != vg.y()); }); }); } @@ -843,6 +852,12 @@ int testLorentzVector() // TLorentzVector t1, t2; // t1.SetPtEtaPhiE(1,2,3,4); t2.SetPtEtaPhiE(5,6,7,8); // t1.DeltaR(t2) + // test structured bindings + auto const [x, y, z, E] = v1; + iret |= (x != v1.X()); + iret |= (y != v1.Y()); + iret |= (z != v1.Z()); + iret |= (E != v1.E()); if (iret == 0) std::cout << "\t\t\tOK\n"; else diff --git a/math/genvector/inc/Math/GenVector/Cartesian3D.h b/math/genvector/inc/Math/GenVector/Cartesian3D.h index ec4b0448f3cce..57a3216897c2f 100644 --- a/math/genvector/inc/Math/GenVector/Cartesian3D.h +++ b/math/genvector/inc/Math/GenVector/Cartesian3D.h @@ -12,7 +12,7 @@ // Header file for class Cartesian3D // // Created by: Lorenzo Moneta at Mon May 30 11:16:56 2005 -// Major revamp: M. FIschler at Wed Jun 8 2005 +// Major revamp: M. Fischler at Wed Jun 8 2005 // // Last update: $ID: $ // diff --git a/math/genvector/inc/Math/GenVector/DisplacementVector2D.h b/math/genvector/inc/Math/GenVector/DisplacementVector2D.h index a822798fdba10..5930077a8d796 100644 --- a/math/genvector/inc/Math/GenVector/DisplacementVector2D.h +++ b/math/genvector/inc/Math/GenVector/DisplacementVector2D.h @@ -166,6 +166,7 @@ namespace ROOT { /** get internal data into 2 Scalar numbers. These are for example (x,y) for a cartesian vector or (r,phi) for a polar vector + \note Alternatively, you may use structured bindings: `auto const [a, b] = v`. */ void GetCoordinates( Scalar& a, Scalar& b) const { fCoordinates.GetCoordinates(a, b); } @@ -538,12 +539,32 @@ namespace ROOT { } // op>> <>() - + // Structured bindings + template + typename CoordSystem::Scalar get(DisplacementVector2D const& p) + { + static_assert(I < 2); + if constexpr (I == 0) { + return p.x(); + } else { + return p.y(); + } + } } // namespace Math } // namespace ROOT +// Structured bindings +#include +namespace std { + template + struct tuple_size> : integral_constant {}; + template + struct tuple_element> { + static_assert(I < 2); + using type = typename CoordSystem::Scalar; + }; +} #endif /* ROOT_Math_GenVector_DisplacementVector2D */ - diff --git a/math/genvector/inc/Math/GenVector/DisplacementVector3D.h b/math/genvector/inc/Math/GenVector/DisplacementVector3D.h index 93e76e485be0e..04ec163b3c35c 100644 --- a/math/genvector/inc/Math/GenVector/DisplacementVector3D.h +++ b/math/genvector/inc/Math/GenVector/DisplacementVector3D.h @@ -12,7 +12,7 @@ // Header source file for class DisplacementVector3D // // Created by: Lorenzo Moneta at Mon May 30 12:21:43 2005 -// Major rewrite: M. FIschler at Wed Jun 8 2005 +// Major rewrite: M. Fischler at Wed Jun 8 2005 // // Last update: $Id$ // @@ -209,6 +209,7 @@ namespace ROOT { /** get internal data into 3 Scalar numbers + \note Alternatively, you may use structured bindings: `auto const [a, b, c] = v`. */ void GetCoordinates( Scalar& a, Scalar& b, Scalar& c ) const { fCoordinates.GetCoordinates(a, b, c); } @@ -698,12 +699,35 @@ namespace ROOT { } // op>> <>() - + // Structured bindings + template + typename CoordSystem::Scalar get(DisplacementVector3D const& p) + { + static_assert(I < 3); + if constexpr (I == 0) { + return p.x(); + } else if constexpr (I == 1) { + return p.y(); + } else { + return p.z(); + } + } } // namespace Math } // namespace ROOT +// Structured bindings +#include +namespace std { + template + struct tuple_size> : integral_constant {}; + template + struct tuple_element> { + static_assert(I < 3); + using type = typename CoordSystem::Scalar; + }; +} #endif /* ROOT_Math_GenVector_DisplacementVector3D */ diff --git a/math/genvector/inc/Math/GenVector/GenVector_exception.h b/math/genvector/inc/Math/GenVector/GenVector_exception.h index f09ecbd68c750..2770eba765769 100644 --- a/math/genvector/inc/Math/GenVector/GenVector_exception.h +++ b/math/genvector/inc/Math/GenVector/GenVector_exception.h @@ -31,9 +31,9 @@ inline void GenVector_Throw(const char *); // is not possible because of missing symbols. // This is due to the fact that the Throw function is used in the inline // code bu this function is implemented in the Genvector library. -class GenVector_exception : public std::runtime_error { +class GenVector_exception : public ::std::runtime_error { public: - GenVector_exception(const std::string &s) : runtime_error(s) {} + GenVector_exception(const ::std::string &s) : runtime_error(s) {} // Compiler-generated copy ctor, copy assignment, dtor are fine // Inherited what() from runtime_error is fine diff --git a/math/genvector/inc/Math/GenVector/LorentzVector.h b/math/genvector/inc/Math/GenVector/LorentzVector.h index 5ee230167e5d4..394fc95460c43 100644 --- a/math/genvector/inc/Math/GenVector/LorentzVector.h +++ b/math/genvector/inc/Math/GenVector/LorentzVector.h @@ -203,6 +203,7 @@ Pt (or rho) refers to transverse momentum, whereas eta refers to pseudorapidity. /** get internal data into 4 Scalar numbers + \note Alternatively, you may use structured bindings: `auto const [a, b, c, d] = v`. */ void GetCoordinates( Scalar& a, Scalar& b, Scalar& c, Scalar & d ) const { fCoordinates.GetCoordinates(a, b, c, d); } @@ -861,19 +862,45 @@ Pt (or rho) refers to transverse momentum, whereas eta refers to pseudorapidity. } // op>> <>() - + // Structured bindings + template + typename CoordSystem::Scalar get(LorentzVector const& p) + { + static_assert(I < 4); + if constexpr (I == 0) { + return p.X(); + } else if constexpr (I == 1) { + return p.Y(); + } else if constexpr (I == 2) { + return p.Z(); + } else { + return p.E(); + } + } } // end namespace Math } // end namespace ROOT +// Structured bindings +#include +namespace std { + template + struct tuple_size> : integral_constant {}; + template + struct tuple_element> { + static_assert(I < 4); + using type = typename CoordSystem::Scalar; + }; +} + #include namespace cling { template -std::string printValue(const ROOT::Math::LorentzVector *v) +::std::string printValue(const ROOT::Math::LorentzVector *v) { - std::stringstream s; + ::std::stringstream s; s << *v; return s.str(); } diff --git a/math/genvector/inc/Math/Vector4Dfwd.h b/math/genvector/inc/Math/Vector4Dfwd.h index 284f7d4f17edf..555353b768348 100644 --- a/math/genvector/inc/Math/Vector4Dfwd.h +++ b/math/genvector/inc/Math/Vector4Dfwd.h @@ -35,7 +35,7 @@ namespace ROOT { // for LorentzVector have only double classes (define the vector in the global ref frame) /** - LorentzVector based on x,y,x,t (or px,py,pz,E) coordinates in double precision with metric (-,-,-,+) + LorentzVector based on x,y,z,t (or px,py,pz,E) coordinates in double precision with metric (-,-,-,+) To use it add the line `#include ` @@ -47,7 +47,7 @@ namespace ROOT { /** - LorentzVector based on x,y,x,t (or px,py,pz,E) coordinates in float precision with metric (-,-,-,+) + LorentzVector based on x,y,z,t (or px,py,pz,E) coordinates in float precision with metric (-,-,-,+) To use it add the line `#include ` @@ -57,7 +57,7 @@ namespace ROOT { /** - LorentzVector based on the x, y, z, and Mass in double precision + LorentzVector based on the x, y, z and Mass in double precision To use it add the line `#include ` diff --git a/math/genvector/test/testGenVector.cxx b/math/genvector/test/testGenVector.cxx index 920f05c4e2dd2..2b3ebf38a786c 100644 --- a/math/genvector/test/testGenVector.cxx +++ b/math/genvector/test/testGenVector.cxx @@ -153,6 +153,11 @@ int testVector3D() { vg4 = vg - vl; #endif + // test structured bindings + auto const [x, y, z] = vg; + iret |= (x != vg.x()); + iret |= (y != vg.y()); + iret |= (z != vg.z()); if (iret == 0) std::cout << "\t\t\t\t\tOK\n"; else std::cout << "\t\t\t\tFAILED\n"; @@ -284,6 +289,10 @@ int testVector2D() { vg4 = vg - vl; #endif + // test structured bindings + auto const [x, y] = vg; + iret |= (x != vg.x()); + iret |= (y != vg.y()); if (iret == 0) std::cout << "\t\t\t\tOK\n"; else std::cout << "\t\t\tFAILED\n"; @@ -807,6 +816,14 @@ int testLorentzVector() // TLorentzVector t1, t2; // t1.SetPtEtaPhiE(1,2,3,4); t2.SetPtEtaPhiE(5,6,7,8); // t1.DeltaR(t2) + + // test structured bindings + auto const [x, y, z, E] = v1; + iret |= (x != v1.X()); + iret |= (y != v1.Y()); + iret |= (z != v1.Z()); + iret |= (E != v1.E()); + if (iret == 0) std::cout << "\t\t\tOK\n"; else