I'm trying to run analysis strictly in Python using upROOT, but I'm finding (unsurprisingly) that I have to build a lot of tools that are already in ROOT. I don't mind doing it, but I want to make sure I don't mess stuff up.
For instance, I have the following for mass squared:
m_squared = np.divide(np.multiply(p_squared, g_squared), b_squared)
Where "p_squared" is the global momentum magnitude (squared), "g_squared" is inverse gamma squared, and "b_squared" is beta squared.
I also have the following for phi:
add_pi = np.hstack(np.where((oX < 0.0) & (oY > 0.0)))
subtract_pi = np.hstack(np.where((oX < 0.0) & (oY < 0.0)))
Phi = np.arctan(np.divide(oY, oX))
Phi[add_pi] = Phi[add_pi] + np.pi
Phi[subtract_pi] = Phi[subtract_pi] - np.pi
Where "oX" and "oY" are the x and y origin coordinates for tracks, respectively.
Is there something built into upROOT to do this? Or is this just a PyROOT thing?