diff --git a/Framework/Utilities/CMakeLists.txt b/Framework/Utilities/CMakeLists.txt index f55df7645645fe362070a467e563983c5bcac6fc..763c534f1c6df580d04211e0d29f87588758418a 100644 --- a/Framework/Utilities/CMakeLists.txt +++ b/Framework/Utilities/CMakeLists.txt @@ -27,6 +27,7 @@ set ( COMBoost.h Bit.h Singleton.h + sgn.h CorsikaFenv.h MetaProgramming.h ) diff --git a/Framework/Utilities/COMBoost.cc b/Framework/Utilities/COMBoost.cc index a12b533bbc0ef756737920b750a5c00a9556a58f..a94645215f95f047d934e316a0dfff3857636419 100644 --- a/Framework/Utilities/COMBoost.cc +++ b/Framework/Utilities/COMBoost.cc @@ -14,17 +14,12 @@ #include <corsika/geometry/Vector.h> #include <corsika/units/PhysicalUnits.h> #include <corsika/utl/COMBoost.h> +#include <corsika/utl/sgn.h> using namespace corsika::utl; using namespace corsika::units::si; using namespace corsika::geometry; -//! sign function without branches -template <typename T> -static int sgn(T val) { - return (T(0) < val) - (val < T(0)); -} - COMBoost::COMBoost(FourVector<HEPEnergyType, Vector<hepmomentum_d>> const& Pprojectile, const HEPMassType massTarget) : fCS(Pprojectile.GetSpaceLikeComponents().GetCoordinateSystem()) { diff --git a/Framework/Utilities/sgn.h b/Framework/Utilities/sgn.h new file mode 100644 index 0000000000000000000000000000000000000000..71d5bec5bbb59fe8c71ef35d0c3f9da1a40b27b7 --- /dev/null +++ b/Framework/Utilities/sgn.h @@ -0,0 +1,14 @@ +#ifndef _utilities_sgn_h +#define _utilities_sgn_h + +namespace corsika::utl { + +//! sign function without branches +template <typename T> +static int sgn(T val) { + return (T(0) < val) - (val < T(0)); +} + +} + +#endif