From 27815f8e47fd6b9c4a195de643a10fa72c28c1e6 Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Tue, 15 Nov 2022 18:54:49 +0100 Subject: [PATCH] Clean characters that are deemed unsafe for DQM --- HLTrigger/Timer/plugins/ThroughputService.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/HLTrigger/Timer/plugins/ThroughputService.cc b/HLTrigger/Timer/plugins/ThroughputService.cc index cab20d107f100..9126ce4a32837 100644 --- a/HLTrigger/Timer/plugins/ThroughputService.cc +++ b/HLTrigger/Timer/plugins/ThroughputService.cc @@ -13,6 +13,8 @@ #include "HLTrigger/Timer/interface/processor_model.h" #include "ThroughputService.h" +using namespace std::literals; + // describe the module's configuration void ThroughputService::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; @@ -74,6 +76,13 @@ void ThroughputService::preGlobalBeginRun(edm::GlobalContext const& gc) { unsigned int bins = std::round(m_time_range / m_time_resolution); double range = bins * m_time_resolution; + // clean characters that are deemed unsafe for DQM + // see the definition of `s_safe` in DQMServices/Core/src/DQMStore.cc + auto safe_for_dqm = "/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+=_()# "s; + for (auto& c : m_dqm_path) + if (safe_for_dqm.find(c) == std::string::npos) + c = '_'; + // define a callback that can book the histograms auto bookTransactionCallback = [&, this](DQMStore::IBooker& booker, DQMStore::IGetter&) { booker.setCurrentFolder(m_dqm_path);