# Higher dimensional generalization of an identity between traces of Hecke operators and number of elliptic curves over finite fields?

In http://www.math.ubc.ca/~behrend/ladic.pdf, the author uses his generalization of Lefschetz trace formula to smooth algebraic stacks to prove an interesting identity (Proposition 6.4.11.):

$$\sum_{k} \frac{1}{p^{k+1}} tr T_p |_{S_{k+2}}=1- \frac{1}{p^3-p} - \sum_{E / \mathbb F_p}\frac{1}{\#E(\mathbb F_p) \# Aut E(\mathbb F_p)}$$.

Here $$T_p$$ is the $$p$$-th Hecke operator on the space of cusp forms $$S_{k+2}$$ of weight $$k + 2$$. The sum on the right hand side extends over all isomorphism classes of elliptic curves over $$\mathbb F_p$$.

In the proof, he applies the trace formula to the algebraic stack of curves of genus one. Can we generalize this identity to other Shimura varieties ? For example, can we apply Behrend trace formula to some moduli stacks describing torsors of abelian varieties?