Skip to content

[Common] pidTPCModule.h: calculate NN prediction on demand only - #19104

Open
lubynets wants to merge 1 commit into
AliceO2Group:masterfrom
lubynets:tpc-nn
Open

lubynets wants to merge 1 commit into
AliceO2Group:masterfrom
lubynets:tpc-nn

Conversation

@lubynets

@lubynets lubynets commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

This PR proposes to skip evaluation of the NN model for particle hypothesis, which are not requested (i.e. useNetwork is set to 0). For the sake of keeping code logic unchanged, the corresponding vector is filled with dummy values -999.
E.g. when useNetwork is requested for e, $\pi$, K, p and not requested for $\mu$, d, t, ${}^3\rm{He}$ and $\alpha$, with the proposed change the ONNX evaluation time is reduced by 55% and ONNX evaluation time plus overhead - by 35%.

Tagging @amaringarcia @ChSonnabend

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown

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

@github-actions github-actions Bot changed the title pidTPCModule.h: calculate NN prediction on demand only [Common] pidTPCModule.h: calculate NN prediction on demand only Dec 4, 2026
@alibuild

alibuild commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 5e66dd1 at 2026-12-04 02:15:

## 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 46 warnings.'
Found 1 errors and 46 warnings.
++ [[ 1 -gt 0 ]]
++ cat /sw/BUILD/14df73a823bf8ffbffa6b58e24cd347fe2bd6688/O2Physics-code-check/errors.txt
Common/Tools/PID/pidTPCModule.h:541:34: error: narrowing conversion from 'double' to 'int' [bugprone-narrowing-conversions,-warnings-as-errors]
++ [[ 46 -gt 0 ]]
++ cat /sw/BUILD/14df73a823bf8ffbffa6b58e24cd347fe2bd6688/O2Physics-code-check/warnings.txt
Common/Tools/PID/pidTPCModule.h:66:10: warning: inclusion of deprecated C++ header 'math.h'; consider using 'cmath' instead [modernize-deprecated-headers]
Common/Tools/PID/pidTPCModule.h:68:1: warning: nested namespaces can be concatenated [modernize-concat-nested-namespaces]
Common/Tools/PID/pidTPCModule.h:107:82: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
Common/Tools/PID/pidTPCModule.h:108:76: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
Common/Tools/PID/pidTPCModule.h:113:94: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
Common/Tools/PID/pidTPCModule.h:161:5: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
Common/Tools/PID/pidTPCModule.h:170:28: 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]
Common/Tools/PID/pidTPCModule.h:207:15: warning: redundant string initialization [readability-redundant-string-init]
Common/Tools/PID/pidTPCModule.h:253:13: warning: do not use 'compare' to test equality of strings; use the string equality operator instead [readability-string-compare]
Common/Tools/PID/pidTPCModule.h:257:17: warning: do not use 'compare' to test equality of strings; use the string equality operator instead [readability-string-compare]
Common/Tools/PID/pidTPCModule.h:270:15: warning: do not use 'compare' to test equality of strings; use the string equality operator instead [readability-string-compare]
Common/Tools/PID/pidTPCModule.h:333:9: warning: the 'empty' method should be used to check for emptiness instead of comparing to an empty object [readability-container-size-empty]
Common/Tools/PID/pidTPCModule.h:391:7: warning: do not use 'else' after 'return' [readability-else-after-return]
Common/Tools/PID/pidTPCModule.h:400:191: warning: use nullptr [modernize-use-nullptr]
Common/Tools/PID/pidTPCModule.h:400:241: warning: use nullptr [modernize-use-nullptr]
Common/Tools/PID/pidTPCModule.h:409:15: warning: the 'empty' method should be used to check for emptiness instead of comparing to an empty object [readability-container-size-empty]
Common/Tools/PID/pidTPCModule.h:429:19: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
Common/Tools/PID/pidTPCModule.h:442:35: warning: initializer for member 'versionName' is redundant [readability-redundant-member-init]
Common/Tools/PID/pidTPCModule.h:478:13: warning: the 'empty' method should be used to check for emptiness instead of comparing to an empty object [readability-container-size-empty]
Common/Tools/PID/pidTPCModule.h:514:189: warning: use nullptr [modernize-use-nullptr]
Common/Tools/PID/pidTPCModule.h:514:239: warning: use nullptr [modernize-use-nullptr]
Common/Tools/PID/pidTPCModule.h:546:21: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
Common/Tools/PID/pidTPCModule.h:561:11: warning: do not use 'compare' to test equality of strings; use the string equality operator instead [readability-string-compare]
Common/Tools/PID/pidTPCModule.h:567:37: warning: do not use 'compare' to test equality of strings; use the string equality operator instead [readability-string-compare]
Common/Tools/PID/pidTPCModule.h:640:20: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:642:20: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:648:22: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:650:22: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:658:20: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:660:20: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:692:18: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:694:18: warning: statement should be inside braces [readability-braces-around-statements]
Common/Tools/PID/pidTPCModule.h:764:21: warning: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays]
[0 more errors; see full log]

Full log here.

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.

2 participants