Measurement of prompt and nonprompt charmonium suppression in PbPb\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\text {PbPb}$$\end{document} collisions at 5.02TeV\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\,\text {Te}\text {V}$$\end{document}

The nuclear modification factors of J/ψ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm {J}/\psi }$$\end{document} and ψ(2S)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\psi \text {(2S)}$$\end{document} mesons are measured in PbPb\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\text {PbPb}$$\end{document} collisions at a centre-of-mass energy per nucleon pair of sNN=5.02TeV\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sqrt{\smash [b]{s_{_{\text {NN}}}}} = 5.02\,\text {Te}\text {V} $$\end{document}. The analysis is based on PbPb\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\text {PbPb}$$\end{document} and pp\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathrm {p}\mathrm {p}$$\end{document} data samples collected by CMS at the LHC in 2015, corresponding to integrated luminosities of 464μb-1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\,\mu \mathrm {b}^{-1}$$\end{document} and 28pb-1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\,\text {pb}^\text {-1}$$\end{document}, respectively. The measurements are performed in the dimuon rapidity range of |y|<2.4\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$|y | < 2.4$$\end{document} as a function of centrality, rapidity, and transverse momentum (pT\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$p_{\mathrm {T}}$$\end{document} ) from pT=3\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$p_{\mathrm {T}} =3$$\end{document}GeV/c\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\,\text {Ge}\text {V}/}\text {c}$$\end{document} in the most forward region and up to 50GeV/c\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\,\text {Ge}\text {V}/}\text {c}$$\end{document}. Both prompt and nonprompt (coming from b hadron decays) J/ψ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm {J}/\psi }$$\end{document} mesons are observed to be increasingly suppressed with centrality, with a magnitude similar to the one observed at sNN=2.76TeV\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\sqrt{\smash [b]{s_{_{\text {NN}}}}} = 2.76\,\text {Te}\text {V} $$\end{document} for the two J/ψ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm {J}/\psi }$$\end{document} meson components. No dependence on rapidity is observed for either prompt or nonprompt J/ψ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm {J}/\psi }$$\end{document} mesons. An indication of a lower prompt J/ψ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm {J}/\psi }$$\end{document} meson suppression at pT>25\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$p_{\mathrm {T}} > 25$$\end{document}GeV/c\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\,\text {Ge}\text {V}/}\text {c}$$\end{document} is seen with respect to that observed at intermediate pT\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$p_{\mathrm {T}}$$\end{document}. The prompt ψ(2S)\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\psi \text {(2S)}$$\end{document} meson yield is found to be more suppressed than that of the prompt J/ψ\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$${\mathrm {J}/\psi }$$\end{document} mesons in the entire pT\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$p_{\mathrm {T}}$$\end{document} range.


Introduction
Quarkonium production in heavy ion collisions has a rich history. In their original article [1], Matsui and Satz proposed that Debye color screening of the heavy-quark potential in a hot medium prevents the production of J/ψ mesons (and this applies also to other heavy-quark bound states such as ψ(2S), and Υ (1S) mesons [2]). Consequently, the suppression of quarkonium yields in heavy ion collisions, relative to those in pp collisions, has long been considered to be a sensitive probe of deconfinement and quark-gluon plasma formation. The J/ψ meson suppression observed in PbPb collisions at the CERN SPS [3] and AuAu collisions at the BNL RHIC [4] is compatible with this picture. Similarly, the disappearance of Υ resonances in PbPb collisions at the CERN LHC [5,6] is consistent with the Debye screening scenario. e-mail: cms-publication-committee-chair@cern.ch When produced abundantly in a single heavy ion collision, uncorrelated heavy quarks may combine to form quarkonia states in the medium [7,8]. This additional source of quarkonium, commonly referred to as recombination, would enhance its production in heavy ion collisions, in contradistinction with the Debye screening scenario. Signs of this effect can be seen in the recent results from the ALICE Collaboration at the LHC [9,10], which measured a weaker J/ψ meson suppression than at RHIC [4,11], despite the higher medium energy density. Note that recombination is only expected to affect charmonium production at low transverse momenta ( p T ), typically for values smaller than the charmonium mass ( p T m ψ c), where the number of charm quarks initially produced in the collision is the largest [8].
At large p T , other mechanisms may contribute to charmonium suppression. Until recently, no quarkonium results were available at high p T , because of kinematic constraints at the SPS and too low counting rates at RHIC. At the LHC, a strong J/ψ suppression has been measured up to p T = 30 GeV/c by the CMS Collaboration [12] in PbPb collisions at a centre-ofmass energy per nucleon pair of √ s NN = 2.76 TeV. Results at 5.02 TeV have also been reported, up to p T = 10 GeV/c, by the ALICE Collaboration [10]. According to Refs. [13,14], quarkonium suppression by Debye screening may occur even at high p T . At the same time, when p T m ψ c, heavy quarkonium is likely to be produced by parton fragmentation, hence it should rather be sensitive to the parton energy loss in the quark-gluon plasma. The similarity of J/ψ meson suppression with the quenching of jets, light hadrons, and D mesons supports this picture [12,15,16].
At the LHC, the inclusive J/ψ meson yield also contains a significant nonprompt contribution coming from b hadron decays [17][18][19]. The nonprompt J/ψ component should reflect medium effects on b hadron production in heavy ion collisions, such as b quark energy loss. Measuring both prompt and nonprompt J/ψ meson production in PbPb collisions thus offers the opportunity to study both hidden charm and open beauty production in the same data sample.
In this paper we report on a new measurement of the prompt and nonprompt J/ψ and ψ(2S) nuclear modification factors (R AA ) using PbPb data, collected at the end of 2015 with the CMS experiment at √ s NN = 5.02 TeV. The analysis is performed via the dimuon decay channel. The results are compared to those obtained at 2.76 TeV [12]. The larger integrated luminosities allow for more precise and more differential measurements of R AA , as functions of centrality, rapidity (y), and p T up to 50 GeV/c.

The CMS detector
The central feature of the CMS apparatus is a superconducting solenoid of 6 m internal diameter, providing a magnetic field of 3.8 T. Within the solenoid volume are a silicon pixel and strip tracker, a lead tungstate crystal electromagnetic calorimeter, and a brass and scintillator hadron calorimeter, each composed of a barrel and two endcap sections. Forward calorimeters extend the coverage provided by the barrel and endcap detectors. Muons are measured in the pseudorapidity range |η| < 2.4 in gas-ionisation detectors embedded in the steel flux-return yoke outside the solenoid, with detection planes made using three technologies: drift tubes, cathode strip chambers, and resistive-plate chambers. The hadron forward (HF) calorimeters use steel as an absorber and quartz fibres as the sensitive material. The two HF calorimeters are located 11.2 m from the interaction region, one on each side, and together they provide coverage in the range 2.9 < |η| < 5.2. They also serve as luminosity monitors. Two beam pick-up timing detectors are located at 175 m on both sides of the interaction point, and provide information about the timing structure of the LHC beam. Events of interest are selected using a two-tiered trigger system [20]. The first level (L1), composed of custom hardware processors, uses information from the calorimeters and muon detectors to select events. The second level, known as the high-level trigger (HLT), consists of a farm of processors running a version of the full event reconstruction software optimised for fast processing. A more detailed description of the CMS detector, together with a definition of the coordinate system used and the relevant kinematic variables, can be found in Ref. [21].
For pp data the vertices are reconstructed with a deterministic annealing vertex fitting algorithm using all of the fully reconstructed tracks [22]. The physics objects used to determine the primary vertex are defined based on a jet finding algorithm [23,24] applied to all charged tracks associated with the vertex, plus the corresponding associated missing transverse momentum. The reconstructed vertex with the largest value of summed physics object p 2 T is taken to be the primary pp interaction vertex. In the case of PbPb data, a single primary vertex is reconstructed using a gap clustering algorithm [22], using pixel tracks only.

