-
Notifications
You must be signed in to change notification settings - Fork 25
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
vector.obj does not recognize "rho" "phi" "eta" "tau" as Momentum4D Object #482
Comments
The observed behavior is intended: the vector is a momentum if and only if any of the component names are momentum synonyms, such as "pt" instead of "rho" or "mass" instead of "tau". "phi" and "eta" are both angles, purely geometric. (One could argue that "eta" should be momentum-like because it's pseudorapidity, a property that's only associated with particle momenta. But pseudorapidity can be defined for any 3-vector (unlike rapidity), and in Vector's system, all of the momentum names are synonyms of some pure geometry name, and there's no other word for "pseudorapidity.") |
I think this is not a bug, and I'll be closing this issue. (Issues can be reopened.) |
Thank you for your explanation. I read the description wrong as that However, then I don't understand why the branches of a awkward Momentum4D arrays are named |
In hindsight, we probably shouldn't have created a distinction between "momentum vectors" and "geometric vectors" because it hasn't been understood without explanation. The reason we wanted to was because we couldn't exclude names like I'm a little unclear about the semantics of import vector
vector.register_awkward() and then use ak.with_name or the This works through option-types (because >>> import awkward as ak
>>> import vector
>>> vector.register_awkward()
>>> a = ak.Array([{"rho": 0, "eta": 0, "phi": 0, "tau": 1}, None], with_name="Momentum4D")
>>> a.show(type=True)
type: 2 * ?Momentum4D[
rho: int64,
eta: int64,
phi: int64,
tau: int64
]
[{rho: 0, eta: 0, phi: 0, tau: 1},
None]
>>> a.rapidity
<Array [0, None] type='2 * ?float64'> |
Vector Version
1.4.1
Python Version
3.11.9
OS / Environment
Windows 11 64 bit
Conda-Forge environment
Describe the bug
Observed behavior:
The same is observed for changing between
rho
andpt
. If either (or both)pt
orm
is used as a keyword the result is a MomentumObject.Expected behavior:
The resulting object in both cases should be a MomentumObject4D
Any additional but relevant log output
No response
The text was updated successfully, but these errors were encountered: