Using the fact that
[math]\displaystyle{ \cos{\phi} \equiv \frac{p_x}{\sqrt{p^2-p_z^2}} }[/math]
[math]\displaystyle{ \Longrightarrow \sqrt{p^2-p_z^2}=\frac{p_x}{\cos{\phi}}=constant }[/math]
We can simply use the expression
[math]\displaystyle{ \frac{p_x}{\cos{\phi}}=\frac{p_x'}{cos{\left(\phi+\delta \phi\right)}} }[/math]
[math]\displaystyle{ \Longrightarrow p_x'=\frac{p_x \times \cos{\left(\phi+\delta \phi\right)}}{\cos{\phi}} }[/math]
Then, using
[math]\displaystyle{ \sqrt{p^2-p_z^2}=\sqrt{p_x^2+p_y^2} }[/math]
[math]\displaystyle{ \Longrightarrow p_y'=\sqrt{p^2-p_z^2-p_x^{'2}} }[/math]
Starting with a data file of momentum components constructed using awk as described above
A program was written to rotate the phi angle as described above. The changing x and y components for this distribution can be seen with