Repository navigation
[Tools,PWGJE] Implemented full inference of GNN b-jet tagger - #18682
Conversation
|
O2 linter results: ❌ 0 errors, |
|
Error while checking build/O2Physics/o2 for ba59bea at 2026-11-10 16:45: Full log here. |
|
Error while checking build/O2Physics/code-check for ba59bea at 2026-11-10 17:11: Full log here. |
|
Error while checking build/O2Physics/staging for ba59bea at 2026-11-10 17:44: Full log here. |
|
Error while checking build/O2Physics/code-check for eceec19 at 2026-11-11 08:18: Full log here. |
|
Error while checking build/O2Physics/code-check for 7457594 at 2026-11-11 11:27: Full log here. |
|
|
||
| T denominator = trackFC * softmaxLogits[1] + (1. - trackFC) * (softmaxLogits[0] + softmaxLogits[3] + softmaxLogits[4]); | ||
| if (denominator == 0.) { | ||
| LOG(debug) << "jettaggingutilities::getTrackDb, zero denominator"; |
There was a problem hiding this comment.
shouldn't there be a return statement here? otherwise you would get a division by zero and have a seg fault
There was a problem hiding this comment.
Hi @nzardosh, thanks for your comments. I've added more explicit exception handling lines.
|
Error while checking build/O2Physics/code-check for d7a6295 at 2026-11-13 08:58: Full log here. |
fcatalan92
left a comment
There was a problem hiding this comment.
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.
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.hevalModelFullto the model interface andgetModelOutputstoMlResponse, returning one vector per output tensor in the ONNX model's output order.getModelOutputexposes 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.PWGJE/DataModel/JetTagging.h*denotesChargedorChargedMCDetectorLevel.*JetGnnTracks(jet, track)pair, containing the jet index, theJTracksindex, and the track's node index in the GNN input.*JetGnnTrackIds*JetGnnTracks, accessible throughtracksGnn_as<T>().ChargedMCDetectorLevelJetTrackOriginDefChargedMCDetectorLevelJetVertexIndexDef*JetGnnTrackOriginTagsscoreML, per GNN input track.-1for unassigned tracks,0for the primary vertex, and positive values for secondary vertices.*JetGnnTracks, allowing them to be joined and accessed together throughtracksGnn_as<soa::Join<...>>().*JetGnnTrackIdspreserves one row per input jet, including an empty array for jets without selected GNN tracks.PWGJE/TableProducer/jetGnnDefinition.cxx*JetGnnTracksand*JetGnnTrackIds.ChargedMCDetectorLevelJetTrackOriginDefandChargedMCDetectorLevelJetVertexIndexDefusingvertexClustering, projecting the full constituent labels onto the selected GNN tracks.jet-gnn-definitioninPWGJE/TableProducer/CMakeLists.txt.PWGJE/TableProducer/jetGnnInference.cxxprocessGnnTagfills the existing jet-tagging tables.processGnnFulladditionally fills the track-origin prediction tables using the input-track mapping produced byjet-gnn-definition.processAlgorithmGNNinjetTaggerHF.cxx. A separate task accommodates the additional GNN outputs and their table dependencies.-999while preserving table alignment.PWGJE/Tasks/bjetTreeCreator.cxxjet-gnn-definition, replacing its localvertexClusteringcall.processMCJetsForGNNExtrb. The standardprocessMCJetsForGNNuses derived track tables without subscribing to the originalaod::Trackstables.PWGJE/Tasks/bjetTaggingGnn.cxxPWGJE/Core/JetTaggingUtilities.hExtended
analyzeJetTrackInfo4GNNwith an optional constituent-index mapping that follows the exact model-node order after track selection and truncation.Added
getTrackDbas a provisional discriminant for b-decay track selection. Using softmax probabilities for the five track-origin categories, it computes: