Let $G$ be a locally compact unimodular group. A continuous irreducible unitary representation $\pi$ of $G$ is a discrete series if its matrix coefficients are in $L^2(G)$.
The, it is possible to define its formal degree $\mathrm{deg}(\pi)$ as the "norm" of the operator "matrix coefficient", i.e. as the constant $d_\pi$ such that for all $v, w \in V_\pi$ we have $$\| \xi^\pi_{v, w} \|_2^2 := \int_{G} |\langle \pi(g)v, w \rangle|^2 dg = d_\pi^{-1} \|v\|^2\|w\|^2.$$
It is known (e.g. Dixmier, C* Algebras, Prop. 18.8.5) that in this case the formal degree matches the Plancherel measure, i.e. $$\mathrm{deg}(\pi) = \mu^{\rm Pl} (\pi).$$
I would like to relate this to the dimension of the "cohomological class" of $\pi$. As in this question, a discrete series $\pi$ is $\xi$-cohomological for a certain $\lambda_\pi$ (its infinitesimal character if I understand correctly). This $\lambda_\pi$ is an irreducible finite-dimensional representation of $G (\mathbb C)$. Do we have $$\mathrm{deg}(\pi) = \mathrm{dim} (\lambda_\pi) \quad ?$$
References for these matters are welcome.