Solution (source code)

= Solution

The two initial momenta cancel, so the laboratory is the <centre-of-momentum frame>. Let $\mathcal E=2\gamma_A m_Ac^2$ be the total initial energy. <Four-momentum conservation> gives $\mathbf p_B=-\mathbf p_\gamma$ and $E_B+E_\gamma=\mathcal E$. The <energy–momentum relation> then yields
$$
m_B^2c^4=E_B^2-c^2|\mathbf p_B|^2
=(\mathcal E-E_\gamma)^2-E_\gamma^2
=\mathcal E^2-2\mathcal E E_\gamma.
$$
Thus
$$
E_\gamma=\frac{\mathcal E^2-m_B^2c^4}{2\mathcal E},\qquad
E_B=\frac{\mathcal E^2+m_B^2c^4}{2\mathcal E}.
$$
Using $v_B/c=c|\mathbf p_B|/E_B=E_\gamma/E_B$ gives
$$
\boxed{\frac{v_B}c=\frac{4m_A^2-m_B^2(1-v_A^2/c^2)}{4m_A^2+m_B^2(1-v_A^2/c^2)}.}
$$
This is <relativistic production of a massive particle and a photon>. A positive-energy photon requires $\mathcal E>m_Bc^2$; equality is the zero-photon-energy threshold.

The velocity vector is $\mathbf v_B=-v_B\mathbf n_\gamma$. Its direction is opposite the photon, but is not fixed relative to the incoming beam by conservation alone. Kinematics supplies its magnitude; an angular distribution needs the collision dynamics.