$\def\RR{\mathbb{R}}\def\ZZ{\mathbb{Z}}$This is essentially the constant term in the [Epstein $\zeta$-function][1]. Given a lattice $\Lambda$ in $\RR^d$, the Epstein $\zeta$ function is $$Z(\Lambda, s) = \sum_{g \in \Lambda \setminus \{ 0 \}} \frac{1}{(g^T g)^s}.$$ $Z$ has a simple pole at $d/2$ with residue $\tfrac{\pi^{d/2}}{\sqrt{\det \Lambda} \ \Gamma(d/2)}$, and no other poles on $\mathrm{Re}(s)\geq d/2$. Set $$Z(s) = \frac{\pi^{d/2}}{(\det \Lambda) \ \Gamma(d/2) (s-d/2)}+c(\Lambda) + O(s-d/2)$$ There are [standard tools][2] to convert Dirichlet series estimates to partial sum estimates. If I didn't drop any constants, then $$c_1 = \frac{2 \pi^{d/2}}{(\det \Lambda) \ \Gamma(d/2)} \quad c_2 = c(\Lambda).$$ Theorem 4 of Terras, "[Bessel Series Expansions of the Epstein Zeta Function and the Functional Equation][3]", Trans. AMS, Vol. 183 (Sep., 1973), pp. 477-486 gives a formula for $c(\Lambda)$ in terms of other functions, but I don't feel competent to summarize it. [1]: https://www.encyclopediaofmath.org/index.php/Epstein_zeta-function [2]: https://mathoverflow.net/questions/201421/tauberian-theorem-with-better-error-term [3]: http://www.jstor.org/stable/1996480