Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Behavior of eta if x, y = 0 in TLorenzVector #80

Open
jmduarte opened this issue Apr 23, 2020 · 3 comments
Open

Behavior of eta if x, y = 0 in TLorenzVector #80

jmduarte opened this issue Apr 23, 2020 · 3 comments

Comments

@jmduarte
Copy link

Hi,

I'm wondering if we want to reproduce the behavior of ROOT.TLorentzVector for eta in the case that x, y = 0 (See https://root.cern.ch/doc/master/TVector3_8cxx_source.html#l00320). That is, ROOT returns sign(z)*10e10.

Currently, uproot-methods throws a ZeroDivisionError:

import uproot_methods
lv = uproot_methods.TLorentzVector(0,0,0,0)
lv.eta # throws ZeroDivisionError

But maybe this behavior is desired?

Thanks,
Javier

@lgray
Copy link
Collaborator

lgray commented Apr 24, 2020

Hrmmm I think it would be best if we returned sign(z)*np.inf. I think that's better than returning some ridiculous number.

@jpivarski Your thoughts?

@jpivarski
Copy link
Member

We never claimed that these Lorentz vectors would have the same behavior as ROOT TLorentzVectors, except inasmuch as they approximate the same mathematical system.

We should think about the limit points. Special floating point values like nan and inf are better than raising exceptions for datasets that are large enough to almost certainly contain pathologies. (It's also possible that arrays of Lorentz vectors have different special cases than individual objects, and that's something that we should synchronize.) But 10e10 for such a case is not something to emulate. Such a thing would stick out as an artificial feature in a histogram and must have been rediscovered by many students. (Especially consider the case of converting data from these eta values into x and y—there would be a strange ring...)

Also worth considering is that these Lorentz vectors are planned to be replaced with the vector package. @henryiii might have something to add about that, although I understand that schedules are in flux at the moment.

@eduardo-rodrigues
Copy link
Member

I agree with @lgray. That fixed 10r10 can only harm you down the line in a non-trivial way …

Note that we can do better in these limits for rapidity, which you can still calculate from tanh^{-1}(p_z/E) for a particle with non-zero mass.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants