From 23623b7af9578ca702c2a6b27443964d9d80ec7b Mon Sep 17 00:00:00 2001 From: Javier Date: Fri, 14 Apr 2023 22:36:47 +0200 Subject: [PATCH 1/2] Suggestion by Matti Kortelainen --- DQMServices/Core/interface/DQMStore.h | 9 +++++---- DQMServices/Core/src/DQMStore.cc | 6 ++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/DQMServices/Core/interface/DQMStore.h b/DQMServices/Core/interface/DQMStore.h index d8affd039894d..3da978631dfe0 100644 --- a/DQMServices/Core/interface/DQMStore.h +++ b/DQMServices/Core/interface/DQMStore.h @@ -751,6 +751,8 @@ namespace dqm { void printTrace(std::string const& message); // print a log message if ME matches trackME_. void debugTrackME(const char* message, MonitorElement* me_local, MonitorElement* me_global) const; + // accesor to keep MEsToSave_ private + const auto& getMEsToSave() const { return MEsToSave_; } private: // MEComparison is a name-only comparison on MEs and Paths, allowing @@ -792,14 +794,13 @@ namespace dqm { // Book MEs by lumi by default whenever possible. bool doSaveByLumi_; - + // Book MEs by lumi from list in DQMServices/Core/python/DQMStore_cfi.py + std::vector MEsToSave_; //just if perLS is ON + // if non-empty, debugTrackME calls will log some information whenever a // ME path contains this string. std::string trackME_; - public: - // Book MEs by lumi from list in DQMServices/Core/python/DQMStore_cfi.py - std::vector MEsToSave_; //just if perLS is ON }; } // namespace implementation diff --git a/DQMServices/Core/src/DQMStore.cc b/DQMServices/Core/src/DQMStore.cc index e034b3e358761..d4c2c2738371c 100644 --- a/DQMServices/Core/src/DQMStore.cc +++ b/DQMServices/Core/src/DQMStore.cc @@ -100,9 +100,11 @@ namespace dqm::implementation { medata.key_.path_ = path; medata.key_.kind_ = kind; - if (not store_->MEsToSave_.empty()) { + const auto& MEs = store_->getMEsToSave(); + + if (not MEs.empty()) { bool pathInList = false; - for (auto& thepath : store_->MEsToSave_) { + for (const auto& thepath : MEs) { if (fullpath == thepath) { medata.key_.scope_ = MonitorElementData::Scope::LUMI; pathInList = true; From d1f49f590a5443052e64c67aaa82a93cf75f1bd1 Mon Sep 17 00:00:00 2001 From: Javier Date: Wed, 19 Apr 2023 16:59:03 +0200 Subject: [PATCH 2/2] Code format --- DQMServices/Core/interface/DQMStore.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DQMServices/Core/interface/DQMStore.h b/DQMServices/Core/interface/DQMStore.h index 3da978631dfe0..9add4570b2fd8 100644 --- a/DQMServices/Core/interface/DQMStore.h +++ b/DQMServices/Core/interface/DQMStore.h @@ -796,11 +796,10 @@ namespace dqm { bool doSaveByLumi_; // Book MEs by lumi from list in DQMServices/Core/python/DQMStore_cfi.py std::vector MEsToSave_; //just if perLS is ON - + // if non-empty, debugTrackME calls will log some information whenever a // ME path contains this string. std::string trackME_; - }; } // namespace implementation