  Using proton-proton collision data, corresponding to an integrated luminosity
of 9$fb^{-1}$, collected with the~LHCb detector between 2011 and 2018, a new
narrow charmonium state, the $X(3842)$ resonance, is observed in the decay
modes $X(3842)\rightarrow D^0\bar{D}^0$ and $X(3842)\rightarrow D^+D^-$. The
mass and the natural width of this state are measured to be \begin{eqnarray*}
m_{X(3842)} & = & 3842.71 \pm 0.16 \pm 0.12 MeV/c^2\,, \Gamma_{X(3842)} & = &
2.79 \pm 0.51 \pm 0.35 MeV\,, \end{eqnarray*} where the first uncertainty is
statistical and the~second is systematic. The observed mass and narrow natural
width suggest the~interpretation of the new state as the~unobserved
spin\nobreakdash-3 $\psi_3\mathrm{\left(1^3D_3\right)}$ charmonium state. In
addition, prompt hadroproduction of the $\psi(3770)$~and $\chi_{c2}(3930)$
states is observed for the first time, and the parameters of these~states are
measured to be \begin{eqnarray*} m_{\psi(3770)} & = & 3778.1 \pm 0.7 \pm 0.6
MeV/c^2\,, m_{\chi_{c2}(3930)} & = & 3921.9 \pm 0.6 \pm 0.2 MeV/c^2\,,
\Gamma_{\chi_{c2}(3930)} & = &36.6 \pm 1.9 \pm 0.9 MeV\,, \end{eqnarray*} where
the first uncertainty is statistical and the~second is systematic.
