Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion DQMServices/Core/src/MonitorElement.cc
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,9 @@ namespace dqm::impl {
auto access = this->accessMut();
update();
if (getAxis(access, __PRETTY_FUNCTION__, axis)->GetNbins() >= bin) {
getAxis(access, __PRETTY_FUNCTION__, axis)->SetBinLabel(bin, label.c_str());
if (strcmp(label.c_str(), getAxis(access, __PRETTY_FUNCTION__, axis)->GetBinLabel(bin)) != 0) {
getAxis(access, __PRETTY_FUNCTION__, axis)->SetBinLabel(bin, label.c_str());
}
} else {
fail = true;
}
Expand Down
22 changes: 16 additions & 6 deletions HLTrigger/Timer/plugins/FastTimerServiceClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ struct MEPSet {
double xmax;
};

namespace {
void setBinLabel(TAxis* axis, int bin, const char* label) {
//TAxis::GetBinLabel currently doesnt have this check
//and changing a label is a slow operation
if (strcmp(axis->GetBinLabel(bin), label) != 0) {
axis->SetBinLabel(bin, label);
}
}

} // namespace

class FastTimerServiceClient : public DQMEDHarvester {
public:
explicit FastTimerServiceClient(edm::ParameterSet const&);
Expand Down Expand Up @@ -165,7 +176,6 @@ void FastTimerServiceClient::fillPathSummaryPlots(DQMStore::IBooker& booker,
double events,
std::string const& current_path) {
// note: the following checks need to be kept separate, as any of these histograms might be missing

booker.setCurrentFolder(current_path);
std::vector<std::string> subsubdirs = getter.getSubdirs();
size_t npaths = subsubdirs.size();
Expand Down Expand Up @@ -262,7 +272,7 @@ void FastTimerServiceClient::fillPathSummaryPlots(DQMStore::IBooker& booker,
real_average->SetYTitle("average processing (real) time [ms]");
for (uint32_t i = 1; i <= bins; ++i) {
const char* module = counter->GetXaxis()->GetBinLabel(i);
real_average->GetXaxis()->SetBinLabel(i, module);
setBinLabel(real_average->GetXaxis(), i, module);
}
}

Expand All @@ -278,7 +288,7 @@ void FastTimerServiceClient::fillPathSummaryPlots(DQMStore::IBooker& booker,
thread_average->SetYTitle("average processing (thread) time [ms]");
for (uint32_t i = 1; i <= bins; ++i) {
const char* module = counter->GetXaxis()->GetBinLabel(i);
thread_average->GetXaxis()->SetBinLabel(i, module);
setBinLabel(thread_average->GetXaxis(), i, module);
}
}

Expand All @@ -293,7 +303,7 @@ void FastTimerServiceClient::fillPathSummaryPlots(DQMStore::IBooker& booker,
real_running->SetYTitle("running processing (real) time [ms]");
for (uint32_t i = 1; i <= bins; ++i) {
const char* module = counter->GetXaxis()->GetBinLabel(i);
real_running->GetXaxis()->SetBinLabel(i, module);
setBinLabel(real_running->GetXaxis(), i, module);
}
}

Expand All @@ -309,7 +319,7 @@ void FastTimerServiceClient::fillPathSummaryPlots(DQMStore::IBooker& booker,
thread_running->SetYTitle("running processing (thread) time [ms]");
for (uint32_t i = 1; i <= bins; ++i) {
const char* module = counter->GetXaxis()->GetBinLabel(i);
thread_running->GetXaxis()->SetBinLabel(i, module);
setBinLabel(thread_running->GetXaxis(), i, module);
}
}

Expand All @@ -325,7 +335,7 @@ void FastTimerServiceClient::fillPathSummaryPlots(DQMStore::IBooker& booker,
efficiency->SetMaximum(1.05);
for (uint32_t i = 1; i <= bins; ++i) {
const char* module = counter->GetXaxis()->GetBinLabel(i);
efficiency->GetXaxis()->SetBinLabel(i, module);
setBinLabel(efficiency->GetXaxis(), i, module);
}
}

Expand Down