From 152d805611057d4348cb1d658336718fb979e909 Mon Sep 17 00:00:00 2001 From: scott snyder <sss@karma> Date: Mon, 30 Aug 2021 22:33:26 -0400 Subject: [PATCH] MuonCondData: Fix cppcheck warnings. Fix cppcheck warnings. --- .../MuonCondData/MuonCondData/CscCondData.h | 4 ++-- .../MuonCondData/MuonCondData/CscCondDbData.h | 4 ++-- .../MuonCondData/MuonCondData/RpcCondDbData.h | 10 +++++----- .../MuonCondData/MuonCondData/RpcConditionPar.h | 4 ++-- .../MuonCondGeneral/MuonCondData/src/RpcCondDbData.cxx | 10 +++++----- .../MuonCondData/src/RpcConditionPar.cxx | 4 ++-- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondData.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondData.h index 7d9e8f8150db..eae7aa5c2ded 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondData.h +++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondData.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef CSCCONDDATA_H @@ -19,7 +19,7 @@ namespace MuonCalib { template <class data_type> class CscCondData { public: - CscCondData(const data_type & value) { m_value = value; } + CscCondData(const data_type & value) : m_value (value) { } void setValue(const data_type & value); inline const data_type & getValue() const; private: diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondDbData.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondDbData.h index 40d27267e79c..6c291243e3de 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondDbData.h +++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/CscCondDbData.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef MUONCONDDATA_CSCCONDDBDATA_H @@ -124,7 +124,7 @@ private: public: // readChannelParam - template <typename T> StatusCode readChannelParam(IdentifierHash hash, T& val, std::string parName) const{ + template <typename T> StatusCode readChannelParam(IdentifierHash hash, T& val, const std::string& parName) const{ if (parName == "f001" ) { float theVal; return readChannelF001 (hash, theVal); val = theVal; } else if(parName == "noise" ) { float theVal; return readChannelNoise (hash, theVal); val = theVal; } diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcCondDbData.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcCondDbData.h index 521d934614ca..3640c4975205 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcCondDbData.h +++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcCondDbData.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef MUONCONDDATA_RPCCONDDBDATA_H @@ -28,10 +28,10 @@ public: RpcCondDbData(); virtual ~RpcCondDbData() = default; - void setDeadPanel (std::string, Identifier ); + void setDeadPanel (const std::string&, Identifier ); void setDeadStrip (Identifier ); void setDeadStripInt (Identifier, int ); - void setDeadStripList (Identifier, std::string ); + void setDeadStripList (Identifier, const std::string& ); void setEfficiency (Identifier, double ); void setFracClusterSize1(Identifier, double ); void setFracClusterSize2(Identifier, double ); @@ -40,9 +40,9 @@ public: void setGapEfficiency (Identifier, double ); void setLowEffPanel (Identifier ); void setMeanClusterSize (Identifier, double ); - void setOffPanel (std::string, Identifier ); + void setOffPanel (const std::string&, Identifier ); void setProjectedTrack (Identifier, int ); - void setStripTime (Identifier, std::vector<double>); + void setStripTime (Identifier, const std::vector<double>&); const std::vector<std::string>& getDeadPanels() const; const std::vector<std::string>& getOffPanels () const; diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcConditionPar.h b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcConditionPar.h index 031ef4395a20..130170890698 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcConditionPar.h +++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/MuonCondData/RpcConditionPar.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #ifndef MUONCONDDATA_RPCCONDITIONPAR_H @@ -23,7 +23,7 @@ class RpcConditionPar{ Identifier identify() {return m_panel;} //std::string key() {return m_stationKey;} - void setParametersPanel(std::string info_panel, std::string info_strip); + void setParametersPanel(const std::string& info_panel, const std::string& info_strip); void getParametersPanel(std::string& info_panel, std::string& info_strip); diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcCondDbData.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcCondDbData.cxx index c56dcd491c06..b51fe176ea8b 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcCondDbData.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcCondDbData.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "MuonCondData/RpcCondDbData.h" @@ -13,7 +13,7 @@ RpcCondDbData::RpcCondDbData(){ // setDeadPanel void -RpcCondDbData::setDeadPanel(std::string name, Identifier Id){ +RpcCondDbData::setDeadPanel(const std::string& name, Identifier Id){ if(std::find(m_cachedDeadPanelsId.begin(), m_cachedDeadPanelsId.end(), Id)!=m_cachedDeadPanelsId.end()) return; m_cachedDeadPanels .push_back(name); m_cachedDeadPanelsId.push_back(Id ); @@ -35,7 +35,7 @@ RpcCondDbData::setDeadStripInt(Identifier chamberId, int striplist){ // setDeadStripList void -RpcCondDbData::setDeadStripList(Identifier chamberId, std::string striplist){ +RpcCondDbData::setDeadStripList(Identifier chamberId, const std::string& striplist){ if(m_cachedDeadStripList.count(chamberId)) return; m_cachedDeadStripList[chamberId] = striplist; } @@ -98,7 +98,7 @@ RpcCondDbData::setMeanClusterSize(Identifier chamberId, double mcs){ // setOffPanel void -RpcCondDbData::setOffPanel(std::string name, Identifier Id){ +RpcCondDbData::setOffPanel(const std::string& name, Identifier Id){ if(std::find(m_cachedOffPanelsId.begin(), m_cachedOffPanelsId.end(), Id)!=m_cachedOffPanelsId.end()) return; m_cachedOffPanels .push_back(name); m_cachedOffPanelsId.push_back(Id ); @@ -113,7 +113,7 @@ RpcCondDbData::setProjectedTrack(Identifier chamberId, int projectedTracks){ // setStripTime void -RpcCondDbData::setStripTime(Identifier stripId, std::vector<double> time){ +RpcCondDbData::setStripTime(Identifier stripId, const std::vector<double>& time){ if(m_cachedStripTime.count(stripId)) return; m_cachedStripTime[stripId] = time; } diff --git a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcConditionPar.cxx b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcConditionPar.cxx index 856a9375f12e..f7afa9a4dde6 100644 --- a/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcConditionPar.cxx +++ b/MuonSpectrometer/MuonConditions/MuonCondGeneral/MuonCondData/src/RpcConditionPar.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ @@ -26,7 +26,7 @@ RpcConditionPar::RpcConditionPar() RpcConditionPar::~RpcConditionPar() { } -void RpcConditionPar::setParametersPanel(std::string info_panel, std::string info_strip) +void RpcConditionPar::setParametersPanel(const std::string& info_panel, const std::string& info_strip) { m_info_panel = info_panel; m_info_strip = info_strip; -- GitLab