Skip to content

[PWGJE] Charm hadronisation: MC task now cleaner and more robust in terms of event selection monitoring - #17976

Merged
nzardosh merged 20 commits into
AliceO2Group:masterfrom
christianreckziegel:charm-hadronisation2
Sep 22, 2026
Merged

nzardosh merged 20 commits into
AliceO2Group:masterfrom
christianreckziegel:charm-hadronisation2

Conversation

@christianreckziegel

Copy link
Copy Markdown
Contributor

What this changes

analyzeMC() is restructured so that the MC event selection is decided once per
generated event
, before any jet loop, instead of per matched jet pair. Unmatched
detector-level jets are now also stored, and the collision QA counter records each
selection step separately.

Motivation

In the previous implementation the event selection was applied inside the loop over
detector-level jets matched to a given particle-level jet. This treated two physically
identical cases differently:

  • a generated event with no reconstructed collision produced a "miss" row, so its
    particle-level jet entered the efficiency denominator;
  • a generated event whose reconstructed collision failed sel8 produced no row at all,
    so its particle-level jet entered neither numerator nor denominator.

Both are generated jets that yielded no usable measurement, so the mixture biased the
efficiency. Deciding the event class once means particle- and detector-level jets live in
a common event-selection phase space, which is what the detector response matrix needs in
order to return particle-level yields defined on the same event class as the data.

Changes

  • Event selection moved out of the jet loops; a generated event is kept only if it has at
    least one associated reconstructed collision passing the selection.
  • New configurables so the convention can be varied from the workflow JSON without code
    changes:
    • applyMcEventSelection (default false) — emulated sel8 and z-vertex cut at
      generated level;
    • applyRecoEventSelection (default true) — sel8 and z-vertex cut at reconstructed
      level;
    • rejectSplitCollisions (default true) — reject generated events associated to more
      than one reconstructed collision.
  • Detector-level jets with no particle-level match (fake candidates and correlated
    background) are now written to MatchJetDistanceTable, with the particle-level fields
    set to sentinel values. These rows are needed for purity and background studies and
    were previously unavailable.
  • Sentinel rows now pass false (not -2) to the bool columns, which previously read
    back as true.
  • h_collision_counter now records the selection steps cumulatively and separately
    (z-vertex, sel8, has-collision, no-split, at reconstructed level), with the bin indices
    defined in a collisionSelections enum instead of hard-coded numbers.

@github-actions

github-actions Bot commented Sep 20, 2026

Copy link
Copy Markdown

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

Please consider the following formatting changes to AliceO2Group#17976
@alibuild

alibuild commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 5dfcf45 at 2026-09-21 14:30:

## sw/BUILD/O2-latest/log
Error: missing ; at end of rule at /sw/SOURCES/O2/daily-20260921-0000/daily-20260921-0000/Detectors/TPC/base/src/TPCBaseLinkDef.h:75:56
Error: missing ; at end of rule at /sw/SOURCES/O2/daily-20260921-0000/daily-20260921-0000/Detectors/TPC/base/src/TPCBaseLinkDef.h:83:135
Error: missing ; at end of rule at /sw/SOURCES/O2/daily-20260921-0000/daily-20260921-0000/Detectors/TPC/base/src/TPCBaseLinkDef.h:84:135
Error: missing ; at end of rule at /sw/SOURCES/O2/daily-20260921-0000/daily-20260921-0000/Detectors/Upgrades/ALICE3/ECal/base/src/ECalBaseLinkDef.h:19:48
Error: missing ; at end of rule at /sw/SOURCES/O2/daily-20260921-0000/daily-20260921-0000/Detectors/Upgrades/ALICE3/MID/base/src/MI3BaseLinkDef.h:18:47
Error: missing ; at end of rule at /sw/SOURCES/O2/daily-20260921-0000/daily-20260921-0000/Detectors/Upgrades/ALICE3/RICH/base/src/RICHBaseLinkDef.h:18:48


## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 2 errors and 2 warnings.'
Found 2 errors and 2 warnings.
++ [[ 2 -gt 0 ]]
++ cat /sw/BUILD/9f9062ee24aadbf0a8564b24dd9739b0003531f5/O2Physics-code-check/errors.txt
PWGJE/Tasks/hfFragmentationFunction.cxx:20:1: error: included header DecayChannels.h is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGJE/Tasks/hfFragmentationFunction.cxx:22:1: error: included header JetHFUtilities.h is not used directly [misc-include-cleaner,-warnings-as-errors]
++ [[ 2 -gt 0 ]]
++ cat /sw/BUILD/9f9062ee24aadbf0a8564b24dd9739b0003531f5/O2Physics-code-check/warnings.txt
PWGJE/Tasks/hfFragmentationFunction.cxx:376:15: warning: implicit conversion 'unsigned long long' -> 'bool' [readability-implicit-bool-conversion]
PWGJE/Tasks/hfFragmentationFunction.cxx:378:22: warning: implicit conversion 'unsigned long long' -> 'bool' [readability-implicit-bool-conversion]
++ [[ 2 -gt 0 ]]
++ exit 1
--

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 50598af at 2026-09-20 03:13:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 2 errors and 2 warnings.'
Found 2 errors and 2 warnings.
++ [[ 2 -gt 0 ]]
++ cat /sw/BUILD/1cad6984f34c6122dcd67de74897c6d5a5845a27/O2Physics-code-check/errors.txt
PWGJE/Tasks/hfFragmentationFunction.cxx:21:1: error: included header JetHFUtilities.h is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGJE/Tasks/hfFragmentationFunction.cxx:26:1: error: included header DecayChannels.h is not used directly [misc-include-cleaner,-warnings-as-errors]
++ [[ 2 -gt 0 ]]
++ cat /sw/BUILD/1cad6984f34c6122dcd67de74897c6d5a5845a27/O2Physics-code-check/warnings.txt
PWGJE/Tasks/hfFragmentationFunction.cxx:377:15: warning: implicit conversion 'unsigned long long' -> 'bool' [readability-implicit-bool-conversion]
PWGJE/Tasks/hfFragmentationFunction.cxx:379:22: warning: implicit conversion 'unsigned long long' -> 'bool' [readability-implicit-bool-conversion]
++ [[ 2 -gt 0 ]]
++ exit 1
--

Full log here.

@alibuild

alibuild commented Sep 20, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for 5dfcf45 at 2026-09-20 09:14:

## sw/BUILD/lhapdf-latest/log
collect2: error: ld returned 1 exit status


## sw/BUILD/XRootD-latest/log
CMake Error at CMakeLists.txt:4 (cmake_minimum_required):

Full log here.

Please consider the following formatting changes to AliceO2Group#17976
@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for 957f802 at 2026-09-22 06:04:

No log files found

Full log here.

@nzardosh
nzardosh merged commit 4498e22 into AliceO2Group:master Sep 22, 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