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

[12_3_X] Fix ThroughputServiceClient.cc unsigned variables overflow #38287

Merged
merged 1 commit into from
Jun 11, 2022
Merged
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
8 changes: 4 additions & 4 deletions HLTrigger/Timer/plugins/ThroughputServiceClient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ void ThroughputServiceClient::fillSummaryPlots(DQMStore::IBooker &booker, DQMSto
width = avg_max - avg_min;

// define the range for .../average_sourced
uint64_t first = sourced->FindFirstBinAbove(0.);
uint64_t last = sourced->FindLastBinAbove(0.);
int64_t first = sourced->FindFirstBinAbove(0.);
int64_t last = sourced->FindLastBinAbove(0.);
Comment on lines +124 to +125
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
int64_t first = sourced->FindFirstBinAbove(0.);
int64_t last = sourced->FindLastBinAbove(0.);
auto first = sourced->FindFirstBinAbove(0.);
auto last = sourced->FindLastBinAbove(0.);

booker.setCurrentFolder(folder);
// (re)book and fill .../average_sourced
average = booker.book1D("average_sourced", "Throughput (sourced events)", (int)width, avg_min, avg_max)->getTH1F();
for (unsigned int i = first; i <= last; ++i)
for (int64_t i = std::max(first, (int64_t)0); i <= last; ++i)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (int64_t i = std::max(first, (int64_t)0); i <= last; ++i)
if(first >= 0)
for (auto i = first; i <= last; ++i)

average->Fill(sourced->GetBinContent(i));

// define the range for .../average_retired
Expand All @@ -135,7 +135,7 @@ void ThroughputServiceClient::fillSummaryPlots(DQMStore::IBooker &booker, DQMSto
booker.setCurrentFolder(folder);
// (re)book and fill .../average_retired
average = booker.book1D("average_retired", "Throughput (retired events)", (int)width, avg_min, avg_max)->getTH1F();
for (unsigned int i = first; i <= last; ++i)
for (int64_t i = std::max(first, (int64_t)0); i <= last; ++i)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (int64_t i = std::max(first, (int64_t)0); i <= last; ++i)
if(first >= 0)
for (auto i = first; i <= last; ++i)

average->Fill(retired->GetBinContent(i));
}
}
Expand Down