How to calculate the variation of the metric on a compact manifold? For example, given a torus with a modular parameter $\tau$ and an action
\begin{equation}
    I=\frac{g}{2}\int_\mathcal{M} d^2 z \sqrt{-g}\ g_{ij}(z) \partial^i\phi \partial^j\phi
\end{equation}
where $g_{ij}$ is the metric on the torus, we want to calculate the energy-momentum tensors' one-point functions on torus using the variation of the action with respect to the metric, namely
\begin{equation}\label{stress tensor}
     \langle T^{ij}(z) \rangle =\frac{-2}{\sqrt{g(z)}}\frac{\delta \ln Z}{\delta g_{ij}(z)}.
 \end{equation}
Then in order to get the result
\begin{equation}
\langle T \rangle =2\pi i \frac{\partial}{\partial\tau}\ln Z,
\end{equation}
should we and how should we consider the contribution with respect to the variation of the modular parameter $\tau$?
 A: The stress tensor on the radial plane has the mode expansion
$$
T(z)  = \sum_n \frac{L_n}{z^{n+2}}
$$
On the cylinder, this gives
$$
T(w) = - \sum_n \frac{L_n}{w^n}  + \frac{c}{24} . 
$$
This is true up to factors of $2\pi$ which depends on your convention. The trace of the stress tensor on the torus is then
$$
\langle T(w) \rangle_\tau = \langle - \sum_n \frac{L_n}{w^n}  + \frac{c}{24}  \rangle_\tau . 
$$
Now, recall that the trace of any operator on the torus is given by
$$
\langle O \rangle_\tau = \text{tr} [ q^{L_0 - \frac{c}{24}} O ] , \qquad q=e^{2\pi i\tau} . 
$$
So only the part of $O$ which diagonalizes $L_0$ contributes to this trace. It then follows that
$$
\langle T(w) \rangle_\tau = - \langle L_0 - \frac{c}{24} \rangle_\tau
$$
Now, consider the partition function
$$
Z(\tau) = \text{tr}[ q^{L_0 - \frac{c}{24}} ] .
$$
It follows that
$$
\partial_\tau Z(\tau) = 2\pi i \text{tr}[ q^{L_0 - \frac{c}{24}} ( L_0 - \frac{c}{24} ) ] = - 2\pi i \langle T(w)\rangle_\tau
$$
Hence,
$$
 \langle T(w)\rangle_\tau =-  \frac{1}{2\pi i} \partial_\tau Z(\tau).
$$
This result differs from yours up to a factor of $(2\pi)^2$ which can be tracked to a difference in the conventions of our definitions of $T$.
