Current structure
in the current structure of an Events()
class, leptons, jets and photons are fundamental detector-level objects. Leptons have a property that indicates their charge (ntrk
) and jets have a property (btag
) that indicates whether they were $b$-tagged.
To deal with cases in which one wants to look at a particular charge or $b$-tags, I wrote the pick_charge()
and b_jets()
functions, which return list-like Objects()
classes of leptons of a particular charge and $b$-jets, respectively. E.g.
events[0].b_jets()
events[0]["electron"].pick_charge(1)
This has the advantage that one can still consider list-like objects of e.g. all electrons (positively and negatively charged) and all jets (with and without a $b$-tag). It also matches the LHCO format.
Alternative structure - separate Objects()
for e.g. lepton and anti-lepton
One alternative is that leptons and anti-leptons, and jets and $b$-jets are treated different objects (i.e. Objects()
classes in this case) from the get-go, rather than the same object but with different properties. E.g.
events[0]["b-jet"]
events[0]["anti-electron"]
I'm not a big fan of this, as lots of selections apply for e.g. electrons and anti-electrons. For an $\eta$ cut, you would have to do:
events.cut_objects("electron", eta)
events.cut_objects("anti-electron", eta) # Got to cut on anti-electrons too
Other possibility
I don't think this is a good idea:
events[0]["electron"] # All electrons
events[0]["-electron"] # Only negative charge electrons
events[0]["+electron"] # Only positive charge electrons
Because inconsistencies might arise when you start removing or counting objects, as objects exist in more than one list. E.g. you might remove electrons with an $\eta$ cut:
events.cut_objects("electron", eta) # ... but I forgot the "-electron" and "+electron"
and forget about the separate -electron
and +electron
objects. I don't think this should be possible. The first option gets around this, by defining functions that return e.g. anti-electrons based on the electron
objects.
Discussion
Any comments or discussion is welcome.