Skip to content

Commit

Permalink
Merge pull request #39853 from Dr15Jones/duplicateBinNamesFix
Browse files Browse the repository at this point in the history
Fix use of duplicate bin names in DQM/L1TMonitor
  • Loading branch information
cmsbuild committed Oct 26, 2022
2 parents 4a0b3a9 + 1003743 commit e58106d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions DQM/L1TMonitor/src/L1GtHwValidation.cc
Expand Up @@ -644,8 +644,8 @@ void L1GtHwValidation::bookHistograms(DQMStore::IBooker& ibooker,
m_gtErrorFlag = ibooker.book1D("GTErrorFlag", "L1 GT error flag for data versus emulator comparison", 5, 0., 5);

m_gtErrorFlag->setBinLabel(1, "Agree", 1);
m_gtErrorFlag->setBinLabel(2, "", 1);
m_gtErrorFlag->setBinLabel(3, "", 1);
m_gtErrorFlag->setBinLabel(2, "2", 1);
m_gtErrorFlag->setBinLabel(3, "3", 1);
m_gtErrorFlag->setBinLabel(4, "Data only", 1);
m_gtErrorFlag->setBinLabel(5, "Emul only", 1);

Expand Down
10 changes: 9 additions & 1 deletion DQM/L1TMonitor/src/L1TdeRCT.cc
Expand Up @@ -1966,9 +1966,17 @@ void L1TdeRCT::bookHistograms(DQMStore::IBooker& ibooker, const edm::Run& run, c
if (!perLSsaving_)
fedVectorMonitorLS_ = ibooker.book2D("rctFedVectorMonitorLS", "FED Vector Monitor Per LS", 108, 0, 108, 2, 0, 2);

std::map<unsigned int, unsigned int> repeats;
for (unsigned int i = 0; i < 108; ++i) {
repeats[crateFED[i]] = 0;
}
for (unsigned int i = 0; i < 108; ++i) {
char fed[10];
sprintf(fed, "%d", crateFED[i]);
if (0 == repeats[crateFED[i]]++) {
sprintf(fed, "%d", crateFED[i]);
} else {
sprintf(fed, "%d_%d", crateFED[i], repeats[crateFED[i]]);
}
fedVectorMonitorRUN_->setBinLabel(i + 1, fed);
if (!perLSsaving_)
fedVectorMonitorLS_->setBinLabel(i + 1, fed);
Expand Down

0 comments on commit e58106d

Please sign in to comment.