  Many physically interesting quantities of the electromagnetic field can be
computed using the electromagnetic scalar product. However, none of the
existing expressions for such scalar product are directly applicable when the
fields are only known in a spatially-bounded domain, as is the case for many
numerical Maxwell solvers. In here, we derive an expression for the
electromagnetic scalar product between radiation fields that only involves
integrals over closed spatial surfaces. The expression readily leads to
formulas for the number of photons, energy, and helicity of generic
polychromatic light pulses of incoming or outgoing character. The capabilities
of popular Maxwell solvers in spatially-bounded computational domains are
thereby augmented, for example, by a straightforward method for normalizing
emitted fields so that they contain a single photon.
