Skip to content

[Tools,PWGJE] Implemented full inference of GNN b-jet tagger - #18682

Merged
nzardosh merged 11 commits into
AliceO2Group:masterfrom
choich08365:gnnbjet_mlresponse_v2
Nov 13, 2026
Merged

nzardosh merged 11 commits into
AliceO2Group:masterfrom
choich08365:gnnbjet_mlresponse_v2

Conversation

@choich08365

@choich08365 choich08365 commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Dear @fcatalan92, @nzardosh, and all concerned,

Could you please take a look at this PR when you have time? I apologise for the large number of changes, and really appreciate your time and effort in reviewing them.
Thank you in advance.

This update extends the GNN b-jet tagger infrastructure to support its track-origin and vertex prediction outputs, enabling future applications such as selecting tracks from b-hadron decays. The current implementation stores jet-tagging and track-origin prediction scores and provides aligned MC truth labels for track origins and vertex indices. Edge-based vertex prediction storage remains deferred.

Tools/ML/model.h, Tools/ML/MlResponse.h

  • Added evalModelFull to the model interface and getModelOutputs to MlResponse, returning one vector per output tensor in the ONNX model's output order.
  • The existing getModelOutput exposes only the last output tensor. The new interface provides access to all three GNN outputs—edge predictions, track-origin predictions, and jet-flavour predictions—from a single model evaluation.
  • Output values are copied into owning vectors so they remain valid after the ONNX output tensors are released.

PWGJE/DataModel/JetTagging.h

  • Added tables that associate selected GNN input tracks with their parent jets, MC truth labels, and prediction scores. In the table names below, * denotes Charged or ChargedMCDetectorLevel.
Table Availability Contents
*JetGnnTracks Data and MCD One row per selected (jet, track) pair, containing the jet index, the JTracks index, and the track's node index in the GNN input.
*JetGnnTrackIds Data and MCD One row per jet, containing an array of indices into *JetGnnTracks, accessible through tracksGnn_as<T>().
ChargedMCDetectorLevelJetTrackOriginDef MCD only One MC track-origin label per GNN input track.
ChargedMCDetectorLevelJetVertexIndexDef MCD only One MC vertex-cluster index per GNN input track.
*JetGnnTrackOriginTags Data and MCD One scalar track-origin discriminant, scoreML, per GNN input track.
  • Track-origin labels distinguish background, charm, beauty, primary-vertex, and other secondary-vertex tracks. Vertex indices use -1 for unassigned tracks, 0 for the primary vertex, and positive values for secondary vertices.
  • Truth and prediction tables share the row count and ordering of *JetGnnTracks, allowing them to be joined and accessed together through tracksGnn_as<soa::Join<...>>().
  • *JetGnnTrackIds preserves one row per input jet, including an empty array for jets without selected GNN tracks.
  • Edge-related table declarations remain commented out for future implementation.

PWGJE/TableProducer/jetGnnDefinition.cxx

  • Added a task that selects constituent tracks for GNN inputs and fills *JetGnnTracks and *JetGnnTrackIds.
  • Preserves the association between model-node order and the original constituent tracks, including track replacement when the configured maximum input size is exceeded.
  • For MCD jets, also fills ChargedMCDetectorLevelJetTrackOriginDef and ChargedMCDetectorLevelJetVertexIndexDef using vertexClustering, projecting the full constituent labels onto the selected GNN tracks.
  • For data jets, fills only the track and index tables because MC truth labels are unavailable.
  • Applies collision, jet, and track selection before constructing GNN inputs. Dataset splitting remains the responsibility of downstream tasks.
  • Registered jet-gnn-definition in PWGJE/TableProducer/CMakeLists.txt.