Event selection
Hadronic collisions are selected offline using information from the HF calorimeters. In order to select PbPb collisions, at least three towers with energy deposits above 3 GeV are required in each of the HF calorimeters, both at forward and backward rapidities. A primary vertex reconstructed with at least two tracks is also required. In addition, a filter on the compatibility of the silicon pixel cluster width and the vertex position is applied [25]. The combined efficiency for this event selection, including the remaining non-hadronic contamination, is (99 ± 2)%. Values higher than 100% are possible, reflecting the possible presence of ultra-peripheral (i.e. non-hadronic) collisions in the selected event sample.
The PbPb sample is divided into bins of collision centrality, which is a measure of the degree of overlap of the colliding nuclei and is related to the number of participating nucleons (N part ). Centrality is defined as the percentile of the inelastic hadronic cross section corresponding to a HF energy deposit above a certain threshold [26]. The most central (highest HF energy deposit) and most peripheral (lowest HF energy deposit) centrality bins used in the analysis are 0-5% and 70-100% respectively. Variables related to the centrality, such as N part and the nuclear overlap function (T AA ) [27], are estimated using a Glauber model simulation described in Ref. [28].
The pp and PbPb data sets correspond to integrated luminosities of 28.0 pb −1 and 464 μb −1 , respectively. Both J/ψ and ψ(2S) mesons are reconstructed using their dimuon decay channel. The dimuon events were selected online by the L1 trigger system, requiring two tracks in the muon detectors with no explicit momentum threshold, in coincidence with a bunch crossing identified by beam pick-up timing detectors. No additional selection was applied by the HLT. Because of the high rate of the most central dimuon events, a prescale was applied at the HLT level during part of the PbPb data taking: as a consequence only 79% of all the dimuon events were recorded, resulting in an effective luminosity of 368 μb −1 . For peripheral events we were able to sample the entire integrated luminosity of 464 μb −1 . This was done by adding an additional requirement that events be in the centrality range of 30-100% to the dimuon trigger. The prescaled data sample is used for the results integrated over centrality and those in the centrality range 0-30%, while for the results in the 30-100% range the data sample with 464 μb −1 was used instead. The results reported in this paper are unaffected by the small number of extra collisions potentially present in the collected events: the mean of the Poisson distribution of the number of collisions per bunch crossing (pileup), averaged over the full data sample, is approximately 0.9 for the pp data and less than 0.01 for PbPb collisions.
Simulated events are used to tune the muon selection criteria and the signal fitting parameters, as well as for acceptance and efficiency studies. These samples, produced using pythia 8.212 [29], and decaying the b hadrons with evtgen 1.3.0 [30], are embedded in a realistic PbPb background event generated with hydjet 1.9 [31] and propagated through the CMS detector with Geant4 [32]. The prompt J/ψ is simulated unpolarised, a scenario in good agreement with pp measurements [33][34][35]. For nonprompt J/ψ , the polarisation is the one predicted by evtgen, roughly λ θ = 0.4. The resulting events are processed through the trigger emulation and the event reconstruction sequences. The assumptions made on the quarkonium polarisation affect the computation of the acceptance. Quantitative estimates of the possible effect evaluated for several polarisation scenarios can be found in Refs. [36,37]. While there are no measurements on quarkonium polarisations in PbPb collisions, a study in pp collisions as a function of the event activity [38] has not revealed significant changes. Therefore the effects of the J/ψ polarisation on the acceptance are not considered as systematic uncertainties.

Muon selection
The muon reconstruction algorithm starts by finding tracks in the muon detectors, which are then fitted together with tracks reconstructed in the silicon tracker. Kinematic selections are imposed to single muons so that their combined trigger, reconstruction and identification efficiency stays above 10%. These selections are: p μ T > 3.50 GeV/c for |η μ | < 1.2 and p μ T > 1.89 GeV/c for 2.1 < |η μ | < 2.4, linearly interpolated in the intermediate |η μ | region. The muons are required to match the ones selected by the dimuon trigger, and soft muon selection criteria are applied to global muons (i.e. muons reconstructed using the combined information of the tracker and muon detectors), as defined in Ref. [39]. Matching muons to tracks measured in the silicon tracker results in a relative p T resolution for muons between 1 and 2% for a typical muon in this analysis [39]. In order to remove cosmic and in-flight decay muons, the transverse and longitudinal distances of approach to the measured vertex of the muons entering in the analysis are required to be less than 0.3 and 20 cm, respectively. The probability that the two muon tracks originate from a common vertex is required to be larger than 1%, lowering the background from b and c hadron semileptonic decays.

