feat: Addition of lepton type for jet labelling#5295
feat: Addition of lepton type for jet labelling#5295delitez wants to merge 11 commits intoacts-project:mainfrom
Conversation
| LightMeson = 10, | ||
| LightBaryon = 11, | ||
| Unknown = 12 | ||
| Other = 12, |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
| 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); | ||
| } |
There was a problem hiding this comment.
If you ditch LeptonType, this also simplifies a bit.
| MuonJet = 7, | ||
| ElectronJet = 8, | ||
| TauJet = 9, | ||
| Unknown = 10 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Actually, it probably needs to sit below B/C and above the light jets, not in between C and B
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.