Skip to content

[Common] occupancy calculation fix at ROF borders; bunch pattern from AggregatedRunInfo - #18574

Open
altsybee wants to merge 1 commit into
AliceO2Group:masterfrom
altsybee:master
Open

altsybee wants to merge 1 commit into
AliceO2Group:masterfrom
altsybee:master

Conversation

@altsybee

@altsybee altsybee commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes

  • Occupancy: vAmpFT0CperColl vector is now filled before it is used for vProxyForCollNtracks.
    This issue was introduced in commit #14202: in the occupancy calculation, any collision near an ITS ROF border (~5% of collisions in Pb-Pb) was counted as 0 tracks (instead of FT0Campl/10) for its neighbours, which was affecting the following cases:

    • the median-time calculation for occupancy,
    • the narrow and strict time-range vetoes,
    • the ITS-track-based occupancy (nITS567tracksInFullTimeWindow).
  • BcSelectionModule, unanchored Run 3 MC (minor): nBCsPerTF was set to 32 (BCs) instead of
    32 orbits * 3564 BCs. Might change results for unanchored MC.

  • Light-ion collision-BC matching (minor): protect against 0/0 when a non-TOF vertex has no high-pt
    TPC-only tracks (TMath::Nint(NaN), platform-dependent result). Without such tracks the TVX
    search is now centred on the original BC.

Refactoring (no change in results)

  • Colliding-BC pattern is taken from runInfo.grpLHC (AggregatedRunInfo) instead of a separate
    GRPLHCIF query. Also:
    • configure() keeps a cross-check comparing bcPatternB from AggregatedRunInfo (mid-run) with
      GRPLHCIF fetched at the first BC timestamp (logs an error on mismatch). To be removed after
      validation.
    • removed bcsPattern (vector of filled BCs); the pattern search now uses the bcPatternB bitset
      via a new helper findBCinPattern(), which reproduces the previous selection exactly
  • Removed unused findClosest()

@github-actions github-actions Bot added the common label Nov 3, 2026
@github-actions github-actions Bot changed the title occupancy calculation fix at ROF borders; bunch pattern from AggregatedRunInfo [Common] occupancy calculation fix at ROF borders; bunch pattern from AggregatedRunInfo Nov 3, 2026
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown

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

@alibuild

alibuild commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 9d7866b at 2026-11-03 19:23:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'To reproduce the results below locally, run: '\''aliBuild build O2Physics-code-check -e ALIBUILD_BASE_HASH=upstream/master'\''.'
To reproduce the results below locally, run: 'aliBuild build O2Physics-code-check -e ALIBUILD_BASE_HASH=upstream/master'.
++ echo 'To apply all automatic fixes, add the '\''-e O2PHYSICS_CHECKER_FIX=1'\'' option.'
To apply all automatic fixes, add the '-e O2PHYSICS_CHECKER_FIX=1' option.
++ echo 'See the documentation for more details at: <https://aliceo2group.github.io/analysis-framework/docs/tools/#running-with-o2physics-code-check>.'
See the documentation for more details at: <https://aliceo2group.github.io/analysis-framework/docs/tools/#running-with-o2physics-code-check>.
++ echo 'Found 1 errors and 94 warnings.'
Found 1 errors and 94 warnings.
++ [[ 1 -gt 0 ]]
++ cat /sw/BUILD/146ee69e6f0a60fbacfe3fd605c91d181b4d00da/O2Physics-code-check/errors.txt
Common/Tools/EventSelectionModule.h:1289:9: error: 'emplace_back' is called inside a loop; consider pre-allocating the container capacity before the loop [performance-inefficient-vector-operation,-warnings-as-errors]
++ [[ 94 -gt 0 ]]
++ cat /sw/BUILD/146ee69e6f0a60fbacfe3fd605c91d181b4d00da/O2Physics-code-check/warnings.txt
Common/Tools/EventSelectionModule.h:62:9: warning: function-like macro 'BITCHECK' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
Common/Tools/EventSelectionModule.h:63:9: warning: function-like macro 'BITCHECK64' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage]
Common/Tools/EventSelectionModule.h:68:1: warning: nested namespaces can be concatenated [modernize-concat-nested-namespaces]
Common/Tools/EventSelectionModule.h:140:3: warning: use '= default' to define a trivial default constructor [modernize-use-equals-default]
Common/Tools/EventSelectionModule.h:161:15: warning: redundant string initialization [readability-redundant-string-init]
Common/Tools/EventSelectionModule.h:162:15: warning: redundant string initialization [readability-redundant-string-init]
Common/Tools/EventSelectionModule.h:355:20: warning: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr]
Common/Tools/EventSelectionModule.h:356:20: warning: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr]
Common/Tools/EventSelectionModule.h:357:20: warning: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr]
Common/Tools/EventSelectionModule.h:358:20: warning: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr]
Common/Tools/EventSelectionModule.h:363:20: warning: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr]
Common/Tools/EventSelectionModule.h:364:20: warning: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr]
Common/Tools/EventSelectionModule.h:368:7: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
Common/Tools/EventSelectionModule.h:369:7: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
Common/Tools/EventSelectionModule.h:399:109: warning: narrowing conversion from 'float' to 'bool' [bugprone-narrowing-conversions]
Common/Tools/EventSelectionModule.h:452:31: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/EventSelectionModule.h:466:38: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/EventSelectionModule.h:529:20: warning: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr]
Common/Tools/EventSelectionModule.h:530:20: warning: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr]
Common/Tools/EventSelectionModule.h:531:20: warning: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr]
Common/Tools/EventSelectionModule.h:532:20: warning: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr]
Common/Tools/EventSelectionModule.h:533:20: warning: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr]
Common/Tools/EventSelectionModule.h:539:20: warning: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr]
Common/Tools/EventSelectionModule.h:540:20: warning: boolean expression can be simplified by DeMorgan's theorem [readability-simplify-boolean-expr]
Common/Tools/EventSelectionModule.h:555:11: warning: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty]
Common/Tools/EventSelectionModule.h:558:19: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/EventSelectionModule.h:562:54: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/EventSelectionModule.h:621:3: warning: use '= default' to define a trivial default constructor [modernize-use-equals-default]
Common/Tools/EventSelectionModule.h:634:15: warning: redundant string initialization [readability-redundant-string-init]
Common/Tools/EventSelectionModule.h:638:3: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
Common/Tools/EventSelectionModule.h:643:3: warning: function 'findBCinPattern' should be marked [[nodiscard]] [modernize-use-nodiscard]
Common/Tools/EventSelectionModule.h:667:21: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/EventSelectionModule.h:682:10: warning: use auto when declaring iterators [modernize-use-auto]
[0 more errors; see full log]

Full log here.

@vkucera

vkucera commented Nov 4, 2026

Copy link
Copy Markdown
Collaborator

Hi @altsybee , you can fix the code-check error by calling reserve to pre-allocate the capacity.

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.

3 participants