From 0422800e34d5a1b84f339d22512d4d408f7ec6cd Mon Sep 17 00:00:00 2001
From: christos <christos@cern.ch>
Date: Fri, 13 May 2022 19:58:14 +0200
Subject: [PATCH] HIEventUtils, TrigAnalysisExamples, TrigRoiConversion,
 TrigEgammaMonitoring pass by const ref

---
 .../HIEventUtils/HIEventUtils/HIEventShapeMap.h  |  8 ++++----
 .../HIEventUtils/HIEventShapeSummaryUtils.h      | 14 +++++++-------
 .../HIEventUtils/HIEventUtils/HIPileupTool.h     | 16 ++++++++--------
 .../HIEventUtils/HIEventUtils/ZdcRecTool.h       | 10 +++++-----
 .../HIEventUtils/Root/HIEventShapeIndex.cxx      |  6 +++---
 .../HIEventUtils/Root/HIEventShapeMap.cxx        |  8 ++++----
 .../Root/HIEventShapeSummaryUtils.cxx            | 14 +++++++-------
 .../HeavyIonPhys/HIEventUtils/Root/ZdcUtils.cxx  |  8 ++++----
 .../src/TagAndProbeExAlg.cxx                     |  8 ++++----
 .../TrigAnalysisExamples/src/TagAndProbeExAlg.h  |  8 ++++----
 .../TrigRoiConversion/Root/RoiReader.cxx         |  4 ++--
 .../TrigEvent/TrigRoiConversion/Root/RoiReader.h |  4 ++--
 .../src/TrigEgammaMonitorTopoAlgorithm.cxx       | 10 ++++++----
 .../src/TrigEgammaMonitorTopoAlgorithm.h         |  4 ++--
 14 files changed, 62 insertions(+), 60 deletions(-)

diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeMap.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeMap.h
index 955d6bca71c2..d62802864e09 100644
--- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeMap.h
+++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeMap.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef HIEVENTUTILS_HIEVENTSHAPEMAP_H
@@ -15,9 +15,9 @@ class HIEventShapeMap
 {
   public:
 
-    static const HIEventShapeIndex* insert(std::string key, const HIEventShapeIndex& index, bool clobber=false);
-    static const HIEventShapeIndex* getIndex(std::string key);
-    static bool hasKey(std::string key);
+    static const HIEventShapeIndex* insert(const std::string& key, const HIEventShapeIndex& index, bool clobber=false);
+    static const HIEventShapeIndex* getIndex(const std::string& key);
+    static bool hasKey(const std::string& key);
     static HIEventShapeMap* getMap();
 
   private:
diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeSummaryUtils.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeSummaryUtils.h
index 24389e6ed1a2..0d15889ec243 100644
--- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeSummaryUtils.h
+++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIEventShapeSummaryUtils.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef HIEVENTUTILS_HIEVENTSHAPESUMMARYUTILS_H
@@ -15,16 +15,16 @@ namespace HI
 {
 
   void fillSummary(const xAOD::HIEventShapeContainer* in, xAOD::HIEventShape* out,
-		   std::function<bool (const xAOD::HIEventShape*)> incFunction,
-		   std::function<void (xAOD::HIEventShape*,const xAOD::HIEventShape*)> addFunction);
+		   const std::function<bool (const xAOD::HIEventShape*)>& incFunction,
+		   const std::function<void (xAOD::HIEventShape*,const xAOD::HIEventShape*)>& addFunction);
 
   void fillSummary(const xAOD::HIEventShapeContainer* in, xAOD::HIEventShape* out,
-		   std::function<bool (const xAOD::HIEventShape*)> incFunction);
+		   const std::function<bool (const xAOD::HIEventShape*)>& incFunction);
 
 
   void fillSummary(const xAOD::HIEventShapeContainer* in, xAOD::HIEventShape* out,
-		   const std::set<unsigned int> indices,
-		   std::function<void (xAOD::HIEventShape*,const xAOD::HIEventShape*)> addFunction);
+		   const std::set<unsigned int>& indices,
+		   const std::function<void (xAOD::HIEventShape*,const xAOD::HIEventShape*)>& addFunction);
 
   struct AddEventShape
   {
@@ -98,7 +98,7 @@ namespace HI
     bool operator()(const xAOD::HIEventShape* in_slice) {return (layers_sel(in_slice) && range_sel(in_slice));};
   };
 
