Skip to content

feat: Addition of lepton type for jet labelling#5295

Draft
delitez wants to merge 11 commits intoacts-project:mainfrom
delitez:leptonJets
Draft

feat: Addition of lepton type for jet labelling#5295
delitez wants to merge 11 commits intoacts-project:mainfrom
delitez:leptonJets

Conversation

@delitez
Copy link
Copy Markdown
Contributor

@delitez delitez commented Mar 27, 2026

In this PR, lepton-type classification is introduced for charged leptons to be used in jet labelling in addition to hadron types. Also, the name "unknown" within hadron types is changed to "others", since it is used to label every remaining hadron after labeling b-, c-, and light jets. "unknown" is now used only for unknown origins.

@github-actions github-actions bot added the Component - Core Affects the Core module label Mar 27, 2026
@github-actions github-actions bot added this to the next milestone Mar 27, 2026
@github-actions github-actions bot added Component - Examples Affects the Examples module Event Data Model labels Mar 27, 2026
LightMeson = 10,
LightBaryon = 11,
Unknown = 12
Other = 12,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could consider keeping the Unkown case as an alias and using

Unknown __attribute__((deprecated("Don't use"))) = Other,

to mark it deprecated? That's not in the standard, but both clang and gcc support it, I believe.

Copy link
Copy Markdown
Member

@paulgessinger paulgessinger Mar 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this seems to work after all:

  Unknown [[deprecated("nope")]] = Other,

This might possibly not work on all compilers that we cover but is worth a try.

}
}

ActsExamples::JetLabel jetLabelFromLeptonType(Acts::LeptonType leptonType) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if we couldn't drop LeptonType and instead just have this function accept the PDG directly. There's one step less than for hadrons, where we map PGDs to hadron category first, which we don't need for leptons.

Going one step further, if there's a single jetLabelFromPdgId() you could just pass in the PDG ids and have this function check if it's a hadron or lepton and return the correct label based on that. This would also simplify the if/elses that you have to do further below at this time.

Comment on lines +199 to +206
auto htype = Acts::ParticleIdHelper::hadronType(pdgId);
auto ltype = Acts::ParticleIdHelper::leptonType(pdgId);

if (Acts::ParticleIdHelper::isHadron(pdgId)) {
label = jetLabelFromHadronType(htype);
} else if (Acts::ParticleIdHelper::isLepton(pdgId)) {
label = jetLabelFromLeptonType(ltype);
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you ditch LeptonType, this also simplifies a bit.

MuonJet = 7,
ElectronJet = 8,
TauJet = 9,
Unknown = 10
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is Unknown still needed, and if yes, can it be an alias of OtherJet now?

We also need to be careful: like this, if there's an electron in the jet cone at all, we'd classify it as an ElectronJet, which is probably not what we want. I think we should put taus between B and C here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it probably needs to sit below B/C and above the light jets, not in between C and B

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

Labels

Component - Core Affects the Core module Component - Examples Affects the Examples module Event Data Model

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants