diff --git a/GeoModelCore/GeoModelKernel/GeoModelKernel/throwExcept.h b/GeoModelCore/GeoModelKernel/GeoModelKernel/throwExcept.h index 82d3ae0aece5240ca82b84a31c3aadf3a70d5b52..f52bc454030c45902818d915573ee3f56860488a 100644 --- a/GeoModelCore/GeoModelKernel/GeoModelKernel/throwExcept.h +++ b/GeoModelCore/GeoModelKernel/GeoModelKernel/throwExcept.h @@ -1,8 +1,8 @@ /* - Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration */ -#ifndef GeoModelHelpers_THROWEXCEPT_H -#define GeoModelHelpers_THROWEXCEPT_H +#ifndef GEOMODELKERNEL_THROWEXCEPT_H +#define GEOMODELKERNEL_THROWEXCEPT_H #include <exception> #include <sstream> @@ -14,4 +14,4 @@ except_str<<MESSAGE; \ throw std::runtime_error(except_str.str()); \ } -#endif \ No newline at end of file +#endif diff --git a/GeoModelCore/GeoModelKernel/src/GeoDiamondSurface.cxx b/GeoModelCore/GeoModelKernel/src/GeoDiamondSurface.cxx index e4d04b77c6930e3c0b191ecf3be9d3092a407c1a..fe90d95bca19821e615b2d2387b006b1364db5d7 100644 --- a/GeoModelCore/GeoModelKernel/src/GeoDiamondSurface.cxx +++ b/GeoModelCore/GeoModelKernel/src/GeoDiamondSurface.cxx @@ -27,10 +27,8 @@ bool GeoDiamondSurface::isOnSurface (const double Px, const double Py, const dou double Pp_y = P_prime_4d[1]; double Pp_z = P_prime_4d[2]; - if(Pp_z != 0 && Pp_z > 1e-5 && Pp_z < -1e-5){ - // now I take tolerance as 1e-5 - return false; - } + // now I take tolerance as 1e-5 + if(std::abs(Pp_z) > 1e-5) return false; double x_bot = this -> getXbottomHalf(); double y_bot = this -> getYbottomHalf(); double x_mid = this -> getXmidHalf(); diff --git a/GeoModelCore/GeoModelKernel/src/GeoTrapezoidSurface.cxx b/GeoModelCore/GeoModelKernel/src/GeoTrapezoidSurface.cxx index 0ce90f5bc7a2f7d8a82256a15e8b9d9d81098398..8809eb68d0580542b629d8a21915213effad8277 100644 --- a/GeoModelCore/GeoModelKernel/src/GeoTrapezoidSurface.cxx +++ b/GeoModelCore/GeoModelKernel/src/GeoTrapezoidSurface.cxx @@ -25,10 +25,8 @@ bool GeoTrapezoidSurface::isOnSurface (const double Px, const double Py, const d double Pp_y = P_prime_4d[1]; double Pp_z = P_prime_4d[2]; - if(Pp_z != 0 && Pp_z > 1e-5 && Pp_z < -1e-5){ - // now I take tolerance as 1e-5 - return false; - } + // now I take tolerance as 1e-5 + if(std::abs(Pp_z) > 1e-5) return false; double half_x_max = this -> getXHalfLengthMax(); double half_x_min = this -> getXHalfLengthMin();