Signal extraction
Because of the long lifetime of b hadrons compared to that of J/ψ mesons, the separation of the prompt and nonprompt J/ψ components relies on the measurement of a secondary μ + μ − vertex displaced from the primary collision vertex. The J/ψ mesons originating from the decay of b hadrons can be resolved using the pseudo-proper decay length [40] J/ψ = L xyz m J/ψ c/| p μμ |, where L xyz is the distance between the primary and dimuon vertices, m J/ψ is the Particle Data Group [41] world average value of the J/ψ meson mass (assumed for all dimuon candidates), and p μμ is the dimuon momentum. Note that due to resolution effects and background dimuons the pseudo-proper decay length can take negative values. To measure the fraction of J/ψ mesons coming from b hadron decays (the so-called nonprompt fraction), the invariant mass spectrum of μ + μ − pairs and their J/ψ distribution are fitted using a two-dimensional (2D) extended unbinned maximum-likelihood fit. In order to obtain the parameters of the different components of the 2D probability density function (PDF), the invariant mass and the J/ψ distributions are fitted sequentially prior to the final 2D fits, as explained below. These fits are performed for each p T , rapidity and centrality bin of the analysis, and separately in pp and PbPb collisions.
The sum of two Crystal Ball functions [42], with different widths but common mean and tail parameters, is used to extract the nominal yield values from the pp and PbPb invariant mass distributions. The tail parameters, as well as the ratio of widths in the PbPb case, are fixed to the values obtained from simulation. The background is described by a polynomial function of order N , where N is the lowest value that provides a good description of the data, and is determined by performing a log-likelihood ratio test between polynomials of different orders, in each analysis bin, while keeping the tail and width ratio parameters fixed. The order of the polynomial is chosen in such a way that increasing the order does not significantly improve the quality of the fit. The typical order of the polynomial is 1 for most of the analysis bins. The invariant mass signal and background parameters are obtained in an initial fit of the invariant mass distribution only and then fixed on the 2D fits of mass and J/ψ distributions, while the number of extracted J/ψ mesons and background dimuons are left as free parameters.
The prompt, nonprompt, and background components of the J/ψ distributions are parameterised using collision data and Monte Carlo (MC) simulated events, and the signal and background contributions unfolded with the s Plot technique [43]. In the context of this analysis, this technique uses the invariant mass signal and background PDFs to discriminate signal from background in the J/ψ distribution. The J/ψ per-event uncertainty distributions of signal and background, provided by the reconstruction algorithm of primary and secondary vertices, are extracted from data and used as templates. The J/ψ resolution is also obtained from the data by fitting the distribution of events with J/ψ < 0 with a combination of three Gaussian functions. The resolution varies event-by-event, so the per-event uncertainty is used as the width of the Gaussian function that describes the core. To take into account the difference on the per-event uncertainty distributions of signal and background dimuons, the resolution PDF is multiplied by the per-event uncertainty distribution of signal and background dimuons separately. All the resolution parameters are fixed in the 2D fits. The b hadron decay length is allowed to float freely in the fit, and it is initialised to the value extracted by fitting the J/ψ distribution of nonprompt J/ψ mesons from a MC sample with an exponential decay function, at generator level. The J/ψ distribution of background dimuons is obtained from fits to the data, using an empirical combination of exponential functions. The parameters of the J/ψ background distribution are also fixed in the 2D fits. Finally, the number of extracted J/ψ mesons, the number of background dimuons and the nonprompt fraction are extracted from the 2D fits. An example of a 2D fit of the invariant mass and pseudo-proper decay length for the PbPb data is shown in Fig. 1 for a representative analysis bin.

