Closed AndrewEdmonds11 closed 3 months ago
this seems to be the best way to retain vector properties. It allows us to use properties defined here: https://vector.readthedocs.io/en/latest/api/vector._methods.html . We need the scikit-hep vector package to be installed in pyana to be able to use this functionality.
We will make a util to help people with this
https://github.com/Mu2e/TrkAna/issues/176 will follow the implementation of this and other functions into a python util. I think the initial task (to figure out how to do this) is complete so I will close this issue.
At the moment, reading any XYZVectorF in uproot gives the three components (
fCoordinates.fX
etc.) and so we have to calculate the magnitude of the vector ourselves. It would be nice if we could read these leaves as XYZVectorFs so that we can take advantage of its member functions.In principle this should be possible (uproot does support ROOT classes) so it just needs someone to look into