Skip to content

Unable to access an otherwise available field of TLorentzVector in expressions #959

Answered by jpivarski
alpetukhov asked this question in Q&A
Discussion options

You must be logged in to vote

In the case of #131, the things with names like "Tracks.fCoordinates.fX" are TBranches. Using a dotted name in expressions makes it look for a TBranch with that name. A TLorentzVector is a single TBranch; the structure is inside of it—there is no TBranch in your file named "truth_p4.fE".1

Outside of the expressions, if you have an Awkward Array named truth_p4, then asking for .fE extracts a field from it as a projection. That's something where a different library (Awkward vs Uproot) uses the same syntax for a different purpose.

The set of functions available in the expressions argument of uproot.TTree.arrays and similar is a closed-off set, like NumExpr. Here's the default set:

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by alpetukhov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants