From 1b4ac0b92509af7e0a1eb0267a1cee04877a6eff Mon Sep 17 00:00:00 2001
From: scott snyder <sss@karma>
Date: Mon, 22 Jun 2020 11:40:44 -0400
Subject: [PATCH] TrigEgammaAnalysisTools: Fix clang 10 warnings.

Avoid spurious object copy in range for.
---
 .../Root/EfficiencyTool.cxx                   | 10 +++---
 .../Root/TrigEgammaAnalysisBaseTool.cxx       |  2 +-
 .../Root/TrigEgammaDistTool.cxx               | 20 +++++------
 .../Root/TrigEgammaEventSelection.cxx         |  4 +--
 .../Root/TrigEgammaNavAnalysisTool.cxx        |  6 ++--
 .../Root/TrigEgammaNavTPAnalysisTool.cxx      |  4 +--
 .../Root/TrigEgammaPlotTool.cxx               | 36 +++++++++----------
 .../Root/TrigEgammaResolutionTool.cxx         |  4 +--
 .../src/TrigEgammaMonTool.cxx                 |  4 +--
 9 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/EfficiencyTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/EfficiencyTool.cxx
index f4baf74a26d..2ffc42bbe7c 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/EfficiencyTool.cxx
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/EfficiencyTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /**********************************************************************
@@ -426,7 +426,7 @@ void EfficiencyTool::inefficiency(const std::string& pid, const std::string base
                std::vector<std::string> groupnames {"Trk", "TrkClus", "TRT"};
                for (int ibin = 0; ibin < hist1("IneffisEM" + pid)->GetNbinsX(); ibin++)
                   hist1("IneffisEM" + pid)->Fill(ibin + 0.5, 0);
-               for (const auto groupname : groupnames)
+               for (const auto& groupname : groupnames)
                   for (int ibin = 0; ibin < hist1("IneffisEM" + pid + groupname)->GetNbinsX(); ibin++)
                       hist1("IneffisEM" + pid + groupname)->Fill(ibin + 0.5, 0);
             }        
@@ -536,7 +536,7 @@ StatusCode EfficiencyTool::toolExecute(const std::string basePath,const TrigInfo
     const std::string pid = info.trigPidDecorator.substr(2);
     
     ATH_MSG_DEBUG("Efficiency for " << info.trigName << " " <<pidword);
-    for(const auto pairObj : pairObjs){
+    for(const auto& pairObj : pairObjs){
         // Final cuts done here
         if(pairObj.first->type()==xAOD::Type::Electron){
             const xAOD::Electron* el = static_cast<const xAOD::Electron *> (pairObj.first);
@@ -595,12 +595,12 @@ StatusCode EfficiencyTool::toolExecute(const std::string basePath,const TrigInfo
               this->fillEfficiency(dir+"/"+algname+"/EFCalo",acceptData.getCutResult("EFCalo"),etthr,pidword,pairObj.first,m_detailedHists);
               this->fillEfficiency(dir+"/"+algname+"/L1Calo",acceptData.getCutResult("L1Calo"),etthr,pidword,pairObj.first);
               if(m_detailedHists){
-                  for(const auto pid : m_isemname) {
+                  for(const auto& pid : m_isemname) {
                       this->fillEfficiency(dir+"/"+algname+"/HLT/"+pid,acceptData.getCutResult("HLT"),etthr,"is"+pid,pairObj.first);
                       if( pairObj.first->auxdecor<bool>("Isolated") ) fillEfficiency(dir+"/"+algname+"/HLT/"+pid+"Iso",
                           acceptData.getCutResult("HLT"),etthr,"is"+pid,pairObj.first);
                   }
-                  for(const auto pid : m_lhname) {
+                  for(const auto& pid : m_lhname) {
                       this->fillEfficiency(dir+"/"+algname+"/HLT/"+pid,acceptData.getCutResult("HLT"),etthr,"is"+pid,pairObj.first);
                       if( pairObj.first->auxdecor<bool>("Isolated") ) fillEfficiency(dir+"/"+algname+"/HLT/"+pid+"Iso",
                           acceptData.getCutResult("HLT"),etthr,"is"+pid,pairObj.first);
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaAnalysisBaseTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaAnalysisBaseTool.cxx
index 2e9f805e41f..f7d0bb03f6c 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaAnalysisBaseTool.cxx
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaAnalysisBaseTool.cxx
@@ -212,7 +212,7 @@ StatusCode TrigEgammaAnalysisBaseTool::initialize() {
     
     }*/
 
-    for(const auto cut:m_trigLevel) m_accept.addCut(cut,cut);
+    for(const auto& cut:m_trigLevel) m_accept.addCut(cut,cut);
     return sc;
 }
 
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaDistTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaDistTool.cxx
index c26e62ee4b7..d5707a3c110 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaDistTool.cxx
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaDistTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /**********************************************************************
@@ -63,7 +63,7 @@ StatusCode TrigEgammaDistTool::toolExecute(const std::string basePath,TrigInfo i
     if (boost::starts_with(info.trigName, "L1" )){
         const auto initRois = fc.get<TrigRoiDescriptor>();
         ATH_MSG_DEBUG("Size of initialRoI" << initRois.size());
-        for(const auto feat : initRois){
+        for(const auto& feat : initRois){
             if(feat.te()==nullptr) {
                 ATH_MSG_DEBUG("initial RoI feature nullptr");
                 continue;
@@ -79,7 +79,7 @@ StatusCode TrigEgammaDistTool::toolExecute(const std::string basePath,TrigInfo i
     }
     else {
         
-        for(const auto pairObj : pairObjs){
+        for(const auto& pairObj : pairObjs){
             fillShowerShapes(dir+"Offline",pairObj.first); // Fill Offline shower shapes
             if(xAOD::EgammaHelpers::isElectron(pairObj.first)) { // Fill offline tracking
                 const xAOD::Electron* elOff =static_cast<const xAOD::Electron*> (pairObj.first);
@@ -91,7 +91,7 @@ StatusCode TrigEgammaDistTool::toolExecute(const std::string basePath,TrigInfo i
         if(m_tp){
             if(info.trigType=="electron"){
                 const auto vec_el = fc.get<xAOD::ElectronContainer>("egamma_Electrons",TrigDefs::alsoDeactivateTEs);
-                for (const auto feat : vec_el){
+                for (const auto& feat : vec_el){
                     if(feat.te()==nullptr) continue;
                     const auto* cont = getFeature<xAOD::ElectronContainer>(feat.te());
                     std::unique_ptr<xAOD::TrigPassBits> bits = getBits<xAOD::ElectronContainer>(feat.te(),cont);
@@ -123,7 +123,7 @@ StatusCode TrigEgammaDistTool::toolExecute(const std::string basePath,TrigInfo i
 
             const auto initRois = fcl1.get<TrigRoiDescriptor>();
             ATH_MSG_DEBUG("Size of initialRoI" << initRois.size());
-            for(const auto feat : initRois){
+            for(const auto& feat : initRois){
                 if(feat.te()==nullptr) {
                     ATH_MSG_DEBUG("initial RoI feature nullptr");
                     continue;
@@ -140,7 +140,7 @@ StatusCode TrigEgammaDistTool::toolExecute(const std::string basePath,TrigInfo i
                 fillL1Calo(dir+"L1Calo",l1);
             }
             const auto vec_l2em = fc.get<xAOD::TrigEMCluster>("",TrigDefs::alsoDeactivateTEs);
-            for (const auto feat : vec_l2em){
+            for (const auto& feat : vec_l2em){
                 if(feat.te()==nullptr) continue;
                 const auto* obj = getFeature<xAOD::TrigEMCluster>(feat.te());
                 // Only consider passing objects
@@ -154,7 +154,7 @@ StatusCode TrigEgammaDistTool::toolExecute(const std::string basePath,TrigInfo i
 
 
             const auto vec_clus = fc.get<xAOD::CaloClusterContainer>("TrigEFCaloCalibFex",TrigDefs::alsoDeactivateTEs);
-            for(const auto feat : vec_clus){
+            for(const auto& feat : vec_clus){
                 if(feat.te()==nullptr) continue;
                 const auto *cont = getFeature<xAOD::CaloClusterContainer>(feat.te(),"TrigEFCaloCalibFex");
                 ATH_MSG_DEBUG("Retreive clusters, bits");
@@ -177,7 +177,7 @@ StatusCode TrigEgammaDistTool::toolExecute(const std::string basePath,TrigInfo i
             // Loop over features, get PassBits from TE for Electron
             if(info.trigType=="electron"){
                 const auto vec_l2el = fc.get<xAOD::TrigElectronContainer>("",TrigDefs::alsoDeactivateTEs);
-                for (const auto feat : vec_l2el){
+                for (const auto& feat : vec_l2el){
                     if(feat.te()==nullptr) continue;
                     const auto* cont = getFeature<xAOD::TrigElectronContainer>(feat.te());
                     std::unique_ptr<xAOD::TrigPassBits> bits = getBits<xAOD::TrigElectronContainer>(feat.te(),cont);
@@ -195,7 +195,7 @@ StatusCode TrigEgammaDistTool::toolExecute(const std::string basePath,TrigInfo i
                 }
                 const auto vec_el = fc.get<xAOD::ElectronContainer>("egamma_Electrons",TrigDefs::alsoDeactivateTEs);
                 ATH_MSG_DEBUG("Retrieved egamma_Electrons: " << vec_el.size());
-                for (const auto feat : vec_el){
+                for (const auto& feat : vec_el){
                     if(feat.te()==nullptr) continue;
                     const auto* cont = getFeature<xAOD::ElectronContainer>(feat.te());
                     std::unique_ptr<xAOD::TrigPassBits> bits = getBits<xAOD::ElectronContainer>(feat.te(),cont);
@@ -219,7 +219,7 @@ StatusCode TrigEgammaDistTool::toolExecute(const std::string basePath,TrigInfo i
             else if(info.trigType=="photon"){
                 const auto vec_ph = fc.get<xAOD::PhotonContainer>("",TrigDefs::alsoDeactivateTEs);
                 ATH_MSG_DEBUG("Retrieved egamma_Photons: " << vec_ph.size());
-                for (const auto feat : vec_ph){
+                for (const auto& feat : vec_ph){
                     if(feat.te()==nullptr) continue;
                     const auto* cont = getFeature<xAOD::PhotonContainer>(feat.te());
                     std::unique_ptr<xAOD::TrigPassBits> bits = getBits<xAOD::PhotonContainer>(feat.te(),cont);
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaEventSelection.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaEventSelection.cxx
index 98545bb95a2..cab71c339c6 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaEventSelection.cxx
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaEventSelection.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 /**********************************************************************
  * AsgTool: TrigEgammaEventSelection
@@ -86,7 +86,7 @@ StatusCode TrigEgammaEventSelection::childBook(){
   }
 
 
-  for(const auto trigName:m_trigInputList){ 
+  for(const auto& trigName:m_trigInputList){ 
     if (std::find(chains.begin(), chains.end(), trigName) != chains.end()){ 
       if(plot()->getTrigInfoMap().count(trigName) != 0)
         ATH_MSG_WARNING("Trigger already booked, removing from trigger list " << trigName);
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavAnalysisTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavAnalysisTool.cxx
index df95ba0164a..0d86adee333 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavAnalysisTool.cxx
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavAnalysisTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "TrigEgammaAnalysisTools/TrigEgammaNavAnalysisTool.h"
@@ -27,7 +27,7 @@ StatusCode TrigEgammaNavAnalysisTool::childBook(){
     m_dir=plot()->getBasePath();
     std::vector<std::string> chains  = tdt()->getListOfTriggers("HLT_e.*, L1_EM.*, HLT_g.*");
 
-    for(const auto trigName:m_trigInputList){
+    for(const auto& trigName:m_trigInputList){
         if (std::find(chains.begin(), chains.end(), trigName) != chains.end()){ 
             if(plot()->getTrigInfoMap().count(trigName) != 0)
                 ATH_MSG_WARNING("Trigger already booked, removing from trigger list " << trigName);
@@ -111,7 +111,7 @@ StatusCode TrigEgammaNavAnalysisTool::childExecute(){
         return StatusCode::SUCCESS; 
     }
     int ilist=0;
-    for(const auto trigger : m_trigList){
+    for(const auto& trigger : m_trigList){
         ATH_MSG_DEBUG("Start Chain Analysis ============================= " << trigger 
                 << " " << getTrigInfo(trigger).trigName); 
         // Trigger counts
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPAnalysisTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPAnalysisTool.cxx
index 71a4ad01aa2..78cd63d5261 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPAnalysisTool.cxx
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPAnalysisTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 
@@ -44,7 +44,7 @@ StatusCode TrigEgammaNavTPAnalysisTool::childBook(){
     m_dir=plot()->getBasePath();
     std::vector<std::string> chains  = tdt()->getListOfTriggers("HLT_e.*, L1_EM.*, HLT_g.*");
 
-    for(const auto trigName:m_trigInputList){ 
+    for(const auto& trigName:m_trigInputList){ 
         if (std::find(chains.begin(), chains.end(), trigName) != chains.end()){ 
             if(plot()->getTrigInfoMap().count(trigName) != 0)
                 ATH_MSG_WARNING("Trigger already booked, removing from trigger list " << trigName);
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaPlotTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaPlotTool.cxx
index a50f2e7c869..0a62f999e6a 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaPlotTool.cxx
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaPlotTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 // Plot Tool -- for all your plotting needs
@@ -193,7 +193,7 @@ StatusCode TrigEgammaPlotTool::book(std::map<std::string,TrigInfo> trigInfo){
 
     setBinning();
     bool badconfig=false;
-    for(const auto info:trigInfo){
+    for(const auto& info:trigInfo){
         // Check for existing trigger in list
         if(m_trigInfo.count(info.first) != 0) {
             ATH_MSG_ERROR("Trigger booked! Check list of triggers in tools");
@@ -209,7 +209,7 @@ StatusCode TrigEgammaPlotTool::book(std::map<std::string,TrigInfo> trigInfo){
             std::vector<std::string> dirnames;
             dirnames.push_back(basePath + "/Distributions/Offline");
             dirnames.push_back(basePath + "/Distributions/HLT");
-            for (const auto dir:dirnames){
+            for (const auto& dir:dirnames){
                 ATH_MSG_VERBOSE(dir);
                 addDirectory(dir);
                 bookDistributionHistos(dir);
@@ -236,7 +236,7 @@ void TrigEgammaPlotTool::bookShifterHistos(){
     std::vector<std::string>::iterator dirItr;
     std::map<std::string, TH1 *>::iterator histItr; 
     // Book histograms from existing expert plots
-    for(const auto info:m_trigInfo){
+    for(const auto& info:m_trigInfo){
         ATH_MSG_INFO(info.first << " ");
         if(getCategoryFromTrigger(info.first,category)){
             dirtrig=m_baseDir+"/Expert/"+info.first;
@@ -247,7 +247,7 @@ void TrigEgammaPlotTool::bookShifterHistos(){
                 addDirectory(dirmam);
                 //Add contents of the histograms
                 if(m_tp){
-                    for(const auto plot:m_distplots){
+                    for(const auto& plot:m_distplots){
                         fullPath = getPath(plot, dirtrig+"/Distributions/HLT");
                         histItr = m_hist1.find(fullPath);
                         if (histItr == m_hist1.end())
@@ -257,7 +257,7 @@ void TrigEgammaPlotTool::bookShifterHistos(){
                     }
                 }
                 else {
-                    for(const auto plot:m_effplots){
+                    for(const auto& plot:m_effplots){
                         fullPath = getPath(plot, dirtrig+"/Efficiency/HLT");
                         histItr = m_hist1.find(fullPath);
                         if (histItr == m_hist1.end())
@@ -265,7 +265,7 @@ void TrigEgammaPlotTool::bookShifterHistos(){
                         else
                         addHistogram((TH1*)hist1(plot,dirtrig+"/Efficiency/HLT")->Clone());
                     }
-                    for(const auto plot:m_distplots){
+                    for(const auto& plot:m_distplots){
                         fullPath = getPath(plot, dirtrig+"/Distributions/HLT");
                         histItr = m_hist1.find(fullPath);
                         if (histItr == m_hist1.end())
@@ -273,7 +273,7 @@ void TrigEgammaPlotTool::bookShifterHistos(){
                         else
                             addHistogram((TH1*)hist1(plot,dirtrig+"/Distributions/HLT")->Clone());
                     }
-                    for(const auto plot:m_resplots){
+                    for(const auto& plot:m_resplots){
                         fullPath = getPath(plot, dirtrig+"/Resolutions/HLT");
                         histItr = m_hist1.find(fullPath);
                         if (histItr == m_hist1.end())
@@ -292,7 +292,7 @@ StatusCode TrigEgammaPlotTool::execute(){
 }
 
 bool TrigEgammaPlotTool::getCategoryFromTrigger(const std::string trigger,std::string &category){
-    for(const auto mam:m_mam){
+    for(const auto& mam:m_mam){
         if(mam.second == trigger){
             category=mam.first;
             return true;
@@ -309,13 +309,13 @@ StatusCode TrigEgammaPlotTool::finalizeShifterHistos(std::map<std::string,TrigIn
     std::string category="";
     std::string fullPath;
     std::map<std::string, TH1 *>::iterator histItr; 
-    for(const auto info:trigInfo){
+    for(const auto& info:trigInfo){
         if(getCategoryFromTrigger(info.first,category)){
             dirtrig=m_baseDir+"/Expert/"+info.first;
             dirmam=m_baseDir+"/Shifter/"+category;
             if(m_tp){
                 ATH_MSG_INFO("Finalize " << name() << " " << info.first << " " << m_tp );
-                for(const auto plot:m_distplots){
+                for(const auto& plot:m_distplots){
                     fullPath = getPath(plot, dirtrig+"/Distributions/HLT");
                     histItr = m_hist1.find(fullPath);
                     if (histItr == m_hist1.end())
@@ -327,7 +327,7 @@ StatusCode TrigEgammaPlotTool::finalizeShifterHistos(std::map<std::string,TrigIn
             }
             else {
                 ATH_MSG_INFO("Finalize " << name() << " " << info.first << " " << m_tp );
-                for(const auto plot:m_effplots){
+                for(const auto& plot:m_effplots){
                     fullPath = getPath(plot, dirtrig+"/Efficiency/HLT");
                     histItr = m_hist1.find(fullPath);
                     if (histItr == m_hist1.end())
@@ -335,7 +335,7 @@ StatusCode TrigEgammaPlotTool::finalizeShifterHistos(std::map<std::string,TrigIn
                     else
                         hist1(plot,dirmam)->Add(hist1(plot,dirtrig+"/Efficiency/HLT"));
                 }
-                for(const auto plot:m_distplots){
+                for(const auto& plot:m_distplots){
                     fullPath = getPath(plot, dirtrig+"/Distributions/HLT");
                     histItr = m_hist1.find(fullPath);
                     if (histItr == m_hist1.end())
@@ -343,7 +343,7 @@ StatusCode TrigEgammaPlotTool::finalizeShifterHistos(std::map<std::string,TrigIn
                     else
                         hist1(plot,dirmam)->Add(hist1(plot,dirtrig+"/Distributions/HLT"));
                 }
-                for(const auto plot:m_resplots){
+                for(const auto& plot:m_resplots){
                     fullPath = getPath(plot, dirtrig+"/Resolutions/HLT");
                     histItr = m_hist1.find(fullPath);
                     if (histItr == m_hist1.end())
@@ -1192,7 +1192,7 @@ void TrigEgammaPlotTool::bookExpertHistos(TrigInfo trigInfo){
       dirnames.push_back(basePath + "/"+algname+"/L2");
       dirnames.push_back(basePath + "/"+algname+"/EFCalo");
 
-      for (const auto dir:dirnames) {
+      for (const auto& dir:dirnames) {
           addDirectory(dir);
           bookEfficiencyHistos(dir);
           if ( m_detailedHists ) 
@@ -1270,7 +1270,7 @@ void TrigEgammaPlotTool::bookExpertHistos(TrigInfo trigInfo){
           effdirs.push_back(basePath + "/"+algname+"/HLT/LHLooseIso");
           effdirs.push_back(basePath + "/"+algname+"/HLT/LHMediumIso");
           effdirs.push_back(basePath + "/"+algname+"/HLT/LHTightIso");
-          for (const auto effdir:effdirs) {
+          for (const auto& effdir:effdirs) {
               addDirectory(effdir);
               bookEfficiencyHistos(effdir);
               bookEfficiency2DHistos(effdir);
@@ -1283,7 +1283,7 @@ void TrigEgammaPlotTool::bookExpertHistos(TrigInfo trigInfo){
 
     dirnames.push_back(basePath + "/Distributions/Offline");
     dirnames.push_back(basePath + "/Distributions/HLT");
-    for (const auto dir:dirnames){
+    for (const auto& dir:dirnames){
         ATH_MSG_VERBOSE(dir);
         addDirectory(dir);
         bookEgammaDistributionHistos(dir);
@@ -1323,7 +1323,7 @@ void TrigEgammaPlotTool::bookExpertHistos(TrigInfo trigInfo){
     addDirectory(dirname);
 
     //Book the kinematic plots for each trigger level
-    for(const auto dir:dirnames) 
+    for(const auto& dir:dirnames) 
         bookDistributionHistos(dir);
 
     // Resolution
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaResolutionTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaResolutionTool.cxx
index 66e0a7441e5..878cdc37975 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaResolutionTool.cxx
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaResolutionTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /**********************************************************************
@@ -49,7 +49,7 @@ StatusCode TrigEgammaResolutionTool::toolExecute(const std::string basePath,Trig
     if(boost::contains(info.trigName,"iloose") || boost::contains(info.trigName,"ivarloose")) filliso=true;
     if(boost::contains(info.trigName,"icaloloose") || boost::contains(info.trigName,"icalovloose") || boost::contains(info.trigName,"icalotight")) filliso=true;
     ATH_MSG_DEBUG("Executing resolution for " << dir);
-    for(const auto pairObj : pairObjs){
+    for(const auto& pairObj : pairObjs){
         const xAOD::Egamma* eg =pairObj.first;
         const HLT::TriggerElement *feat = pairObj.second; 
 
diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/src/TrigEgammaMonTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/src/TrigEgammaMonTool.cxx
index 84c3551dfeb..983104b3d3c 100644
--- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/src/TrigEgammaMonTool.cxx
+++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/src/TrigEgammaMonTool.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
 */
 
 /**********************************************************************
@@ -37,7 +37,7 @@ StatusCode TrigEgammaMonTool::book(){
     ATH_MSG_INFO("Initializing " << name() << "...");
     ATH_MSG_INFO("Retrieving tools..." << m_asgToolNames.size());
 
-    for(const auto toolname : m_asgToolNames){
+    for(const auto& toolname : m_asgToolNames){
         ATH_MSG_INFO("Add "<<toolname<<"..." );
         m_asgtools.push_back(ToolHandle<ITrigEgammaAnalysisBaseTool>(toolname));
     }
-- 
GitLab