PWGJE/TableProducer/jetGnnInference.cxx

  • Added a dedicated GNN inference task supporting data and MCD jets:
    • processGnnTag fills the existing jet-tagging tables.
    • processGnnFull additionally fills the track-origin prediction tables using the input-track mapping produced by jet-gnn-definition.
  • Includes the jet-tagging functionality provided by processAlgorithmGNN in jetTaggerHF.cxx. A separate task accommodates the additional GNN outputs and their table dependencies.
  • Full inference retrieves all output tensors in one model evaluation and computes jet and track discriminants. Edge outputs are currently unused.
  • Skips inference for rejected collisions or jets and inputs with fewer than two selected tracks, storing an invalid jet score of -999 while preserving table alignment.
  • Added inclusive track-origin score QA and MC truth-separated distributions. MC track-origin labels are used for QA only.
  • Retained optional output support for future vertex prediction tables.

PWGJE/Tasks/bjetTreeCreator.cxx

  • Updated GNN tree production to read track-origin and vertex labels from the tables produced by jet-gnn-definition, replacing its local vertexClustering call.
  • Uses the selected GNN track mapping to associate each stored track with its labels.
  • Separated original-track quality variables into processMCJetsForGNNExtrb. The standard processMCJetsForGNN uses derived track tables without subscribing to the original aod::Tracks tables.
  • Aligned collision selection with the definition and inference tasks while retaining downstream dataset splitting and sampling.
  • Kept these changes confined to GNN tree production.

PWGJE/Tasks/bjetTaggingGnn.cxx

  • Introduced task-local collision selection consistent with the GNN definition, inference, and tree-production tasks.
  • Applied it to the relevant data and MCD analysis processes, preserving dataset splitting and the dedicated selection-counter processes.

PWGJE/Core/JetTaggingUtilities.h

  • Extended analyzeJetTrackInfo4GNN with an optional constituent-index mapping that follows the exact model-node order after track selection and truncation.

  • Added getTrackDb as a provisional discriminant for b-decay track selection. Using softmax probabilities for the five track-origin categories, it computes:

    log(Pbeauty /
        [trackFC × Pcharm
         + (1 − trackFC) × (Pbackground + PPV + PotherSV)])
    

@github-actions github-actions Bot changed the title Implemented full inference of GNN b-jet tagger [Tools,PWGJE] Implemented full inference of GNN b-jet tagger Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

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

nzardosh
nzardosh previously approved these changes Nov 10, 2026
@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for ba59bea at 2026-11-10 16:45:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGJE/DataModel/JetTagging.h:223:1: error: multi-line comment [-Werror=comment]
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGJE/DataModel/JetTagging.h:223:1: error: multi-line comment [-Werror=comment]
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGJE/DataModel/JetTagging.h:223:1: error: multi-line comment [-Werror=comment]
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGJE/DataModel/JetTagging.h:223:1: error: multi-line comment [-Werror=comment]
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGJE/DataModel/JetTagging.h:223:1: error: multi-line comment [-Werror=comment]
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGJE/DataModel/JetTagging.h:223:1: error: multi-line comment [-Werror=comment]
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGJE/DataModel/JetTagging.h:223:1: error: multi-line comment [-Werror=comment]
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGJE/DataModel/JetTagging.h:223:1: error: multi-line comment [-Werror=comment]
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGJE/DataModel/JetTagging.h:223:1: error: multi-line comment [-Werror=comment]
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGJE/DataModel/JetTagging.h:223:1: error: multi-line comment [-Werror=comment]
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for ba59bea at 2026-11-10 17:11:

## 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 20 errors and 70 warnings.'
Found 20 errors and 70 warnings.
++ [[ 20 -gt 0 ]]
++ cat /sw/BUILD/c8c1066e86363a0d7184aefb8fa55fa407ea0050/O2Physics-code-check/errors.txt
PWGJE/DataModel/JetTagging.h:33:1: error: included header utility is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGJE/DataModel/JetTagging.h:34:1: error: included header vector is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGJE/DataModel/JetTagging.h:223:79: error: multi-line // comment [clang-diagnostic-comment,-warnings-as-errors]
PWGJE/DataModel/JetTagging.h:224:75: error: multi-line // comment [clang-diagnostic-comment,-warnings-as-errors]
PWGJE/DataModel/JetTagging.h:225:75: error: multi-line // comment [clang-diagnostic-comment,-warnings-as-errors]
PWGJE/DataModel/JetTagging.h:226:74: error: multi-line // comment [clang-diagnostic-comment,-warnings-as-errors]
PWGJE/DataModel/JetTagging.h:227:74: error: multi-line // comment [clang-diagnostic-comment,-warnings-as-errors]
PWGJE/DataModel/JetTagging.h:228:74: error: multi-line // comment [clang-diagnostic-comment,-warnings-as-errors]
PWGJE/DataModel/JetTagging.h:229:73: error: multi-line // comment [clang-diagnostic-comment,-warnings-as-errors]
PWGJE/DataModel/JetTagging.h:230:73: error: multi-line // comment [clang-diagnostic-comment,-warnings-as-errors]
PWGJE/DataModel/JetTagging.h:231:73: error: multi-line // comment [clang-diagnostic-comment,-warnings-as-errors]
PWGJE/DataModel/JetTagging.h:232:73: error: multi-line // comment [clang-diagnostic-comment,-warnings-as-errors]
PWGJE/DataModel/JetTagging.h:233:73: error: multi-line // comment [clang-diagnostic-comment,-warnings-as-errors]
PWGJE/DataModel/JetTagging.h:234:73: error: multi-line // comment [clang-diagnostic-comment,-warnings-as-errors]
PWGJE/DataModel/JetTagging.h:235:73: error: multi-line // comment [clang-diagnostic-comment,-warnings-as-errors]
PWGJE/DataModel/JetTagging.h:236:73: error: multi-line // comment [clang-diagnostic-comment,-warnings-as-errors]
PWGJE/DataModel/JetTagging.h:237:71: error: multi-line // comment [clang-diagnostic-comment,-warnings-as-errors]
Tools/ML/model.h:187:5: error: no header providing "assert" is directly included [misc-include-cleaner,-warnings-as-errors]
Tools/ML/model.h:190:58: error: no header providing "OrtAllocatorType" is directly included [misc-include-cleaner,-warnings-as-errors]
Tools/ML/model.h:190:95: error: no header providing "OrtMemType" is directly included [misc-include-cleaner,-warnings-as-errors]
++ [[ 70 -gt 0 ]]
++ cat /sw/BUILD/c8c1066e86363a0d7184aefb8fa55fa407ea0050/O2Physics-code-check/warnings.txt
PWGJE/Core/JetTaggingUtilities.h:235:5: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:294:9: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:331:9: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:403:11: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:438:11: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:449:5: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:475:11: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:495:47: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:497:45: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:508:41: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:510:41: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:512:58: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:514:58: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:518:55: warning: statement should be inside braces [readability-braces-around-statements]
[0 more errors; see full log]

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for ba59bea at 2026-11-10 17:44:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGJE/DataModel/JetTagging.h:223:1: error: multi-line comment [-Werror=comment]
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGJE/DataModel/JetTagging.h:223:1: error: multi-line comment [-Werror=comment]
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGJE/DataModel/JetTagging.h:223:1: error: multi-line comment [-Werror=comment]
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGJE/DataModel/JetTagging.h:223:1: error: multi-line comment [-Werror=comment]
ninja: build stopped: subcommand failed.

Full log here.

@vkucera
vkucera marked this pull request as draft November 10, 2026 20:07
@choich08365
choich08365 marked this pull request as ready for review November 11, 2026 04:01
@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for eceec19 at 2026-11-11 08:18:

## 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 6 errors and 66 warnings.'
Found 6 errors and 66 warnings.
++ [[ 6 -gt 0 ]]
++ cat /sw/BUILD/594dcc8387f916ec841320c28bd5250ccb6d3d58/O2Physics-code-check/errors.txt
PWGJE/DataModel/JetTagging.h:33:1: error: included header utility is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGJE/DataModel/JetTagging.h:34:1: error: included header vector is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGJE/Tasks/bjetTreeCreator.cxx:486:45: error: no header providing "M_PI" is directly included [misc-include-cleaner,-warnings-as-errors]
Tools/ML/model.h:187:5: error: no header providing "assert" is directly included [misc-include-cleaner,-warnings-as-errors]
Tools/ML/model.h:190:58: error: no header providing "OrtAllocatorType" is directly included [misc-include-cleaner,-warnings-as-errors]
Tools/ML/model.h:190:95: error: no header providing "OrtMemType" is directly included [misc-include-cleaner,-warnings-as-errors]
++ [[ 66 -gt 0 ]]
++ cat /sw/BUILD/594dcc8387f916ec841320c28bd5250ccb6d3d58/O2Physics-code-check/warnings.txt
PWGJE/Core/JetTaggingUtilities.h:235:5: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:294:9: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:331:9: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:403:11: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:438:11: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:449:5: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:475:11: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:495:47: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:497:45: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:508:41: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:510:41: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:512:58: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:514:58: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:518:55: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:521:53: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:533:41: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:534:12: warning: redundant boolean literal in conditional return statement [readability-simplify-boolean-expr]
PWGJE/Core/JetTaggingUtilities.h:550:29: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:563:69: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:566:11: warning: variable 'varSignImpSig' is not initialized [cppcoreguidelines-init-variables]
PWGJE/Core/JetTaggingUtilities.h:589:7: warning: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty]
PWGJE/Core/JetTaggingUtilities.h:644:42: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:676:69: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:689:30: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:709:69: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:738:30: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:754:15: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:759:120: warning: statement should be inside braces [readability-braces-around-statements]
[0 more errors; see full log]

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 7457594 at 2026-11-11 11:27:

## 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 5 errors and 66 warnings.'
Found 5 errors and 66 warnings.
++ [[ 5 -gt 0 ]]
++ cat /sw/BUILD/32cb57e8df27e3da1f543069be3a83d6dbde5be3/O2Physics-code-check/errors.txt
PWGJE/DataModel/JetTagging.h:33:1: error: included header utility is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGJE/DataModel/JetTagging.h:34:1: error: included header vector is not used directly [misc-include-cleaner,-warnings-as-errors]
Tools/ML/model.h:187:5: error: no header providing "assert" is directly included [misc-include-cleaner,-warnings-as-errors]
Tools/ML/model.h:190:58: error: no header providing "OrtAllocatorType" is directly included [misc-include-cleaner,-warnings-as-errors]
Tools/ML/model.h:190:95: error: no header providing "OrtMemType" is directly included [misc-include-cleaner,-warnings-as-errors]
++ [[ 66 -gt 0 ]]
++ cat /sw/BUILD/32cb57e8df27e3da1f543069be3a83d6dbde5be3/O2Physics-code-check/warnings.txt
PWGJE/Core/JetTaggingUtilities.h:235:5: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:294:9: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:331:9: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:403:11: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:438:11: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:449:5: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:475:11: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:495:47: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:497:45: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:508:41: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:510:41: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:512:58: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:514:58: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:518:55: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:521:53: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:533:41: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:534:12: warning: redundant boolean literal in conditional return statement [readability-simplify-boolean-expr]
PWGJE/Core/JetTaggingUtilities.h:550:29: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:563:69: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:566:11: warning: variable 'varSignImpSig' is not initialized [cppcoreguidelines-init-variables]
PWGJE/Core/JetTaggingUtilities.h:589:7: warning: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty]
PWGJE/Core/JetTaggingUtilities.h:644:42: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:676:69: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:689:30: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:709:69: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:738:30: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:754:15: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:759:120: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:781:61: warning: statement should be inside braces [readability-braces-around-statements]
[0 more errors; see full log]