Acceptance and efficiency corrections
Correction factors are applied to all results to account for detector acceptance, trigger, reconstruction, and selection efficiencies of the μ + μ − pairs. The corrections are derived from prompt and nonprompt J/ψ meson MC samples in pp and PbPb, and are evaluated in the same bins of p T , centrality, and rapidity used in the R AA and cross section analyses. The prompt and nonprompt J/ψ meson p T distributions in bins of rapidity in MC samples are compared to those in data, and the ratios of data over MC are used to weight the MC J/ψ distributions to describe the data better. This weighting accounts for possible mis-modelling of J/ψ kinematics in MC. The acceptance in a given analysis bin is defined as the fraction of generated J/ψ mesons in that bin which decay into two muons entering the kinematic limits defined above, and reflects the geometrical coverage of the CMS detector. The value of the acceptance correction ranges from 4 to 70%, depending on the dimuon p T , both for prompt and nonprompt J/ψ mesons in pp and PbPb collisions. The efficiency in a given analysis bin is defined as the ratio of the number of reconstructed J/ψ mesons in which both muons pass the analysis selection and the number of generated J/ψ mesons in which both muons pass the analysis selection. The efficiency correction depends on the dimuon p T , rapidity and event centrality, and ranges from 20 to 75% (15 to 75%) for prompt (nonprompt) J/ψ mesons in PbPb data, and from 40 to 85% for both prompt and nonprompt J/ψ mesons in pp data. The efficiency is lower at low than at high p T , and it decreases from mid to forward rapidity; it is also lower for central than peripheral events. The individual components of the efficiency (tracking recon-  Fig. 1 Invariant mass spectrum of μ + μ − pairs (upper) and pseudoproper decay length distribution (lower) in PbPb collisions for 1.8 < |y| < 2.4, 4.5 < p T < 5.5 GeV/c, for all centralities. The result of the fit described in the text is also shown struction, standalone muon reconstruction, global muon fit, muon identification and selection, and triggering) are also measured using single muons from J/ψ meson decays in both simulated and collision data, using the tag-and-probe (T&P) technique [36,44]. The values obtained from data and simulation are seen to differ only for the muon trigger efficiency and the ratio of the data over simulated efficiencies is used as a correction factor for the efficiency. The correction factor for dimuons is at most 1.35 (1.38) for the pp (PbPb) efficiency in the 3 < p T < 4.5 GeV/c and forward rapidity bin, but the p T and rapidity integrated value of the correction is about 1.03. The other T&P efficiency components are compatible, hence only used as a cross-check, as well as to estimate systematic uncertainties.

