Skip to content
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
7 changes: 7 additions & 0 deletions Detectors/AOD/src/AODProducerWorkflowSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3367,6 +3367,13 @@ std::uint64_t AODProducerWorkflowDPL::fillBCSlice(int (&slice)[2], double tmin,
// the time becomes larger than bcMax.
// (if this is not the case we could determine it with a similar call to mBCLookup)
auto& bcvector = mBCLookup.getBCTimeVector();
// lower_bound reports {size(), 0} when no BC is at or after bcMin, i.e. the track time
// window starts past the last BC of the timeframe. Clamp to the last BC, as the binary
// search above does, so that the slice stays in range and the time reference stays valid.
if (p.first >= bcvector.size()) {
p.first = bcvector.size() - 1;
p.second = bcvector[p.first];
}
auto upperindex = p.first;
while (upperindex < bcvector.size() && bcvector[upperindex] <= bcMax) {
upperindex++;
Expand Down
Loading