The crosssections of $\psi(2S)$ meson production in protonproton 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 crosssections 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 crosssections integrated over this kinematic region are \begin{equation*} \begin{split} \sigma( 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 crosssections 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 crosssections 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( 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.
Distributions of (left) the invariant mass $m_{\mu ^+\mu ^ }$ and (right) pseudo decay time $t_z$ of selected $\psi {(2S)}$ candidates in the kinematic bin of $5< p_{\mathrm{T}} <6\text{ Ge V /}c $ and $2.5<y<3.0$ in the $13\text{ Te V} $ data sample. Projections of the twodimensional fit result are also shown. The solid (red) line is the total fit function, the shaded (green) area corresponds to the background component. The prompt $\psi {(2S)}$ contribution is shown in crosshatched (blue) area, $\psi {(2S)}$ from$b$ in a solid (black) line and the tail contribution due to the association of $\psi {(2S)}$ with the wrong PV is shown in filled (magenta) area. The tail contribution is invisible in the invariantmass plot. 
Fig1a.pdf [24 KiB] HiDef png [531 KiB] Thumbnail [294 KiB] *.C file 

Fig1b.pdf [32 KiB] HiDef png [464 KiB] Thumbnail [271 KiB] *.C file 

Doubledifferential production crosssections of prompt $\psi {(2S)}$ as functions of $ p_{\mathrm{T}}$ in bins of $y$ at (left) $13\text{ Te V} $ and (right) $7\text{ Te V} $. The statistical and systematic uncertainties are added in quadrature. The $\psi {(2S)}$ meson is assumed to be produced unpolarised. 
Fig2a.pdf [18 KiB] HiDef png [185 KiB] Thumbnail [187 KiB] *.C file 

Fig2b.pdf [17 KiB] HiDef png [165 KiB] Thumbnail [165 KiB] *.C file 

Doubledifferential production crosssections of $\psi {(2S)}$ from $ b $ as functions of $ p_{\mathrm{T}} $ in bins of $y$ at (left) $13\text{ Te V} $ and (right) $7\text{ Te V} $. The statistical and systematic uncertainties are added in quadrature. The $\psi {(2S)}$ meson is assumed to be produced unpolarised. 
Fig3a.pdf [18 KiB] HiDef png [187 KiB] Thumbnail [189 KiB] *.C file 

Fig3b.pdf [17 KiB] HiDef png [165 KiB] Thumbnail [166 KiB] *.C file 

Differential production crosssections as functions of $ p_{\mathrm{T}}$ in the range $2.0<y<4.5$ for the (top) $13\text{ Te V} $ and (bottom) $7\text{ Te V} $ samples. The lefthand figures are for prompt $\psi {(2S)}$ and the results are compared with the NRQCD calculations \cite{Shao:2014yta}; the righthand figures are for $\psi {(2S)}$ from $ b $ and the results are compared with the FONLL calculations \cite{Cacciari:1998it}. 
Fig4a.pdf [16 KiB] HiDef png [291 KiB] Thumbnail [190 KiB] *.C file 

Fig4b.pdf [17 KiB] HiDef png [304 KiB] Thumbnail [191 KiB] *.C file 

Fig4c.pdf [16 KiB] HiDef png [270 KiB] Thumbnail [182 KiB] *.C file 

Fig4d.pdf [16 KiB] HiDef png [262 KiB] Thumbnail [173 KiB] *.C file 

Differential production crosssections as functions of $y$ (top) in the range $2< p_{\mathrm{T}} <20\text{ Ge V /}c $ for the $13\text{ Te V} $ sample and (bottom) in the range $3.5< p_{\mathrm{T}} <14\text{ Ge V /}c $ for the $7\text{ Te V} $ sample. The left figures are for prompt $\psi {(2S)}$ , the right figures are for $\psi {(2S)}$ from $ b $ compared with the FONLL calculations \cite{Cacciari:1998it}. 
Fig5a.pdf [14 KiB] HiDef png [94 KiB] Thumbnail [101 KiB] *.C file 

Fig5b.pdf [16 KiB] HiDef png [289 KiB] Thumbnail [187 KiB] *.C file 

Fig5c.pdf [14 KiB] HiDef png [97 KiB] Thumbnail [105 KiB] *.C file 

Fig5d.pdf [16 KiB] HiDef png [307 KiB] Thumbnail [191 KiB] *.C file 

Fractions of $\psi {(2S)} $from$ b $ in bins of $ p_{\mathrm{T}}$ and $y$ for the (left) $13\text{ Te V} $ and (right) $7\text{ Te V} $ samples. The uncertainties are statistical. 
Fig6a.pdf [18 KiB] HiDef png [170 KiB] Thumbnail [174 KiB] *.C file 

Fig6b.pdf [17 KiB] HiDef png [148 KiB] Thumbnail [153 KiB] *.C file 

Ratios of differential crosssections between prompt $\psi {(2S)}$ and prompt $ { J \mskip 3mu/\mskip 2mu\psi \mskip 2mu}$ mesons at $13\text{ Te V} $ as functions of (left) $ p_{\mathrm{T}}$ and (right) $y$. The NRQCD predicted ratio \cite{Shao:2014yta} is shown in the left panel for comparison. 
Fig7a.pdf [17 KiB] HiDef png [394 KiB] Thumbnail [239 KiB] *.C file 

Fig7b.pdf [14 KiB] HiDef png [94 KiB] Thumbnail [102 KiB] *.C file 

Ratios of differential crosssections between $\psi {(2S)}$ from $ b $ and $ { J \mskip 3mu/\mskip 2mu\psi \mskip 2mu}$ mesons from $ b $ hadron decays at $13\text{ Te V} $ as functions of (left) $ p_{\mathrm{T}}$ and (right) $y$. The FONLL calculations \cite{Cacciari:2015fta} are shown for comparison. 
Fig8a.pdf [17 KiB] HiDef png [263 KiB] Thumbnail [188 KiB] *.C file 

Fig8b.pdf [17 KiB] HiDef png [235 KiB] Thumbnail [175 KiB] *.C file 

Ratio of differential production crosssections between the $13\text{ Te V} $ and $7\text{ Te V} $ measurements as a function of (left) $ p_{\mathrm{T}}$ integrated over $y$, (right) $y$ integrated over $ p_{\mathrm{T}} $ for prompt $\psi {(2S)}$ production. Theoretical calculations of NRQCD \cite{Shao:2014yta} are compared to data on the left side. 
Fig9a.pdf [17 KiB] HiDef png [353 KiB] Thumbnail [207 KiB] *.C file 

Fig9b.pdf [14 KiB] HiDef png [86 KiB] Thumbnail [98 KiB] *.C file 

Ratio of differential production crosssections between the $13\text{ Te V} $ and the $7\text{ Te V} $ measurements as a function of (left) $ p_{\mathrm{T}}$ integrated over $y$, (right) $y$ integrated over $ p_{\mathrm{T}} $ for $\psi {(2S)}$ from $ b $ . Theoretical FONLL calculations \cite{Cacciari:2015fta} are compared to the measured $\psi {(2S)}$ from $ b $ ratio. 
Fig10a.pdf [17 KiB] HiDef png [231 KiB] Thumbnail [156 KiB] *.C file 

Fig10b.pdf [16 KiB] HiDef png [293 KiB] Thumbnail [183 KiB] *.C file 

Animated gif made out of all figures. 
PAPER2018049.gif Thumbnail 
Systematic uncertainties on the $\psi {(2S)}$ crosssection measurements. The uncertainty from the $t_z$ fit only affects the $\psi {(2S)} $from$b$ result. Uncertainties labelled with "$\ast$" are correlated between kinematic bins. 
Table_1.pdf [57 KiB] HiDef png [94 KiB] Thumbnail [44 KiB] tex code 

Differential production crosssections $\mathrm{d}\sigma/\mathrm{d} p_{\mathrm{T}} $ (in $\text{ nb}$ /( $ {\mathrm{Ge V /}c}$ )) of prompt $\psi {(2S)}$ and $\psi {(2S)}$ from$ b $ mesons at $13\text{ Te V} $. The first uncertainties are statistical and the second (third) are uncorrelated (correlated) systematic uncertainties amongst bins. 
Table_2.pdf [37 KiB] HiDef png [166 KiB] Thumbnail [89 KiB] tex code 

Differential production crosssections $\mathrm{d}\sigma/\mathrm{d} y$ (in $\text{ nb}$ ) of prompt $\psi {(2S)}$ and $\psi {(2S)}$ from$ b $ mesons at $13\text{ Te V} $. The first uncertainties are statistical and the second (third) are uncorrelated (correlated) systematic uncertainties amongst bins. 
Table_3.pdf [29 KiB] HiDef png [83 KiB] Thumbnail [48 KiB] tex code 

Differential crosssections $\mathrm{d}\sigma/\mathrm{d} p_{\mathrm{T}} $ (in $\text{ nb}$ /( $ {\mathrm{Ge V /}c}$ )) of prompt $\psi {(2S)}$ and $\psi {(2S)}$ from$b$ mesons at $7\text{ Te V} $, integrated over $y$ between 2.0 and 4.5. The first uncertainties are statistical and the second (third) are uncorrelated (correlated) systematic uncertainties amongst bins. 
Table_4.pdf [37 KiB] HiDef png [140 KiB] Thumbnail [78 KiB] tex code 

Differential crosssections $\mathrm{d}\sigma/\mathrm{d} y$ (in $\text{ nb}$ ) of prompt $\psi {(2S)}$ and $\psi {(2S)}$ from$b$ mesons at $7\text{ Te V} $, integrated over $ p_{\mathrm{T}}$ between 3.5 and 14 $\text{ Ge V /}c$ . The first uncertainties are statistical and the second (third) are uncorrelated (correlated) systematic uncertainties amongst bins. 
Table_5.pdf [29 KiB] HiDef png [84 KiB] Thumbnail [48 KiB] tex code 

Fractions of $\psi {(2S)}$ from$ b $ (in %) at $13\text{ Te V} $ in bins of $( p_{\mathrm{T}} ,y)$ of $\psi {(2S)}$ mesons. The uncertainties are statistical only. The systematic uncertainties are negligible. Adjacent bins with large statistical uncertainty have been merged. 
Table_6.pdf [35 KiB] HiDef png [155 KiB] Thumbnail [82 KiB] tex code 

Fractions of $\psi {(2S)}$ from$ b $ (in %) at $7\text{ Te V} $ in bins of $( p_{\mathrm{T}} ,y)$ of $\psi {(2S)}$ mesons. The uncertainties are statistical only. The systematic uncertainties are negligible. 
Table_7.pdf [36 KiB] HiDef png [129 KiB] Thumbnail [67 KiB] tex code 

Ratios of production crosssections at $13\text{ Te V} $ between $\psi {(2S)}$ mesons and $ { J \mskip 3mu/\mskip 2mu\psi \mskip 2mu}$ mesons in bins of $ p_{\mathrm{T}}$ for prompt productions and those from $ b $hadron decays. The statistical and systematic uncertainties are added in quadrature. 
Table_8.pdf [38 KiB] HiDef png [152 KiB] Thumbnail [78 KiB] tex code 

Ratios of production crosssections between $\psi {(2S)}$ mesons and $ { J \mskip 3mu/\mskip 2mu\psi \mskip 2mu}$ mesons at $13\text{ Te V} $ in bins of $y$ for prompt productions and those from $ b $hadron decays. The statistical and systematic uncertainties are added in quadrature. 
Table_9.pdf [30 KiB] HiDef png [86 KiB] Thumbnail [42 KiB] tex code 

Ratios of production crosssections between $13\text{ Te V} $ and $7\text{ Te V} $ in bins of $ p_{\mathrm{T}}$ for prompt $\psi {(2S)}$ and $\psi {(2S)}$ from$ b $ mesons. The statistical and systematic uncertainties are added in quadrature. 
Table_10.pdf [37 KiB] HiDef png [147 KiB] Thumbnail [78 KiB] tex code 

Ratios of crosssections between measurements at $13\text{ Te V} $ and $7\text{ Te V} $ in different bins of $y$ for prompt $\psi {(2S)}$ and $\psi {(2S)}$ from$ b $ mesons. The statistical and systematic uncertainties are added in quadrature. 
Table_11.pdf [29 KiB] HiDef png [95 KiB] Thumbnail [47 KiB] tex code 
Created on 20 August 2019.Citation count from INSPIRE on 20 August 2019.