diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h index 70faa362228e44ef690c05aa47fe6f5acd12051d..0da3b190683765025d135ead1db16490de3798bf 100644 --- a/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h +++ b/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h @@ -126,6 +126,9 @@ class LArWheelCalculator std::pair<int, int> GetPhiGapAndSide(const CLHEP::Hep3Vector &p) const; double AmplitudeOfSurface(const CLHEP::Hep3Vector& P, int side, int fan_number) const; + /// Set the sincos calculator + // void SetVectorizedSincos() {m_sincos_calculator = &m_vsincos_par.eval;}; + /// @} private: @@ -216,6 +219,11 @@ class LArWheelCalculator #if HAVE_VECTOR_SIZE_ATTRIBUTE vsincos_par m_vsincos_par{}; #endif + + private: + typedef void (LArWheelCalculator::*SincosCalculator)(const double, double &, double &) const; + SincosCalculator m_sincos_calculator; + void EvalSincos(const double P, double &x, double &y) const {(this->*m_sincos_calculator)(P, x, y);}; }; #ifndef XAOD_STANDALONE diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator.cxx b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator.cxx index 11a481c860f3ce6e4e7b3f54362d3f0b7b405e87..cec1e276735ff6757ff28016bea30d4938c8eada 100644 --- a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator.cxx +++ b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator.cxx @@ -443,6 +443,9 @@ LArWheelCalculator::LArWheelCalculator(LArG4::LArWheelCalculator_t a_wheelType, fclose(O); exit(0); */ + + // set the sincos calculator + m_sincos_calculator = &LArWheelCalculator::parameterized_sincos; } /* converts module gap number into wheel gap number */ diff --git a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx index 06239cc8c1f498f6896d10a35aa4f24aefa2871c..0163f1ba944261716d645d35db5a03b20068ad04 100644 --- a/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx +++ b/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/DistanceCalculatorSaggingOff.cxx @@ -48,7 +48,7 @@ namespace LArWheelCalculator_Impl const double cos_a = scalpha.cs, sin_a = scalpha.sn; #else // parameterized sine double cos_a, sin_a; - lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a); + lwc()->EvalSincos(P.y(), sin_a, cos_a); #endif // determination of the nearest quarter-wave number int nqwave = (z < 0.) ? 0 : int(z / lwc()->m_QuarterWaveLength); @@ -160,7 +160,7 @@ namespace LArWheelCalculator_Impl double cos_a = scalpha.cs, sin_a = scalpha.sn; #else // parameterized sine double cos_a, sin_a; - lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a); + lwc()->EvalSincos(P.y(), sin_a, cos_a); #endif bool sqw = false; @@ -251,7 +251,7 @@ namespace LArWheelCalculator_Impl const double cos_a = scalpha.cs, sin_a = scalpha.sn; #else // parameterized sine double cos_a, sin_a; - lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a); + lwc()->EvalSincos(P.y(), sin_a, cos_a); #endif int nqwave; @@ -339,7 +339,7 @@ namespace LArWheelCalculator_Impl double cos_a = scalpha.cs, sin_a = scalpha.sn; #else // parameterized sine double cos_a, sin_a; - lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a); + lwc()->EvalSincos(P.y(), sin_a, cos_a); #endif bool sqw = false; @@ -434,7 +434,7 @@ namespace LArWheelCalculator_Impl // parameterized sine #else double cos_a, sin_a; - lwc()->m_vsincos_par.eval(P.y(), sin_a, cos_a); + lwc()->EvalSincos(P.y(), sin_a, cos_a); #endif // determination of the nearest quarter-wave number