From adc84b94b30ffba72c2d917b0d258eaca11117de Mon Sep 17 00:00:00 2001 From: Adam Edward Barton <adam.edward.barton@cern.ch> Date: Thu, 13 Aug 2020 10:21:32 +0100 Subject: [PATCH] clang-tidy autofix performance --- .../MMClusterization/src/ProjectionMMClusterBuilderTool.cxx | 2 +- .../MMClusterization/src/ProjectionMMClusterBuilderTool.h | 2 +- .../MMClusterization/src/UTPCMMClusterBuilderTool.cxx | 2 +- .../STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ProjectionMMClusterBuilderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ProjectionMMClusterBuilderTool.cxx index 90defcc086ee..af5fe82fe80f 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ProjectionMMClusterBuilderTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ProjectionMMClusterBuilderTool.cxx @@ -169,7 +169,7 @@ StatusCode Muon::ProjectionMMClusterBuilderTool::doFineScan(std::vector<int>& fl } StatusCode Muon::ProjectionMMClusterBuilderTool::doPositionCalculation(std::vector<double>& v_posxc, - const std::vector<double>& v_cor,const std::vector<int> idx_selected, double& xmean, double& xmeanErr,double& qtot,const std::vector<Muon::MMPrepData>& prdsOfLayer)const { + const std::vector<double>& v_cor,const std::vector<int>& idx_selected, double& xmean, double& xmeanErr,double& qtot,const std::vector<Muon::MMPrepData>& prdsOfLayer)const { //determine cluster charge qtot=0; for(const auto& idx:idx_selected) qtot+=prdsOfLayer.at(idx).charge(); diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ProjectionMMClusterBuilderTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ProjectionMMClusterBuilderTool.h index b46faee9d68a..817023efc8d2 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ProjectionMMClusterBuilderTool.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/ProjectionMMClusterBuilderTool.h @@ -57,7 +57,7 @@ namespace Muon StatusCode calculateCorrection(const std::vector<Muon::MMPrepData> &prdsOfLayer,std::vector<double>& v_posxc,std::vector<double>& v_cor) const ; StatusCode doFineScan(std::vector<int>& flag,const std::vector<double>& v_posxc, const std::vector<double>& v_cor, std::vector<int>& idx_selected) const ; - StatusCode doPositionCalculation(std::vector<double>& v_posxc, const std::vector<double>& v_cor, const std::vector<int> idx_selected,double& xmean, double& xmeanErr, double & qtot,const std::vector<Muon::MMPrepData>& prdsOfLayer) const; + StatusCode doPositionCalculation(std::vector<double>& v_posxc, const std::vector<double>& v_cor, const std::vector<int>& idx_selected,double& xmean, double& xmeanErr, double & qtot,const std::vector<Muon::MMPrepData>& prdsOfLayer) const; StatusCode writeNewPrd(std::vector<std::unique_ptr<Muon::MMPrepData>>& clustersVect,double xmean, double xerr,double qtot,const std::vector<int>& idx_selected,const std::vector<Muon::MMPrepData>& prdsOfLayer) const ; diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/UTPCMMClusterBuilderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/UTPCMMClusterBuilderTool.cxx index de315539cee5..c87d3499a545 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/UTPCMMClusterBuilderTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/UTPCMMClusterBuilderTool.cxx @@ -83,7 +83,7 @@ StatusCode Muon::UTPCMMClusterBuilderTool::getClusters(std::vector<Muon::MMPrepD std::vector<double> stripsLocalPosX; stripsLocalPosX.reserve(MMprdsOfLayer.size()); - for( auto MMprd: MMprdsOfLayer){ + for( const auto& MMprd: MMprdsOfLayer){ Identifier id_prd=MMprd.identify(); int gasGap=m_idHelperSvc->mmIdHelper().gasGap(id_prd); stripsLocalPosX.push_back(((gasGap%2==0 && m_digiHasNegativeAngles) ? -1:1)*MMprd.localPosition().x()); //flip local positions for even gas gaps to reduce hough space to positiv angles diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx index f9662875fa74..394196382587 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx @@ -87,7 +87,7 @@ StatusCode Muon::SimpleSTgcClusterBuilderTool::getClusters(std::vector<Muon::sTg double maxCharge = -1.0; double totalCharge = 0.0; - for ( auto it : cluster ) { + for ( const auto& it : cluster ) { rdoList.push_back(it.identify()); elementsCharge.push_back(it.charge()); elementsChannel.push_back(m_idHelperSvc->stgcIdHelper().channel(it.identify())); @@ -119,7 +119,7 @@ StatusCode Muon::SimpleSTgcClusterBuilderTool::getClusters(std::vector<Muon::sTg ATH_MSG_DEBUG("Cluster size: " << cluster.size()); if ( cluster.size() > 1 ) { double weight = 0.0; - for ( auto it : cluster ) { + for ( const auto& it : cluster ) { isStrip ? weight = it.charge() : weight = 1.0; ATH_MSG_DEBUG("isStrip: " << isStrip << " weight: " << weight); //sigmaSq += weight*(it.localPosition().x()-weightedPosX)*(it.localPosition().x()-weightedPosX); @@ -239,7 +239,7 @@ void SimpleSTgcClusterBuilderTool::dumpStrips( std::vector<Muon::sTgcPrepData>& { ATH_MSG_INFO("====> Dumping all strips: "); - for ( auto it : stripsVect ) { + for ( const auto& it : stripsVect ) { Identifier stripId = it.identify(); ATH_MSG_INFO("Strip identifier: " << m_idHelperSvc->stgcIdHelper().show_to_string(stripId) ); } -- GitLab