I read the article Threshold energy on Wikipedia about colliding particles and their threshold energy.
Consider the case where a particle 1 with lab energy $E_1$ (momentum $p_1$) and mass $m_1$ impinges on a target particle 2 at rest in the lab, i.e. with lab energy and mass $E_2 = m_2$. The threshold energy $E_{1,thr}$ to produce three particles of masses $m_a,m_b,m_c$, i.e.
$1+2 \rightarrow a+b+c$
is then found by assuming that these three particles are at rest in the center of mass frame (symbols with hat indicate quantities in the center of mass frame):
$$E_{cm}=m_ac^{2}+m_bc^{2}+m_cc^{2}=\hat{E}_1+\hat{E}_2=\gamma(E_1-\beta p_1c)+\gamma m_2c^{2}$$
Here $E_{cm}$ is the total energy available in the center of mass frame.
Using $\gamma = \frac{E_1+m_2c^{2}}{E_{cm}}$, $\beta =\frac{p_1c}{E_1+m_2c^2}$, and $\ p_1^2c^2=E_1^2-m_1^2c^4$
one derives that
$$E_{1,thr}=\frac{(m_ac^2+m_bc^2+m_cc^2)^2-(m_1c^2+m_2c^2)^2}{2m_2c^2}$$
I don't understand where $\gamma = \frac{E_1+m_2c^{2}}{E_{cm}}$ and $\beta= \frac{p_1c}{E_1+m_2c^2}$ come from. I am also confused by the meaning of the equation
$$\hat{E_1}+\hat{E_2}=\gamma(E_1-\beta p_1c)+\gamma m_2c^{2}.$$
I know it has something to do with conservation of energy but the term $(E_1-\beta p_1c)$ feels like its coming from nowhere
If someone could clarify this that would be great.