So now depending on your choice of $g$ and $h$ you can use this to do different things. For instance, if you want to prove the Weyl law, you want to choose $g$ so that its support lies in $[-R,R]$ where $R$ is less than the length of any geodesic on $S$. You'd hope to then be able to $h$ to be characteristic of $[-X,X]$, but obv $h$ must have Paley-Wiener type, so you need to massage it a fair bit