# Comparing Selberg and Eichler-Selberg trace formulas

The trace formula of Selberg gives an equality between trace of Hecke operators (a spectral sum) on spaces of Maass forms and sums over closed geodesics mostly. The Eichler-Selberg trace formula, however, gives an identity between trace of Hecke operators on spaces of modular forms and sums over class numbers (or Kloosterman sums).

Are they both related or, rather, both complementary and we need both to have a full spectral picture (of what? a whole trace of Hecke operators?)

More specifically, how can both be made close/comparable? Can we for instance have a version of Selberg's trace formula where the geometric/arithmetic side is written as sum of some class numbers, or other arithmetic invariants?

Trace formulas, and in particular the Selberg trace formula, is an identity $$I(f) = J(f)$$ of spectral and global distributions where $$f$$ is a test function. There are different ways to use the trace formula, e.g., you can look at the trace formula for suitably nice $$f$$ without actually specifying it, or pick a specific test function $$f$$ and see what both sides tell you.
The Eichler-Selberg trace formula is a specialization of the Selberg trace formula for a specific $$f$$ that picks out traces of Hecke operators on holomorphic modular forms. E.g., see Zagier's article for a derivation in level 1 (well, if you want to follow the proof, see also Zagier's correction).