Lorentz invariant measure, Scaling problem? I'm having some trouble understanding some of the Fourier stuff in QFT.
Let's say we adopt the following convention:
$$\tilde{\phi}(p) = \int d^4x \,\,  e^{-ipx} \phi(x) $$
which gives us the following inverse formula:
$$\phi(x) = \int \frac{1}{(2\pi)^4} d^4p\,\, e^{ipx} \tilde{\phi}(p) $$
Now in reality, the components of $p$ are not independent and are related buy the condition $\omega^2 - \vec{p}-m^2=0$. So we want to write:
$$\phi_t(\vec{x}) = \int \frac{1}{(2\pi)^4} d^3\vec{p}\,\, d\omega\,\, e^{i\vec{p}\vec{x}} \tilde{\phi} (p) \,\, \delta({\omega^2 - \vec{p}-m^2}) $$
The goal is enforce the condition $\omega^2 - \vec{p}-m^2=0$ while still being Lorentz invariant and this is indeed achieved by adding this Dirac function.
But doing this won't give me the right final expression, because I still end up with  $\frac{d^3\vec{p}}{(2\pi)^4} $ instead of $\frac{d^3\vec{p}}{(2\pi)^3}$. I can't get rid of the additional $2\pi$ factor.
The problem of $\delta({\omega^2 - \vec{p}-m^2})$ is that it is in a way arbitrary, one could use  $\delta({\frac{1}{c}(\omega^2 - \vec{p}-m^2}))$ instead which also enforces the same condition. And in this case we end up with $\frac{cd^3\vec{p}}{(2\pi)^4} $.
Since there is one correct answer, how should we choose the scaling ? and why, what's the motivation? I feel that the scaling should be coherent with some other convention that we use but I'm not sure which one.
 A: Although, one can do Fourier transformation of the field the way you did it in the first two equations, it is seldom done this way. Furthermore one can't jump from $\int d^4p$ to $\int d^3p \; d\omega \; \delta(\dots)$ as they are not equivalent mathematically.
Most textbooks start with the fields at specific fixed time. The fields are then decomposed using creation/annihilation operators, and it is observed that the states created with these operators are eigenvalues of the Hamiltonian. Due to this fact in the full time-dependent field creation/annihilation operators acquire $e^{-i \omega_p}$ coefficient (through time evolution operator).
In the end the field decomposition looks like:
$$
\phi(x) = \int \frac{d^3p}{(2\pi)^3} \frac{1}{\sqrt{2 \omega_p}}
  \left( a_p e^{-ip \cdot x} + a^\dagger_p e^{ip \cdot x} \right)
$$
You should be able to find derivation of this in almost any QFT textbook.

About the use of the delta-function in QFT integrals. One can swap integral (given $\omega_p = \sqrt{m^2 + |\mathbf{p}|^2}$:
$$
\int \frac{d^4p}{(2\pi)^4} (2 \pi) \theta(p^0) \delta\left( p^2 - m^2 \right) f(p^0, \mathbf{p})
$$
With:
$$
\int \frac{d^3p}{(2\pi)^3} \frac{1}{2 \omega_p} f(\omega_p, \mathbf{p})
$$
The first integral is manifestly Lorentz-invariant, while the second one is simpler. Both are completely equivalent in any case.
