Reference for explicit formula for $\sum_n \Lambda(n) \chi(n)$ with smooth weights Let $\Lambda$ be the von Mangoldt function and $\chi$ a primitive character mod $q$, then we have the explicit formula
$$
\sum_{n \leq X} \Lambda(n) \chi(n) = \delta_{\chi} X - \sum_{ |Im \ \rho| \leq T} \frac{X^{\rho}}{\rho} + O((\frac{X}{T}+1) \log^2(qXT)), 
$$
where $\delta_{\chi}$ is $1$ if $\chi$ is the principal character and $0$ otherwise, and $\rho$'s are the non-trivial zeros of the $L$ function $L(s, \chi)$. I was interested in the explicit formula of 
$$
\sum_{n \leq X} \Lambda(n) \chi(n) \phi(n)
$$
where $\phi$ is a smooth function. I would greatly appreciate a reference for this. Thank you very much. 
 A: The answer is addressed in Siegel-Walfisz Theorem with smooth weights.  A very particular smooth weight is used, but the ideas can be adapted to other smooth weights with minor changes.
Also, the answer is addressed in Theorem 5.11 in Iwaniec and Kowalski.  Their answer may look slightly different from your first centered equation above because they do not "push the contour all the way to the left".  Instead, they push the contour to the line $\mathrm{Re}(s)=-c$ for some fixed $c>0$; then, they use the functional equation.  However, one can indeed "push the contour all the way to the left" and achieve what is perhaps a more classical-looking result (like your first centered equation).  But all of the key ingredients are indeed present in the setup of Section 5.5 in Iwaniec and Kowalski.
Several particular choices of weights are explored in Montgomery-Vaughan (Chapter 5), as mentioned by @Greg Martin.  Their so-called "abelian weights" correspond to with the answer to Siegel-Walfisz Theorem with smooth weights.  But for arbitrary smooth weights, the only result that comes to my mind is Theorem 5.11 in Iwaniec and Kowalski.
