Lets say you are given a distribution function $f(p)$ and you want to define a temperature, $T_f$, for this distribution. (I assume $\mu = 0$.)
It is then natural to define a temperature the following way: \begin{equation} T_f \equiv \frac{ \int d^3p \ G(p) f(p)}{\int d^3p \ f(p)}, \end{equation} where $G(p)$ is defined by the following equation \begin{equation} T = \frac{ \int d^3p \ G(p) f_{eq}(p,T)}{\int d^3p \ f_{eq}(p,T)}, \end{equation} where $f_{eq}(p,T)$ is the equilibrium thermal distribution function.
I know that if $f_{eq}$ is given by the Maxwell-Boltzmann distribution, then $$G_{MB}(p) = \frac{p^2}{3E},$$ where $E = \sqrt{p^2 + m^2}$.
What I need is to find an expression for $G(p)$ if $f_{eq}$ is the Bose-Einstein or Fermi-Dirac distribution $$ f_{eq} = \frac{1}{e^{E(p)/T} \pm 1}.$$
I do not need an analytic expression for $G(p)$, an integral that I can solve numerically is sufficient. It seems to me that this should be possible to do, but I just can't think of how.