Systematic uncertainties
The systematic uncertainties in these measurements arise from the invariant mass signal and background fitting model assumptions, the parameterisation of the J/ψ distribution, the acceptance and efficiency computation, and sample normalisation (integrated luminosity in pp data, counting of the equivalent number of minimum bias events in PbPb, and nuclear overlap function). These systematic uncertainties are derived separately for pp and PbPb results, and the total systematic uncertainty is computed as the quadratic sum of the partial terms.
The systematic uncertainty due to each component of the 2D fits is estimated from the difference between the nominal value and the result obtained with the variations of the different components mentioned below, in the extracted number of prompt and nonprompt J/ψ mesons, or nonprompt fraction separately. In the following, the typical uncertainty is given for the observable on which each source has the biggest impact.
In order to determine the uncertainty associated with the invariant mass fitting procedure, the signal and background PDFs are independently varied, in each analysis bin. For the uncertainty in the signal, the parameters that were fixed in the nominal fits are left free with a certain constraint. The constraint for each parameter is determined from fits to the data, by leaving only one of the parameters free, and it is chosen as the root mean square of the variations over the different analysis bins. A different signal shape is also used: a Crystal Ball function plus a Gaussian function, with the CB tail parameters, as well as the ratio of widths in the PbPb case, again fixed from MC. The dominant uncertainty comes from the variation of the signal shape, yielding values for the number of extracted nonprompt J/ψ mesons ranging from 0.1 to 2.9% (0.3-5.5%) in pp (PbPb) data. For the background model, the following changes are considered, while keeping the nominal signal shape. First, the log-likelihood ratio tests are done again with two variations of the threshold used to choose the order of the polynomial function in each analysis bin. Also the fitted mass range is varied. Finally, an exponential of a polynomial function is also used. The dominant uncertainty in the background model arises from the assumed shape (invariant mass range) in pp (PbPb) data. The corresponding uncertainty ranges from 0.1 to 2.1% (0.1-2.8%). The maximum difference of each of these variations, in each analysis bin and separately for the signal and the background, is taken as an independent systematic uncertainty.
For the J/ψ distribution fitting procedure, four independent variations of the different components entering in the 2D fits are considered. For the J/ψ uncertainty distribution, instead of using the distributions corresponding to signal and background, the total distribution is assumed. The contribution to the systematic uncertainty in the number of extracted nonprompt J/ψ mesons ranges from 0.3 to 2% (0.3-9.5%) in pp (PbPb) data. The J/ψ resolution obtained from prompt J/ψ meson MC is used instead of that evaluated from data. The corresponding uncertainty in the nonprompt fraction ranges from 1 to 5% (1-11%) in pp (PbPb) data. A nonprompt J/ψ meson MC template replaces the exponential decay function for the b hadron decay length. In this case, the contribution of this source to the systematic uncertainty in the nonprompt J/ψ yield ranges from 0.2 to 8% (0.2-20%) in pp (PbPb) data. A template of the J/ψ distribution of background dimuons obtained from the data is used to describe the background, instead of the empirical combination of exponential functions. This variation has an impact on the nonprompt J/ψ yield ranging from 0.1 to 1.3% (0.   The uncertainties in the acceptance and efficiency determination are evaluated with MC studies considering a broad range of p T and angular spectra compatible with the pp and PbPb data within their uncertainties. These variations yield an uncertainty about 0.2% (<1.7%) in pp (PbPb) collisions, both for prompt and nonprompt J/ψ acceptance and efficiency. The statistical uncertainty of the weighting of the MC distributions, reflecting the impact of the limited knowledge on the kinematic distribution of J/ψ mesons on the acceptance and efficiency corrections, is used as systematic uncertainty. This uncertainty is at most 6% (11%) in pp (PbPb) collisions at the largest p T but it usually ranges from 1 to 3% in both collision systems. In addition, the systematic uncertainties in the T&P correction factors, arising from the limited data sample available and from the procedure itself, are taken into account, covering all parts of the muon efficiency: inner tracking and muon reconstruction, identification, and triggering. The dominant uncertainty in the T&P correction factors arises from muon reconstruction and ranges from 2 to 10% for both collision systems.
The global uncertainty in the pp luminosity measurement is 2.3% [45]. The number of minimum bias events corresponding to our dimuon sample in PbPb (N MB ) comes from a simple event counting in the events selected by the Minimum Bias triggers, taking into account the trigger prescale. The corresponding uncertainty arises from the inefficiency of trigger and event selection, and is estimated to be 2%. Finally, the uncertainty in the T AA is estimated by varying the Glauber model parameters within their uncertainty and taking into account the uncertainty on the trigger and event selection efficiency, and ranges from 3 to 16% from the most central to the most peripheral events used in this analysis.

Results
In this section, the results obtained for nonprompt J/ψ fractions, prompt and nonprompt J/ψ cross sections for each collision system, and nuclear modification factors R AA are presented and discussed. In addition, a derivation of the ψ(2S) R AA is also presented and discussed. For all results plotted versus p T or |y|, the abscissae of the points correspond to the centre of the respective bin, and the horizontal error bars reflect the width of the bin. The lower p T thresholds in the different rapidity intervals reflect the detector acceptance. In the range 1.8 < |y| < 2.4 J/ψ are measured down to 3 GeV/c, while for the bins with |y| < 1.8 they are measured down to 6.5 GeV/c. When plotted as a function of centrality, the abscissae are the average N part values for minimum bias events within each centrality bin. The weighted average N part values (weighted for the number of binary nucleonnucleon collisions) correspond in most cases to the average N part values for minimum bias events, with the exception of the most peripheral bin (50-100%) where N part changes from 22 to 43. The centrality binning used is 0-5-10-15-20-25-30-35-40-45-50-60-70-100% for the results in |y| < 2.4, and 0-10-20-30-40-50-100% for the results differential in rapidity.

Nonprompt J/ψ meson fractions
The nonprompt J/ψ meson fraction is defined as the proportion of measured J/ψ mesons coming from b hadron decays, corrected for acceptance and efficiency. It is presented in Fig. 2 for pp and PbPb collisions, as a function of p T and rapidity, in the full |y| < 2.4 and 6.5 < p T < 50 GeV/c range. No significant rapidity dependence is observed, while there is a strong p T dependence, from about 20% at low p T to 60% at high p T , reflecting the different p T distributions

Prompt and nonprompt J/ψ meson cross sections in pp and PbPb collisions
The measurements of the prompt and nonprompt J/ψ cross sections can help to test the existing theoretical models of both quarkonium production and b hadron production. The cross sections are computed from the corrected yields, where N J/ψ is the number of prompt or nonprompt J/ψ mesons, A is the acceptance, is the efficiency, and Δp T and Δy are the p T and rapidity bin widths, respectively. To put the pp and PbPb data on a comparable scale, the corrected yields are normalised by the measured integrated luminosity for pp collisions (σ = N /L), and by the product of the number of corresponding minimum bias events and the centrality-integrated nuclear overlap value for PbPb collisions (N /(N MB T AA )). Global uncertainties (common to all measurements) arise from these normalisation factors and account for the integrated luminosity uncertainty in pp collisions (±2.3%) and the N MB and T AA uncertainty for PbPb collisions +3.4% −3.9% , respectively. The cross sections for the production of prompt and nonprompt J/ψ mesons that decay into two muons (Bσ , where B is the branching ratio of J/ψ to dimuons) are reported as a function of p T and rapidity in Fig. 3.

Prompt J/ψ meson nuclear modification factor
In order to compute the nuclear modification factor R AA in a given bin of centrality (cent.), the above-mentioned PbPb and pp normalised cross sections are divided in the following way: where the centrality fraction is the fraction of the inclusive inelastic cross section probed in the analysis bin. Global uncertainties (indicated as boxes in the plots at R AA = 1) arise from the full pp statistical and systematic uncertainties and the PbPb N MB uncertainty when binning as a function of the centrality; and from the integrated luminosity of the pp data, and the N MB and T AA uncertainties of the PbPb data, when binning as a function of rapidity or p T . In Fig. 4, the R AA of prompt J/ψ mesons as a function of rapidity, N part and p T are shown, integrating in each case over the other two non-plotted variables. The results are compared to those obtained at √ s NN = 2.76 TeV [12], and they are found to be in good overall agreement. No strong rapidity dependence of the suppression is observed. As a function of centrality, the R AA is suppressed even for the most peripheral bin (70-100%), with the suppression slowly increasing with N part . The R AA value for the most central events (0-5%) is The boxes plotted at R AA = 1 indicate the size of the global relative uncertainties measured for 6.5 < p T < 50 GeV/c and |y| < 2.4 to be 0.219 ± 0.005 (stat) ± 0.013 (syst). As a function of p T the R AA is approximately constant in the range of 5-20 GeV/c, but an indication of less suppression at higher p T is seen for the first time in quarkonia. Charged hadrons, for which the suppression is usually attributed to parton energy loss [16,46], show a similar increase in R AA at high p T for PbPb collisions at √ s NN = 5.02 TeV [27]. Double-differential studies are also performed. Figure 5 shows the p T (upper) and centrality (lower) dependence of prompt J/ψ R AA measured in the mid-and most forward rapidity intervals. A similar suppression pattern is observed for both rapidities. Figure 6 (upper) shows the dependence of R AA as a function of p T , for three centrality intervals. Although the mean level of suppression strongly depends on the sampled centrality range, the general trend of the p T dependence appears similar in all three centrality ranges, including the increase of R AA at high p T . Finally, Fig. 6 (lower) considers the rapidity interval 1.8 < |y| < 2.4, where the acceptance goes down at lower p T . The suppression is found to be similar in peripheral events at moderate (3 < p T < 6.5 GeV/c) and high (6.5 < p T < 50 GeV/c) transverse momentum ranges, but it is weaker for lower p T in the most central region. This is also reflected in the first bin of the most forward measurement in Fig. 5 (upper). A similarly reduced suppression at low p T is observed by the ALICE Collaboration, which is attributed to a regeneration contribution [9,10].
The results are presented in Fig. 7 as a function of dimuon p T and N part , in two rapidity ranges of different p T reach. In the bins where the double ratio is consistent with 0, 95% CL intervals on the prompt ψ(2S) R AA are derived using the Feldman-Cousins procedure [48]. The procedure to obtain the CL intervals is the same as in the double ratio measurement, incorporating the J/ψ R AA statistical and systematic uncertainties as a nuisance parameter. It can be observed that the ψ(2S) meson production is more suppressed than that of J/ψ mesons, in the entire measured range. The ψ(2S) meson R AA shows no clear dependence of the suppression with p T , and hints of an increasing suppression with collision centrality. These results show that the ψ(2S) mesons are more strongly affected by the medium created in PbPb collisions than the J/ψ mesons.

Nonprompt J/ψ meson nuclear modification factor
The procedure applied to derive the prompt J/ψ meson R AA is applied to the nonprompt component. In Fig. 8, the R AA of nonprompt J/ψ as a function of rapidity, centrality and p T are shown, integrating in each case over the other two nonplotted variables. The results are compared to those obtained at √ s NN = 2.76 TeV [12]. A good overall agreement is found, although no rapidity dependence is observed in the present analysis, while the suppression was slowly increasing towards forward rapidities in the lower-energy measurement. A steady increase of the suppression is observed with increasing centrality of the collision. The R AA for the most central events (0-5%) measured for 6.5 < p T < 50 GeV/c and |y| < 2.4 is 0.365 ± 0.009 (stat) ± 0.022 (syst).
As for the prompt production case, double-differential studies are also performed. Figure 9 shows the p T (upper) and centrality (lower) dependence of nonprompt J/ψ meson R AA measured in the mid-and most forward rapidity intervals. No strong rapidity dependence is observed, and a hint of a smaller suppression at low p T is seen in the 1.8 < |y| < 2.4 range. Figure 10 (upper) shows the dependence of R AA as a function of p T , for three centrality ranges. While the nonprompt J/ψ meson R AA does not seem to depend on rapidity, the data indicates a larger p T dependence in peripheral events. Finally, Fig. 10 (lower) shows, for 1.8 < |y| < 2.4, R AA as a function of N part , for two p T intervals. Hints of (GeV/c)  Fig. 9 Nuclear modification factor of J/ψ mesons from b hadrons (nonprompt J/ψ ) as a function of dimuon p T (upper) and N part (lower) and in the mid-and most forward rapidity intervals. For the results as a function of N part the most central bin corresponds to 0-10%, and the most peripheral one to 50-100%. The bars (boxes) represent statistical (systematic) point-by-point uncertainties. The boxes plotted at R AA = 1 indicate the size of the global relative uncertainties a stronger suppression are seen for p T > 6.5 GeV/c at all centralities.

Conclusions
Prompt and nonprompt J/ψ meson production has been studied in pp and PbPb collisions at √ s NN = 5.02 TeV, as a function of rapidity, transverse momentum ( p T ), and collision centrality, in different kinematic and centrality ranges. Three observables were measured: nonprompt J/ψ fractions, prompt and nonprompt J/ψ cross sections for each collision system, and nuclear modification factors R AA . The R AA results show a strong centrality dependence, with an increasing suppression for increasing centrality. For both prompt and nonprompt J/ψ mesons no significant dependence on rapidity is observed. An indication of less suppression in the lowest p T range at forward rapidity is seen for both J/ψ components. Double-differential measurements show the same trend, and also suggest a stronger p T dependence in peripheral events. An indication of less suppression of the prompt J/ψ meson at high p T is seen with respect to that observed at intermediate p T . The measurements are consistent with previous results at √ s NN = 2.76 TeV.
Combined with previous results for the double ratio (N ψ(2S) /N J/ψ ) PbPb /(N ψ(2S) /N J/ψ ) pp , the current R AA values for J/ψ mesons are used to derive the prompt ψ(2S) meson R AA in PbPb collisions at √ s NN = 5.02 TeV, as a function of p T and collision centrality, in two different rapidity ranges. The results show that the ψ(2S) is more suppressed than the J/ψ meson for all the kinematical ranges studied. No p T dependence is observed within the current uncertainties. Hints of an increase in suppression with increasing collision centrality are also observed.
Acknowledgements We congratulate our colleagues in the CERN accelerator departments for the excellent performance of the LHC and thank the technical and administrative staffs at CERN and at other CMS institutes for their contributions to the success of the CMS effort. In addition, we gratefully acknowledge the computing centres and personnel of the Worldwide LHC Computing Grid for delivering so effectively the computing infrastructure essential to our analyses. Finally, we acknowledge the enduring support for the construction and operation of the LHC and the CMS detector provided by the following funding agencies: