diff --git a/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCDatabaseManager.h b/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCDatabaseManager.h index caaf9db446a949ff7727cf50d7136f8030a60e5e..b98575446bacf14191ba0d70b05cdd7611c6e4b2 100644 --- a/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCDatabaseManager.h +++ b/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCDatabaseManager.h @@ -51,7 +51,7 @@ class TGCDatabaseManager : public AthMessaging const TGCEIFICoincidenceMap* getEIFICoincidenceMap(int sideId) const; const TGCTileMuCoincidenceMap* getTileMuCoincidenceMap() const; std::shared_ptr<TGCNSWCoincidenceMap> getNSWCoincidenceMap(int sideId, int octantId, int moduleId) const; - TGCGoodMF* getGoodMFMap() const; + std::shared_ptr<TGCGoodMF> getGoodMFMap() const; TGCConnectionInPP* getConnectionInPP(TGCPatchPanel* patchPanel) const; void addConnectionInPP(const TGCPatchPanel* patchPanel, const TGCConnectionInPP* connectionInPP); @@ -73,7 +73,7 @@ class TGCDatabaseManager : public AthMessaging std::array<std::array<std::array<std::shared_ptr<TGCNSWCoincidenceMap>, NumberOfModuleInBW>, NumberOfOctant>, NumberOfSide> m_mapNSW; TGCConnectionPPToSL* m_PPToSL[NumberOfRegionType]; TGCConnectionASDToPP* m_ASDToPP[NumberOfRegionType][NumberOfPatchPanelType][TotalNumForwardBackwardType]; - TGCGoodMF* m_mapGoodMF; + std::shared_ptr<TGCGoodMF> m_mapGoodMF; std::map<PatchPanelIDs, std::pair<const TGCConnectionInPP, PatchPanelPointers> > m_patchPanelToConnectionInPP; @@ -105,7 +105,7 @@ std::shared_ptr<TGCNSWCoincidenceMap> TGCDatabaseManager::getNSWCoincidenceMap(i } inline -TGCGoodMF* TGCDatabaseManager::getGoodMFMap() const +std::shared_ptr<TGCGoodMF> TGCDatabaseManager::getGoodMFMap() const { return m_mapGoodMF; } diff --git a/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCGoodMF.h b/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCGoodMF.h index 22a89103a88e19a0fd5e978b611924d75a5f6290..51b5de3e592c0ceed1050d64d05549689cfbf287 100644 --- a/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCGoodMF.h +++ b/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCGoodMF.h @@ -31,7 +31,7 @@ class TGCArguments; class TGCGoodMF { public: TGCGoodMF(TGCArguments*); - ~TGCGoodMF(); + ~TGCGoodMF() = default; TGCGoodMF(const TGCGoodMF& right); const TGCGoodMF& operator=(const TGCGoodMF& right); diff --git a/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCSector.h b/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCSector.h index cf31717118ecf3da18abbf52f8edb0e44b0f1ca6..80b0a5d7b076935fd5b2fb1e7b78070c82486498 100644 --- a/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCSector.h +++ b/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCSector.h @@ -95,7 +95,7 @@ private: const TGCEIFICoincidenceMap* mapI=0); void setTileMuMap(const TGCTileMuCoincidenceMap* map); void setNSWMap(std::shared_ptr<const TGCNSWCoincidenceMap> mapNSW); - void setGoodMFMap(const TGCGoodMF* mapGoodMF); + void setGoodMFMap(std::shared_ptr<const TGCGoodMF> mapGoodMF); void connectPPToSB(const TGCConnectionPPToSB* connection); void connectSBToHPB(const TGCConnectionSBToHPB* connection); void connectHPBToSL(const TGCConnectionHPBToSL* connection); diff --git a/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCSectorLogic.h b/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCSectorLogic.h index 00fe7a4f02361a3cab530162579efd631e8ecdc9..47b9110ef11dc8f6dafe40e23b13795bf975a313 100644 --- a/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCSectorLogic.h +++ b/Trigger/TrigT1/TrigT1TGC/TrigT1TGC/TGCSectorLogic.h @@ -79,7 +79,7 @@ public: const TGCTileMuCoincidenceMap* mapTM); void setNSWMap(std::shared_ptr<const TGCNSW> nsw, std::shared_ptr<const TGCNSWCoincidenceMap> mapNSW); - void setGoodMFMap(const TGCGoodMF* mapGoodMF); + void setGoodMFMap(std::shared_ptr<const TGCGoodMF> mapGoodMF); void showResult(TGCSLSelectorOut* out); TGCSectorLogic(TGCArguments*, TGCRegionType regionIn, int id); @@ -129,7 +129,7 @@ private: const TGCTMDB* m_pTMDB; std::shared_ptr<const TGCNSW> m_nsw; std::shared_ptr<const TGCNSWCoincidenceMap> m_mapNSW; - const TGCGoodMF* m_mapGoodMF; + std::shared_ptr<const TGCGoodMF> m_mapGoodMF; // for Run2 TGCSLPreSelector m_preSelector; diff --git a/Trigger/TrigT1/TrigT1TGC/src/TGCDatabaseManager.cxx b/Trigger/TrigT1/TrigT1TGC/src/TGCDatabaseManager.cxx index 1f773af7e55703cd2e9552b2a3a8dda196dc2b3e..98d8e17dbb01d8d0e60c792043daeb74dbb55c31 100644 --- a/Trigger/TrigT1/TrigT1TGC/src/TGCDatabaseManager.cxx +++ b/Trigger/TrigT1/TrigT1TGC/src/TGCDatabaseManager.cxx @@ -170,7 +170,7 @@ TGCDatabaseManager::TGCDatabaseManager(TGCArguments* tgcargs, } if(tgcArgs()->useRun3Config()){ - m_mapGoodMF = new TGCGoodMF(tgcArgs()); + m_mapGoodMF.reset(new TGCGoodMF(tgcArgs())); } } diff --git a/Trigger/TrigT1/TrigT1TGC/src/TGCGoodMF.cxx b/Trigger/TrigT1/TrigT1TGC/src/TGCGoodMF.cxx index c620778d73c2ae0b960f72f1174d56da6149b9f7..d4f87fcec11699b5b0a753ac1d67b7fb8ad66bec 100644 --- a/Trigger/TrigT1/TrigT1TGC/src/TGCGoodMF.cxx +++ b/Trigger/TrigT1/TrigT1TGC/src/TGCGoodMF.cxx @@ -42,10 +42,6 @@ TGCGoodMF::TGCGoodMF(TGCArguments* tgcargs) } } -TGCGoodMF::~TGCGoodMF() -{ -} - TGCGoodMF::TGCGoodMF(const TGCGoodMF& right) { m_tgcArgs=right.m_tgcArgs; @@ -85,14 +81,13 @@ bool TGCGoodMF::readBadMFList() // get BadMF list getline(file,buf,delimiter); std::istringstream cont(buf); - std::map<int,int> mapssc; // <SSCId,badMFId> + std::map<int,int> mapssc = m_mapisgoodMF[mod]; // mapssc = <SSCId,badMFId>, m_mapisgoodMF = <ModuleId,<~>> int badMFId; for(int i=0; i<=maxssc; i++) { cont>>badMFId; if(badMFId < 0) continue; mapssc[i] = badMFId; } - m_mapisgoodMF[mod] = mapssc; // <ModuleId,<~>> } } return true; @@ -103,7 +98,7 @@ bool TGCGoodMF::test_GoodMF(int moduleId,int sscId,int RoI) const std::map<int, std::map<int, int> >::const_iterator itModule=m_mapisgoodMF.find(moduleId); if (itModule==m_mapisgoodMF.end()) return true; - std::map<int, int> mapssc = itModule->second; + const std::map<int, int> &mapssc = itModule->second; std::map<int, int>::const_iterator itSSC=mapssc.find(sscId); if (itSSC==mapssc.end()) return true; @@ -117,8 +112,7 @@ bool TGCGoodMF::test_GoodMF(int moduleId,int sscId,int RoI) const if(RoI%N_RoIofSSC >= 4){ RoIId = RoI%N_RoIofSSC-4; } else{ RoIId = RoI%N_RoIofSSC+4; } - if(bs[RoIId]){return false;} - else return true; + return !bs[RoIId]; } diff --git a/Trigger/TrigT1/TrigT1TGC/src/TGCSector.cxx b/Trigger/TrigT1/TrigT1TGC/src/TGCSector.cxx index 0cdeb71c77ba3da16c26d9f4cb84e1ba92c37e5d..25d5317b0088b1e21afcaa4c301d80eb1020e775 100644 --- a/Trigger/TrigT1/TrigT1TGC/src/TGCSector.cxx +++ b/Trigger/TrigT1/TrigT1TGC/src/TGCSector.cxx @@ -147,7 +147,7 @@ TGCSector::TGCSector(TGCArguments* tgcargs) std::shared_ptr<const TGCNSWCoincidenceMap> mapNSW = db->getNSWCoincidenceMap(m_sideId, m_octantId,m_moduleId); setNSWMap(mapNSW); - const TGCGoodMF* mapGoodMF = db->getGoodMFMap(); + std::shared_ptr<const TGCGoodMF> mapGoodMF = db->getGoodMFMap(); setGoodMFMap(mapGoodMF); } @@ -309,7 +309,7 @@ void TGCSector::setNSWMap(std::shared_ptr<const TGCNSWCoincidenceMap> mapNSW) if (m_SL) m_SL->setNSWMap(m_NSW, mapNSW); } -void TGCSector::setGoodMFMap(const TGCGoodMF* mapGoodMF) +void TGCSector::setGoodMFMap(std::shared_ptr<const TGCGoodMF> mapGoodMF) { if (m_SL) m_SL->setGoodMFMap(mapGoodMF); } diff --git a/Trigger/TrigT1/TrigT1TGC/src/TGCSectorLogic.cxx b/Trigger/TrigT1/TrigT1TGC/src/TGCSectorLogic.cxx index 35efb8d71b41cbfc8b636c36d38559d93a713e26..f0d9bcaeeb20b004a3027116df1ddb1e46f8baef 100644 --- a/Trigger/TrigT1/TrigT1TGC/src/TGCSectorLogic.cxx +++ b/Trigger/TrigT1/TrigT1TGC/src/TGCSectorLogic.cxx @@ -111,11 +111,10 @@ void TGCSectorLogic::setTileMuMap(const TGCTMDB* tmdb, if( m_nsw == 0 || m_mapNSW == 0){tgcArgs()->set_USE_NSW(false);} } -void TGCSectorLogic::setGoodMFMap(const TGCGoodMF* mapGoodMF) +void TGCSectorLogic::setGoodMFMap(std::shared_ptr<const TGCGoodMF> mapGoodMF) { m_mapGoodMF = mapGoodMF; - if (m_mapGoodMF !=0){m_useGoodMF = true;} - else{m_useGoodMF = false;} + m_useGoodMF = m_mapGoodMF != nullptr; } void TGCSectorLogic::setWireHighPtBoard(int port, TGCHighPtBoard* highPtBoard)