Skip to content

[DPG] Skip ambiguous tracks with an empty BC slice in the event selection QA - #18019

Merged
alcaliva merged 1 commit into
AliceO2Group:masterfrom
sawenzel:fix-evselqa-ambiguous-empty-bc-slice
Sep 23, 2026
Merged

alcaliva merged 1 commit into
AliceO2Group:masterfrom
sawenzel:fix-evselqa-ambiguous-empty-bc-slice

Conversation

@sawenzel

Copy link
Copy Markdown
Contributor

This fixes a crash of the event selection QA task on MC AODs.

  • An ambiguous track can carry the BC slice (-1, -1), which means it has no associated BC at all.
  • The existing guard only rejected slices at or beyond the end of the BC table, so (-1, -1) passed it and bc_as().begin().globalIndex() was called on an empty slice, which segfaults.
  • The guard now uses has_bc(), which tests both slice ends for being negative, as CollisionAssociation.h already does, and checks the upper end as well.
  • Reproduced on LHC26a5a_gp_2025_v10 with O2Physics daily-20260729-0000-1, where the task exits 128; with this change the same file is processed and the QA histograms are filled.

This fixes a crash of the event selection QA task on MC AODs.

- An ambiguous track can carry the BC slice (-1, -1), which means it has no
  associated BC at all.
- The existing guard only rejected slices at or beyond the end of the BC table,
  so (-1, -1) passed it and bc_as().begin().globalIndex() was called on an empty
  slice, which segfaults.
- The guard now uses has_bc(), which tests both slice ends for being negative,
  as CollisionAssociation.h already does, and checks the upper end as well.
- Reproduced on LHC26a5a_gp_2025_v10 with O2Physics daily-20260729-0000-1, where
  the task exits 128; with this change the same file is processed and the QA
  histograms are filled.
@github-actions github-actions Bot added the dpg label Sep 22, 2026
@github-actions github-actions Bot changed the title Skip ambiguous tracks with an empty BC slice in the event selection QA [DPG] Skip ambiguous tracks with an empty BC slice in the event selection QA Sep 22, 2026
@github-actions

Copy link
Copy Markdown

O2 linter results: ❌ 0 errors, ⚠️ 21 warnings, 🔕 0 disabled

@alibuild

alibuild commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 3c1ae43 at 2026-09-23 10:35:

## sw/BUILD/O2-latest/log
Error: missing ; at end of rule at /sw/SOURCES/O2/daily-20260923-0000/daily-20260923-0000/Detectors/TPC/base/src/TPCBaseLinkDef.h:75:56
Error: missing ; at end of rule at /sw/SOURCES/O2/daily-20260923-0000/daily-20260923-0000/Detectors/TPC/base/src/TPCBaseLinkDef.h:83:135
Error: missing ; at end of rule at /sw/SOURCES/O2/daily-20260923-0000/daily-20260923-0000/Detectors/TPC/base/src/TPCBaseLinkDef.h:84:135
Error: missing ; at end of rule at /sw/SOURCES/O2/daily-20260923-0000/daily-20260923-0000/Detectors/Upgrades/ALICE3/ECal/base/src/ECalBaseLinkDef.h:19:48
Error: missing ; at end of rule at /sw/SOURCES/O2/daily-20260923-0000/daily-20260923-0000/Detectors/Upgrades/ALICE3/RICH/base/src/RICHBaseLinkDef.h:18:48
Error: missing ; at end of rule at /sw/SOURCES/O2/daily-20260923-0000/daily-20260923-0000/Detectors/Upgrades/ALICE3/MID/base/src/MI3BaseLinkDef.h:18:47


## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 2 errors and 68 warnings.'
Found 2 errors and 68 warnings.
++ [[ 2 -gt 0 ]]
++ cat /sw/BUILD/ef8a4a3a611918281cebf717120d908af9f2011a/O2Physics-code-check/errors.txt
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:114:61: error: 'true' and 'false' expressions are equivalent [misc-redundant-expression,-warnings-as-errors]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:116:61: error: 'true' and 'false' expressions are equivalent [misc-redundant-expression,-warnings-as-errors]
++ [[ 68 -gt 0 ]]
++ cat /sw/BUILD/ef8a4a3a611918281cebf717120d908af9f2011a/O2Physics-code-check/warnings.txt
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:68:8: warning: constructor does not initialize these fields: ccdb [cppcoreguidelines-pro-type-member-init]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:99:27: warning: statement should be inside braces [readability-braces-around-statements]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:114:52: warning: conditional operator with identical true and false expressions [bugprone-branch-clone]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:116:52: warning: conditional operator with identical true and false expressions [bugprone-branch-clone]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:416:25: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:422:7: warning: use auto when initializing with a template cast to avoid duplicating the type name [modernize-use-auto]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:425:65: warning: implicit conversion 'bool' -> 'Double_t' (aka 'double') [readability-implicit-bool-conversion]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:486:7: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:487:7: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:535:36: warning: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:538:36: warning: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:571:23: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:572:19: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:572:35: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:573:19: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:573:34: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:667:11: warning: use auto when initializing with a template cast to avoid duplicating the type name [modernize-use-auto]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:669:15: warning: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:724:47: warning: statement should be inside braces [readability-braces-around-statements]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:778:30: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:779:30: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:780:30: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:795:27: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:795:27: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:795:45: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:795:63: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:824:36: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:829:25: warning: statement should be inside braces [readability-braces-around-statements]
DPG/Tasks/AOTEvent/eventSelectionQa.cxx:834:44: warning: statement should be inside braces [readability-braces-around-statements]
[0 more errors; see full log]

Full log here.

@sawenzel sawenzel changed the title [DPG] Skip ambiguous tracks with an empty BC slice in the event selection QA Skip ambiguous tracks with an empty BC slice in the event selection QA Sep 23, 2026
@github-actions github-actions Bot changed the title Skip ambiguous tracks with an empty BC slice in the event selection QA [DPG] Skip ambiguous tracks with an empty BC slice in the event selection QA Sep 23, 2026
@alcaliva
alcaliva enabled auto-merge (squash) September 23, 2026 07:33

@altsybee altsybee left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

thanks for this fix, @sawenzel !

@alcaliva
alcaliva merged commit a899ce0 into AliceO2Group:master Sep 23, 2026
16 of 18 checks passed
@sawenzel
sawenzel deleted the fix-evselqa-ambiguous-empty-bc-slice branch September 23, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

4 participants