Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DT DQM] Fix some minor style bugs 14_0_X #45007

Merged
merged 1 commit into from
May 22, 2024
Merged
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
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