-
Notifications
You must be signed in to change notification settings - Fork 28
boosting 4-vectors does not work on TLorentzVectorArray #62
Comments
I see what's going on here: it's a casualty of scope creep. Originally, these functions were written for Numpy arrays—the idea being that you could have flat arrays of Lorentz vectors—but in most cases, they "just worked" for awkward arrays (because they share Numpy idioms) and this fact is clearly useful. However, awkward arrays don't support masked-assignment (I'm hoping to make this possible in awkward 1.0). In most of these functions, I removed masked-assignment and in-place assignment, but I must have missed this one. The masked-assignment is intended to protect against division by zero—specifically, zero over zero (corresponding to boosting by exactly zero). To do this truly vectorially, we should let the division by zero happen and clean up afterward. Since these are zero over zero cases, the result we want to clean up is NaN. If the array is Numpy, we can mask-assign these cases; otherwise, we can use awkward's I believe that the correct limit for this case is The fix is in PR #63. |
I just noticed that I have an open PR (#63) that should fix this, and it's pretty stale. Did this fix your problem/is it no longer relevant/etc.? |
For me this problem is still relevant. I get a |
Hi,
I am stumbling over a problem w/ 4-vectors in uproot_methods:
Consider the problem of having events with lorentz vectors and wanting to boost all of them into their rest frame. The operation works per-event, but not o the full full (batched) set of events
I'm looking into what the issue could be but perhaps someone is faster
the first
print
works as expected, the seconds does not and fails withThe text was updated successfully, but these errors were encountered: