Electroweak interaction: From $W^{1}_{\mu},W^{2}_{\mu},W^{3}_{\mu},B_{\mu}$ to $W^{\pm},Z_{\mu},A_{\mu}$ EDIT: Additional question at the end
I am trying to illuminate how the "unphysical" gauge bosons $W^{1}_{\mu},W^{2}_{\mu},W^{3}_{\mu},B_{\mu}$  will be the "physical" $W^{\pm},Z_{\mu},A_{\mu}$ when diagonalizing the mass matrix. Notice that it is in Euclidean time, so we do not have to care about the Lorentz indices. Furthermore $\sigma(x)$ is the Higgs field and $v$ is the vacuum expectation value.
After the symmetry breaking 
$$
SU(2)_L\times U(1)_Y \rightarrow U(1),
$$
and inserting the vacuum expecation value, I got the following Lagrangian (just the dynamical part):
$$
\frac{1}{2}D_{\mu}\phi^{\dagger}D_{\mu}\phi = \frac{1}{2}\partial_{\mu}\sigma \partial_{\mu} \sigma + \frac{(v+\sigma)^2}{8}(g^2W^{1}_{\mu}W^{1}_{\mu} + g^2W^{2}_{\mu}W^{2}_{\mu}   + (gW^{3}_{\mu} - g'B_{\mu})(gW^{3}_{\mu} - g'B_{\mu})) .
$$
$W^{\pm}=W^{1}_{\mu}\pm W^{2}_{\mu}$ is clear, but retrieving $Z_{\mu}$ and $A_{\mu}$ not. I tryied the following, since the last part of the Lagrangian can be written like:
$$
(W^{3}_{\mu},B_{\mu}) \begin{pmatrix}g^2 & -gg'\\-gg'& g'^{2} \end{pmatrix} \begin{pmatrix}W^{3}_{\mu}\\B_{\mu} \end{pmatrix}
$$
The diagonlized matrix reads
$$
M_D=\begin{pmatrix}0 & 0\\0& g^2 +g'^{2} \end{pmatrix}
$$
and does not give the right linear combinations of $Z_{\mu}$ and $A_{\mu}$, which are given in my literature as
$$
A_{\mu} = \frac{g'W^{3}_{\mu} + g B_{\mu}}{\sqrt{g^2+g'^2}},\qquad Z_{\mu} = \frac{gW^{3}_{\mu} - g' B_{\mu}}{\sqrt{g^2+g'^2}}
$$
My question is now, how to get these combinations, it looks like I am close, but only close. And the other question where comes the normalization conditions for the field from?
Cheers!
EDIT: 
I finally found the linear combinations, mass eigenstates, like they are in the literature, by inserting not only the diagonlized mass matrix $M_D$, but by inserting $M = PM_DP^{-1}$
As I was looking at the covariant derivative to find out how the fields couple to the Higgs doublet I was wondering how I could possibly turn the following matrix into mass eigenstates of the gauge fields:
$$
\frac{i}{2}\begin{pmatrix}gW^{3}_{\mu} + g'B_{\mu} & 0\\
0& g W^{3}_{\mu} + g'B_{\mu}\end{pmatrix}
$$
again, cheers!
 A: You have noticed already that
$$
\mathcal{L}_{mass}\propto \left[g^2(W^1_\mu W_\mu^{1}+W^2_\mu W_\mu^{2})+(gW_\mu^3-g^\prime B_\mu)^2\right]
$$
with the kinetic terms for $W^{i}_\mu$ and $B_{\mu}$ canonically normalized. 
Therefore the neutral linear combination of $W^3_\mu$ and $B_\mu$ that gets mass is  proportional to $(gW_\mu^3-g^\prime B_\mu)$ and the proportionality constant $1/\sqrt{g^2+g^{\prime\,2}}$ fixed by the fact that you want keep the fields canonically normalized (that is, you are doing a rotation from $(W_\mu,B_\mu)^T$ to $(Z_\mu,A_\mu)^T$)
$$
\mathcal{L}_{mass}\propto \left[g^2(W^1_\mu W_\mu^{1}+W^2_\mu W_\mu^{2})+(g^2+g^{\prime\,2})\frac{(gW_\mu^3-g^\prime B_\mu)^2}{g^2+g^{\prime\,2}}\right]=
\left[g^2(W^1_\mu W_\mu^{1}+W^2_\mu W_\mu^{2})+(g^2+g^{\prime\,2})Z_\mu^2\right]
$$
where you see that
$$
\frac{g}{\sqrt{g^2+g^{\prime\,2}}}=\cos\theta_W
$$
and
$$
\frac{m_W^2}{m_{Z}^2\cos^2\theta_W}=1\,.
$$
in agreement with the literature.
Indeed, only the $Z$-boson and $W^{\pm}$ get masses, as the photon is massless: the neutrual combination that gets mass must be identified with $Z$-boson
