From 47933c35ecf3ea0352023e7928c02441dfdce6b1 Mon Sep 17 00:00:00 2001
From: ckato <ckato@cern.ch>
Date: Sat, 17 Nov 2018 21:31:15 +0100
Subject: [PATCH] updating getOnlineId in MuonMDT_CablingMap as const function

---
 .../MuonCablingData/MuonCablingData/MuonMDT_CablingMap.h  | 8 ++++----
 .../MuonCablingData/src/MuonMDT_CablingMap.cxx            | 8 ++++----
 .../MuonCablings/MuonMDT_Cabling/src/MdtTestCabling.cxx   | 4 ++++
 3 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/MuonSpectrometer/MuonCablings/MuonCablingData/MuonCablingData/MuonMDT_CablingMap.h b/MuonSpectrometer/MuonCablings/MuonCablingData/MuonCablingData/MuonMDT_CablingMap.h
index 1c8e34e58bf..c2ee5f755af 100644
--- a/MuonSpectrometer/MuonCablings/MuonCablingData/MuonCablingData/MuonMDT_CablingMap.h
+++ b/MuonSpectrometer/MuonCablings/MuonCablingData/MuonCablingData/MuonMDT_CablingMap.h
@@ -66,10 +66,10 @@ class MuonMDT_CablingMap : public MdtMapBase<MdtSubdetectorMap> {
   MdtSubdetectorMap* getSubdetectorMap(uint8_t subdetectorId) const;
 
   /** return the ROD id of a given chamber, given station, eta, phi */
-  uint32_t getROBId(int station, int eta, int phi);
+  uint32_t getROBId(int station, int eta, int phi) const;
 
   /** return the ROD id of a given chamber, given the hash id */
-  uint32_t getROBId(const IdentifierHash stationCode);
+  uint32_t getROBId(const IdentifierHash stationCode) const;
 
  /** return a vector of HashId lists for a  given list of ROD's */
   const std::vector<IdentifierHash> getChamberHashVec(const std::vector< uint32_t> &ROBId_list) const;
@@ -90,7 +90,7 @@ class MuonMDT_CablingMap : public MdtMapBase<MdtSubdetectorMap> {
   bool getOnlineId(int stationName, int stationEta, int stationPhi,
 		   int multiLayer, int layer, int tube,
 		   uint8_t& subdetectorId, uint8_t& rodId, uint8_t& csmId,
-		   uint8_t& tdcId, uint8_t& channelId);
+		   uint8_t& tdcId, uint8_t& channelId) const;
 
  private:
 
@@ -113,7 +113,7 @@ class MuonMDT_CablingMap : public MdtMapBase<MdtSubdetectorMap> {
   ListOfROD* m_listOfROD;
 
   /** private function to compute a station code for the chamber to ROD map */
-  bool getStationCode(int station, int eta, int phi, IdentifierHash& mdtIdHash);
+  bool getStationCode(int station, int eta, int phi, IdentifierHash& mdtIdHash) const;
 
   /** Pointer to the MdtIdHelper */
   const MdtIdHelper* m_mdtIdHelper;
diff --git a/MuonSpectrometer/MuonCablings/MuonCablingData/src/MuonMDT_CablingMap.cxx b/MuonSpectrometer/MuonCablings/MuonCablingData/src/MuonMDT_CablingMap.cxx
index 7765b16154f..9e598e05fea 100644
--- a/MuonSpectrometer/MuonCablings/MuonCablingData/src/MuonMDT_CablingMap.cxx
+++ b/MuonSpectrometer/MuonCablings/MuonCablingData/src/MuonMDT_CablingMap.cxx
@@ -367,7 +367,7 @@ bool MuonMDT_CablingMap::addChamberToRODMap(int station, int eta, int phi,
  *
  */
 bool MuonMDT_CablingMap::getStationCode(int station, int eta, int phi, 
-					IdentifierHash& mdtHashId)
+					IdentifierHash& mdtHashId) const
 {
   // create the station identifier
   Identifier elementId = m_mdtIdHelper->elementID(station,eta,phi);
@@ -387,7 +387,7 @@ bool MuonMDT_CablingMap::getStationCode(int station, int eta, int phi,
  * return the ROBid of a given station, identified through station, eta, phi
  *
  */
-uint32_t MuonMDT_CablingMap::getROBId(int station, int eta, int phi)
+uint32_t MuonMDT_CablingMap::getROBId(int station, int eta, int phi) const
 {
 
   int rodId = 0;
@@ -407,7 +407,7 @@ uint32_t MuonMDT_CablingMap::getROBId(int station, int eta, int phi)
 }
 
 // get the ROBid given the identifier hash
-uint32_t MuonMDT_CablingMap::getROBId(const IdentifierHash stationCode)
+uint32_t MuonMDT_CablingMap::getROBId(const IdentifierHash stationCode) const
 {
   int rodId = 0;
 
@@ -587,7 +587,7 @@ bool MuonMDT_CablingMap::getOnlineId(int stationName, int stationEta, int statio
 				     int multiLayer, int layer, int tube,
 				     uint8_t& subdetectorId, uint8_t& rodId, 
 				     uint8_t& csmId, uint8_t& tdcId, 
-				     uint8_t& channelId)
+				     uint8_t& channelId) const
 {
 
   
diff --git a/MuonSpectrometer/MuonCablings/MuonMDT_Cabling/src/MdtTestCabling.cxx b/MuonSpectrometer/MuonCablings/MuonMDT_Cabling/src/MdtTestCabling.cxx
index f2f37b26e61..6d032dfc921 100644
--- a/MuonSpectrometer/MuonCablings/MuonMDT_Cabling/src/MdtTestCabling.cxx
+++ b/MuonSpectrometer/MuonCablings/MuonMDT_Cabling/src/MdtTestCabling.cxx
@@ -183,8 +183,12 @@ bool MdtTestCabling::testMap()
 
 	      // test the back-conversion to online indeces
 	      m_chronoSvc->chronoStart(m_chrono3);
+	      /*
 	      cabling =  m_cablingSvc->getOnlineId(station,eta,phi,multi,layer,tube,
 						   newSubdet,newRod,newCsm,newAmt,newChan);
+	      */
+	      cabling = readCdo->getOnlineId(station,eta,phi,multi,layer,tube,newSubdet,newRod,newCsm,newAmt,newChan);
+
 	      m_chronoSvc->chronoStop(m_chrono3);
 
 	      if (!cabling) {
-- 
GitLab