-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: NanoEvents Delphes #584
Conversation
With scikit-hep/uproot5#441 and scikit-hep/uproot5#442 I can now do: import awkward as ak
from coffea.nanoevents import NanoEventsFactory, DelphesSchema
events = NanoEventsFactory.from_root(
"tests/samples/delphes.root",
"Delphes",
schemaclass=DelphesSchema,
).events()
ak.to_list(events) which confirms we can at least interpret all the branches successfully. |
Using
and an editable install at the current commit
and the others look ok
So I want to add quicker access for some of the branches that have brackets in the name, and it would be nice to automatically interpret some of these as TLVs -- and that requires wrapping it somehow? Or is it expected that |
Can confirm it all looks ok without the TLV interpretations
|
Certainly the |
Another option is to hack at the form to turn the record items into x y z t. |
I went with this option for hacking at the form using a recursive function. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last check I would suggest is make sure _ = ak.to_list(events)
runs. This makes sure all arrays materialize successfully. The output will be gigantic so best not to print it :)
This PR will aim to add functionality for coffea to read in Delphes files.
Docstrings are added for common names. The following were more complicated branches that needed to be handled / fixed in uproot first initially before being handled correctly in coffea. The schema is modified in a custom way to drop in the
vector.LorentzVector
behavior for those that are TLVs.Area
(TLorentzVector)Constituents
(TRefArray)Edges[4]
(Float_t)FracPt[5]
(Float_t)Particle
(TRef)Particles
(TRefArray)PrunedP4[5]
(TLorentzVector)SoftDroppedJet
(TLorentzVector)SoftDroppedP4[5]
(TLorentzVector)SoftDroppedSubJet1
(TLorentzVector)SoftDroppedSubJet2
(TLorentzVector)Tau[5]
(Float_t)TrimmedP4[5]
(TLorentzVector)We don't know why
Area
is a TLV.