Full log here.

Comment thread PWGJE/Core/JetTaggingUtilities.h Outdated

T denominator = trackFC * softmaxLogits[1] + (1. - trackFC) * (softmaxLogits[0] + softmaxLogits[3] + softmaxLogits[4]);
if (denominator == 0.) {
LOG(debug) << "jettaggingutilities::getTrackDb, zero denominator";

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.

shouldn't there be a return statement here? otherwise you would get a division by zero and have a seg fault

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi @nzardosh, thanks for your comments. I've added more explicit exception handling lines.

@nzardosh
nzardosh self-requested a review November 11, 2026 13:42
@nzardosh
nzardosh enabled auto-merge (squash) November 11, 2026 13:42
@alibuild

alibuild commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for d7a6295 at 2026-11-13 08: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 6 errors and 76 warnings.'
Found 6 errors and 76 warnings.
++ [[ 6 -gt 0 ]]
++ cat /sw/BUILD/d0c72f56b5bbfe99f1100f88c961d6b2a77a7085/O2Physics-code-check/errors.txt
PWGJE/DataModel/JetTagging.h:33:1: error: included header utility is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGJE/DataModel/JetTagging.h:34:1: error: included header vector is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGJE/DataModel/Jet.h:181:1: error: Called C++ object pointer is null [clang-analyzer-core.CallAndMessage,-warnings-as-errors]
Tools/ML/model.h:187:5: error: no header providing "assert" is directly included [misc-include-cleaner,-warnings-as-errors]
Tools/ML/model.h:190:58: error: no header providing "OrtAllocatorType" is directly included [misc-include-cleaner,-warnings-as-errors]
Tools/ML/model.h:190:95: error: no header providing "OrtMemType" is directly included [misc-include-cleaner,-warnings-as-errors]
++ [[ 76 -gt 0 ]]
++ cat /sw/BUILD/d0c72f56b5bbfe99f1100f88c961d6b2a77a7085/O2Physics-code-check/warnings.txt
PWGJE/Core/JetTaggingUtilities.h:235:5: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:294:9: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:331:9: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:403:11: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:438:11: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:449:5: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:475:11: warning: do not use 'else' after 'return' [readability-else-after-return]
PWGJE/Core/JetTaggingUtilities.h:495:47: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:497:45: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:508:41: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:510:41: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:512:58: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:514:58: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:518:55: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:521:53: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:533:41: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:534:12: warning: redundant boolean literal in conditional return statement [readability-simplify-boolean-expr]
PWGJE/Core/JetTaggingUtilities.h:550:29: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:563:69: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:566:11: warning: variable 'varSignImpSig' is not initialized [cppcoreguidelines-init-variables]
PWGJE/Core/JetTaggingUtilities.h:589:7: warning: the 'empty' method should be used to check for emptiness instead of 'size' [readability-container-size-empty]
PWGJE/Core/JetTaggingUtilities.h:644:42: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:676:69: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:689:30: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:709:69: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:738:30: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:754:15: warning: statement should be inside braces [readability-braces-around-statements]
PWGJE/Core/JetTaggingUtilities.h:759:120: warning: statement should be inside braces [readability-braces-around-statements]
[0 more errors; see full log]

Full log here.

@fcatalan92 fcatalan92 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.

Hi @choich08365, I had a look at the ML part and looks OK to me.

@ChSonnabend, @fmazzasc, @jackal1-66, maybe you could have a look too. In particular, I'm not sure if the changes adhere to the current strategy for the wrapper, since the outputs are always returned by copy.

@nzardosh
nzardosh merged commit 3513c51 into AliceO2Group:master Nov 13, 2026
16 of 17 checks passed
@choich08365
choich08365 deleted the gnnbjet_mlresponse_v2 branch November 15, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants