Skip to content

[PWGHF] Fix D0 ML prompt and non-prompt score ordering#17173

Open
zhangbiao-phy wants to merge 1 commit into
AliceO2Group:masterfrom
zhangbiao-phy:fix-tof-empty-collision-tables
Open

[PWGHF] Fix D0 ML prompt and non-prompt score ordering#17173
zhangbiao-phy wants to merge 1 commit into
AliceO2Group:masterfrom
zhangbiao-phy:fix-tof-empty-collision-tables

Conversation

@zhangbiao-phy

@zhangbiao-phy zhangbiao-phy commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

I received several reports from different analysers about the D0 BDT score ordering, which has caused some confusion.

This PR fixes the D0 ML score class ordering used in the D0 task and ML response helper.

The D0 ML output vector follows the common charm-hadron convention:

  • index 0: background
  • index 1: prompt
  • index 2: non-prompt

The previous code interpreted indices 1 and 2 as non-prompt and prompt in some places. This update aligns the D0 ML feature mapping and THnSparse axis ordering with the model output convention and with the convention used by other charm-hadron tasks.

The ML selection cut directions are unchanged. For o2-analysis-hf-candidate-selector-d0, cutDirMl should remain:

  • 0 for the background score
  • 1 for the prompt score
  • 1 for the non-prompt score

i.e. cutDirMl = 0,1,1.

Tagging D0 task users: @Mingyu3360715 @wuctlby @xinyepeng @kgwizdzi @atavirag

Please let me know if you have any comments on this! Thanks a lot!

@github-actions github-actions Bot added the pwghf PWG-HF label Jul 22, 2026
@github-actions

Copy link
Copy Markdown

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

@github-actions github-actions Bot changed the title Fix D0 ML prompt and non-prompt score ordering [PWGHF] Fix D0 ML prompt and non-prompt score ordering Jul 22, 2026
@zhangbiao-phy
zhangbiao-phy marked this pull request as ready for review July 22, 2026 16:53
@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 2167cb7 at 2026-07-22 19:31:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 14 errors and 0 warnings.'
Found 14 errors and 0 warnings.
++ [[ 14 -gt 0 ]]
++ cat /sw/BUILD/5c493efe7d3fb384c62dfd6adf1ba15666c4c360/O2Physics-code-check/errors.txt
PWGHF/Core/HfMlResponseD0ToKPi.h:42:9: error: function-like macro 'CHECK_AND_FILL_VEC_D0_FULL' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
PWGHF/Core/HfMlResponseD0ToKPi.h:44:32: error: macro argument should be enclosed in parentheses [bugprone-macro-parentheses,-warnings-as-errors]
PWGHF/Core/HfMlResponseD0ToKPi.h:50:9: error: function-like macro 'CHECK_AND_FILL_VEC_D0' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
PWGHF/Core/HfMlResponseD0ToKPi.h:58:9: error: function-like macro 'CHECK_AND_FILL_VEC_D0_HFHELPER' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
PWGHF/Core/HfMlResponseD0ToKPi.h:67:9: error: function-like macro 'CHECK_AND_FILL_VEC_D0_HFHELPER_SIGNED' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
PWGHF/Core/HfMlResponseD0ToKPi.h:80:9: error: function-like macro 'CHECK_AND_FILL_VEC_D0_OBJECT_HFHELPER_SIGNED' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
PWGHF/Core/HfMlResponseD0ToKPi.h:83:34: error: macro argument should be enclosed in parentheses [bugprone-macro-parentheses,-warnings-as-errors]
PWGHF/Core/HfMlResponseD0ToKPi.h:85:34: error: macro argument should be enclosed in parentheses [bugprone-macro-parentheses,-warnings-as-errors]
PWGHF/Core/HfMlResponseD0ToKPi.h:93:9: error: function-like macro 'CHECK_AND_FILL_VEC_D0_SIGNED' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
PWGHF/Core/HfMlResponseD0ToKPi.h:96:34: error: macro argument should be enclosed in parentheses [bugprone-macro-parentheses,-warnings-as-errors]
PWGHF/Core/HfMlResponseD0ToKPi.h:98:34: error: macro argument should be enclosed in parentheses [bugprone-macro-parentheses,-warnings-as-errors]
PWGHF/Core/HfMlResponseD0ToKPi.h:107:9: error: function-like macro 'CHECK_AND_FILL_VEC_D0_ML' used; consider a 'constexpr' template function [cppcoreguidelines-macro-usage,-warnings-as-errors]
PWGHF/Core/HfMlResponseD0ToKPi.h:111:36: error: macro argument should be enclosed in parentheses [bugprone-macro-parentheses,-warnings-as-errors]
PWGHF/Core/HfMlResponseD0ToKPi.h:113:36: error: macro argument should be enclosed in parentheses [bugprone-macro-parentheses,-warnings-as-errors]
++ [[ 0 -gt 0 ]]
++ [[ 14 -gt 0 ]]
++ exit 1
--

Full log here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pwghf PWG-HF

Development

Successfully merging this pull request may close these issues.

2 participants