Skip to content

Commit

Permalink
Protection against empty ITS dead map
Browse files Browse the repository at this point in the history
  • Loading branch information
ekryshen committed Dec 18, 2024
1 parent 3529a22 commit 1993712
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Common/TableProducer/eventSelection.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -411,10 +411,10 @@ struct BcSelectionTask {

// check number of inactive chips and set kIsGoodITSLayer3, kIsGoodITSLayer0123, kIsGoodITSLayersAll flags
int64_t orbit = globalBC / nBCsPerOrbit;
if ((orbit < prevOrbitForInactiveChips || orbit > nextOrbitForInactiveChips) && run >= 500000) {
if (mapInactiveChips.size() > 0 && (orbit < prevOrbitForInactiveChips || orbit > nextOrbitForInactiveChips)) {
auto it = mapInactiveChips.upper_bound(orbit);
bool isEnd = (it == mapInactiveChips.end());
if (isEnd && mapInactiveChips.size() > 0)
if (isEnd)
it--;
nextOrbitForInactiveChips = isEnd ? orbit : it->first; // setting current orbit in case we reached the end of mapInactiveChips
auto vNextInactiveChips = it->second;
Expand Down

0 comments on commit 1993712

Please sign in to comment.