  A local formula for the dimension of a superselection sector in Quantum Field
Theory is obtained as vacuum expectation value of the exponential of the proper
Hamiltonian. In the particular case of a chiral conformal theory, this provides
a local analogue of a global formula obtained by Kac and Wakimoto within the
context of representations of certain affine Lie algebras. Our formula is model
independent and its version in general Quantum Field Theory applies to black
hole thermodynamics. The relative free energy between two thermal equilibrium
states associated with a black hole turns out to be proportional to the
variation of the conditional entropy in different superselection sectors, where
the conditional entropy is defined as the Connes-Stoermer entropy associated
with the DHR localized endomorphism representing the sector. The constant of
proportionality is half of the Hawking temperature. As a consequence the
relative free energy is quantized proportionally to the logarithm of a rational
number, in particular it is equal to a linear function the logarithm of an
integer once the initial state or the final state is taken fixed.