-  float getModulation(const xAOD::HIEventShape* es, const std::vector<unsigned int> harmonics, float phi);
+  float getModulation(const xAOD::HIEventShape* es, const std::vector<unsigned int>& harmonics, float phi);
   int setHarmonics(std::vector<unsigned int>& in);
 }
 
diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIPileupTool.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIPileupTool.h
index 3dd56584eaec..d2ede7691460 100644
--- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIPileupTool.h
+++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/HIPileupTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef HIEVENTUTILS_HIPILEUPTOOL_H
@@ -54,17 +54,17 @@ namespace HI
     std::vector<double> m_etCutAndPurity;
     std::string m_fname;
 
-    double m_etThreshold;
-    double m_purityCut;
+    double m_etThreshold = 0.0;
+    double m_purityCut = 0.0;
     bool m_setup;
     //Average energy deposited in the ZDC by neutrons
     const double m_npeak = 2510.;
 
-    TH2D* m_hEvents;
-    TH2D* m_hPileUp;
-    TH1D* m_hCut;
-    TH1D* m_hEff;
-    TH1D* m_hPurity;
+    TH2D* m_hEvents = nullptr;
+    TH2D* m_hPileUp = nullptr;
+    TH1D* m_hCut = nullptr;
+    TH1D* m_hEff = nullptr;
+    TH1D* m_hPurity = nullptr;
   };
 }
 #endif
diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/ZdcRecTool.h b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/ZdcRecTool.h
index fe06e51de0a8..02f9d2736b4e 100644
--- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/ZdcRecTool.h
+++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/HIEventUtils/ZdcRecTool.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef HIEVENTUTILS_ZDCRECTOOL_H
@@ -44,8 +44,8 @@ namespace ZDC
   private:
 
     // internal functions - moved to private accoding to T.Bold request while merging into master
-    TF1* m_tf1SincInterp;
-    TF1* m_tf1FermiExpFit;
+    TF1* m_tf1SincInterp = nullptr;
+    TF1* m_tf1FermiExpFit = nullptr;
 
     // Name of the ZDC rec tool
     std::string m_name;
@@ -54,9 +54,9 @@ namespace ZDC
     // Path to the configuring file
     std::string m_zdcRecConfigPath;
 
-    mutable bool m_eventReady;
+    mutable bool m_eventReady = false;
     std::string m_zdcModuleContainerName;
-    const xAOD::ZdcModuleContainer* m_zdcModules;
+    const xAOD::ZdcModuleContainer* m_zdcModules = nullptr;
 
   };
 
diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeIndex.cxx b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeIndex.cxx
index 77e3d879d8c0..c71797be60ca 100644
--- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeIndex.cxx
+++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeIndex.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "HIEventUtils/HIEventShapeIndex.h"
@@ -252,7 +252,7 @@ void HIEventShapeIndex::initializeEventShapeContainer(xAOD::HIEventShapeContaine
 
 	}
 
-	for(auto pp : m_edges)
+	for(const auto& pp : m_edges)
 	{
 		for(auto ri : pp.second)
 		{
@@ -286,7 +286,7 @@ std::string HIEventShapeIndex::print() const
 {
 	std::stringstream ss;
 	ss.precision(3);
-	for(auto pp : m_edges)
+	for(const auto& pp : m_edges)
 	{
 		for(auto ri : pp.second)
 		{
diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeMap.cxx b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeMap.cxx
index 3ac5b1f230b0..09acc6bc2e27 100644
--- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeMap.cxx
+++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeMap.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "HIEventUtils/HIEventShapeMap.h"
@@ -12,7 +12,7 @@ HIEventShapeMap* HIEventShapeMap::getMap()
   return &s_obj;
 }
 
-const HIEventShapeIndex* HIEventShapeMap::insert(std::string key, const HIEventShapeIndex& index, bool clobber)
+const HIEventShapeIndex* HIEventShapeMap::insert(const std::string& key, const HIEventShapeIndex& index, bool clobber)
 {
   std::map<std::string,HIEventShapeIndex>::iterator mItr=s_obj.m_map.find(key);
   if(mItr!=s_obj.m_map.end())
@@ -22,14 +22,14 @@ const HIEventShapeIndex* HIEventShapeMap::insert(std::string key, const HIEventS
   else mItr=s_obj.m_map.insert(std::pair<std::string,HIEventShapeIndex>(key,index)).first;
   return &(mItr->second);
 }
-const HIEventShapeIndex* HIEventShapeMap::getIndex(std::string key)
+const HIEventShapeIndex* HIEventShapeMap::getIndex(const std::string& key)
 {
   auto itr=s_obj.m_map.find(key);
   if(itr==s_obj.m_map.end()) return nullptr;
   return &(itr->second);
 }
 
-bool HIEventShapeMap::hasKey(std::string key)
+bool HIEventShapeMap::hasKey(const std::string& key)
 {
   return (s_obj.m_map.find(key)!=s_obj.m_map.end());
 }
diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeSummaryUtils.cxx b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeSummaryUtils.cxx
index 7a15a4da2dc8..0dafd14433be 100644
--- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeSummaryUtils.cxx
+++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/HIEventShapeSummaryUtils.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "HIEventUtils/HIEventShapeSummaryUtils.h"
@@ -51,8 +51,8 @@ namespace HI
 
 
   void fillSummary(const xAOD::HIEventShapeContainer* in, xAOD::HIEventShape* out,
-		   std::function<bool (const xAOD::HIEventShape*)> incFunction,
-		   std::function<void (xAOD::HIEventShape*,const xAOD::HIEventShape*)> addFunction)
+		   const std::function<bool (const xAOD::HIEventShape*)>& incFunction,
+		   const std::function<void (xAOD::HIEventShape*,const xAOD::HIEventShape*)>& addFunction)
   {
     for(const auto sItr : *in )
     {
@@ -61,15 +61,15 @@ namespace HI
   }
 
   void fillSummary(const xAOD::HIEventShapeContainer* in, xAOD::HIEventShape* out,
-		   const std::set<unsigned int> indices,
-		   std::function<void (xAOD::HIEventShape*,const xAOD::HIEventShape*)> addFunction)
+		   const std::set<unsigned int>& indices,
+		   const std::function<void (xAOD::HIEventShape*,const xAOD::HIEventShape*)>& addFunction)
   {
     for(const auto i : indices ) addFunction(out,in->at(i));
   } 
 
 
   void fillSummary(const xAOD::HIEventShapeContainer* in, xAOD::HIEventShape* out,
-		   std::function<bool (const xAOD::HIEventShape*)> incFunction)
+		   const std::function<bool (const xAOD::HIEventShape*)>& incFunction)
   {
     for(const auto sItr : *in )
     {
@@ -77,7 +77,7 @@ namespace HI
     }
   }
 
-  float getModulation(const xAOD::HIEventShape* es, const std::vector<unsigned int> harmonics, float phi)
+  float getModulation(const xAOD::HIEventShape* es, const std::vector<unsigned int>& harmonics, float phi)
   {
     float mod=1;
     for(const auto itr : harmonics)
diff --git a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/ZdcUtils.cxx b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/ZdcUtils.cxx
index 08c2dc82f585..d7b045cb0c04 100644
--- a/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/ZdcUtils.cxx
+++ b/PhysicsAnalysis/HeavyIonPhys/HIEventUtils/Root/ZdcUtils.cxx
@@ -1,12 +1,12 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #include "HIEventUtils/ZdcUtils.h"
 
 namespace ZDC
 {
-  float getAmplitudeSumG0(const xAOD::ZdcModuleContainer* in, std::function<bool (const xAOD::ZdcModule*)> incFunction, std::string& suffix)
+  float getAmplitudeSumG0(const xAOD::ZdcModuleContainer* in, const std::function<bool (const xAOD::ZdcModule*)>& incFunction, std::string& suffix)
   {
     float amplitude = 0;
     float mod_amp;
@@ -24,7 +24,7 @@ namespace ZDC
     return amplitude;
   }
 
-  float getAmplitudeSumG1(const xAOD::ZdcModuleContainer* in, std::function<bool (const xAOD::ZdcModule*)> incFunction, std::string/* suffix*/)
+  float getAmplitudeSumG1(const xAOD::ZdcModuleContainer* in, const std::function<bool (const xAOD::ZdcModule*)>& incFunction, const std::string&/* suffix*/)
   {
     float amplitude = 0;
     for (const auto zm : *in)
@@ -34,7 +34,7 @@ namespace ZDC
     return amplitude;
   }
 
-  float getAmplitudeSum(const xAOD::ZdcModuleContainer* in, std::function<bool (const xAOD::ZdcModule*)> incFunction)
+  float getAmplitudeSum(const xAOD::ZdcModuleContainer* in, const std::function<bool (const xAOD::ZdcModule*)>& incFunction)
   {
     float amplitude = 0;
     for (const auto zm : *in)
diff --git a/Trigger/TrigAnalysis/TrigAnalysisExamples/src/TagAndProbeExAlg.cxx b/Trigger/TrigAnalysis/TrigAnalysisExamples/src/TagAndProbeExAlg.cxx
index 9f1f65b61413..6da99e4bd9c9 100644
--- a/Trigger/TrigAnalysis/TrigAnalysisExamples/src/TagAndProbeExAlg.cxx
+++ b/Trigger/TrigAnalysis/TrigAnalysisExamples/src/TagAndProbeExAlg.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 // Updated to xAOD for Trigger Tutorial
@@ -340,7 +340,7 @@ StatusCode TagAndProbeExAlg::EmulationAnalysis(){
 //     TrigObjectMatching package
 
 // Does the reco'd muon pass L1 of the chain we're interested in?
-bool TagAndProbeExAlg::passL1( const xAOD::IParticle &recoObj, const std::string chain ) {
+bool TagAndProbeExAlg::passL1( const xAOD::IParticle &recoObj, const std::string& chain ) {
     ATH_MSG_INFO("L1Matching: Type " << recoObj.type() << " Chain " << chain);
     //L1 matching, requires custom matching
     double deltaR=999.;
@@ -410,12 +410,12 @@ bool TagAndProbeExAlg::passL1( const xAOD::IParticle &recoObj, const std::string
 
 // Does the reco'd object pass HLT of the chain we're interested in?
 // And the reco'd object is matched to a triggered object
-bool TagAndProbeExAlg::passHLT( const xAOD::IParticle &recoObj, const std::string chain) {
+bool TagAndProbeExAlg::passHLT( const xAOD::IParticle &recoObj, const std::string& chain) {
     return m_matchTool->match(recoObj,chain,m_dRMax);
 }
 
 //Just find a match to any trigger in a list or group
-bool TagAndProbeExAlg::passHLT( const xAOD::IParticle &recoObj, std::vector<std::string> chainList) {
+bool TagAndProbeExAlg::passHLT( const xAOD::IParticle &recoObj, const std::vector<std::string>& chainList) {
     bool match=false;
     for(const std::string& chain:chainList){
         if(m_matchTool->match(recoObj,chain,m_dRMax))
diff --git a/Trigger/TrigAnalysis/TrigAnalysisExamples/src/TagAndProbeExAlg.h b/Trigger/TrigAnalysis/TrigAnalysisExamples/src/TagAndProbeExAlg.h
index ee1674e4923e..6619e188cde0 100644
--- a/Trigger/TrigAnalysis/TrigAnalysisExamples/src/TagAndProbeExAlg.h
+++ b/Trigger/TrigAnalysis/TrigAnalysisExamples/src/TagAndProbeExAlg.h
@@ -1,7 +1,7 @@
 // Dear emacs, this is -*- c++ -*-
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 // $Id: TagAndProbeExAlg.h 778537 2016-10-14 15:34:31Z ssnyder $
@@ -105,9 +105,9 @@ private:
    std::map<std::string,TProfile*> m_h_eff_eta;
    
    // private functions
-   bool passL1(const xAOD::IParticle &recoObj, const std::string chain); // did the object match L1
-   bool passHLT(const xAOD::IParticle &recoObj, const std::string chain); // did the object match HLT
-   bool passHLT(const xAOD::IParticle &recoObj, std::vector<std::string> chainList); // did the object match HLT
+   bool passL1(const xAOD::IParticle &recoObj, const std::string& chain); // did the object match L1
+   bool passHLT(const xAOD::IParticle &recoObj, const std::string& chain); // did the object match HLT
+   bool passHLT(const xAOD::IParticle &recoObj, const std::vector<std::string>& chainList); // did the object match HLT
    bool passObjectSelection(const xAOD::IParticle &trigObj);
    bool passMuon(const xAOD::Muon &muon); // does the muon pass selection
    bool passElectron( const xAOD::Electron &electron); // tag electron selection
diff --git a/Trigger/TrigEvent/TrigRoiConversion/Root/RoiReader.cxx b/Trigger/TrigEvent/TrigRoiConversion/Root/RoiReader.cxx
index 94cee52b7391..38755fa55b40 100644
--- a/Trigger/TrigEvent/TrigRoiConversion/Root/RoiReader.cxx
+++ b/Trigger/TrigEvent/TrigRoiConversion/Root/RoiReader.cxx
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 //
 //   @file    RoiReader.cxx         
@@ -65,7 +65,7 @@ void RoiReader::execute( std::vector<std::string>& keys ) {
 
 
 
-void RoiReader::deserialiser( TrigRoiDescriptorCollection& collection, const std::string key ) const {
+void RoiReader::deserialiser( TrigRoiDescriptorCollection& collection, const std::string& key ) const {
   xAOD::RoiDescriptorStore* fetchedstore = 0;
   if ( evtStore()->retrieve( fetchedstore, key ).isSuccess() && fetchedstore!=0 ) { 
     RoiUtil::deserialise( fetchedstore->serialised(), collection );
diff --git a/Trigger/TrigEvent/TrigRoiConversion/Root/RoiReader.h b/Trigger/TrigEvent/TrigRoiConversion/Root/RoiReader.h
index d1180c2ff983..40cb4ca3495f 100644
--- a/Trigger/TrigEvent/TrigRoiConversion/Root/RoiReader.h
+++ b/Trigger/TrigEvent/TrigRoiConversion/Root/RoiReader.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TRIGROICONVERSION_ROIREADER_H
@@ -29,7 +29,7 @@ public:
   virtual void execute( std::vector<std::string>& keys ) override;
 
   void deserialiser( TrigRoiDescriptorCollection& collection,
-                     const std::string key ) const;
+                     const std::string& key ) const;
 
 };
 
diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTopoAlgorithm.cxx b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTopoAlgorithm.cxx
index 9eb954ac7eca..b0a31e8f210e 100644
--- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTopoAlgorithm.cxx
+++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTopoAlgorithm.cxx
@@ -1,7 +1,9 @@
 /*
-  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
+#include <utility>
+
 #include "TrigEgammaMonitorTopoAlgorithm.h"
 #include "TrigDecisionTool/FeatureRequestDescriptor.h"
 #include "xAODBase/IParticleContainer.h"
@@ -157,7 +159,7 @@ bool TrigEgammaMonitorTopoAlgorithm::match( const xAOD::IParticleContainer &cont
 
 //!=========================================================================
 
-void TrigEgammaMonitorTopoAlgorithm::make_legs( std::string trigger, 
+void TrigEgammaMonitorTopoAlgorithm::make_legs( const std::string& trigger, 
                                                  std::string key_leg0,
                                                  std::string key_leg1,
                                                  std::vector<Legs> &legs_vec ) const
@@ -168,14 +170,14 @@ void TrigEgammaMonitorTopoAlgorithm::make_legs( std::string trigger,
   frd_leg0.reset();
   frd_leg0.setChainGroup(trigger);
   frd_leg0.setCondition(TrigDefs::Physics); // Only fired trigger
-  frd_leg0.setRequireSGKey( TrigEgammaMonitorBaseAlgorithm::match()->key(key_leg0));
+  frd_leg0.setRequireSGKey( TrigEgammaMonitorBaseAlgorithm::match()->key(std::move(key_leg0)));
   frd_leg0.setRestrictRequestToLeg(0);
   
   Trig::FeatureRequestDescriptor frd_leg1;
   frd_leg1.reset();
   frd_leg1.setChainGroup(trigger);
   frd_leg1.setCondition(TrigDefs::Physics); // Only fired trigger
-  frd_leg1.setRequireSGKey( TrigEgammaMonitorBaseAlgorithm::match()->key(key_leg1));
+  frd_leg1.setRequireSGKey( TrigEgammaMonitorBaseAlgorithm::match()->key(std::move(key_leg1)));
   frd_leg1.setRestrictRequestToLeg(1);
 
   // Get all combinations given by the L1
diff --git a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTopoAlgorithm.h b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTopoAlgorithm.h
index 1819ec7e8c36..877d9c0b955f 100644
--- a/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTopoAlgorithm.h
+++ b/Trigger/TrigMonitoring/TrigEgammaMonitoring/src/TrigEgammaMonitorTopoAlgorithm.h
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef TrigEgammaMonitorTopoAlgorithm_H
@@ -47,7 +47,7 @@ class TrigEgammaMonitorTopoAlgorithm: public TrigEgammaMonitorBaseAlgorithm
     SG::ReadHandleKey<xAOD::PhotonContainer> m_offPhotonKey{ this, "PhotonKey", "Photons", ""};
 
     /*! Get all combinations */
-    void make_legs( std::string trigger, std::string key_leg0, std::string key_leg1, std::vector<Legs> &) const;
+    void make_legs( const std::string& trigger, std::string key_leg0, std::string key_leg1, std::vector<Legs> &) const;
     bool match( const xAOD::IParticleContainer &container,const xAOD::IParticle *part_on , const xAOD::IParticle *&part_off) const;
 
 };
-- 
GitLab