Skip to content

Add ATLAS-style truth labels for jet constituents - #552

Draft
afroch wants to merge 4 commits into
HEP-FCC:masterfrom
afroch:constituent-truth-labels
Draft

afroch wants to merge 4 commits into
HEP-FCC:masterfrom
afroch:constituent-truth-labels

Conversation

@afroch

@afroch afroch commented Sep 16, 2026

Copy link
Copy Markdown

Summary

Adds truth labels for every jet constituent in ConstituentTruthLabels, based on the reco-MC link:

  • truthOriginLabel: 2 Primary, 3 FromB, 4 FromBC, 5 FromC, 6 FromTau, 7 OtherSecondary, and -1 without an MC link.
  • truthTypeLabel: 0 NoTruth, 1 Other, ±2 pion, ±3 kaon, 4 lambda, ±5 electron, ±6 muon, 7 photon, with the sign following the charge as in ATLAS.
  • truthSourceLabel: 0 NoTruth, 1 NotSecondary, 3 StrangeMesonDecay, 4 StrangeBaryonDecay, 5 GammaConversion, taken from the direct parent. Heavy flavour decay products count as NotSecondary, their origin is given by truthOriginLabel.
  • truthVertexIndex: 0 for the MC primary vertex and 1, 2, ... for the other production vertices (merged within 0.1 mm, numbered per event), -2 without an MC link.
  • truthPdgId of the matched MC particle.

The origin and vertex labels are based on get_truthOrigin_cluster and get_truthVertex_cluster by @vincentriechers (truth-labelling). Compared to those, constituents without an MC link are no longer counted as OtherSecondary, the vertex numbering starts from the MC primary vertex and uses the ATLAS value -2 for missing truth, and the type and source labels are new.

Delphes samples have no pileup, fake tracks or hadronic interactions, so those ATLAS classes never appear. The outputs are float arrays per jet, like the other pfcand_* variables.

Merge order

Merge this PR only after #551.

Testing

  • For H→bb jets the constituents are 49% Primary, 25% FromBC, 21% FromB and 4% OtherSecondary, 95% are NotSecondary and 54% come from the primary vertex.
  • ctest: 57/57.

Re-run the analysis' own jet clustering with truth particles added at
negligible momentum and report which jet each one lands in. Ghosts are
matched back to the existing jets by shared constituents, so this works for
any clustering functor, including inclusive algorithms. The exclusive
clustering helper now exposes its clustering so it can be re-run.
Add HadronGhostTruthLabelID and HadronGhostInitialTruthLabelID, each with
the extended variant, plus the PDG id and pT of the labelling hadron and the
ghost b/c hadron counts. Taus are ghost-associated as well. The shared MC
record helpers live in TruthLabelUtils.
Add PartonTruthLabelID from the highest-energy ghost-associated parton.
Partons are the last ones before hadronisation, found from the decay tree
rather than from generator status codes, which differ between productions
(the Whizard+Pythia6 samples only use status 1 and 2).
Add truthOriginLabel, truthTypeLabel, truthSourceLabel, truthVertexIndex
and the matched PDG id for every jet constituent, following the ATLAS
conventions. Constituents without an MC link get the origin label -1 and the
vertex index -2.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant