Skip to content

[Common] factorize the occupancy calculation into OccupancyCalculator - #18623

Merged
dsekihat merged 3 commits into
AliceO2Group:masterfrom
altsybee:master
Nov 9, 2026
Merged

dsekihat merged 3 commits into
AliceO2Group:masterfrom
altsybee:master

Conversation

@altsybee

@altsybee altsybee commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

EventSelectionModule: factorize the occupancy calculation into OccupancyCalculator

  • The occupancy calculation is moved from EventSelectionModule::processRun3 into a new class OccupancyCalculator:
    • OccupancyCalculator::Source (per-collision inputs) and OccupancyCalculator::Result
      (occupancy estimators and flags);
    • calculate(refGlobalBC, refVz, ...) computes the occupancy wrt a reference BC, so the same
      code can later provide occupancy at the BC level; calculateForSource(i, ...) is the
      collision-level call used in processRun3.
  • processRun3 fills the per-collision inputs and takes the occupancy values and flags from the
    calculator; the per-collision temporary vectors (and vectors of vectors) are removed.
  • The outputs are identical to those from previous calculations; checked with Pb-Pb, OO, pp.
  • Occupancy calculation is now faster by ~x2, mainly due to avoiding per-collision heap allocations.

added OccupancyCalculator class for occupancy calculations within EventSelectionModule
@github-actions github-actions Bot added the common label Nov 6, 2026
@github-actions github-actions Bot changed the title factorize the occupancy calculation into OccupancyCalculator [Common] factorize the occupancy calculation into OccupancyCalculator Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown

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

@alibuild

alibuild commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for 524cc34 at 2026-11-06 17:54:

No log files found

Full log here.

@alibuild

alibuild commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 524cc34 at 2026-11-06 17:58:

## 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 91 warnings.'
Found 1 errors and 91 warnings.
++ [[ 1 -gt 0 ]]
++ cat /sw/BUILD/b3cc4426fa23fa0bb955fbc5a6d2d5f53cdbe213/O2Physics-code-check/errors.txt
Common/Tools/EventSelectionModule.h:57:1: error: included header numeric is not used directly [misc-include-cleaner,-warnings-as-errors]
++ [[ 91 -gt 0 ]]
++ cat /sw/BUILD/b3cc4426fa23fa0bb955fbc5a6d2d5f53cdbe213/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:675:30: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/EventSelectionModule.h:677:34: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/EventSelectionModule.h:679:34: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/EventSelectionModule.h:681:35: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/EventSelectionModule.h:716:53: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/EventSelectionModule.h:718:63: warning: statement should be inside braces [readability-braces-around-statements]
[0 more errors; see full log]

Full log here.

@dsekihat
dsekihat merged commit b0eedb8 into AliceO2Group:master Nov 9, 2026
13 of 14 checks passed
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