diff --git a/ATLAS-Extensions/LArCustomSolidExtension/import/Control/CxxUtils/CxxUtils/features.h b/ATLAS-Extensions/LArCustomSolidExtension/import/Control/CxxUtils/CxxUtils/features.h index e063f476568470b1fd6d0ed2b1d4a557e7870b5e..51c50ab08da862d2e120d579c703ff61f5b1d92b 100644 --- a/ATLAS-Extensions/LArCustomSolidExtension/import/Control/CxxUtils/CxxUtils/features.h +++ b/ATLAS-Extensions/LArCustomSolidExtension/import/Control/CxxUtils/CxxUtils/features.h @@ -1,6 +1,6 @@ // This file's extension implies that it's C, but it's really -*- C++ -*-. /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ /** * @file CxxUtils/features.h @@ -14,29 +14,40 @@ #include <features.h> -/// Do we have function multiversioning? GCC and clang > 7 support -/// the target attribute -#if ( defined(__i386__) || defined(__x86_64__) ) && \ - defined(__ELF__) && defined(__GNUC__) && !defined(__CLING__) && \ - !defined(__ICC) && !defined(__COVERITY__) && !defined(__CUDACC__) && \ - !defined(CL_SYCL_LANGUAGE_VERSION) && !defined(SYCL_LANGUAGE_VERSION) && \ - !defined(__HIP__) -# define HAVE_FUNCTION_MULTIVERSIONING 1 +/// Do we support the compatible set of GCC and clang extensions +/// These are our main compilers. +#if (defined(__GNUC__) || defined(__clang__)) && \ + !(defined(__ICC) || defined(__COVERITY__) || \ + defined(__CUDACC__) || defined(__CLING__)) +# define HAVE_GCC_CLANG_EXTENSIONS 1 +#else +# define HAVE_GCC_CLANG_EXTENSIONS 0 +#endif + +/// Do we have function multiversioning? +/// GCC and clang support the target attribute +#if HAVE_GCC_CLANG_EXTENSIONS && \ + (defined(__i386__) || defined(__x86_64__)) && defined(__ELF__) && \ + !defined(__HIP__) && !defined(CL_SYCL_LANGUAGE_VERSION) && \ + !defined(SYCL_LANGUAGE_VERSION) +#define HAVE_FUNCTION_MULTIVERSIONING 1 #else # define HAVE_FUNCTION_MULTIVERSIONING 0 #endif -/// Do we have the target_clones attribute? clang does not support it -#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && \ - !defined(__COVERITY__) && !defined(__CUDACC__) +/// Do we additionally have the target_clones attribute? +/// GCC and clang >=14 support it. +/// ...But at least for GCC11 and clang 14 in +/// order to work for both we have to apply +/// it to a declaration (for clang) that is also definition (for GCC) +#if HAVE_FUNCTION_MULTIVERSIONING && !(defined(__clang__) && __clang_major__ < 14) # define HAVE_TARGET_CLONES 1 #else # define HAVE_TARGET_CLONES 0 #endif /// Do we have support for all GCC intrinsics? -#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && \ - !defined(__COVERITY__) && !defined(__CUDACC__) +#if HAVE_GCC_CLANG_EXTENSIONS && !defined(__clang__) # define HAVE_GCC_INTRINSICS 1 #else # define HAVE_GCC_INTRINSICS 0 @@ -52,7 +63,7 @@ // __builtin_popcount // __builtin_popcountl // __builtin_popcountll -#if defined(__GNUC__) || defined(__clang__) +#if HAVE_GCC_CLANG_EXTENSIONS # define HAVE_BITCOUNT_INTRINSICS 1 #else # define HAVE_BITCOUNT_INTRINSICS 0 @@ -60,9 +71,8 @@ // Do we have the vector_size attribute for writing explicitly // vectorized code? -#if (defined(__GNUC__) || defined(__clang__)) && !defined(__CLING__) && \ - !defined(__ICC) && !defined(__COVERITY__) && !defined(__CUDACC__) -#define HAVE_VECTOR_SIZE_ATTRIBUTE 1 +#if HAVE_GCC_CLANG_EXTENSIONS +# define HAVE_VECTOR_SIZE_ATTRIBUTE 1 #else # define HAVE_VECTOR_SIZE_ATTRIBUTE 0 #endif @@ -71,14 +81,26 @@ // __builtin_convertvector // GCC>=9 does #if HAVE_VECTOR_SIZE_ATTRIBUTE && (defined(__clang__) || (__GNUC__ >= 9)) -#define HAVE_CONVERT_VECTOR 1 +# define HAVE_CONVERT_VECTOR 1 #else -#define HAVE_CONVERT_VECTOR 0 +# define HAVE_CONVERT_VECTOR 0 #endif // Do we have mallinfo2? Present in glibc 2.33, // in which mallinfo is deprecated. -#define HAVE_MALLINFO2 (__GLIBC_PREREQ(2, 33)) +#if defined(__GLIBC__) && __GLIBC_PREREQ(2, 33) +# define HAVE_MALLINFO2 1 +#else +# define HAVE_MALLINFO2 0 +#endif + + +// Do we have malloc hooks? They were removed in glibc 2.34. +#if defined(__GLIBC__) && !__GLIBC_PREREQ(2, 34) +# define HAVE_MALLOC_HOOKS 1 +#else +# define HAVE_MALLOC_HOOKS 0 +#endif #endif // not CXXUTILS_FEATURES_H diff --git a/ATLAS-Extensions/LArCustomSolidExtension/import/Control/CxxUtils/CxxUtils/vec.h b/ATLAS-Extensions/LArCustomSolidExtension/import/Control/CxxUtils/CxxUtils/vec.h index b53500189ce2c6a8a77ce6538fc4b0fa83f8d9a1..a73775856a6e623fcbb4c7f693a5d21317a3c780 100644 --- a/ATLAS-Extensions/LArCustomSolidExtension/import/Control/CxxUtils/CxxUtils/vec.h +++ b/ATLAS-Extensions/LArCustomSolidExtension/import/Control/CxxUtils/CxxUtils/vec.h @@ -374,7 +374,7 @@ vpermute(VEC& dst, const VEC& src) /** * @brief vpermute2 function. - * move any element of a vector src + * move any element of the vectors src1, src2 * into any or multiple position inside dst. */ template<size_t... Indices, typename VEC> diff --git a/ATLAS-Extensions/LArCustomSolidExtension/import/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h b/ATLAS-Extensions/LArCustomSolidExtension/import/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h index 906057ecf49909ee1008e4787971ee58f2b2506a..845f69bb4a2cdb9cc70eb268db6400607bacd099 100644 --- a/ATLAS-Extensions/LArCustomSolidExtension/import/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h +++ b/ATLAS-Extensions/LArCustomSolidExtension/import/DetectorDescription/GeoModel/GeoSpecialShapes/GeoSpecialShapes/LArWheelCalculator.h @@ -5,6 +5,7 @@ #ifndef GEOSPECIALSHAPES_LARWHEELCALCULATOR_H #define GEOSPECIALSHAPES_LARWHEELCALCULATOR_H +#include <array> #include <vector> // FMV and other checks @@ -144,9 +145,9 @@ class LArWheelCalculator bool m_SaggingOn; // ! bool m_phiRotation; bool m_slant_use_default; - double m_slant_parametrization[5]; // pol4 - double m_sin_parametrization[7]; // up to pol6 - double m_cos_parametrization[7]; + std::array<double,5> m_slant_parametrization; // pol4 + std::array<double,LARWC_SINCOS_POLY+1> m_sin_parametrization; + std::array<double,LARWC_SINCOS_POLY+1> m_cos_parametrization; std::vector<std::vector<double> > m_sagging_parameter; // ! double m_ActiveLength; diff --git a/ATLAS-Extensions/LArCustomSolidExtension/import/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx b/ATLAS-Extensions/LArCustomSolidExtension/import/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx index b9e35d653962f6da89d25a7953afefaac62ce7f2..3f2965996d02760b8ae86575f76fb16641d60bd2 100644 --- a/ATLAS-Extensions/LArCustomSolidExtension/import/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx +++ b/ATLAS-Extensions/LArCustomSolidExtension/import/DetectorDescription/GeoModel/GeoSpecialShapes/src/LArWheelCalculator_Impl/sincos_poly.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include "GeoSpecialShapes/LArWheelCalculator.h" @@ -96,165 +96,98 @@ static VECTOR findLinearApproximation( using namespace CLHEP; -void LArWheelCalculator::fill_sincos_parameterization() -{ - const Int_t nrPolyDegree = LARWC_SINCOS_POLY; -#if LARWC_SINCOS_POLY > 4 && DEBUGPRINT - std::cout << "LARWC_SINCOS_POLY: " << LARWC_SINCOS_POLY << std::endl; -#endif - const Int_t nBasisFunctions = nrPolyDegree + 1; +/// Helper functions to calculate polynomial approximations +namespace { + const Int_t nBasisFunctions = LARWC_SINCOS_POLY + 1; - // We compute the polynomial approximations once per side, and store them in - // the static variables below for reuse in successive calculator instances. - // For multi-threading, then, this code needs to be mutex locked. - // FIXME: this could done in a cleaner way. - static std::mutex fillParamMutex; - std::lock_guard<std::mutex> lock(fillParamMutex); + /// Helper struct to return sine/cosine values from functions + struct sincos_params { + std::array<double, nBasisFunctions> sin{}; + std::array<double, nBasisFunctions> cos{}; + }; - static bool filled[2] = { false, false }; - static double sin_parametrization[2][nBasisFunctions]; - static double cos_parametrization[2][nBasisFunctions]; + /// Calculate polynomial approximations for given wheel radii + sincos_params calc_params(LArWheelCalculator& lwc, double Rmin, double Rmax) { - // Reuse the computation if already performed - size_t S = m_isInner? 0: 1; - if(filled[S]){ - for(Int_t i = 0; i < nBasisFunctions; ++ i){ - m_sin_parametrization[i] = sin_parametrization[S][i]; - m_cos_parametrization[i] = cos_parametrization[S][i]; - } - - // Parameterization for the vectorized sincos calculation - // see ATLASSIM-4753 for details - // s4, s5, c4, c5 - // s2, s3, c2, c3 - // s0, s1, c0, c1 - m_vsincos_par.param_0[0] = m_sin_parametrization[4]; - m_vsincos_par.param_0[1] = m_sin_parametrization[5]; - m_vsincos_par.param_0[2] = m_cos_parametrization[4]; - m_vsincos_par.param_0[3] = m_cos_parametrization[5]; - m_vsincos_par.param_1[0] = m_sin_parametrization[2]; - m_vsincos_par.param_1[1] = m_sin_parametrization[3]; - m_vsincos_par.param_1[2] = m_cos_parametrization[2]; - m_vsincos_par.param_1[3] = m_cos_parametrization[3]; - m_vsincos_par.param_2[0] = m_sin_parametrization[0]; - m_vsincos_par.param_2[1] = m_sin_parametrization[1]; - m_vsincos_par.param_2[2] = m_cos_parametrization[0]; - m_vsincos_par.param_2[3] = m_cos_parametrization[1]; - return; - } + sincos_params p; - //const Double_t Rmin = m_isInner? 290.*mm: 600.*mm; - //const Double_t Rmax = m_isInner? 710.*mm: 2050.*mm; - const Double_t Rmin = m_isInner? 250.*mm: 560.*mm; - const Double_t Rmax = m_isInner? 750.*mm: 2090.*mm; - //const Double_t Rmin = m_isInner? 220.*mm: 530.*mm; - //const Double_t Rmax = m_isInner? 780.*mm: 2120.*mm; - const Double_t Rstep = 1.*mm; - const Int_t nrPoints = (Rmax - Rmin) * (1./Rstep); - const Int_t dataLen = nrPoints + 1; + const Double_t Rstep = 1.*mm; + const Int_t nrPoints = (Rmax - Rmin) * (1./Rstep); + const Int_t dataLen = nrPoints + 1; #ifndef SINCOSPOLY_USE_EIGEN - VECTOR x(dataLen); // angle points - VECTOR ysin(dataLen); // to be approximated function values at angle points - sin - VECTOR ycos(dataLen); // to be approximated function values at angle points - cos - MATRIX bf(nBasisFunctions, dataLen); // Matrix of values of basis functions at angle points + VECTOR x(dataLen); // angle points + VECTOR ysin(dataLen); // to be approximated function values at angle points - sin + VECTOR ycos(dataLen); // to be approximated function values at angle points - cos + MATRIX bf(nBasisFunctions, dataLen); // Matrix of values of basis functions at angle points #else - VECTOR x=VECTOR::Zero(dataLen); // angle points - VECTOR ysin=VECTOR::Zero(dataLen); // to be approximated function values at angle points - sin - VECTOR ycos=VECTOR::Zero(dataLen); // to be approximated function values at angle points - cos - MATRIX bf=MATRIX::Zero(nBasisFunctions, dataLen); // Matrix of values of basis functions at angle points + VECTOR x=VECTOR::Zero(dataLen); // angle points + VECTOR ysin=VECTOR::Zero(dataLen); // to be approximated function values at angle points - sin + VECTOR ycos=VECTOR::Zero(dataLen); // to be approximated function values at angle points - cos + MATRIX bf=MATRIX::Zero(nBasisFunctions, dataLen); // Matrix of values of basis functions at angle points #endif - for(Int_t i = 0; i < dataLen; ++ i){ - const Double_t a = Rmin + i * Rstep; - x[i] = a; - CxxUtils::sincos scalpha(parameterized_slant_angle(a)); - ysin[i] = scalpha.sn; - ycos[i] = scalpha.cs; - for(Int_t n = 0; n < nBasisFunctions; ++ n) { - bf(n, i) = pow(a, n); + for(Int_t i = 0; i < dataLen; ++ i){ + const Double_t a = Rmin + i * Rstep; + x[i] = a; + CxxUtils::sincos scalpha(lwc.parameterized_slant_angle(a)); + ysin[i] = scalpha.sn; + ycos[i] = scalpha.cs; + for(Int_t n = 0; n < nBasisFunctions; ++ n) { + bf(n, i) = pow(a, n); + } } - } - - VECTOR params_sin = - findLinearApproximation(dataLen, nBasisFunctions, ysin, bf); - VECTOR params_cos = - findLinearApproximation(dataLen, nBasisFunctions, ycos, bf); - - for(Int_t i = 0; i < nBasisFunctions; ++ i){ - m_sin_parametrization[i] = params_sin[i]; - m_cos_parametrization[i] = params_cos[i]; - sin_parametrization[S][i] = params_sin[i]; - cos_parametrization[S][i] = params_cos[i]; - } - // Parameterization for the vectorized sincos calculation - // see ATLASSIM-4753 for details - // s4, s5, c4, c5 - // s2, s3, c2, c3 - // s0, s1, c0, c1 - m_vsincos_par.param_0[0] = m_sin_parametrization[4]; - m_vsincos_par.param_0[1] = m_sin_parametrization[5]; - m_vsincos_par.param_0[2] = m_cos_parametrization[4]; - m_vsincos_par.param_0[3] = m_cos_parametrization[5]; - m_vsincos_par.param_1[0] = m_sin_parametrization[2]; - m_vsincos_par.param_1[1] = m_sin_parametrization[3]; - m_vsincos_par.param_1[2] = m_cos_parametrization[2]; - m_vsincos_par.param_1[3] = m_cos_parametrization[3]; - m_vsincos_par.param_2[0] = m_sin_parametrization[0]; - m_vsincos_par.param_2[1] = m_sin_parametrization[1]; - m_vsincos_par.param_2[2] = m_cos_parametrization[0]; - m_vsincos_par.param_2[3] = m_cos_parametrization[1]; - filled[S] = true; + VECTOR params_sin = + findLinearApproximation(dataLen, nBasisFunctions, ysin, bf); + VECTOR params_cos = + findLinearApproximation(dataLen, nBasisFunctions, ycos, bf); - // FIXME: nothing below is needed unless debug printing + for(Int_t i = 0; i < nBasisFunctions; ++ i){ + p.sin[i] = params_sin[i]; + p.cos[i] = params_cos[i]; + } + // + // Nothing below is needed unless for debugging + // #if DEBUGPRINT + std::cout << "LARWC_SINCOS_POLY: " << LARWC_SINCOS_POLY << std::endl; std::cout << "sin params:" << params_sin << std::endl; std::cout << "cos params:" << params_cos << std::endl; double dsinr = 0., dcosr = 0.; double dtrigr = 0; -#endif double dsin = 0., dcos = 0.; double dtrig = 0.; for(double r = Rmin + 40.; r < Rmax - 40.; r += Rstep / 10.){ - CxxUtils::sincos scalpha(parameterized_slant_angle(r)); + CxxUtils::sincos scalpha(lwc.parameterized_slant_angle(r)); double sin_a, cos_a; double sin_a_v, cos_a_v; - parameterized_sincos(r, sin_a, cos_a); - m_vsincos_par.eval(r, sin_a_v, cos_a_v); -#if DEBUGPRINT + lwc.parameterized_sincos(r, sin_a, cos_a); + lwc.m_vsincos_par.eval(r, sin_a_v, cos_a_v); std::streamsize ss = std::cout.precision(); std::cout.precision(16); std::cout << "def: " << r << " " << sin_a << " " << cos_a << std::endl; std::cout << "vec: " << r << " " << sin_a_v << " " << cos_a_v << std::endl; std::cout << "dif: " << r << " " << (sin_a - sin_a_v) / sin_a << " " << (cos_a - cos_a_v) / cos_a << std::endl; std::cout.precision(ss); -#endif double ds = fabs(scalpha.sn - sin_a); if(ds > dsin){ dsin = ds; -#if DEBUGPRINT dsinr = r; -#endif } double dc = fabs(scalpha.cs - cos_a); if(dc > dcos){ dcos = dc; -#if DEBUGPRINT dcosr = r; -#endif } double dt = fabs(sin_a*sin_a + cos_a*cos_a - 1.); if(dt > dtrig){ dtrig = dt; -#if DEBUGPRINT dtrigr = r; -#endif } } -#if DEBUGPRINT std::cout << "Max. difference: " << std::endl << "\tsin: " << dsin << " at " << dsinr << std::endl << "\tcos: " << dcos << " at " << dcosr << std::endl @@ -266,8 +199,8 @@ void LArWheelCalculator::fill_sincos_parameterization() const Int_t nIter=10000; std::cout << "Perfomance test started, " << nIter << " iterations" << std::endl; - double y_testsin[dataLen]; - double y_testcos[dataLen]; + double y_testsin[dataLen] ={}; + double y_testcos[dataLen] ={}; struct timeval tvsincos_start, tvsincos_stop; gettimeofday(&tvsincos_start, 0); for(Int_t iIter=0;iIter<nIter;iIter++) { @@ -285,7 +218,7 @@ void LArWheelCalculator::fill_sincos_parameterization() gettimeofday(&tvpoly_start, 0); for(Int_t iIter=0;iIter<nIter;iIter++) { for(Int_t i=0;i<dataLen;i++) { - parameterized_sincos(x[i], y_testsin[i], y_testcos[i]); + lwc.parameterized_sincos(x[i], y_testsin[i], y_testcos[i]); } } gettimeofday(&tvpoly_stop, 0); @@ -295,4 +228,47 @@ void LArWheelCalculator::fill_sincos_parameterization() std::cout << "Approximation is " << timeSinCos/timePoly << " faster " << std::endl; #endif + return p; + } + + /// Calculate (and cache) inner wheel parameterization + const sincos_params& inner_params(LArWheelCalculator& lwc) { + static const sincos_params p = calc_params(lwc, 250.*mm, 750.*mm); + return p; + } + + /// Calculate (and cache) outer wheel parameterization + const sincos_params& outer_params(LArWheelCalculator& lwc) { + static const sincos_params p = calc_params(lwc, 560.*mm, 2090.*mm); + return p; + } +} + +void LArWheelCalculator::fill_sincos_parameterization() +{ + // The polynomial approximations are calculated once per side, and stored + // as statics for reuse in successive calculator instances. + const sincos_params& p = m_isInner ? inner_params(*this) : outer_params(*this); + + // Fill the parameters into our instances variables + m_sin_parametrization = p.sin; + m_cos_parametrization = p.cos; + + // Parameterization for the vectorized sincos calculation + // see ATLASSIM-4753 for details + // s4, s5, c4, c5 + // s2, s3, c2, c3 + // s0, s1, c0, c1 + m_vsincos_par.param_0[0] = m_sin_parametrization[4]; + m_vsincos_par.param_0[1] = m_sin_parametrization[5]; + m_vsincos_par.param_0[2] = m_cos_parametrization[4]; + m_vsincos_par.param_0[3] = m_cos_parametrization[5]; + m_vsincos_par.param_1[0] = m_sin_parametrization[2]; + m_vsincos_par.param_1[1] = m_sin_parametrization[3]; + m_vsincos_par.param_1[2] = m_cos_parametrization[2]; + m_vsincos_par.param_1[3] = m_cos_parametrization[3]; + m_vsincos_par.param_2[0] = m_sin_parametrization[0]; + m_vsincos_par.param_2[1] = m_sin_parametrization[1]; + m_vsincos_par.param_2[2] = m_cos_parametrization[0]; + m_vsincos_par.param_2[3] = m_cos_parametrization[1]; } diff --git a/ATLAS-Extensions/LArCustomSolidExtension/import/Simulation/G4Utilities/Geo2G4/src/LArWheelSliceSolid.h b/ATLAS-Extensions/LArCustomSolidExtension/import/Simulation/G4Utilities/Geo2G4/src/LArWheelSliceSolid.h index 7d05aaa2d305de53486c75ab19c63b86aa39e9f7..328b4aee8a9f409ad96790d3551227f782705b29 100644 --- a/ATLAS-Extensions/LArCustomSolidExtension/import/Simulation/G4Utilities/Geo2G4/src/LArWheelSliceSolid.h +++ b/ATLAS-Extensions/LArCustomSolidExtension/import/Simulation/G4Utilities/Geo2G4/src/LArWheelSliceSolid.h @@ -5,7 +5,7 @@ #ifndef GEO2G4_LARWHEELSLICESOLID_H #define GEO2G4_LARWHEELSLICESOLID_H #ifndef PORTABLE_LAR_SHAPE -#include "AthenaKernel/MsgStreamMember.h" +#include "AthenaBaseComps/AthMessaging.h" #endif #include "G4VSolid.hh" @@ -39,6 +39,9 @@ class TF1; class G4Polyhedra; struct EMECData; class LArWheelSliceSolid : public G4VSolid +#ifndef PORTABLE_LAR_SHAPE + , public AthMessaging +#endif { public: typedef enum { Inner, Outer } pos_t; @@ -146,17 +149,11 @@ class LArWheelSliceSolid : public G4VSolid void test(void); void clean_tests(void); void init_tests(void); - /// Log a message using the Athena controlled logging system - MsgStream& msg( MSG::Level lvl ) const { return m_msg << lvl; } - /// Check whether the logging system is active at the provided verbosity level - bool msgLvl( MSG::Level lvl ) const { return m_msg.get().level() <= lvl; } #endif protected: - /// Private message stream member -#ifndef PORTABLE_LAR_SHAPE - mutable Athena::MsgStreamMember m_msg; +#ifndef PORTABLE_LAR_SHAPE TF1 *m_f_area, *m_f_vol, *m_f_area_on_pc, *m_f_length, *m_f_side_area; #endif diff --git a/ATLAS-Extensions/LArCustomSolidExtension/import/Simulation/G4Utilities/Geo2G4/src/LArWheelSliceSolidInit.cxx b/ATLAS-Extensions/LArCustomSolidExtension/import/Simulation/G4Utilities/Geo2G4/src/LArWheelSliceSolidInit.cxx index 252ff49b421322ea3b08938fc02ab456abb255c7..a7fb0d2c9cc749cb5472135967b39cf9435f77dd 100644 --- a/ATLAS-Extensions/LArCustomSolidExtension/import/Simulation/G4Utilities/Geo2G4/src/LArWheelSliceSolidInit.cxx +++ b/ATLAS-Extensions/LArCustomSolidExtension/import/Simulation/G4Utilities/Geo2G4/src/LArWheelSliceSolidInit.cxx @@ -25,7 +25,6 @@ #include "GeoSpecialShapes/EMECData.h" #include "CLHEP/Units/PhysicalConstants.h" #ifndef PORTABLE_LAR_SHAPE -#include "AthenaBaseComps/AthMsgStreamMacros.h" #include "AthenaBaseComps/AthCheckMacros.h" #endif #include "G4GeometryTolerance.hh" @@ -51,20 +50,21 @@ LArWheelSliceSolid::LArWheelSliceSolid( G4int zside, const LArWheelCalculator *calc, const EMECData *emecData -) : G4VSolid(name), m_Pos(pos), m_Type(type), - m_Calculator(calc) -#ifndef PORTABLE_LAR_SHAPE - ,m_msg("LArWSS") +) : G4VSolid(name) +#ifndef PORTABLE_LAR_SHAPE + , AthMessaging("LArWSS") #endif + , m_Pos(pos), m_Type(type), m_Calculator(calc) { createSolid(name, zside, slice, emecData); } LArWheelSliceSolid::LArWheelSliceSolid(const G4String& name, const EMECData *emecData) - : G4VSolid(name), m_Calculator(0) + : G4VSolid(name) #ifndef PORTABLE_LAR_SHAPE - , m_msg("LArWSS") + , AthMessaging("LArWSS") #endif + , m_Calculator(0) { if(name.find("::Inner") != G4String::npos) m_Pos = Inner; else if(name.find("::Outer") != G4String::npos) m_Pos = Outer; diff --git a/ATLAS-Extensions/LArCustomSolidExtension/import/Simulation/G4Utilities/Geo2G4/src/LArWheelSolid.h b/ATLAS-Extensions/LArCustomSolidExtension/import/Simulation/G4Utilities/Geo2G4/src/LArWheelSolid.h index f52005db4d015bbd507715f2a4ffcc5f9f1ca79c..08e81fdf6f51675036f1adf4380a4f1a8dd98581 100644 --- a/ATLAS-Extensions/LArCustomSolidExtension/import/Simulation/G4Utilities/Geo2G4/src/LArWheelSolid.h +++ b/ATLAS-Extensions/LArCustomSolidExtension/import/Simulation/G4Utilities/Geo2G4/src/LArWheelSolid.h @@ -5,7 +5,7 @@ #ifndef GEO2G4_LARWHEELSOLID_H #define GEO2G4_LARWHEELSOLID_H #ifndef PORTABLE_LAR_SHAPE -#include "AthenaKernel/MsgStreamMember.h" +#include "AthenaBaseComps/AthMessaging.h" #endif #include "G4VSolid.hh" @@ -87,6 +87,9 @@ inline const char *LArWheelSolidTypeString(LArWheelSolid_t type) } class LArWheelSolid : public G4VSolid +#ifndef PORTABLE_LAR_SHAPE +, public AthMessaging +#endif { public: @@ -216,17 +219,9 @@ private: void test(void); void clean_tests(void); void init_tests(void); - /// Log a message using the Athena controlled logging system - MsgStream& msg( MSG::Level lvl ) const { return m_msg << lvl; } - /// Check whether the logging system is active at the provided verbosity level - bool msgLvl( MSG::Level lvl ) const { return m_msg.get().level() <= lvl; } #endif protected: - /// Private message stream member -#ifndef PORTABLE_LAR_SHAPE - mutable Athena::MsgStreamMember m_msg; -#endif TF1 *m_f_area, *m_f_vol, *m_f_area_on_pc, *m_f_length, *m_f_side_area; diff --git a/ATLAS-Extensions/LArCustomSolidExtension/import/Simulation/G4Utilities/Geo2G4/src/LArWheelSolidInit.cxx b/ATLAS-Extensions/LArCustomSolidExtension/import/Simulation/G4Utilities/Geo2G4/src/LArWheelSolidInit.cxx index 3055281847d5e30fa53a74391e781c21a4b0fdda..ba275349da6d0f898ef5c243939d1fedf52804a4 100644 --- a/ATLAS-Extensions/LArCustomSolidExtension/import/Simulation/G4Utilities/Geo2G4/src/LArWheelSolidInit.cxx +++ b/ATLAS-Extensions/LArCustomSolidExtension/import/Simulation/G4Utilities/Geo2G4/src/LArWheelSolidInit.cxx @@ -18,10 +18,6 @@ #include "LArFanSection.h" #include "G4ShiftedCone.h" -#ifndef PORTABLE_LAR_SHAPE -#include "AthenaBaseComps/AthMsgStreamMacros.h" -#endif - #ifdef DEBUG_LARWHEELSOLID G4int LArWheelSolid::Verbose = 0; #endif @@ -38,10 +34,11 @@ LArWheelSolid::LArWheelSolid(const G4String& name, LArWheelSolid_t type, LArWheelCalculator *calc, const EMECData *emecData ) - : G4VSolid(name), m_Type(type), m_Calculator(calc), m_PhiPosition(CLHEP::halfpi), m_fs(0) + : G4VSolid(name) #ifndef PORTABLE_LAR_SHAPE - , m_msg("LArWheelSolid") + , AthMessaging("LArWheelSolid") #endif + , m_Type(type), m_Calculator(calc), m_PhiPosition(CLHEP::halfpi), m_fs(0) { #ifndef PORTABLE_LAR_SHAPE #ifdef LARWHEELSOLID_USE_FANBOUND