It depends on which situation you look at.
Take an ideal fluid. It's characterized by an equation of state and a fluid four-velocity field ##u^{\mu}##. The energy-momentum tensor is defined through 2 invariants (or rather scalar fields): the internal-energy density and pressure in the local rest frames of the fluid cells, ##\epsilon## and ##P##. At one space-time point in the restframe the components read
$$T^{* \mu \nu}=\mathrm{diag}(\epsilon,P,P,P).$$
Since ##u^{* \mu}=(1,0,0,0)## and ##\eta^{*\mu \nu}=(1,-1,-1,-1)## you can write this in manifestly covariant form as
$$T^{* \mu \nu}=(\epsilon+P) u^{*\mu} u^{* \nu}-P \eta^{* \mu \nu}.$$
Since ##u^{\mu}## are four-vector components, and ##\eta^{* \mu \nu}=\eta^{\mu \nu}## are invariant tensor components (under Lorentz boosts), the equation holds in any frame,
$$T^{\mu \nu} =(\epsilon+P) u^{\mu} u^{\nu} - P \eta^{\mu \nu}.$$
The invariants (scalar fields) in this case are
$$u_{\mu} u_{\nu} T^{\mu \nu}=\epsilon$$
and
$$\eta_{\mu \nu} T^{\mu \nu}=\epsilon-3P.$$
Of course the latter scalar ("the trace") is one you can define for any energy-momentum tensor. For a free electromagnetic field or a fluid of massless particles it vanishes (in the classical-field theory approximation) because of the scale invariance of free electromagnetic fields and massless particles making up an ideal fluid.