From e825eea4619520606738622bdee3382a9f2e1d75 Mon Sep 17 00:00:00 2001 From: Scott Snyder <scott.snyder@cern.ch> Date: Fri, 8 Sep 2023 12:22:23 +0200 Subject: [PATCH] FsrUtils: Fix cppcheck warnings. FsrUtils: Fix cppcheck warnings. Pass strings/containers by const reference, not by value. --- .../AnalysisCommon/FsrUtils/FsrUtils/FsrPhotonTool.h | 6 +++--- .../AnalysisCommon/FsrUtils/Root/FsrPhotonTool.cxx | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/PhysicsAnalysis/AnalysisCommon/FsrUtils/FsrUtils/FsrPhotonTool.h b/PhysicsAnalysis/AnalysisCommon/FsrUtils/FsrUtils/FsrPhotonTool.h index c5846e51ac24..7a41e95f0391 100644 --- a/PhysicsAnalysis/AnalysisCommon/FsrUtils/FsrUtils/FsrPhotonTool.h +++ b/PhysicsAnalysis/AnalysisCommon/FsrUtils/FsrUtils/FsrPhotonTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #ifndef FSRUTILS_FsrPhotonTool_H @@ -73,8 +73,8 @@ namespace FSR { /// @} private: /// Need for the FSR search - std::vector<FsrCandidate>* sortFsrCandidates( std::vector< std::pair <const xAOD::IParticle*, double> > FsrCandList, - std::string option="ET"); + std::vector<FsrCandidate>* sortFsrCandidates( const std::vector< std::pair <const xAOD::IParticle*, double> >& FsrCandList, + const std::string& option="ET"); bool isOverlap(const xAOD::Electron_v1* electron, std::vector< std::pair <const xAOD::IParticle*, double> > phfsr, unsigned int nofPhFsr); double deltaR(float muonEta, float muonPhi, float phEta, float phPhi) const; diff --git a/PhysicsAnalysis/AnalysisCommon/FsrUtils/Root/FsrPhotonTool.cxx b/PhysicsAnalysis/AnalysisCommon/FsrUtils/Root/FsrPhotonTool.cxx index 965f99c66457..b24cb8ac8fe9 100644 --- a/PhysicsAnalysis/AnalysisCommon/FsrUtils/Root/FsrPhotonTool.cxx +++ b/PhysicsAnalysis/AnalysisCommon/FsrUtils/Root/FsrPhotonTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration */ #include <utility> @@ -369,7 +369,7 @@ namespace FSR { } // end of getFsrPhotons - std::vector<FsrCandidate>* FsrPhotonTool::sortFsrCandidates(std::vector< std::pair <const xAOD::IParticle*, double> > FsrCandList, std::string option) + std::vector<FsrCandidate>* FsrPhotonTool::sortFsrCandidates(const std::vector< std::pair <const xAOD::IParticle*, double> >& FsrCandList, const std::string& option) { m_fsrPhotons.clear(); -- GitLab