  The cross-sections of $\psi(2S)$ meson production in proton-proton collisions
at $\sqrt{s}=13~\mathrm{TeV}$ are measured with a data sample collected by the
LHCb detector corresponding to an integrated luminosity of
$275~p\mathrm{b}^{-1}$. The production cross-sections for prompt $\psi(2S)$
mesons and those for $\psi(2S)$ mesons from $b$-hadron decays
($\psi{(2S)}\mathrm{-from-}b$) are determined as functions of the transverse
momentum, $p_{\mathrm{T}}$, and the rapidity, $y$, of the $\psi(2S)$ meson in
the kinematic range $2<p_{\mathrm{T}}<20~\mathrm{GeV}/c$ and $2.0<y<4.5$. The
production cross-sections integrated over this kinematic region are
\begin{equation*} \begin{split} \sigma(\mbox{prompt }\psi(2S),13~\mathrm{TeV})
&= {1.430 \pm 0.005(\mathrm{stat}) \pm 0.099 (\mathrm{syst})\mu\mathrm{b}},\\
\sigma(\psi(2S)\mathrm{-from-}b,13~\mathrm{TeV})&={0.426 \pm
0.002(\mathrm{stat}) \pm0.030 (\mathrm{syst})\mu\mathrm{b}}. \end{split}
\end{equation*} A new measurement of $\psi(2S)$ production cross-sections in
$pp$ collisions at $\sqrt{s}=7~\mathrm{TeV}$ is also performed using data
collected in 2011, corresponding to an integrated luminosity of
$614~{p\mathrm{b}^{-1}}$.The integrated production cross-sections in the
kinematic range $3.5<p_{\mathrm{T}}<14~\mathrm{GeV}/c$ and $2.0<y<4.5$ are
\begin{equation*} \begin{split} \sigma(\mbox{prompt }\psi(2S),7~\mathrm{TeV})
&={0.471 \pm0.001 (\mathrm{stat}) \pm 0.025 (\mathrm{syst})\mu\mathrm{b}},\\
\sigma(\psi(2S)\mathrm{-from-}b,7~\mathrm{TeV}) &={0.126\pm0.001
(\mathrm{stat}) \pm0.008 (\mathrm{syst})\mu\mathrm{b}}. \end{split}
\end{equation*} All results show reasonable agreement with theoretical
calculations.
