diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/ATLAS_CHECK_THREAD_SAFETY b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..8bf4b99c0973d31322b2c14fb2cdeb5a2546fa90 --- /dev/null +++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +InnerDetector/InDetRecEvent/InDetRIO_OnTrack diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/PixelRIO_OnTrackErrorScaling.h b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/PixelRIO_OnTrackErrorScaling.h index a34fbe5beea0b8be8a6dcc9e82425c0734513e02..190643fb7b576a30d7cc2e037e459703be7eead9 100644 --- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/PixelRIO_OnTrackErrorScaling.h +++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/PixelRIO_OnTrackErrorScaling.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef _PixelRIO_OnTrackErrorScaling_H_ #define _PixelRIO_OnTrackErrorScaling_H_ @@ -26,11 +26,11 @@ public: kPixIBLEta, kNParamTypes}; - static const char **paramNames() { return s_names; } + static const char* const* paramNames() { return s_names; } virtual bool postProcess() override; protected: - static const char *s_names[kNParamTypes]; + static const char* const s_names[kNParamTypes]; }; CLASS_DEF( PixelRIO_OnTrackErrorScaling , 254709438 , 1 ) diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SCTRIO_OnTrackErrorScaling.h b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SCTRIO_OnTrackErrorScaling.h index c023558cda0a50c2593af8747b472857c3cffc28..96d626bc911dd8669e009801bacc6b17dfe71a32 100644 --- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SCTRIO_OnTrackErrorScaling.h +++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SCTRIO_OnTrackErrorScaling.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef _SCTRIO_OnTrackErrorScaling_H_ #define _SCTRIO_OnTrackErrorScaling_H_ @@ -19,10 +19,10 @@ public: kEndcap, kNParamTypes}; - static const char **paramNames() { return s_names; } + static const char* const* paramNames() { return s_names; } virtual bool postProcess() override; protected: - static const char *s_names[kNParamTypes]; + static const char* const s_names[kNParamTypes]; }; diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SiClusterOnTrack.h b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SiClusterOnTrack.h index fc773dd6a15bfdf7007e4ec612c2aed0cb524d5f..709cb650c9af341c673b73b72eaa46b918fcfaa8 100755 --- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SiClusterOnTrack.h +++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/SiClusterOnTrack.h @@ -103,7 +103,7 @@ namespace InDet { /** The IdentifierHash - probably not used*/ IdentifierHash m_idDE; /** The global position */ - mutable std::atomic<const Amg::Vector3D*> m_globalPosition; + mutable std::atomic<const Amg::Vector3D*> m_globalPosition; // This may be replaced by CachedUniquePtr bool m_isbroad; }; diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRTRIO_OnTrackErrorScaling.h b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRTRIO_OnTrackErrorScaling.h index 134e29578eb7b344cb91b9df22aa81e99081cc0e..0451a243b934769ac0fd48f018cb28d5aa0a99e4 100644 --- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRTRIO_OnTrackErrorScaling.h +++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRTRIO_OnTrackErrorScaling.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef _TRTRIO_OnTrackErrorScaling_H_ #define _TRTRIO_OnTrackErrorScaling_H_ @@ -19,10 +19,10 @@ public: kEndcap, kNParamTypes}; - static const char **paramNames() { return s_names; } + static const char* const* paramNames() { return s_names; } virtual bool postProcess() override; protected: - static const char *s_names[kNParamTypes]; + static const char* const s_names[kNParamTypes]; }; diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h index d63ef19d1e4a333761312d06a754cbccacc4513c..98c8522e6d5c1095087b7355c0fd52dd27cddd6f 100755 --- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h +++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/InDetRIO_OnTrack/TRT_DriftCircleOnTrack.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -22,6 +22,8 @@ #include "InDetPrepRawData/TRT_DriftCircleContainer.h" #include "AthLinks/ElementLink.h" +#include <atomic> + namespace Trk { class Surface; class LocalParameters; @@ -156,13 +158,13 @@ namespace InDet{ void setGlobalPosition(Amg::Vector3D& loc3Dframe) const; /** global position to be cached */ - mutable const Amg::Vector3D* m_globalPosition; + mutable std::atomic<const Amg::Vector3D*> m_globalPosition; // This may be replaced by CachedUniquePtr /**local angle to be written out */ - mutable float m_localAngle; + mutable std::atomic<float> m_localAngle; /**local position along wire to be written out*/ - mutable float m_positionAlongWire; + mutable std::atomic<float> m_positionAlongWire; /** the contained RIO (PRD, PrepRawData) - TRT_DriftCircle in this case */ // mutable const InDet::TRT_DriftCircle* m_rio; diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/PixelRIO_OnTrackErrorScaling.cxx b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/PixelRIO_OnTrackErrorScaling.cxx index d69fe70b8076a65196169679552bccc48f145364..b6b6f75ff558ae58c09b979d966091a9dd719c69 100644 --- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/PixelRIO_OnTrackErrorScaling.cxx +++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/PixelRIO_OnTrackErrorScaling.cxx @@ -1,10 +1,10 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "InDetRIO_OnTrack/PixelRIO_OnTrackErrorScaling.h" #include "InDetIdentifier/PixelID.h" -const char *PixelRIO_OnTrackErrorScaling::s_names[PixelRIO_OnTrackErrorScaling::kNParamTypes]={ +const char* const PixelRIO_OnTrackErrorScaling::s_names[PixelRIO_OnTrackErrorScaling::kNParamTypes]={ "PixPhi Barrel", "PixEta Barrel", "PixPhi Endcap", diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SCTRIO_OnTrackErrorScaling.cxx b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SCTRIO_OnTrackErrorScaling.cxx index 1c69e3795334c4e770f5bd73246defdf64eb6a44..749cb4daa928e08428e7003f7b72b50328c3a1f3 100644 --- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SCTRIO_OnTrackErrorScaling.cxx +++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SCTRIO_OnTrackErrorScaling.cxx @@ -1,13 +1,13 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "InDetRIO_OnTrack/SCTRIO_OnTrackErrorScaling.h" #include <iostream> -const char *SCTRIO_OnTrackErrorScaling::s_names[SCTRIO_OnTrackErrorScaling::kNParamTypes]={ +const char * const SCTRIO_OnTrackErrorScaling::s_names[SCTRIO_OnTrackErrorScaling::kNParamTypes]={ "SCT Barrel", "SCT Endcap" - }; +}; namespace { inline double square(double a) { return a*a; } diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SiClusterOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SiClusterOnTrack.cxx index 5aa45e5ddf1c5e383c7b12176e2715bcaf541819..acde8bb4711cee286e9db09525dc970d84ed6435 100755 --- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SiClusterOnTrack.cxx +++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/SiClusterOnTrack.cxx @@ -84,8 +84,16 @@ InDet::SiClusterOnTrack& InDet::SiClusterOnTrack::operator=( const SiClusterOnTr const Amg::Vector3D& InDet::SiClusterOnTrack::globalPosition() const { - if (!m_globalPosition) m_globalPosition = associatedSurface().localToGlobal(localParameters()); - return (*m_globalPosition); + if (m_globalPosition==nullptr) { + const Amg::Vector3D* expected{nullptr}; + const Amg::Vector3D* desired{associatedSurface().localToGlobal(localParameters())}; + if (not m_globalPosition.compare_exchange_strong(expected, desired)) { + // This happens if more than one threads try to set m_globalPosition. + delete desired; + desired = nullptr; + } + } + return (*m_globalPosition); } MsgStream& InDet::SiClusterOnTrack::dump( MsgStream& sl ) const diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRTRIO_OnTrackErrorScaling.cxx b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRTRIO_OnTrackErrorScaling.cxx index 95362b0fca81e9795c52f4294489ca242a61343e..29929fc83a89bc0df8d081f4f8aeb23b00d29888 100644 --- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRTRIO_OnTrackErrorScaling.cxx +++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRTRIO_OnTrackErrorScaling.cxx @@ -1,10 +1,10 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "InDetRIO_OnTrack/TRTRIO_OnTrackErrorScaling.h" #include <iostream> -const char *TRTRIO_OnTrackErrorScaling::s_names[TRTRIO_OnTrackErrorScaling::kNParamTypes]={ +const char* const TRTRIO_OnTrackErrorScaling::s_names[TRTRIO_OnTrackErrorScaling::kNParamTypes]={ "TRT Barrel", "TRT Endcap" }; diff --git a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRT_DriftCircleOnTrack.cxx b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRT_DriftCircleOnTrack.cxx index 29317b2ee30a249372e062d3802a035f0283ffd7..f1875eb771ecb5e1c27ec7db4acee58844c9a201 100755 --- a/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRT_DriftCircleOnTrack.cxx +++ b/InnerDetector/InDetRecEvent/InDetRIO_OnTrack/src/TRT_DriftCircleOnTrack.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /////////////////////////////////////////////////////////////////// @@ -96,9 +96,9 @@ InDet::TRT_DriftCircleOnTrack::TRT_DriftCircleOnTrack //copy constructor: InDet::TRT_DriftCircleOnTrack::TRT_DriftCircleOnTrack( const InDet::TRT_DriftCircleOnTrack& rot): Trk::RIO_OnTrack(rot), - m_globalPosition(rot.m_globalPosition ? new Amg::Vector3D(*rot.m_globalPosition) : 0 ), - m_localAngle(rot.m_localAngle), - m_positionAlongWire(rot.m_positionAlongWire), + m_globalPosition(rot.m_globalPosition ? new Amg::Vector3D(*rot.m_globalPosition.load()) : 0 ), + m_localAngle(rot.m_localAngle.load()), + m_positionAlongWire(rot.m_positionAlongWire.load()), m_rio(rot.m_rio), m_idDE(rot.m_idDE), m_status(rot.m_status), @@ -115,8 +115,8 @@ InDet::TRT_DriftCircleOnTrack& InDet::TRT_DriftCircleOnTrack::operator=( const I delete m_globalPosition; m_globalPosition = (rot.m_globalPosition ? new Amg::Vector3D(*rot.m_globalPosition) : 0); m_rio = rot.m_rio; - m_localAngle = rot.m_localAngle; - m_positionAlongWire = rot.m_positionAlongWire; + m_localAngle = rot.m_localAngle.load(); + m_positionAlongWire = rot.m_positionAlongWire.load(); m_idDE = rot.m_idDE; m_status = rot.m_status; m_highLevel = rot.m_highLevel; @@ -132,10 +132,10 @@ InDet::TRT_DriftCircleOnTrack& InDet::TRT_DriftCircleOnTrack::operator=( InDet:: if ( &rot != this) { Trk::RIO_OnTrack::operator= (rot); delete m_globalPosition; - m_globalPosition = rot.m_globalPosition; + m_globalPosition = rot.m_globalPosition.load(); m_rio = rot.m_rio; - m_localAngle = rot.m_localAngle; - m_positionAlongWire = rot.m_positionAlongWire; + m_localAngle = rot.m_localAngle.load(); + m_positionAlongWire = rot.m_positionAlongWire.load(); m_idDE = rot.m_idDE; m_status = rot.m_status; m_highLevel = rot.m_highLevel; @@ -161,7 +161,15 @@ const Trk::Surface& InDet::TRT_DriftCircleOnTrack::associatedSurface() const void InDet::TRT_DriftCircleOnTrack::setGlobalPosition(Amg::Vector3D& loc3Dframe) const{ const Trk::StraightLineSurface* slsf = dynamic_cast<const Trk::StraightLineSurface*>( &(associatedSurface()) ); if(slsf) { - m_globalPosition = new Amg::Vector3D(slsf->transform() * loc3Dframe); + delete m_globalPosition; + m_globalPosition = nullptr; + const Amg::Vector3D* expected{nullptr}; + const Amg::Vector3D* desired{new Amg::Vector3D(slsf->transform() * loc3Dframe)}; + if (not m_globalPosition.compare_exchange_strong(expected, desired)) { + // This happens if more than one threads try to set m_globalPosition. + delete desired; + desired = nullptr; + } }else{ throw GaudiException("Dynamic_cast to StraightLineSurface failed!", "TRT_DriftCircleOnTrack::setGlobalPosition()", diff --git a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/CMakeLists.txt b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/CMakeLists.txt index fd0bf3e76892555eb2f185f8c4501f1974d440a4..276b06da449b2043daa0e5c1a5c5c01ea5886343 100644 --- a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/CMakeLists.txt +++ b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/CMakeLists.txt @@ -8,6 +8,7 @@ atlas_subdir( SiClusterOnTrackTool ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC Control/AthenaBaseComps + Control/CxxUtils Database/AthenaPOOL/AthenaPoolUtilities DetectorDescription/GeoPrimitives GaudiKernel @@ -40,7 +41,7 @@ atlas_add_component( SiClusterOnTrackTool src/*.cxx src/components/*.cxx INCLUDE_DIRS ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps AthenaPoolUtilities GeoPrimitives GaudiKernel InDetPrepRawData InDetRIO_OnTrack TrkParameters TrkToolInterfaces TrkAmbiguityProcessorLib StoreGateLib SGtests EventPrimitives InDetIdentifier InDetReadoutGeometry SiClusterizationToolLib TrkSurfaces TrkRIO_OnTrack PixelConditionsData TrkNeuralNetworkUtils ) + LINK_LIBRARIES ${EIGEN_LIBRARIES} AthenaBaseComps CxxUtils AthenaPoolUtilities GeoPrimitives GaudiKernel InDetPrepRawData InDetRIO_OnTrack TrkParameters TrkToolInterfaces TrkAmbiguityProcessorLib StoreGateLib SGtests EventPrimitives InDetIdentifier InDetReadoutGeometry SiClusterizationToolLib TrkSurfaces TrkRIO_OnTrack PixelConditionsData TrkNeuralNetworkUtils ) # Install files from the package: atlas_install_headers( SiClusterOnTrackTool ) diff --git a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/SiClusterOnTrackTool/SCT_ClusterOnTrackTool.h b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/SiClusterOnTrackTool/SCT_ClusterOnTrackTool.h index c108691157fa165baa0dd71122d96f5162980212..cf979bdc1a887c5c7a036df410ec17255a6a0051 100755 --- a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/SiClusterOnTrackTool/SCT_ClusterOnTrackTool.h +++ b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/SiClusterOnTrackTool/SCT_ClusterOnTrackTool.h @@ -18,11 +18,15 @@ #include "GaudiKernel/ToolHandle.h" #include "AthenaBaseComps/AthAlgTool.h" #include "TrkToolInterfaces/IRIO_OnTrackCreator.h" -#include "InDetRIO_OnTrack/SCTRIO_OnTrackErrorScaling.h" -#include "TrkParameters/TrackParameters.h" + +#include "CxxUtils/checker_macros.h" +#include "InDetCondTools/ISiLorentzAngleTool.h" #include "InDetRIO_OnTrack/SCT_ClusterOnTrack.h" +#include "InDetRIO_OnTrack/SCTRIO_OnTrackErrorScaling.h" #include "SCT_ModuleDistortions/ISCT_ModuleDistortionsTool.h" -#include "InDetCondTools/ISiLorentzAngleTool.h" +#include "TrkParameters/TrackParameters.h" + +ATLAS_CHECK_FILE_THREAD_SAFETY; namespace InDet { diff --git a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/PixelClusterOnTrackTool.cxx b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/PixelClusterOnTrackTool.cxx index b179d7b1fa5d755e5304292706d939580ae40943..a49ca7a88d55b3aa2d833bb2724e76e26e2d16fc 100755 --- a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/PixelClusterOnTrackTool.cxx +++ b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/PixelClusterOnTrackTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ ///////////////////////////////////////////////////////////////// diff --git a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/SCT_ClusterOnTrackTool.cxx b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/SCT_ClusterOnTrackTool.cxx index c3a6a1632108eb6ac2254bae443a6a271c3503aa..ba96b1f88e554897e1026f9797c61ad9ebb57be0 100755 --- a/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/SCT_ClusterOnTrackTool.cxx +++ b/InnerDetector/InDetRecTools/SiClusterOnTrackTool/src/SCT_ClusterOnTrackTool.cxx @@ -14,14 +14,18 @@ #include "SiClusterOnTrackTool/SCT_ClusterOnTrackTool.h" +#include "CxxUtils/checker_macros.h" #include "TrkSurfaces/RectangleBounds.h" #include "TrkSurfaces/TrapezoidBounds.h" -#include <cmath> #include "TrkRIO_OnTrack/check_cast.h" +#include <cmath> + using CLHEP::micrometer; using CLHEP::deg; +ATLAS_CHECK_FILE_THREAD_SAFETY; + /////////////////////////////////////////////////////////////////// // Constructor /////////////////////////////////////////////////////////////////// diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/MuonRIO_OnTrack/MDTRIO_OnTrackErrorScaling.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/MuonRIO_OnTrack/MDTRIO_OnTrackErrorScaling.h index 2ce586665d74c21abd7812c09fc53e4d1875f27e..0eb7c4fe2e706fea928f38e8d8872b1561ae7e9a 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/MuonRIO_OnTrack/MDTRIO_OnTrackErrorScaling.h +++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/MuonRIO_OnTrack/MDTRIO_OnTrackErrorScaling.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef _MDTRIO_OnTrackErrorScaling_H_ #define _MDTRIO_OnTrackErrorScaling_H_ @@ -20,10 +20,10 @@ public: kEndcap, kNParamTypes}; - static const char **paramNames() { return s_names; } + static const char* const* paramNames() { return s_names; } virtual bool postProcess() override; protected: - static const char *s_names[kNParamTypes]; + static const char* const s_names[kNParamTypes]; }; CLASS_DEF( MDTRIO_OnTrackErrorScaling , 100992927, 1 ) diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/MuonRIO_OnTrack/MuonEtaPhiRIO_OnTrackErrorScaling.h b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/MuonRIO_OnTrack/MuonEtaPhiRIO_OnTrackErrorScaling.h index 8b3634e1307e7283f2fe16e5f84a263b4ae96262..1c703be8197b1bee0ed11b18283f67736183a69d 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/MuonRIO_OnTrack/MuonEtaPhiRIO_OnTrackErrorScaling.h +++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/MuonRIO_OnTrack/MuonEtaPhiRIO_OnTrackErrorScaling.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef _MUONETAPHIRIO_OnTrackErrorScaling_H_ #define _MUONETAPHIRIO_OnTrackErrorScaling_H_ @@ -20,10 +20,10 @@ public: kEta, kNParamTypes}; - static const char **paramNames() { return s_names; } + static const char* const* paramNames() { return s_names; } virtual bool postProcess() override; protected: - static const char *s_names[kNParamTypes]; + static const char* const s_names[kNParamTypes]; }; CLASS_DEF( MuonEtaPhiRIO_OnTrackErrorScaling , 92816455, 1 ) diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MDTRIO_OnTrackErrorScaling.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MDTRIO_OnTrackErrorScaling.cxx index b2d59f77eb69e684d8aeb840a7385bb4cf460ac4..1c11d76fa6e9d73428623ed2917cfec290e0ecde 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MDTRIO_OnTrackErrorScaling.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MDTRIO_OnTrackErrorScaling.cxx @@ -1,10 +1,10 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "MuonRIO_OnTrack/MDTRIO_OnTrackErrorScaling.h" #include <iostream> -const char *MDTRIO_OnTrackErrorScaling::s_names[MDTRIO_OnTrackErrorScaling::kNParamTypes]={ +const char* const MDTRIO_OnTrackErrorScaling::s_names[MDTRIO_OnTrackErrorScaling::kNParamTypes]={ "MDT Barrel", "MDT Endcap" }; diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MuonEtaPhiRIO_OnTrackErrorScaling.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MuonEtaPhiRIO_OnTrackErrorScaling.cxx index 64c2024ff693c83f0c2e93ada8fb48a1c38ad61e..207935704b4761ed420abcc9a89da203122c28ce 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MuonEtaPhiRIO_OnTrackErrorScaling.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonRIO_OnTrack/src/MuonEtaPhiRIO_OnTrackErrorScaling.cxx @@ -1,10 +1,10 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "MuonRIO_OnTrack/MuonEtaPhiRIO_OnTrackErrorScaling.h" #include <iostream> -const char *MuonEtaPhiRIO_OnTrackErrorScaling::s_names[MuonEtaPhiRIO_OnTrackErrorScaling::kNParamTypes]={ +const char* const MuonEtaPhiRIO_OnTrackErrorScaling::s_names[MuonEtaPhiRIO_OnTrackErrorScaling::kNParamTypes]={ "Phi", "Eta" }; diff --git a/Tracking/TrkEvent/TrkRIO_OnTrack/TrkRIO_OnTrack/RIO_OnTrackErrorScaling.h b/Tracking/TrkEvent/TrkRIO_OnTrack/TrkRIO_OnTrack/RIO_OnTrackErrorScaling.h index 911f87f0e13f85bd7fa070cf369e03393b2949f9..f246e48a5edb21c5d26a7653c97ea7934dcb36cc 100644 --- a/Tracking/TrkEvent/TrkRIO_OnTrack/TrkRIO_OnTrack/RIO_OnTrackErrorScaling.h +++ b/Tracking/TrkEvent/TrkRIO_OnTrack/TrkRIO_OnTrack/RIO_OnTrackErrorScaling.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ /* Dear emacs, this is -*-c++-*- */ #ifndef _RIO_OnTrackErrorScaling_H_ @@ -30,7 +30,7 @@ protected : /// @param n_paramter_sets the number of parameter sets /// @param param_names the names of the parameter sets /// @param n_paramters the number of parameters per set. - void checkParameters(const char *label, unsigned int n_paramter_sets, const char **param_names, unsigned int n_paramters) const; + void checkParameters(const char *label, unsigned int n_paramter_sets, const char* const* param_names, unsigned int n_paramters) const; private: std::vector<std::vector<double> > m_params; }; diff --git a/Tracking/TrkEvent/TrkRIO_OnTrack/src/RIO_OnTrackErrorScaling.cxx b/Tracking/TrkEvent/TrkRIO_OnTrack/src/RIO_OnTrackErrorScaling.cxx index 4042a8554fd4bbb12ad470a873229e5c628274e5..df58b593585145f41a75c11eb3c74d88e91e63d1 100644 --- a/Tracking/TrkEvent/TrkRIO_OnTrack/src/RIO_OnTrackErrorScaling.cxx +++ b/Tracking/TrkEvent/TrkRIO_OnTrack/src/RIO_OnTrackErrorScaling.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "TrkRIO_OnTrack/RIO_OnTrackErrorScaling.h" @@ -13,7 +13,7 @@ CLID RIO_OnTrackErrorScaling::clid() const { void RIO_OnTrackErrorScaling::checkParameters(const char *label, unsigned int n_paramter_sets, - const char **param_names, + const char* const* param_names, unsigned int n_paramters) const { if (params().size() != n_paramter_sets ) { diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.cxx index e610ed532e1b2cc3b22c9a47174a7ad3d5bee8c8..b4be7e0f598c7fd8d41d36ac4cc82f532dbcefff 100644 --- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.cxx +++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingCondAlg.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "TrkRIO_OnTrack/RIO_OnTrackErrorScaling.h" @@ -71,7 +71,7 @@ StatusCode RIO_OnTrackErrorScalingCondAlg::addErrorScaling(const std::string &ty return StatusCode::FAILURE; } m_kits.push_back(the_kit); - const char **parameters=the_kit->paramNames(); + const char* const* parameters=the_kit->paramNames(); for (unsigned int param_i=0; param_i<the_kit->nParametres(); ++param_i) { registerAttribute( std::string(parameters[param_i]), m_kits.size()-1, param_i); } diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingIDKits.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingIDKits.cxx index 2559917acee3457c206a537e12126d8261be37a9..0011bb440f258894a2edd626695cf03b901cc089 100644 --- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingIDKits.cxx +++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingIDKits.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "RIO_OnTrackErrorScalingKit.h" #include "InDetRIO_OnTrack/PixelRIO_OnTrackErrorScaling.h" @@ -13,7 +13,7 @@ public: virtual unsigned int nParametres() const override { return PixelRIO_OnTrackErrorScaling::kNParamTypes; } - virtual const char **paramNames() const override { + virtual const char* const* paramNames() const override { return PixelRIO_OnTrackErrorScaling::paramNames(); } @@ -37,7 +37,7 @@ public: virtual unsigned int nParametres() const override { return SCTRIO_OnTrackErrorScaling::kNParamTypes; } - virtual const char **paramNames() const override { + virtual const char* const* paramNames() const override { return SCTRIO_OnTrackErrorScaling::paramNames(); } @@ -50,7 +50,7 @@ public: virtual unsigned int nParametres() const override { return TRTRIO_OnTrackErrorScaling::kNParamTypes; } - virtual const char **paramNames() const override { + virtual const char* const* paramNames() const override { return TRTRIO_OnTrackErrorScaling::paramNames(); } diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingKit.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingKit.cxx index 6b3be9d4d1057c9edaac2e321ea79b19653e7fdd..f13c9214b966404010d0374786771de8281fd056 100644 --- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingKit.cxx +++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingKit.cxx @@ -1,10 +1,10 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "RIO_OnTrackErrorScalingKit.h" size_t RIO_OnTrackErrorScalingKit::getParamIndex(const std::string &name) const { - const char **param_names = paramNames(); + const char* const* param_names = paramNames(); for(size_t idx=0; idx<nParametres(); ++idx) { if (strcmp(param_names[idx],name.c_str())==0) return idx; } diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingKit.h b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingKit.h index cd5e9328d6aa37ac9269b4ab949ef82064a2d5cc..9300a0eb4908fdedca4bcfc0ee0fb8a586172de5 100644 --- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingKit.h +++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingKit.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #ifndef _RIO_OnTrackErrorScalingKit_H_ @@ -14,7 +14,7 @@ public: virtual ~RIO_OnTrackErrorScalingKit() {} virtual unsigned int nParametres() const = 0; - virtual const char **paramNames() const = 0; + virtual const char* const* paramNames() const = 0; virtual size_t getParamIndex(const std::string &name) const; virtual std::unique_ptr<RIO_OnTrackErrorScaling> create() const = 0; diff --git a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.cxx b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.cxx index 935535ad4ec435efec4ef450c8a8196c8eeb21f4..10cd25b9e8aca41681a0ccd0eff559a08bb34c9f 100644 --- a/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.cxx +++ b/Tracking/TrkTools/TrkRIO_OnTrackCreator/src/RIO_OnTrackErrorScalingMuonKits.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ #include "RIO_OnTrackErrorScalingKit.h" #include "MuonRIO_OnTrack/MuonEtaPhiRIO_OnTrackErrorScaling.h" @@ -28,8 +28,8 @@ public: virtual unsigned int nParametres() const override { return MuonEtaPhiRIO_OnTrackErrorScaling::kNParamTypes; } - virtual const char **paramNames() const override { - return const_cast<const char **>(m_names); + virtual const char* const* paramNames() const override { + return const_cast<const char* const*>(m_names); } private: char **m_names; @@ -47,7 +47,7 @@ public: virtual unsigned int nParametres() const override { return MDTRIO_OnTrackErrorScaling::kNParamTypes; } - virtual const char **paramNames() const override { + virtual const char* const* paramNames() const override { return MDTRIO_OnTrackErrorScaling::paramNames(); } };