Skip to content

Commit

Permalink
Merge pull request #44800 from jfernan2/fixSeveralDTDQMbugs
Browse files Browse the repository at this point in the history
[DT DQM] Fix some minor style bugs
  • Loading branch information
cmsbuild authored May 2, 2024
2 parents d603ec8 + 0c0b41d commit c2ea811
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
3 changes: 2 additions & 1 deletion DQM/DTMonitorClient/src/DTBlockedROChannelsTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ void DTBlockedROChannelsTest::dqmEndLuminosityBlock(DQMStore::IBooker& ibooker,
}

if (!offlineMode) {
hSystFractionVsLS = new DTTimeEvolutionHisto(ibooker, "EnabledROChannelsVsLS", "% RO channels", 500, 5, true, 3);
hSystFractionVsLS =
new DTTimeEvolutionHisto(ibooker, "EnabledROChannelsVsLS", "Fraction of RO channels", 500, 5, true, 3);
}
} // end attempt to make these bookings only once!

Expand Down
11 changes: 9 additions & 2 deletions DQM/DTMonitorClient/src/DTLocalTriggerTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,15 @@ void DTLocalTriggerTest::runClientDiagnostic(DQMStore::IBooker& ibooker, DQMStor
delete BXHH;
delete Flag1st;

corrFrac = besttrigsCorr / besttrigs;
secondFrac = trigsFlag2nd / trigs;
if (besttrigs != 0)
corrFrac = besttrigsCorr / besttrigs;
else
corrFrac = 1;
if (trigs != 0)
secondFrac = trigsFlag2nd / trigs;
else
secondFrac = 0;

if (corrFrac < parameters.getUntrackedParameter<double>("corrFracError", .5)) {
corrSummary = 2;
} else if (corrFrac < parameters.getUntrackedParameter<double>("corrFracWarning", .6)) {
Expand Down
1 change: 1 addition & 0 deletions DQM/DTMonitorModule/interface/DTTimeEvolutionHisto.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ class DTTimeEvolutionHisto {
int nBookedBins;
int theMode;
MonitorElement* histo;
int binLabelCounter;
};
#endif

Expand Down
14 changes: 10 additions & 4 deletions DQM/DTMonitorModule/src/DTTimeEvolutionHisto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ DTTimeEvolutionHisto::DTTimeEvolutionHisto(DQMStore::IBooker& ibooker,
: valueLastTimeSlot(0), theFirstLS(firstLS), theLSPrescale(lsPrescale), doSlide(sliding), theMode(mode) {
// set the number of bins to be booked
nBookedBins = nbins;
binLabelCounter = -1;
if (sliding)
nBookedBins++;
if (!sliding && theMode == 0)
Expand Down Expand Up @@ -96,7 +97,8 @@ void DTTimeEvolutionHisto::setTimeSlotValue(float value, int timeSlot) {
} else if (bin != nBookedBins) {
histo->setBinContent(bin, histo->getBinContent(bin + 1));
histo->setBinError(bin, histo->getBinError(bin + 1));
histo->setBinLabel(bin, histo->getTH1F()->GetXaxis()->GetBinLabel(bin + 1), 1);
histo->setBinLabel(bin, histo->getTH1F()->GetXaxis()->GetBinLabel(bin + 1), 1); //slide to left
histo->setBinLabel(bin + 1, "", 1); //delete old label to avoid duplication
}
}
histo->setBinContent(nBookedBins, value);
Expand Down Expand Up @@ -158,11 +160,15 @@ void DTTimeEvolutionHisto::updateTimeSlot(int ls, int nEventsInLS) {
// set the bin label
stringstream binLabel;
binLabel << "LS " << firstLSinTimeSlot;
if (nEventsInLastTimeSlot.size() > 1)
if (nEventsInLastTimeSlot.size() > 1) {
binLabel << "-" << lastLSinTimeSlot;
binLabelCounter++;
}

//if(lastLSinTimeSlot%(3*(int)theLSPrescale)==0)
histo->setBinLabel(nBookedBins, binLabel.str(), 1);
// Set only labels which can be seen in the plot without zooming
if (binLabelCounter % ((int)(nBookedBins / 25)) == 0) //around 25 labels fit in a full size hist
histo->setBinLabel(nBookedBins, binLabel.str(), 1);
//first label, LS=1 ideally, is guaranteed by setting binLabelCounter=-1 in constructor

// reset the counters for the time slot
nEventsInLastTimeSlot.clear();
Expand Down

0 comments on commit c2ea811

Please sign in to comment.