Skip to content

Commit

Permalink
Clean characters that are deemed unsafe for DQM
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard committed Nov 15, 2022
1 parent c31ecff commit 27815f8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions HLTrigger/Timer/plugins/ThroughputService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 27815f8

Please sign in to comment.