mildly relativistic particles

would it be possible to write down a temperature scaling \(T(a)\) with scale factor \(a\) of an ensemble of particles with a general relativistic dispersion relation \(\epsilon=\sqrt{p^2+m^2}\)? can you show that only the extreme cases of classical and ultrarelativistic particles yield power laws for \(T(a)\)?