diff --git a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/CscIdHelper.h b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/CscIdHelper.h index 879785104d6b200da8985b13dd50123f91c7a051..904c884a909db1a404925c498897a23e3785050f 100644 --- a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/CscIdHelper.h +++ b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/CscIdHelper.h @@ -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 */ // ****************************************************************************** @@ -86,13 +86,13 @@ class CscIdHelper : public MuonIdHelper // Identifier builders Identifier elementID(int stationName, int stationEta, int stationPhi, bool check=false, bool* isValid=0) const; - Identifier elementID(std::string stationNameStr, int stationEta, + Identifier elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool check=false, bool* isValid=0) const; Identifier elementID(const Identifier& channelID) const; Identifier channelID(int stationName, int stationEta, int stationPhi, int chamberLayer, int wireLayer, int measuresPhi, int strip, bool check=false, bool* isValid=0) const; - Identifier channelID(std::string stationNameStr, int stationEta, + Identifier channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int chamberLayer, int wireLayer, int measuresPhi, int strip, bool check=false, bool* isValid=0) const; Identifier channelID(const Identifier& id, int chamberLayer, int wireLayer, @@ -245,7 +245,7 @@ CLASS_DEF(CscIdHelper, 4171, 1) return result; } -inline Identifier CscIdHelper::elementID(std::string stationNameStr, +inline Identifier CscIdHelper::elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool check, bool* isValid) const { Identifier id; @@ -283,7 +283,7 @@ inline Identifier CscIdHelper::channelID(int stationName, int stationEta, int st return result; } -inline Identifier CscIdHelper::channelID(std::string stationNameStr, int stationEta, +inline Identifier CscIdHelper::channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int chamberLayer, int wireLayer, int measuresPhi, int strip, bool check, bool* isValid) const { diff --git a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MdtIdHelper.h b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MdtIdHelper.h index 109ceed683f6594c2c770e1f69ede5440cafb960..ec318ddf578ed6515b25f5bf5456347d6a029028 100644 --- a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MdtIdHelper.h +++ b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MdtIdHelper.h @@ -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 */ // ****************************************************************************** @@ -84,10 +84,10 @@ class MdtIdHelper : public MuonIdHelper // Atlas Identifier builders Identifier elementID(int stationName, int stationEta, int stationPhi, bool check=false, bool* isValid=0) const; - Identifier elementID(std::string stationNameStr, int stationEta, int stationPhi, bool check=false, bool* isValid=0) const; + Identifier elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool check=false, bool* isValid=0) const; Identifier elementID(const Identifier& channelID) const; Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube, bool check=false, bool* isValid=0) const; - Identifier channelID(std::string stationNameStr, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube, bool check=false, bool* isValid=0) const; + Identifier channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube, bool check=false, bool* isValid=0) const; Identifier channelID(const Identifier& id, int multilayer, int tubeLayer, int tube, bool check=false, bool* isValid=0) const; Identifier parentID (const Identifier& id) const; @@ -230,7 +230,7 @@ inline Identifier MdtIdHelper::elementID(int stationName, return result; } -inline Identifier MdtIdHelper::elementID(std::string stationNameStr, +inline Identifier MdtIdHelper::elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool check, bool* isValid) const { Identifier id; @@ -269,7 +269,7 @@ inline Identifier MdtIdHelper::channelID(int stationName, return result; } -inline Identifier MdtIdHelper::channelID(std::string stationNameStr, +inline Identifier MdtIdHelper::channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube, bool check, bool* isValid) const diff --git a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MmIdHelper.h b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MmIdHelper.h index eefe12e029c6793b7f75185201da4b12be41cfb3..e632c75de1afcf706af8221aa4c80a514820a6f5 100644 --- a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MmIdHelper.h +++ b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MmIdHelper.h @@ -73,11 +73,11 @@ class MmIdHelper : public MuonIdHelper { // Identifier builders Identifier elementID(int stationName, int stationEta, int stationPhi, bool check=false, bool* isValid=0) const; - Identifier elementID(std::string stationNameStr, int stationEta, int stationPhi, bool check=false, bool* isValid=0) const ; + Identifier elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool check=false, bool* isValid=0) const ; Identifier elementID(const Identifier& channelID) const ; Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel, bool check=false, bool* isValid=0) const ; - Identifier channelID(std::string stationNameStr, int stationEta, int stationPhi, int multilayer, int gasGap, int channel, bool check=false, bool* isValid=0) const ; + Identifier channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int multilayer, int gasGap, int channel, bool check=false, bool* isValid=0) const ; Identifier channelID(const Identifier& id, int multilayer, int gasGap, int channel, bool check=false, bool* isValid=0) const ; Identifier parentID (const Identifier& id) const; @@ -197,7 +197,7 @@ CLASS_DEF(MmIdHelper, 4175, 1) return result; } /*******************************************************************************/ -inline Identifier MmIdHelper::elementID(std::string stationNameStr, int stationEta, int stationPhi, bool check, bool* isValid) const { +inline Identifier MmIdHelper::elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool check, bool* isValid) const { Identifier id; int stationName = stationNameIndex(stationNameStr); id = elementID(stationName, stationEta, stationPhi, check, isValid); @@ -227,7 +227,7 @@ inline Identifier MmIdHelper::channelID(int stationName, int stationEta, int sta return result; } /*******************************************************************************/ -inline Identifier MmIdHelper::channelID(std::string stationNameStr, int stationEta, int stationPhi, int multilayer, int gasGap, int channel, bool check, bool * isValid) const { +inline Identifier MmIdHelper::channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int multilayer, int gasGap, int channel, bool check, bool * isValid) const { Identifier id; int stationName = stationNameIndex(stationNameStr); id = channelID(stationName, stationEta, stationPhi, multilayer, gasGap, channel, check, isValid); diff --git a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MuonIdHelper.h b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MuonIdHelper.h index 3fbc7ad9473b31ae37d5f4c48e5560040f5e4c3e..de81c50f2de418230c095c05f61b55a1248da8b4 100644 --- a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MuonIdHelper.h +++ b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/MuonIdHelper.h @@ -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 */ // ****************************************************************************** @@ -305,9 +305,6 @@ class MuonIdHelper : public AtlasDetectorID protected: - // Gaudi message service - IMessageSvc* m_msgSvc; - // Check values down to station level bool validStation(int stationName, int technology) const; @@ -320,8 +317,8 @@ class MuonIdHelper : public AtlasDetectorID private: - //Copy construcor - do not use! - inline MuonIdHelper(const MuonIdHelper & other) : AtlasDetectorID(other) {} + //Copy constructor - do not use! + inline MuonIdHelper(const MuonIdHelper & other) = delete; inline MuonIdHelper & operator=(const MuonIdHelper &right); // vectors for stationNames and technologies diff --git a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/RpcIdHelper.h b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/RpcIdHelper.h index 7ea8edb3b70f03066b618cc35e79f3b9e83403f3..44fef94ff208017d36152f67dbef673223381a47 100644 --- a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/RpcIdHelper.h +++ b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/RpcIdHelper.h @@ -70,14 +70,14 @@ class RpcIdHelper : public MuonIdHelper Identifier elementID(int stationName, int stationEta, int stationPhi, int doubletR, bool check=false, bool* isValid=0, bool noPrint=false) const; - Identifier elementID(std::string stationNameStr, int stationEta, + Identifier elementID(const std::string& stationNameStr, int stationEta, int stationPhi, int doubletR, bool check=false, bool* isValid=0) const; Identifier elementID(const Identifier& elementID, int doubletR, bool check=false, bool* isValid=0) const; Identifier elementID(const Identifier& channelID) const; Identifier channelID(int stationName, int stationEta, int stationPhi, int doubletR, int doubletZ, int doubletPhi, int gasGap, int measuresPhi, int strip, bool check=false, bool* isValid=0, bool noPrint=false) const; - Identifier channelID(std::string stationNameStr, int stationEta, + Identifier channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int doubletR, int doubletZ, int doubletPhi, int gasGap, int measuresPhi, int strip, bool check=false, bool* isValid=0) const; Identifier channelID(const Identifier& id, int doubletZ, int doubletPhi, @@ -165,7 +165,7 @@ class RpcIdHelper : public MuonIdHelper virtual int init_detectorElement_hashes(void); int init_id_to_hashes(); int zIndex(const Identifier& id) const; - int zIndex(std::string name, int eta, int dR, int dZ, int dP) const; + int zIndex(const std::string& name, int eta, int dR, int dZ, int dP) const; unsigned int m_module_hashes[60][20][8][2]; unsigned int m_detectorElement_hashes[60][20][8][2][4]; @@ -266,7 +266,7 @@ CLASS_DEF(RpcIdHelper, 4172, 1) } -inline Identifier RpcIdHelper::elementID(std::string stationNameStr, int stationEta, +inline Identifier RpcIdHelper::elementID(const std::string& stationNameStr, int stationEta, int stationPhi, int doubletR, bool check, bool* isValid) const { Identifier id; @@ -441,7 +441,7 @@ inline Identifier RpcIdHelper::channelID(int stationName, int stationEta, int st } -inline Identifier RpcIdHelper::channelID(std::string stationNameStr, int stationEta, +inline Identifier RpcIdHelper::channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int doubletR, int doubletZ, int doubletPhi, int gasGap, int measuresPhi, int strip, bool check, bool* isValid) const { @@ -682,7 +682,7 @@ inline int RpcIdHelper::zIndex(const Identifier& id) const { return zIndex(name, eta, dR, dZ, dP); } -inline int RpcIdHelper::zIndex(std::string name, int eta, int dR, int dZ, int dP) const { +inline int RpcIdHelper::zIndex(const std::string& name, int eta, int dR, int dZ, int dP) const { /** - from Stefania BMS5 which has the following structure: diff --git a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/TgcIdHelper.h b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/TgcIdHelper.h index 3ce8ac1e9278c999605a05ce36b52aab1fa9f258..d01841da25f326360e9b3dc2f0ad18371e2097b1 100644 --- a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/TgcIdHelper.h +++ b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/TgcIdHelper.h @@ -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 */ // ****************************************************************************** @@ -83,12 +83,12 @@ class TgcIdHelper : public MuonIdHelper // Identifier builders Identifier elementID(int stationName, int stationEta, int stationPhi, bool check=false, bool* isValid=0) const; - Identifier elementID(std::string stationNameStr, int stationEta, + Identifier elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool check=false, bool* isValid=0) const ; Identifier elementID(const Identifier& channelID) const ; Identifier channelID(int stationName, int stationEta, int stationPhi, int gasGap, int isStrip, int channel, bool check=false, bool* isValid=0) const ; - Identifier channelID(std::string stationNameStr, int stationEta, + Identifier channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int gasGap, int isStrip, int channel, bool check=false, bool* isValid=0) const ; Identifier channelID(const Identifier& id, int gasGap, int isStrip, int channel, bool check=false, bool* isValid=0) const ; @@ -227,7 +227,7 @@ CLASS_DEF(TgcIdHelper, 4173, 1) return result; } -inline Identifier TgcIdHelper::elementID(std::string stationNameStr, int stationEta, +inline Identifier TgcIdHelper::elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool check, bool* isValid) const { Identifier id; @@ -262,7 +262,7 @@ inline Identifier TgcIdHelper::channelID(int stationName, int stationEta, int st return result; } -inline Identifier TgcIdHelper::channelID(std::string stationNameStr, int stationEta, +inline Identifier TgcIdHelper::channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int gasGap, int isStrip, int channel, bool check, bool * isValid) const { Identifier id; diff --git a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/sTgcIdHelper.h b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/sTgcIdHelper.h index c4ee0937ce708810589d9d6914378da4c5f9a8ef..74e71901a7c11407f2ff88d54e3fbad4ff1e5658 100644 --- a/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/sTgcIdHelper.h +++ b/MuonSpectrometer/MuonIdHelpers/MuonIdHelpers/sTgcIdHelper.h @@ -74,15 +74,15 @@ class sTgcIdHelper : public MuonIdHelper { // Identifier builders Identifier elementID(int stationName, int stationEta, int stationPhi, bool check=false, bool* isValid=0) const; - Identifier elementID(std::string stationNameStr, int stationEta,int stationPhi, bool check=false, bool* isValid=0) const ; + Identifier elementID(const std::string& stationNameStr, int stationEta,int stationPhi, bool check=false, bool* isValid=0) const ; Identifier elementID(const Identifier& channelID) const ; Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel, bool check=false, bool* isValid=0) const ; - Identifier channelID(std::string stationNameStr, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel, bool check=false, bool* isValid=0) const ; + Identifier channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel, bool check=false, bool* isValid=0) const ; Identifier channelID(const Identifier& id, int multilayer, int gasGap, int channelType, int channel, bool check=false, bool* isValid=0) const ; Identifier padID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int padEta, int padPhi, bool check=false, bool* isValid=0) const ; - Identifier padID(std::string stationNameStr, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int padEta, int padPhi, bool check=false, bool* isValid=0) const ; + Identifier padID(const std::string& stationNameStr, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int padEta, int padPhi, bool check=false, bool* isValid=0) const ; Identifier padID(const Identifier& id, int multilayer, int gasGap, int channelType, int padEta, int padPhi, bool check=false, bool* isValid=0) const ; Identifier parentID (const Identifier& id) const; @@ -224,7 +224,7 @@ CLASS_DEF(sTgcIdHelper, 4174, 1) return result; } /*******************************************************************************/ -inline Identifier sTgcIdHelper::elementID(std::string stationNameStr, int stationEta, int stationPhi, bool check, bool* isValid) const { +inline Identifier sTgcIdHelper::elementID(const std::string& stationNameStr, int stationEta, int stationPhi, bool check, bool* isValid) const { Identifier id; int stationName = stationNameIndex(stationNameStr); id = elementID(stationName, stationEta, stationPhi, check, isValid); @@ -255,7 +255,7 @@ inline Identifier sTgcIdHelper::channelID(int stationName, int stationEta, int s return result; } /*******************************************************************************/ -inline Identifier sTgcIdHelper::channelID(std::string stationNameStr, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel, bool check, bool * isValid) const { +inline Identifier sTgcIdHelper::channelID(const std::string& stationNameStr, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel, bool check, bool * isValid) const { Identifier id; int stationName = stationNameIndex(stationNameStr); id = channelID(stationName, stationEta, stationPhi, multilayer, gasGap, channelType, channel, check, isValid); @@ -302,7 +302,7 @@ inline Identifier sTgcIdHelper::padID(int stationName, int stationEta, int stati return result; } /*******************************************************************************/ -inline Identifier sTgcIdHelper::padID(std::string stationNameStr, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int padEta, int padPhi, bool check, bool * isValid) const { +inline Identifier sTgcIdHelper::padID(const std::string& stationNameStr, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int padEta, int padPhi, bool check, bool * isValid) const { Identifier id; int stationName = stationNameIndex(stationNameStr); id = padID(stationName, stationEta, stationPhi, multilayer, gasGap, channelType, padEta, padPhi, check, isValid); diff --git a/MuonSpectrometer/MuonIdHelpers/src/MmIdHelper.cxx b/MuonSpectrometer/MuonIdHelpers/src/MmIdHelper.cxx index 7dc505a6a8e0390e7a444928fae4d24318c6caec..fc754d33835e0f220b6f9d5c50de9e1e55540f82 100644 --- a/MuonSpectrometer/MuonIdHelpers/src/MmIdHelper.cxx +++ b/MuonSpectrometer/MuonIdHelpers/src/MmIdHelper.cxx @@ -18,8 +18,9 @@ /*******************************************************************************/ // Constructor/Destructor -MmIdHelper::MmIdHelper() : MuonIdHelper("MmIdHelper") { - m_GASGAP_INDEX = 6; +MmIdHelper::MmIdHelper() : MuonIdHelper("MmIdHelper"), + m_GASGAP_INDEX (6) +{ } /*******************************************************************************/ // Initialize dictionary diff --git a/MuonSpectrometer/MuonIdHelpers/src/MuonIdHelper.cxx b/MuonSpectrometer/MuonIdHelpers/src/MuonIdHelper.cxx index 16f391e168dbd09cf5a004c71137f48a112083bd..92a53fc19d2c66d051b10444e1d51c4407e7cc10 100644 --- a/MuonSpectrometer/MuonIdHelpers/src/MuonIdHelper.cxx +++ b/MuonSpectrometer/MuonIdHelpers/src/MuonIdHelper.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 */ // ****************************************************************************** @@ -39,9 +39,10 @@ MuonIdHelper::MuonIdHelper(std::string logName): m_station_region_index(0), m_mo m_dict = 0; m_msgSvc = 0; ISvcLocator* svcLocator = Gaudi::svcLocator(); - StatusCode sc = svcLocator->service("MessageSvc", m_msgSvc); + IMessageSvc* msgSvc = nullptr; + StatusCode sc = svcLocator->service("MessageSvc", msgSvc); if (sc.isFailure()) std::cout << "Fail to locate Message Service" << std::endl; - m_Log = std::make_unique<MsgStream>(m_msgSvc, logName.empty() ? "MuonIdHelper" : logName); + m_Log = std::make_unique<MsgStream>(msgSvc, logName.empty() ? "MuonIdHelper" : logName); } // Destructor diff --git a/MuonSpectrometer/MuonIdHelpers/src/sTgcIdHelper.cxx b/MuonSpectrometer/MuonIdHelpers/src/sTgcIdHelper.cxx index e4e08b5ec53391625bb8a12caaad6e38e617df5d..294533ef5cd5914aa3343bbc4ff0d5ecb77cec64 100644 --- a/MuonSpectrometer/MuonIdHelpers/src/sTgcIdHelper.cxx +++ b/MuonSpectrometer/MuonIdHelpers/src/sTgcIdHelper.cxx @@ -19,9 +19,10 @@ /*******************************************************************************/ // Constructor/Destructor -sTgcIdHelper::sTgcIdHelper() : MuonIdHelper("sTgcIdHelper") { - m_GASGAP_INDEX = 6; - m_CHANNELTYPE_INDEX = 7; +sTgcIdHelper::sTgcIdHelper() : MuonIdHelper("sTgcIdHelper"), + m_GASGAP_INDEX (6), + m_CHANNELTYPE_INDEX (7) +{ } /*******************************************************************************/ // Initialize dictionary