From 48bb03f215aa2c4616c3d457e114e6b8c7393a70 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20K=C3=B6hler?= <nicolas.koehler@cern.ch>
Date: Sun, 18 Apr 2021 19:25:00 +0200
Subject: [PATCH 1/2] remove unused instances of RpcCablingSvc

---
 .../MuonJiveXML/TrigRpcDataRetriever.h        | 28 ++++++++-----------
 .../MuonJiveXML/src/TrigRpcDataRetriever.cxx  | 25 +++++------------
 .../RpcLv1RawDataValAlg.h                     |  3 +-
 .../RpcRawDataMonitoring/RpcRawDataValAlg.h   |  7 +----
 .../src/RpcRawDataValAlg.cxx                  | 13 ++-------
 5 files changed, 22 insertions(+), 54 deletions(-)

diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/TrigRpcDataRetriever.h b/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/TrigRpcDataRetriever.h
index f7e27ea36478..c61c11433cbd 100644
--- a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/TrigRpcDataRetriever.h
+++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/TrigRpcDataRetriever.h
@@ -1,24 +1,26 @@
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
 */
 
 #ifndef JIVEXML_TRIGRPCDATARETRIEVER_H
 #define JIVEXML_TRIGRPCDATARETRIEVER_H
 
-#include <string>
 
-#include "JiveXML/IDataRetriever.h"
 #include "AthenaBaseComps/AthAlgTool.h"
+#include "JiveXML/IDataRetriever.h"
+#include "GaudiKernel/ServiceHandle.h"
+#include "GaudiKernel/ToolHandle.h"
+
 #include "MuonReadoutGeometry/MuonDetectorManager.h"
 #include "MuonReadoutGeometry/RpcReadoutElement.h"
 #include "MuonRPC_CnvTools/IRPC_RDO_Decoder.h"
-#include "GaudiKernel/ServiceHandle.h"
-#include "GaudiKernel/ToolHandle.h"
+#include "RPC_CondCabling/RpcCablingCondData.h"
+
 #include "MuonIdHelpers/IMuonIdHelperSvc.h"
 #include "RPC_CondCabling/RpcCablingCondData.h"
 #include "StoreGate/ReadCondHandleKey.h"
 
-class IRPCcablingSvc;
+#include <string>
 
 namespace JiveXML {
 
@@ -43,22 +45,14 @@ namespace JiveXML {
    ///The data type that is generated by this retriever
     const std::string m_typeName;
 
-    ///The storegate key for the CSC collection
-    std::string m_sgKey;
+    Gaudi::Property<std::string> m_sgKey{this,"StoreGateKey","RPCPAD","StoreGate key for the RPC RDO container"};
 
     ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
 
-    const IRPCcablingSvc *m_rpcCabling;
-
-    SG::ReadCondHandleKey<RpcCablingCondData> m_readKey{this, "ReadKey", "RpcCablingCondData", "Key of RpcCablingCondData"};
-
-    /// RPC decoder
     ToolHandle<Muon::IRPC_RDO_Decoder> m_rpcDecoder{this,"RpcRDO_Decoder","Muon::RpcRDO_Decoder"}; 
     
-    ///Geo Model
-    SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_DetectorManagerKey {this, "DetectorManagerKey", 
-	"MuonDetectorManager", 
-	"Key of input MuonDetectorManager condition data"};    
+    SG::ReadCondHandleKey<RpcCablingCondData> m_rpcCab{this, "ReadKey", "RpcCablingCondData", "Key of RpcCablingCondData"};
+    SG::ReadCondHandleKey<MuonGM::MuonDetectorManager> m_DetectorManagerKey {this, "DetectorManagerKey", "MuonDetectorManager", "Key of input MuonDetectorManager condition data"};
   };
   
 }
diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TrigRpcDataRetriever.cxx b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TrigRpcDataRetriever.cxx
index a9b100492751..8035246ae2f5 100644
--- a/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TrigRpcDataRetriever.cxx
+++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/src/TrigRpcDataRetriever.cxx
@@ -1,21 +1,16 @@
 /*
-  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 "MuonJiveXML/TrigRpcDataRetriever.h"
 
-#include <vector>
-#include <list>
-
 #include "MuonJiveXML/MuonFullIDHelper.h"
-
 #include "MuonReadoutGeometry/RpcReadoutElement.h"
 #include "MuonPrepRawData/MuonPrepDataContainer.h"
-
 #include "MuonRDO/RpcPadContainer.h"
-#include "MuonRPC_CnvTools/IRPC_RDO_Decoder.h"
 
-#include "RPCcablingInterface/IRPCcablingServerSvc.h"
+#include <vector>
+#include <list>
 
 namespace JiveXML {
 
@@ -26,19 +21,13 @@ namespace JiveXML {
     m_typeName("RPC") // same datatype name as RPC ! Must not be run together
   {
     declareInterface<IDataRetriever>(this);
-    declareProperty("StoreGateKey",   m_sgKey = "RPCPAD", "StoreGate key for the RPC RDO container" );
   }
 
   //--------------------------------------------------------------------------
 
   StatusCode TrigRpcDataRetriever::initialize(){
-
-    const IRPCcablingServerSvc* RpcCabGet;
-    ATH_CHECK(service("RPCcablingServerSvc", RpcCabGet));
-    ATH_CHECK(RpcCabGet->giveCabling(m_rpcCabling));
-
     ATH_CHECK(m_idHelperSvc.retrieve());
-    ATH_CHECK(m_readKey.initialize());
+    ATH_CHECK(m_rpcCab.initialize());
     ATH_CHECK(m_rpcDecoder.retrieve());
     ATH_CHECK(m_DetectorManagerKey.initialize());
     return StatusCode::SUCCESS;
@@ -103,7 +92,7 @@ namespace JiveXML {
 
  
     //loop on pad
-    SG::ReadCondHandle<RpcCablingCondData> readHandle{m_readKey, Gaudi::Hive::currentContext()};
+    SG::ReadCondHandle<RpcCablingCondData> readHandle{m_rpcCab, Gaudi::Hive::currentContext()};
     const RpcCablingCondData* rpcCabling{*readHandle};
 
     const DataHandle<RpcPad> itColl(firstRdoColl);
@@ -159,7 +148,7 @@ namespace JiveXML {
                   // transform the pad sectorId according to the cabling convention
                   uint16_t side                   = (sectorId<32) ? 0 : 1;
                   uint16_t sl                     = sectorId-side*32     ;
-                  std::list<Identifier> stripList = m_rpcCabling->give_strip_id(side,sl,padId,cmaId,rpcChan->ijk(),rpcChan->channel());
+                  std::list<Identifier> stripList = rpcCabling->give_strip_id(side,sl,padId,cmaId,rpcChan->ijk(),rpcChan->channel(),&m_idHelperSvc->rpcIdHelper());
                   std::list<Identifier>::const_iterator it_list;
                   for (it_list=stripList.begin() ; it_list != stripList.end() ; ++it_list) {
                     Identifier stripOfflineId = *it_list;
@@ -206,7 +195,7 @@ namespace JiveXML {
                  // transform the pad sectorId according to the cabling convention
                 uint16_t side                   = (sectorId<32) ? 0 : 1;
                 uint16_t sl                     = sectorId-side*32     ;
-                std::list<Identifier> stripList1 = m_rpcCabling->give_strip_id(side,sl,padId,cmaId,rpcChan1->ijk(),rpcChan1->channel());
+                std::list<Identifier> stripList1 = rpcCabling->give_strip_id(side,sl,padId,cmaId,rpcChan1->ijk(),rpcChan1->channel(),&m_idHelperSvc->rpcIdHelper());
                 std::list<Identifier>::const_iterator it_list1;
                 for (it_list1=stripList1.begin() ; it_list1 != stripList1.end() ; ++it_list1) {
                   Identifier stripOfflineId1 = *it_list1;
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcLv1RawDataValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcLv1RawDataValAlg.h
index 51e881c2f526..ac9cb7ff51b8 100755
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcLv1RawDataValAlg.h
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcLv1RawDataValAlg.h
@@ -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
 */
 //////////////////////////////////////////////////////////////////////////////////////////////
 // Package : RpcRawDataMonitoring
@@ -24,7 +24,6 @@
 
 #include "xAODEventInfo/EventInfo.h"
 
-#include "RPCcablingInterface/IRPCcablingServerSvc.h"
 #include "GaudiKernel/ServiceHandle.h"
 #include "MuonIdHelpers/IMuonIdHelperSvc.h"
 #include "RPC_CondCabling/RpcCablingCondData.h"
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataValAlg.h b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataValAlg.h
index 6cd3cb8a1385..428ad6ce4d95 100755
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataValAlg.h
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataMonitoring/RpcRawDataValAlg.h
@@ -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
 */
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -32,8 +32,6 @@
 #include <TH2I.h>
 #include <TH1I.h>
 #include <inttypes.h>
-
-class IRPCcablingSvc;
  
 template <class ConcreteAlgorithm> class AlgFactory;
 
@@ -106,9 +104,6 @@ class RpcRawDataValAlg: public ManagedMonitorToolBase {
       "Key of input MuonDetectorManager condition data"};    
 
   ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
-  
-  const IRPCcablingSvc* m_cabling;
-   
 
   //Declare Properties  
   std::string m_chamberName		;
diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcRawDataValAlg.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcRawDataValAlg.cxx
index ad40448e05ba..5d40750fdf92 100755
--- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcRawDataValAlg.cxx
+++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonRawDataMonitoring/RpcRawDataMonitoring/src/RpcRawDataValAlg.cxx
@@ -22,7 +22,6 @@
 #include "MuonReadoutGeometry/RpcReadoutSet.h"
 #include "MuonReadoutGeometry/MuonReadoutElement.h"  
 #include "MuonReadoutGeometry/RpcReadoutElement.h"
-#include "RPCcablingInterface/IRPCcablingServerSvc.h"
 
 #include "MuonRDO/RpcFiredChannel.h"
 #include "MuonRDO/RpcCoinMatrix.h"
@@ -54,10 +53,8 @@ static const   int timeNbin	      =	  128;
 
 /////////////////////////////////////////////////////////////////////////////
 
-RpcRawDataValAlg::RpcRawDataValAlg( const std::string & type, const std::string & name, const IInterface* parent )
-  :ManagedMonitorToolBase( type, name, parent )
-  //,m_pSummarySvc("RPCCondSummarySvc", name)
-{
+RpcRawDataValAlg::RpcRawDataValAlg( const std::string & type, const std::string & name, const IInterface* parent ) :
+    ManagedMonitorToolBase( type, name, parent ) {
   // Declare the properties 
   declareProperty("DoRpcEsd",            m_doRpcESD		= false	); 
   declareProperty("CheckCabling",        m_checkCabling		= false	);
@@ -116,12 +113,6 @@ StatusCode RpcRawDataValAlg::initialize(){
   // MuonDetectorManager from the conditions store
   ATH_CHECK(m_DetectorManagerKey.initialize());
   ATH_CHECK(m_idHelperSvc.retrieve());
-
-  // get RPC cablingSvc
-  const IRPCcablingServerSvc* RpcCabGet = nullptr;
-  ATH_CHECK(service("RPCcablingServerSvc", RpcCabGet));
-  ATH_CHECK(RpcCabGet->giveCabling(m_cabling));
-  ATH_MSG_DEBUG(" Found the RPCcablingSvc. ");
   
   m_rpc_eventstotal=0;  
   
-- 
GitLab


From e7a31122c0cdeb44462bf07cf894b51d3c62b1d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20K=C3=B6hler?= <nicolas.koehler@cern.ch>
Date: Sun, 18 Apr 2021 19:28:27 +0200
Subject: [PATCH 2/2] remove double include

---
 .../MuonCnv/MuonJiveXML/MuonJiveXML/TrigRpcDataRetriever.h   | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/TrigRpcDataRetriever.h b/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/TrigRpcDataRetriever.h
index c61c11433cbd..84c08779ea5d 100644
--- a/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/TrigRpcDataRetriever.h
+++ b/MuonSpectrometer/MuonCnv/MuonJiveXML/MuonJiveXML/TrigRpcDataRetriever.h
@@ -10,15 +10,12 @@
 #include "JiveXML/IDataRetriever.h"
 #include "GaudiKernel/ServiceHandle.h"
 #include "GaudiKernel/ToolHandle.h"
+#include "StoreGate/ReadCondHandleKey.h"
 
 #include "MuonReadoutGeometry/MuonDetectorManager.h"
-#include "MuonReadoutGeometry/RpcReadoutElement.h"
 #include "MuonRPC_CnvTools/IRPC_RDO_Decoder.h"
 #include "RPC_CondCabling/RpcCablingCondData.h"
-
 #include "MuonIdHelpers/IMuonIdHelperSvc.h"
-#include "RPC_CondCabling/RpcCablingCondData.h"
-#include "StoreGate/ReadCondHandleKey.h"
 
 #include <string>
 
-- 
GitLab