diff --git a/Generators/Pythia8_i/src/Pythia8_i.cxx b/Generators/Pythia8_i/src/Pythia8_i.cxx
index 3ab4d5e2134f65211f3e8d5e65783a2c9f4ed96d..a45a52a3bbd8bd086b82c1aba2849e859b7f7a29 100644
--- a/Generators/Pythia8_i/src/Pythia8_i.cxx
+++ b/Generators/Pythia8_i/src/Pythia8_i.cxx
@@ -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
 */
 #include "Pythia8_i/Pythia8_i.h"
 #include "Pythia8_i/UserProcessFactory.h"
@@ -175,19 +175,19 @@ StatusCode Pythia8_i::genInitialize() {
     }
   }
 
-  for(const std::pair<std::string, double> &param : Pythia8_UserHooks::UserHooksFactory::userSettings<double>()){
+  for(const std::pair<const std::string, double> &param : Pythia8_UserHooks::UserHooksFactory::userSettings<double>()){
     m_pythia->settings.addParm(param.first, param.second, false, false, 0., 0.);
   }
 
-  for(const std::pair<std::string, int> &param : Pythia8_UserHooks::UserHooksFactory::userSettings<int>()){
+  for(const std::pair<const std::string, int> &param : Pythia8_UserHooks::UserHooksFactory::userSettings<int>()){
     m_pythia->settings.addMode(param.first, param.second, false, false, 0., 0.);
   }
 
-  for(const std::pair<std::string, int> &param : Pythia8_UserHooks::UserHooksFactory::userSettings<bool>()){
+  for(const std::pair<const std::string, bool> &param : Pythia8_UserHooks::UserHooksFactory::userSettings<bool>()){
     m_pythia->settings.addFlag(param.first, param.second);
   }
 
-  for(const std::pair<std::string, std::string> &param : Pythia8_UserHooks::UserHooksFactory::userSettings<std::string>()){
+  for(const std::pair<const std::string, std::string> &param : Pythia8_UserHooks::UserHooksFactory::userSettings<std::string>()){
     m_pythia->settings.addWord(param.first, param.second);
   }
 
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/MuonPhysValMonitoringTool.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/MuonPhysValMonitoringTool.cxx
index b94293e21703dc3684b9dfed072b58aa251c2a66..4e7b63876191b9549e1f5a5aba6181e72e5add66 100644
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/MuonPhysValMonitoringTool.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/MuonPhysValMonitoringTool.cxx
@@ -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
 */
 
 // MuonPhysValMonitoringTool.cxx 
@@ -177,7 +177,7 @@ StatusCode MuonPhysValMonitoringTool::bookHistograms()
   if (m_slowMuonsName!="") separateSAFMuons = false; // no such muons in case of SlowMuon reco
   
   std::string muonContainerName = m_muonsName.name();
-  for (const auto category : m_selectMuonCategoriesStr) {
+  for (const auto& category : m_selectMuonCategoriesStr) {
     std::string categoryPath = m_muonsName+"/"+category+"/";
     m_muonValidationPlots.push_back( new MuonValidationPlots(0, categoryPath,
               m_selectMuonWPs, m_selectMuonAuthors, m_isData,
@@ -799,7 +799,7 @@ StatusCode MuonPhysValMonitoringTool::fillHistograms()
         }//m_vRecoMuons_EffDen
       }//m_muonItems
 //@@@@@ L1 items efficiency @@@@@
-      for (const auto L1MuonItem : m_L1MuonItems) { 
+      for (const auto& L1MuonItem : m_L1MuonItems) { 
         m_vRecoMuons_EffDen=m_vRecoMuons_EffDen_CB; m_SelectedAuthor=1;
         float treshold=0.;
         if(L1MuonItem=="L1_MU4") treshold=4000;
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/MuonValidationPlots.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/MuonValidationPlots.cxx
index e41c54b36f2d38b344b902e49405d691ae5740d8..9dd0383c843bcdb4a8cd3a4f6767c760e9674ba9 100644
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/MuonValidationPlots.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonPhysValMonitoring/src/MuonValidationPlots.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
 */
 
 #include "MuonValidationPlots.h"
@@ -16,7 +16,7 @@ MuonValidationPlots::MuonValidationPlots(PlotBase* pParent, std::string sDir,std
     m_truthSelections[1] = "MSAcceptance"; //truth muons in MS acceptance (at least 4 associated hits in the MS)
     
     //histogram classes for all muons
-    for(const auto truthSelection : m_truthSelections) {
+    for(const auto& truthSelection : m_truthSelections) {
       m_oTruthMuonPlots.push_back(new Muon::TruthMuonPlotOrganizer(this,"truth/"+truthSelection));
     }
     m_oTruthRelatedMuonPlots = new Muon::TruthRelatedMuonPlotOrganizer(this, "matched/AllMuons", doBinnedResolutionPlots);//, doMuonTree);
@@ -248,7 +248,7 @@ bool MuonValidationPlots::isGoodTruthTrack(const xAOD::TruthParticle& truthMu) {
   int nPrecHits=0;
   bool hasEnoughPrecHits=false;
 
-  for (const auto hitTypeItr : hitTypes) {
+  for (const auto& hitTypeItr : hitTypes) {
     if (truthMu.isAvailable<uint8_t>(hitTypeItr)) {
       nPrecHits+=truthMu.auxdata<uint8_t>(hitTypeItr);
       if (nPrecHits>=minPrecHits) {
diff --git a/PhysicsAnalysis/AnalysisCommon/PMGTools/Root/PMGCrossSectionTool.cxx b/PhysicsAnalysis/AnalysisCommon/PMGTools/Root/PMGCrossSectionTool.cxx
index aaa346dbd3c2e52b2d1f20cf5b8d8e008a880aa5..fd2014c2f3e1304777322c71ef2b5d7074c9fb0f 100644
--- a/PhysicsAnalysis/AnalysisCommon/PMGTools/Root/PMGCrossSectionTool.cxx
+++ b/PhysicsAnalysis/AnalysisCommon/PMGTools/Root/PMGCrossSectionTool.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
 */
 
 // $Id: PMGCrossSectionTool.cxx 764400 2016-07-26 17:47:39Z tripiana $
@@ -208,7 +208,7 @@ double PMGCrossSectionTool::getSampleXsection(const int dsid) const
 std::vector<int> PMGCrossSectionTool::getLoadedDSIDs() const {
   std::vector<int> dsids;
   dsids.reserve(m_fStoreSampleInfo.size());
-  for (const std::pair<unsigned, AllSampleInfo>& key_info : m_fStoreSampleInfo) {
+  for (const std::pair<const unsigned, AllSampleInfo>& key_info : m_fStoreSampleInfo) {
     dsids.push_back(key_info.second.dsid);
   }
   return dsids;