Skip to content

[PWGHF] HF-track femto: split HF-decay kaon DCA templates into charm and beauty origin - #18896

Draft
FDUEnrich wants to merge 7 commits into
AliceO2Group:masterfrom
FDUEnrich:feat/kaon-pid-syst-bits
Draft

FDUEnrich wants to merge 7 commits into
AliceO2Group:masterfrom
FDUEnrich:feat/kaon-pid-syst-bits

Conversation

@FDUEnrich

@FDUEnrich FDUEnrich commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Splits the DCA template of kaons from heavy-flavour decays into charm and beauty origin, so the two contributions can be reweighted separately in the template fit. Only PWGHF files are changed; the FemtoDream data model is untouched.

  • Data model: unchanged. Kaons from HF decays keep kSecondaryFromHF.
  • Producer: for kaons from a beauty-hadron decay chain, motherPDG (debug table) now stores the beauty-hadron ancestor returned by RecoDecay::getParticleOrigin. motherPDG of every other particle is unchanged.
  • Task: new hDCAxy_SecondaryFromCharm and hDCAxy_SecondaryFromBeauty, booked only for MC with kaons as particle 1, in two folders next to the existing hDCAxy_SecondaryFromHF:
    • Track_one_MC: all selected tracks, filled once per track;
    • Track_allSelected_MC: tracks in same-event pairs, filled per pair after the k* cut. These are the templates used in the pair-level fit; the charm/beauty fraction can differ from that of all tracks.
    • A kSecondaryFromHF kaon goes to the beauty template if motherPDG is a beauty hadron, otherwise to the charm template.
    • The axes are the same as hDCAxy_SecondaryFromHF, and in each folder the two templates add up to it bin by bin.

Local test (MC, Λc–K, same input)

Check Result
Producer FDParticle table (including pidcut), MC truth, origin column (master vs this branch) identical
Existing AnalysisResults objects (master vs this branch) identical, except Track_one_MC/Debug/hPDGmother_SecondaryFromHF (beauty-origin kaons now show the beauty-hadron ancestor, by design)
Track_one_MC HF template 134 entries = 87 charm + 47 beauty, identical in every 4D bin
Track_allSelected_MC HF template 177 entries = 151 charm + 26 beauty, identical in every 4D bin
motherPDG changed only for kaons from beauty-hadron decays

The local sample has no MC-matched Λc, so the pair-level check was run with a local test-only change (not in this PR) that also accepts background candidates in the MC partition.

Note: on current master, running hf-candidate-creator-3prong-expressions with processMc locally needs mult-cent-table: processMonteCarlo = 1, because MultsExtraMC is now joined. This is not related to this PR.

🤖 Generated with Claude Code

The charm-hadron-track femto producer stored only a single pass/fail bit
for the custom kaon PID, so PID variations required a separate producer
(train) per variation.

Producer: bit 0 of the PID container keeps the nominal selection; bit i
(i >= 1) is filled with the i-th entry of the new nSigmaTpcKaMaxVar,
nSigmaCombKaMaxVar, nSigmaCombKaTightMaxVar and nSigmaTpcPiMinVar vectors
(defaults: tight 2.5/2.5/1.5/3.5 and loose 3.5/3.5/2.5/2.5). The pion
rejection is varied too, since pions in the TPC-only region dominate the
kaon contamination. Add a KaonPidBitCounter QA histogram.

Task: select kaons with ncheckbit(pidcut, pidBitTrack1Ka) instead of
pidcut == 1. The default 1 keeps the nominal selection and is backward
compatible with existing derived data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

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

Kaons from heavy-flavour decays keep the kSecondaryFromHF origin in the
derived tables (no change to the FemtoDream data model). For these kaons
the producer now stores in motherPDG the PDG code of the HF-hadron
ancestor: the beauty hadron if there is a beauty ancestor, otherwise the
closest charm hadron.

The task uses it to fill Track_one_MC/hDCAxy_SecondaryFromCharm and
hDCAxy_SecondaryFromBeauty, with the same axes as the existing
hDCAxy_SecondaryFromHF template (their sum equals it bin by bin), so the
charm and beauty contributions can be reweighted separately.

To derive kaon-level weights from weights defined on the HF hadron, the
producer adds AnalysisQA/hKaonFromCharm and hKaonFromBeauty
(kaon pT, HF-ancestor pT, |PDG| of the HF ancestor).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@FDUEnrich FDUEnrich changed the title [PWGHF] Add kaon PID systematic-variation bits to HF-track femto [PWGHF] HF-track femto: kaon PID systematic bits and charm/beauty split of HF kaon templates Nov 24, 2026
FDUEnrich and others added 2 commits November 24, 2026 17:22
- Use the RecoDecay PDG divisor and quark constants instead of
  hard-coded numbers (pdg/explicit-code).
- Rename KaonPidThresholds to HfKaonPidThresholds (pwghf/name/struct-class).
- Book the kaon HF-ancestor QA histograms for |trkPDGCode| == 321, as
  they are filled based on the absolute PDG code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on PID variations

- The charm/beauty split only needs the origin: drop findCharmHadronAncestor,
  isBeautyHadron and the HF-ancestor QA histograms. For kaons from a
  beauty-hadron decay chain, motherPDG stores the beauty-hadron ancestor
  given by RecoDecay::getParticleOrigin; motherPDG of all other particles
  is unchanged. The task classifies kSecondaryFromHF kaons as beauty if
  motherPDG is a beauty hadron and as charm otherwise.
- Default kaon PID variations follow the Run 2 strategy: only the Method2
  nSigmaComb threshold is varied (tight 2.7, loose 3.3), all other
  thresholds stay at their nominal values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@FDUEnrich
FDUEnrich marked this pull request as draft November 24, 2026 17:04
… and track trees

Add the PWGHF tables HfFemtoPairPids and HfFemtoTrkPids with the producer
pidcut of the associated track. They are filled together with every row of
FDHfCharmTrkPairs and FDHfTrk, so they join row by row. Running the task with
the loosest kaon PID bit then allows the nominal and tight selections to be
applied offline on the pair tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@FDUEnrich FDUEnrich changed the title [PWGHF] HF-track femto: kaon PID systematic bits and charm/beauty split of HF kaon templates [PWGHF] HF-track femto: kaon PID systematic bits, charm/beauty split of HF kaon templates, PID bits in output trees Nov 24, 2026
The kaon purity and the PID systematic uncertainty are obtained with the
existing framework (MC AnalysisResults, producer configurables, output trees).
Keep only the charm/beauty split of the HF-decay kaon DCA templates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@FDUEnrich FDUEnrich changed the title [PWGHF] HF-track femto: kaon PID systematic bits, charm/beauty split of HF kaon templates, PID bits in output trees [PWGHF] HF-track femto: split HF-decay kaon DCA templates into charm and beauty origin Nov 25, 2026
… tracks in pairs

Book and fill hDCAxy_SecondaryFromCharm and hDCAxy_SecondaryFromBeauty
also in Track_allSelected_MC, next to hDCAxy_SecondaryFromHF of the
tracks in same-event pairs (filled per pair, after the k* cut). The
pair-level DCA templates are the ones used in the template fit, and the
charm/beauty fraction can differ from the one of all tracks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant