1 Introduction

Recent data from RHIC and the CERN LHC for mesons containing charm and beauty quarks have allowed more detailed theoretical and experimental studies [1] of the phenomenology of these heavy quarks in a deconfined quark gluon plasma (QGP) [2] at large energy densities and high temperatures [3]. Heavy quarks, whether as quarkonium states \(\mathrm{Q} \overline{\mathrm{Q}} \) (hidden heavy flavour) [4] or as mesons made of heavy-light quark–antiquark pairs \(\mathrm{Q} \overline{\mathrm{q}} \) (open heavy flavour) [5], are considered key probes of the QGP, since their short formation time allows them to probe all stages of the QGP evolution [1].

At LHC energies, the inclusive \({\mathrm{J}}/\psi \) yield contains a significant nonprompt contribution from \(\mathrm{b}\) hadron decays [6,7,8], offering the opportunity of studying both open beauty and hidden charm in the same measurement. Because of the long lifetime (\(\mathcal {O}(500)\,\upmu \mathrm{m}/c\)) of \(\mathrm{b}\) hadrons, compared to the QGP lifetime (\(\mathcal {O}(10) {fm}/c\)), the nonprompt contribution should not suffer from colour screening of the potential between the \(\mathrm{Q}\) and the \(\overline{\mathrm{Q}}\) by the surrounding light quarks and gluons, which decreases the prompt quarkonium yield [9]. Instead, the nonprompt contribution should reflect the energy loss of \(\mathrm{b}\) quarks in the medium. The importance of an unambiguous and detailed measurement of open beauty flavour is driven by the need to understand key features of the dynamics of parton interactions and hadron formation in the QGP: the colour-charge and parton-mass dependences for the in-medium interactions [5, 10,11,12,13], the relative contribution of radiative and collisional energy loss [14,15,16], and the effects of different hadron formation times [17, 18]. Another aspect of the heavy-quark phenomenology in the QGP concerns differences in the behaviour (energy loss mechanisms, amount and strength of interactions with the surrounding medium) of a \(\mathrm{Q} \overline{\mathrm{Q}} \) pair (the pre-quarkonium state) relative to that of a single heavy quark Q (the pre-meson component) [19,20,21].

Experimentally, modifications to the particle production are usually quantified by the ratio of the yield measured in heavy ion collisions to that in proton–proton (\(\mathrm{p}\mathrm{p}\)) collisions, scaled by the mean number of binary nucleon–nucleon (NN) collisions. This ratio is called the nuclear modification factor \(R_{\mathrm{AA}}\). In the absence of medium effects, one would expect \(R_{\mathrm{AA}} = 1\) for hard processes, which scale with the number of NN collisions. The \(R_{\mathrm{AA}}\) for prompt and nonprompt \({\mathrm{J}}/\psi \) have been previously measured in \(\mathrm{PbPb}\) at \(\sqrt{{s_{_{\text {NN}}}}} =2.76\) \(\,\mathrm{TeV}\) by CMS in bins of transverse momentum (\(p_{\mathrm{T}}\)), rapidity (y) and collision centrality [22]. A strong centrality-dependent suppression has been observed for \({\mathrm{J}}/\psi \) with \(p_{\mathrm{T}} > 6.5\,{\mathrm{GeV}}/{\mathrm{c}} \). The ALICE Collaboration has measured \({\mathrm{J}}/\psi \) down to \(p_{\mathrm{T}} =0\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\) in the electron channel at midrapidity (\(|{y}|<0.8\)) [23] and in the muon channel at forward rapidity (\(2.5<y<4\)) [24]. Except for the most peripheral event selection, a suppression of inclusive \({\mathrm{J}}/\psi \) meson production is observed for all collision centralities. However, the suppression is smaller than that at \(\sqrt{{s_{_{\text {NN}}}}} =0.2\) \(\,\mathrm{TeV}\)  [25], smaller at midrapidity than at forward rapidity, and, in the forward region, smaller for \(p_{\mathrm{T}} <2\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\) than for \(5<p_{\mathrm{T}} <8\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\)  [26]. All these results were interpreted as evidence that the measured prompt \({\mathrm{J}}/\psi \) yield is the result of an interplay between (a) primordial production (\({\mathrm{J}}/\psi \) produced in the initial hard-scattering of the collisions), (b) colour screening and energy loss (\({\mathrm{J}}/\psi \) destroyed or modified by interactions with the surrounding medium), and (c) recombination/regeneration mechanisms in a deconfined partonic medium, or at the time of hadronization (\({\mathrm{J}}/\psi \) created when a free charm and a free anti-charm quark come close enough to each other to form a bound state) [27,28,29].

A complement to the \(R_{\mathrm{AA}}\) measurement is the elliptic anisotropy coefficient \(v_{2}\). This is the second Fourier coefficient in the expansion of the azimuthal angle (\(\Phi \)) distribution of the \({\mathrm{J}}/\psi \) mesons, \(\mathrm{d}N/\mathrm{d}\Phi \propto 1+2v_{2} \cos [2(\Phi -\Psi _{\mathrm{PP}})]\) with respect to \(\Psi _{\mathrm{PP}}\), the azimuthal angle of the “participant plane” calculated for each event. In a noncentral heavy ion collision, the overlap region of the two colliding nuclei has a lenticular shape. The participant plane is defined by the beam direction and the direction of the shorter axis of the lenticular region. Typical sources for a nonzero elliptic anisotropy are a path length difference arising from energy loss of particles traversing the reaction zone, or different pressure gradients along the short and long axes. Both effects convert the initial spatial anisotropy into a momentum anisotropy \(v_{2} \) [30]. The effect of energy loss is usually studied using high \(p_{\mathrm{T}}\) and/or heavy particles (so-called “hard probes” of the medium), for which the parent parton is produced at an early stage of the collision. If the partons are emitted in the direction of the participant plane, they have on average a shorter in-medium path length than partons emitted orthogonally, leading to a smaller modification to their energy or, in the case of \(\mathrm{Q} \overline{\mathrm{Q}} \) and the corresponding onium state, a smaller probability of being destroyed. Pressure gradients drive in-medium interactions that can modify the direction of the partons. This effect is most important at low \(p_{\mathrm{T}}\).

The \(v_{2}\) of open charm (D mesons) and hidden charm (inclusive \({\mathrm{J}}/\psi \) mesons) was measured at the LHC by the ALICE Collaboration. The D mesons with \(2<p_{\mathrm{T}} <6\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\)  [31] were found to have a significant positive \(v_{2}\), while for \({\mathrm{J}}/\psi \) mesons with \(2<p_{\mathrm{T}} <4\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\) there was an indication of nonzero \(v_{2}\)  [32]. The precision of the results does not yet allow a determination of the origin of the observed anisotropy. One possible interpretation is that charm quarks at low \(p_{\mathrm{T}}\), despite their much larger mass than those of the usd quarks, participate in the collective expansion of the medium. A second possibility is that there is no collective motion for the charm quarks, and the observed anisotropy is acquired via quark recombination [27, 33, 34].

In this paper, the \(R_{\mathrm{AA}}\) and the \(v_{2}\) for prompt and nonprompt \({\mathrm{J}}/\psi \) mesons are presented in several event centrality intervals and several kinematic regions. The results are based on event samples collected during the 2011 \(\mathrm{PbPb}\) and 2013 \(\mathrm{p}\mathrm{p}\) LHC runs at a nucleon–nucleon centre-of-mass energy of 2.76\(\,\mathrm{TeV}\), corresponding to integrated luminosities of 152\(\,\upmu \mathrm{b}^{-1}\) and 5.4\(\,{\mathrm{pb}}^{-1}\), respectively.

2 Experimental setup and event selection

A detailed description of the CMS detector, together with a definition of the coordinate system and the relevant kinematic variables, can be found in Ref. [35]. The central feature of the CMS apparatus is a superconducting solenoid, of 6 m internal diameter and 15 m length. Within the field volume are the silicon tracker, the crystal electromagnetic calorimeter, and the brass and scintillator hadron calorimeter. The CMS apparatus also has extensive forward calorimetry, including two steel and quartz-fiber Cherenkov hadron forward (HF) calorimeters, which cover the range \(2.9<|{\eta _\text {det}}|<5.2\), where \(\eta _\text {det}\) is measured from the geometrical centre of the CMS detector. The calorimeter cells, in the \(\eta \)-\(\phi \) plane, form towers projecting radially outwards from close to the nominal interaction point. These detectors are used in the present analysis for the event selection, collision impact parameter determination, and measurement of the azimuthal angle of the participant plane.

Muons are detected in the pseudorapidity window \(|{\eta }|< 2.4\), by gas-ionization detectors made of three technologies: drift tubes, cathode strip chambers, and resistive plate chambers, embedded in the steel flux-return yoke of the solenoid. The silicon tracker is composed of pixel detectors (three barrel layers and two forward disks on either side of the detector, made of 66 million \(100\times 150\,\upmu \mathrm{m} ^2\) pixels) followed by microstrip detectors (ten barrel layers plus three inner disks and nine forward disks on either side of the detector, with strip pitch between 80 and 180\(\,\upmu \mathrm{m}\)).

The measurements reported here are based on \(\mathrm{PbPb}\) and \(\mathrm{p}\mathrm{p}\) events selected online (triggered) by a hardware-based dimuon trigger without an explicit muon momentum threshold (i.e. the actual threshold is determined by the detector acceptance and efficiency of the muon trigger). The same trigger logic was used during the pp and PbPb data taking periods.

In order to select a sample of purely inelastic hadronic PbPb (pp) collisions, the contributions from ultraperipheral collisions and noncollision beam background are removed offline, as described in Ref. [36]. Events are preselected if they contain a reconstructed primary vertex formed by at least two tracks and at least three (one in the case of pp events) HF towers on each side of the interaction point with an energy of at least 3\(\,\mathrm{GeV}\) deposited in each tower. To further suppress the beam-gas events, the distribution of hits in the pixel detector along the beam direction is required to be compatible with particles originating from the event vertex. These criteria select \((97\pm 3)\)% (>99%) of inelastic hadronic PbPb (pp) collisions with negligible contamination from non-hadronic interactions [36]. Using this efficiency it is calculated that the \(\mathrm{PbPb}\) sample corresponds to a number of minimum bias (MB) events \(N_{\mathrm{MB}}=(1.16\pm 0.04)\times 10^9\). The pp data set corresponds to an integrated luminosity of 5.4\(\,{\mathrm{pb}}^{-1}\) known to an accuracy of 3.7% from the uncertainty in the calibration based on a van der Meer scan [37]. The two data sets correspond to approximately the same number of elementary NN collisions.

Muons are reconstructed offline using tracks in the muon detectors (“standalone muons”) that are then matched to tracks in the silicon tracker, using an algorithm optimized for the heavy ion environment [38]. In addition, an iterative track reconstruction algorithm [39] is applied to the \(\mathrm{PbPb}\) data, limited to regions defined by the standalone muons. The \(\mathrm{p}\mathrm{p}\) reconstruction algorithm includes an iterative tracking step in the full silicon tracker. The final parameters of the muon trajectory are obtained from a global fit of the standalone muon with a matching track in the silicon tracker.

The centrality of heavy ion collisions, i.e. the geometrical overlap of the incoming nuclei, is correlated to the energy released in the collisions. In CMS, centrality is defined as percentiles of the distribution of the energy deposited in the HFs. Using a Glauber model calculation as described in Ref. [36], one can estimate variables related to the centrality, such as the mean number of nucleons participating in the collisions (\(N_{\text {part}}\)), the mean number of binary NN collisions (\(N_{\text {coll}}\)), and the average nuclear overlap function (\(T_{\mathrm{AA}}\)) [40]. The latter is equal to the number of NN binary collisions divided by the NN cross section and can be interpreted as the NN-equivalent integrated luminosity per heavy ion collision, at a given centrality. In the following, \(N_{\text {part}}\) will be the variable used to show the centrality dependence of the measurements, while \(T_{\mathrm{AA}}\) directly enters into the nuclear modification factor calculation. It should be noted that the PbPb hadronic cross section (\(7.65 \pm 0.42\) b), computed with this Glauber simulation, results in an integrated luminosity of \(152\pm 9\) \(\,\upmu \mathrm{b}^{-1}\), compatible within 1.2 sigma with the integrated luminosity based on the van der Meer scan, which has been evaluated to be \(166\pm 8\) \(\,\upmu \mathrm{b}^{-1}\). All the \(R_{\mathrm{AA}}\) results presented in the paper have been obtained using the \(N_{\mathrm{MB}}\) event counting that is equivalent to 152\(\,\upmu \mathrm{b}^{-1}\) expressed in terms of integrated luminosity.

Several Monte Carlo (MC) simulated event samples are used to model the signal shapes and evaluate reconstruction, trigger, and selection efficiencies. Samples of prompt and nonprompt \({\mathrm{J}}/\psi \) are generated with pythia  6.424 [41] and decayed with evtgen 1.3.0 [42], while the final-state bremsstrahlung is simulated with photos 2.0 [43]. The prompt \({\mathrm{J}}/\psi \) is simulated unpolarized, a scenario in good agreement with \(\mathrm{p}\mathrm{p}\) measurements [44,45,46]. For nonprompt \({\mathrm{J}}/\psi \), the results are reported for the polarization predicted by evtgen, roughly \(\lambda _{\theta } = -0.4\), however not a well-defined value, since in many \({\mathrm{B}}\rightarrow {\mathrm{J}}/\psi X\) modes the spin alignment is either forced by angular momentum conservation or given as input from measured values of helicity amplitudes in decays. If the acceptances were different in \(\mathrm{p}\mathrm{p}\) and \(\mathrm{PbPb}\), they would not perfectly cancel in the \(R_{\mathrm{AA}}\). This would be the case if, for instance, some physics processes (such as polarization or energy loss) would affect the measurement in \(\mathrm{PbPb}\) collisions with a strong kinematic dependence within an analysis bin. As in previous analyses [47,48,49,50], such possible physics effects are not considered as systematic uncertainties, but a quantitative estimate of this effect for two extreme polarization scenarios can be found in Ref. [22]. In the \(\mathrm{PbPb}\) case, the pythia signal events are further embedded in heavy ion events generated with hydjet  1.8 [51], at the level of detector hits and with matching vertices. The detector response was simulated with Geant4  [52], and the resulting information was processed through the full event reconstruction chain, including trigger emulation.

3 Analysis

Throughout this analysis the same methods for signal extraction and corrections are used for both the \(\mathrm{p}\mathrm{p}\) and \(\mathrm{PbPb}\) data.

3.1 Corrections

For both \(R_{\mathrm{AA}}\) and \(v_{2}\) results, correction factors are applied event-by-event to each dimuon, to account for inefficiencies in the trigger, reconstruction, and selection of the \(\mu ^{+} \mu ^{-} \) pairs. They were evaluated, using MC samples, in four dimensions (\(p_{\mathrm{T}}\), centrality, y, and \(L_{xyz}\)) for the \(\mathrm{PbPb}\) results, and in three-dimensions (\(p_{\mathrm{T}}\), y, and \(L_{xyz}\)) for the \(\mathrm{p}\mathrm{p}\) results. After checking that the efficiencies on the prompt and nonprompt \({\mathrm{J}}/\psi \) MC samples near \(L_{xyz}=0\) are in agreement, two efficiency calculations are made. One calculation is made on the prompt \({\mathrm{J}}/\psi \) MC sample, as a function of \(p_{\mathrm{T}}\), in 10 rapidity intervals between \(y=-2.4\) and \(y=2.4\), and 4 centrality bins (0–10%, 10–20%, 20–40%, and 40–100%). For each y and centrality interval, the \(p_{\mathrm{T}}\) dependence of the efficiency is smoothed by fitting it with a Gaussian error function. A second efficiency is calculated using the nonprompt \({\mathrm{J}}/\psi \) MC sample, as a function of \(L_{xyz}\), in the same y binning, but for coarser \(p_{\mathrm{T}}\) bins and for centrality 0–100%. This is done in two steps. The efficiency is first calculated as a function of \(L_{xyz}^{\text {true}}\), and then converted into an efficiency versus measured \(L_{xyz}\), using a 2D dispersion map of \(L_{xyz}^{\text {true}}\) vs. \(L_{xyz}\). In the end, each dimuon candidate selected in data, with transverse momentum \(p_{\mathrm{T}}\), rapidity y, centrality c, and \(L_{xyz}=d\) (mm), is assigned an efficiency weight equal to

$$\begin{aligned} w= & {} \text {efficiency}^{\text {prompt} {\mathrm{J}}/\psi }(p_{\mathrm{T}},y,c,L_{xyz}=0)\nonumber \\&\times \frac{\text {efficiency}^{\text {nonprompt}\,{\mathrm{J}}/\psi }(p_{\mathrm{T}},y,L_{xyz}=d)}{\text {efficiency}^{\text {nonprompt}\,{\mathrm{J}}/\psi }(p_{\mathrm{T}},y,L_{xyz}=0)}. \end{aligned}$$
(1)

The individual components of the MC efficiency (tracking reconstruction, standalone muon reconstruction, global muon fit, muon identification and selection, triggering) are cross-checked using single muons from \({\mathrm{J}}/\psi \) decays in simulated and collision data, with the tag-and-probe technique (T&P)  [53]. For all but the tracking reconstruction, scaling factors (calculated as the ratios between the data and MC T&P obtained efficiencies), estimated as a function of the muon \(p_{\mathrm{T}}\) in several muon pseudorapidity regions, are used to scale the dimuon MC-calculated efficiencies. They are applied event-by-event, as a weight, to each muon that passes all analysis selections and enter the mass and \(\ell _{{\mathrm{J}}/\psi }\) distributions. The weights are similar for the \(\mathrm{p}\mathrm{p}\) and \(\mathrm{PbPb}\) samples, and range from 1.02 to 0.6 for single muons with \(p_{\mathrm{T}} >4-5\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\) and \(p_{\mathrm{T}} <3.5\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\), respectively. For the tracking efficiency, which is above 99% even in the case of PbPb events, the full difference between data and MC T&P results (integrated over all the kinematic region probed) is propagated as a global (common to all points) systematic uncertainty.

3.2 Signal extraction

The single-muon acceptance and identification criteria are the same as in Ref. [22]. Opposite-charge muon pairs, with invariant mass between 2.6 and 3.5\({\,\text {GeV/}c^{2}}\), are fitted with a common vertex constraint and are kept if the fit \(\chi ^2\) probability is larger than 1%. Results are presented in up to six bins of absolute \({\mathrm{J}}/\psi \) meson rapidity (equally spaced between 0 and 2.4) integrated over \(p_{\mathrm{T}}\) (6.5 \(<\) \(p_{\mathrm{T}}\) \(<\) 30 GeV/c), up to six bins in \(p_{\mathrm{T}}\) ([6.5, 8.5], [8.5, 9.5], [9.5, 11], [11, 13], [13, 16], [16, 30] \(\,{\mathrm{GeV}}/{\mathrm{c}}\)) integrated over rapidity (\(|{y}|<2.4\)), and up to three additional low-\(p_{\mathrm{T}}\) bins ([3, 4.5], [4.5, 5.5], [5.5, 6.5]\(\,{\mathrm{GeV}}/{\mathrm{c}}\)) at forward rapidity (\(1.6<|{y}|<2.4\)). The lower \(p_{\mathrm{T}}\) limit for which the results are reported is imposed by the detector acceptance, the muon reconstruction algorithm, and the selection criteria used in the analysis. The \(\mathrm{PbPb}\) sample is split in bins of collision centrality, defined using fractions of the inelastic hadronic cross section where 0% denotes the most central collisions. This fraction is determined from the HF energy distribution [54]. The most central (highest HF energy deposit) and most peripheral (lowest HF energy deposit) centrality bins used in the analysis are 0–5% and 60–100%, and 0–10% and 50–100%, for prompt and nonprompt \({\mathrm{J}}/\psi \) results, respectively. The rest of the centrality bins are in increments of 5% up to 50% for the high \(p_{\mathrm{T}}\) prompt \({\mathrm{J}}/\psi \) results integrated over y, and in increments of 10% for all other cases. The \(N_{\text {part}}\) values, computed for events with a flat centrality distribution, range from \(381\pm 2\) in the 0–5% bin to \(14\pm 2\) in the 60–100% bin. If the events would be distributed according to the number of NN collisions, \(N_{\text {coll}}\), which is expected for initially produced hard probes, the average \(N_{\text {part}}\) would become 25 instead of 14 for the most peripheral bin, and 41 instead of 22 in the case of the 50–100% bin. For the other finer bins, the difference is negligible (less than 3%).

The same method for signal extraction is used in both the \(v_{2}\) and the \(R_{\mathrm{AA}}\) analyses, for both the \(\mathrm{PbPb}\) and \(\mathrm{p}\mathrm{p}\) samples. The separation of prompt \({\mathrm{J}}/\psi \) mesons from those coming from \(\mathrm{b}\) hadron decays relies on the measurement of a secondary \(\mu ^{+} \mu ^{-} \) vertex displaced from the primary collision vertex. The displacement \(\vec {r}\) between the \(\mu ^{+} \mu ^{-} \) vertex and the primary vertex is measured first. Then, the most probable decay length of \(\mathrm{b}\) hadron in the laboratory frame [55] is calculated as

$$\begin{aligned} L_{xyz} = \frac{\hat{u}^TS^{-1}\vec {r}}{\hat{u}^TS^{-1}\hat{u}}, \end{aligned}$$
(2)

where \(\hat{u}\) is the unit vector in the direction of the \({\mathrm{J}}/\psi \) meson momentum (\(\vec {p}\)) and S is the sum of the primary and secondary vertex covariance matrices. From this quantity, the pseudo-proper decay length \(\ell _{{\mathrm{J}}/\psi } = L_{xyz}\, m_{{\mathrm{J}}/\psi }/p\) (which is the decay length of the \({\mathrm{J}}/\psi \) meson) is computed as an estimate of the \(\mathrm{b}\) hadron decay length.

To measure the fraction of the \({\mathrm{J}}/\psi \) mesons coming from b hadron decays (the so-called b fraction), the invariant-mass spectrum of \(\mu ^{+} \mu ^{-} \) pairs and their \(\ell _{{\mathrm{J}}/\psi }\) distribution are fitted sequentially in an extended unbinned maximum likelihood fit. The fits are performed for each \(p_{\mathrm{T}}\), \(|{y}|\), and centrality bin of the analysis, and in addition in the case of the \(\mathrm{PbPb}\) \(v_{2}\) analysis, in four bins in \(|{\Delta \Phi }| = |{\phi -\Psi _2}|\), equally spaced between 0 and \(\pi /2\). The second-order “event plane” angle \(\Psi _2\), measured as explained below, corresponds to the event-by-event azimuthal angle of maximum particle density. It is an approximation of the participant plane angle \(\Psi _{\mathrm{PP}}\), which is not directly observable.

The fitting procedure is similar to the one used in earlier analyses of pp collisions at \(\sqrt{s}\) = 7\(\,\mathrm{TeV}\)  [56], and PbPb collisions at \(\sqrt{{s_{_{\text {NN}}}}}\) = 2.76\(\,\mathrm{TeV}\)  [22]. The \({\mathrm{J}}/\psi \) meson mass distribution is modelled by the sum of a Gaussian function and a Crystal Ball (CB) function [57], with a common mean \(m_0\) and independent widths. The CB radiative tail parameters are fixed to the values obtained in fits to simulated distributions for different kinematic regions [50]. The invariant mass background probability density function (PDF) is an exponential function whose parameters are allowed to float in each fit. Since the mass resolution depends on y and \(p_{\mathrm{T}}\), all resolution-related parameters are left free when binning as a function of \(|{y}|\) or \(p_{\mathrm{T}}\). In the case of centrality binning, the width of the CB function is left free, while the rest of the parameters are fixed to the centrality-integrated results, 0–100%, for a given \(p_{\mathrm{T}}\) and \(|{y}|\) bin. When binning in \(|{\Delta \Phi }|\), all signal parameters are fixed to their values in the \(|{\Delta \Phi }|\)-integrated fit.

The \(\ell _{{\mathrm{J}}/\psi }\) distribution is modeled by a prompt signal component represented by a resolution function, a nonprompt component given by an exponential function convoluted with the resolution function, and the continuum background component represented by the sum of the resolution function plus three exponential decay functions to take into account long-lived background components [56]. The resolution function is comprised of the sum of two Gaussian functions, which depend upon the per-event uncertainty of the measured \(\ell _{{\mathrm{J}}/\psi }\), determined from the covariance matrices of the primary and secondary vertex fits. The fit parameters of the \(\ell _{{\mathrm{J}}/\psi }\) distribution were determined through a series of fits. Pseudo-proper decay length background function parameters are fixed using dimuon events in data located on each side of the \({\mathrm{J}}/\psi \) resonance peak. In all cases, the b fraction is a free fit parameter. An example of 2D fits is given in Fig. 1.

Fig. 1
figure 1

Invariant mass spectra (top) and pseudo-proper decay length distribution (bottom) of \(\mu ^{+} \mu ^{-} \) pairs in centrality 0–100% and integrated over the rapidity range \(|{y}|<2.4\) and the \(p_{\mathrm{T}}\) range \(6.5<p_{\mathrm{T}} <30\,{\mathrm{GeV}}/{\mathrm{c}} \). The error bars on each point represent statistical uncertainties. The projections of the two-dimensional fit onto the respective axes are overlaid as solid black lines. The dashed green and red lines show the fitted contribution of prompt and nonprompt \({\mathrm{J}}/\psi \). The fitted background contributions are shown as dotted blue lines

Fig. 2
figure 2

The \(|{\Delta \Phi }|\) distribution of high \(p_{\mathrm{T}}\) prompt \({\mathrm{J}}/\psi \) mesons, \(6.5<p_{\mathrm{T}} <30\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\), measured in the rapidity range \(|{y}|<2.4\) and event centrality 10–60%, normalized by the bin width and the sum of the prompt yields in all four \(\Delta \Phi \) bins. The dashed line represents the function \(1+2v_{2} ^{\text {obs}} \cos (|{2\Delta \varPhi }|)\) used to extract the \(v_{2} ^{\text {obs}}\). The event-averaged resolution correction factor, corresponding to this event centrality, is also listed, together with the calculated final \(v_{2}\) for this kinematic bin. The systematic uncertainty listed in the legend includes the 2.7% global uncertainty from the event plane measurement

The \(v_{2}\) analysis follows closely the event plane method described in Ref. [58]. The \({\mathrm{J}}/\psi \) mesons reconstructed with \(y>0\) (\(y<0\)) are correlated with the event plane \(\Psi _2\) found using energy deposited in a region of the HF spanning \(-5< \eta < -3\) (\(3< \eta < 5\)). This is chosen to introduce a rapidity gap between the particles used in the event plane determination and the \({\mathrm{J}}/\psi \) meson, in order to reduce the effect of other correlations that might exist, such as those from dijet production. To account for nonuniformities in the detector acceptance that can lead to artificial asymmetries in the event plane angle distribution and thereby affect the deduced \(v_{2}\) values, a Fourier analysis “flattening” procedure [59] is used, where each calculated event plane angle is shifted slightly to recover a uniform azimuthal distribution, as described in Ref. [58]. The event plane has a resolution that depends on centrality, and is caused by the finite number of particles used in its determination.

The corrections applied event-by-event ensure that the prompt and nonprompt yields extracted from fitting the invariant mass and \(\ell _{{\mathrm{J}}/\psi }\) distributions account for reconstruction and selection inefficiencies. As such, after extracting the yields in each \(|{y}|\), \(p_{\mathrm{T}}\), centrality (and \(|{\Delta \Phi }|\)) bin, the \(v_{2}\) and \(R_{\mathrm{AA}}\) can be calculated directly. The \(R_{\mathrm{AA}}\) is defined by

$$\begin{aligned} R_{\mathrm{AA}} = \frac{N_{\text {PbPb}}^{{\mathrm{J}}/\psi }}{(T_{\mathrm{AA}} \, \sigma _{\text {pp}}^{{\mathrm{J}}/\psi })}, \end{aligned}$$
(3)

where \(N_{\text {PbPb}}^{{\mathrm{J}}/\psi }\) is the number of prompt or nonprompt \({\mathrm{J}}/\psi \) mesons produced per \(\mathrm{PbPb}\) collision, \(\sigma _{\text {pp}}^{{\mathrm{J}}/\psi }\) is the corresponding pp cross section, and \(T_{\mathrm{AA}}\) is the nuclear overlap function.

The \(v_{2}\) is calculated by fitting the \([1/N_{\text {total}}^{{\mathrm{J}}/\psi }][\mathrm{d}N^{{\mathrm{J}}/\psi }/\mathrm{d}|{\Delta \Phi }|]\) distributions with the function \(1+2v_{2} ^{\text {obs}} \cos (|{2\Delta \Phi }|)\), where the \(N_{\text {total}}^{{\mathrm{J}}/\psi }\) is the prompt or nonprompt \({\mathrm{J}}/\psi \) yield integrated over azimuth for each kinematic bin. An example of such a fit is shown in Fig. 2. The final \(v_{2}\) coefficient in the event plane method is evaluated by dividing the observed value \(v_2^{\text {obs}}\) by an event-averaged resolution-correction R, i.e. \(v_2=v_2^{\text {obs}}/R\), as described in Ref. [60]. The factor R, calculated experimentally as described in Ref. [58], can range from 0 to 1, with a better resolution corresponding to a larger value of R. No difference is observed when determining R using the dimuon-triggered events analysed here, compared to the values used in Ref. [58] for the analysis of charged hadrons. For this paper, the \(v_{2}\) analysis is restricted to the centrality interval 10–60% to ensure a nonsymmetric overlap region in the colliding nuclei, while maintaining a good event plane resolution (\(R \gtrsim 0.8\) in the event centrality ranges in which results are reported: 10–20%, 20–30%, and 30–60%).

3.3 Estimation of uncertainties

Several sources of systematic uncertainties are considered for both \(R_{\mathrm{AA}}\) and \(v_{2}\) analyses. They are mostly common, thus calculated and propagated in a similar way.

The systematic uncertainties in the signal extraction method (fitting) are evaluated by varying the analytical form of each component of the PDF hypotheses. For the invariant mass PDF, as an alternative signal shape, a sum of two Gaussian functions is used, with shared mean and both widths as free parameters in the fit. For the same PDF, the uncertainty in the background shape is evaluated using a first order Chebychev polynomial. For the differential centrality bins, with the invariant mass signal PDF parameters fixed to the 0–100% bin, an uncertainty is calculated by performing fits in which the constrained parameters are allowed to vary with a Gaussian PDF. The mean of the constraining Gaussian function and the initial value of the constrained parameters come from the fitting in the 0–100% bin with no fixed parameters. The uncertainties of the parameters in the 0–100% bin is used as a width of the constraining Gaussian. For the lifetime PDF components, the settings that could potentially affect the b fraction are changed. The \(\ell _{{\mathrm{J}}/\psi }\) shape of the nonprompt \({\mathrm{J}}/\psi \) is taken directly from the reconstructed one in simulation and converted to a PDF. Tails of this PDF, where the MC statistics are insufficient, are mirrored from neighboring points, weighted with the corresponding efficiency. The sum in quadrature of all yield variations with respect to the nominal fit is propagated in the calculation of the systematic uncertainty in the final results. The variations across all \(R_{\mathrm{AA}}\) (\(v_{2}\)) analysis bins are between 0.7 and 16% (2.6 and 38%) for prompt \({\mathrm{J}}/\psi \), and 1.4 and 19% (20 and 81%) for nonprompt \({\mathrm{J}}/\psi \). They increase from mid to forward rapidity, from high- to low-\(p_{\mathrm{T}}\), and for \(\mathrm{PbPb}\) results also from central to peripheral bins.

Three independent uncertainties are assigned for the dimuon efficiency corrections. One addresses the uncertainty on the parametrization of the efficiency vs. \(p_{\mathrm{T}}\), y, and centrality. For the \(R_{\mathrm{AA}}\) results, it is estimated, in each signal y and centrality bin, by randomly moving 100 times, each individual efficiency versus \(p_{\mathrm{T}}\) point within its statistical uncertainty, re-fitting with the Gaussian error function, and recalculating each time a corrected MC signal yield. For the \(v_{2}\) results, this procedure is not practical: it requires re-weighting and re-fitting many times the full data sample. So in this case, the uncertainty is estimated by changing two settings in the nominal efficiency, and re-fitting data only once, with the modified efficiency: (a) using binned efficiency instead of fits, and (b) using only the nonprompt \({\mathrm{J}}/\psi \) MC sample, integrated over all event centralities. The relative uncertainties for this source, propagated into the final results, are calculated for \(R_{\mathrm{AA}}\) as the root-mean-square of the 100 yield variations with respect to the yield obtained with the nominal efficiency parametrization, and for the \(v_{2}\) analysis as the full difference between the nominal and the modified-efficiency results. Across all \(R_{\mathrm{AA}}\) (\(v_{2}\)) analysis bins, the values are between 0.6 and 20% (1.5 and 54%) for prompt \({\mathrm{J}}/\psi \), and 0.7 and 24% (6.1 and 50%) for nonprompt \({\mathrm{J}}/\psi \) results. These uncertainties increase from high to low \(p_{\mathrm{T}}\), and from mid to forward rapidity but do not have a strong centrality dependence.

A second uncertainty addresses the accuracy of the efficiency vs. \(L_{xyz}\) calculation, and is estimated by changing the \(L_{xyz}\) resolution. It is done in several steps: (a) the binning in the \(L_{xyz}^{\text {true}}\) vs. \(L_{xyz}\) maps is changed; (b) the dimuon efficiency weights are recalculated; c) the data is reweighed and refitted to extract the signal yields. The variations across all \(R_{\mathrm{AA}}\) (\(v_{2}\)) analysis bins are between 0.025 and 3.7% (0.1 and 16%) for prompt \({\mathrm{J}}/\psi \), and 0.1 and 13% (29 and 32%) for nonprompt \({\mathrm{J}}/\psi \) results. In the case of the prompt \({\mathrm{J}}/\psi \), the variations are small and rather constant across all bins, around 2-3%, with the 16% variation being reached only in the lowest-\(p_{\mathrm{T}}\) bin in the \(v_{2}\) analysis. For nonprompt \({\mathrm{J}}/\psi \) the variations increase from mid to forward rapidity, and for \(\mathrm{PbPb}\) also from peripheral to central bins.

Finally, a third class of uncertainty arises from the scaling factors. For the \(v_{2}\) analysis, the full difference between results with and without T&P corrections is propagated to the final systematic uncertainty. It varies between 0.4 and 7.4% for prompt \({\mathrm{J}}/\psi \), and 5.4 and 8.8% for nonprompt \({\mathrm{J}}/\psi \) results. For the \(R_{\mathrm{AA}}\) analysis, this uncertainty comprises two contributions. A parametrization uncertainty was estimated by randomly moving each of the data T&P efficiency points within their statistical uncertainty, recalculating each time the scaling factors and the dimuon efficiencies in all the analysis bins, and propagating the root-mean-square of all variations to the total T&P uncertainty. In addition, a systematic uncertainty was estimated by changing different settings of the T&P method. The contributions are similar for the prompt and nonprompt \({\mathrm{J}}/\psi \) results, and vary between 1.4 and 13% across all bins, for the combined trigger, identification, and reconstruction efficiencies, with the largest uncertainties in the forward and low \(p_{\mathrm{T}}\) regions. On top of these bin-by-bin T&P uncertainties, an uncertainty in the tracking reconstruction efficiency, 0.3 and 0.6% for each muon track, for \(\mathrm{p}\mathrm{p}\) and \(\mathrm{PbPb}\), respectively, is doubled for dimuon candidates, and considered as a global uncertainty in the final results.

There is one additional source of uncertainty that is particular to each analysis. For the \(R_{\mathrm{AA}}\) results, it is the \(T_{\mathrm{AA}}\) uncertainty, which varies between 16 and 4.1% from most peripheral (70–100%) to most central (0–5%) events, and it has a value of 5.6% for the 0–100% case, estimated as described in Ref. [36]. For the \(v_{2}\) analysis, uncertainties are assigned for the event plane measurement. A systematic uncertainty is associated with the event plane flattening procedure and the resolution correction determination (±1% [60]), and another with the sensitivity of the measured \(v_{2}\) values to the size of the minimum \(\eta \) gap (2.5%, following Ref. [60]). The two uncertainties are added quadratically to a total of 2.7% global uncertainty in the \(v_{2}\) measurement.

The total systematic uncertainty in the \(R_{\mathrm{AA}}\) is estimated by summing in quadrature the uncertainties from the signal extraction and efficiency weighting. The range of the final uncertainties on prompt and nonprompt \({\mathrm{J}}/\psi \) \(R_{\mathrm{AA}}\) is between 2.1 and 22%, and 2.8 and 28%, respectively, across bins of the analysis. The uncertainty in the integrated luminosity of the \(\mathrm{p}\mathrm{p}\) data (3.7%), \(N_{\mathrm{MB}}\) events in \(\mathrm{PbPb}\) data (3%), and tracking efficiency (0.6% for pp and 1.2% for \(\mathrm{PbPb}\) data) are considered as global uncertainties.

The total systematic uncertainty for \(v_{2}\) is estimated by summing in quadrature the contributions from the yield extraction and efficiency corrections. The range of the final uncertainties on prompt and nonprompt \({\mathrm{J}}/\psi \) \(v_{2}\) results is between 10 and 57%, and 37 and 100%, respectively.

3.4 Displaying uncertainties

In all the results shown, statistical uncertainties are represented by error bars, and systematic uncertainties by boxes centered on the points. For the \(v_{2}\) results, the global uncertainty from the event plane measurement is not included in the point-by-point uncertainties. Boxes plotted at \(R_{\mathrm{AA}} =1\) represent the scale of the global uncertainties. For \(R_{\mathrm{AA}}\) results plotted as a function of \(p_{\mathrm{T}}\) or \(|{y}|\), the statistical and systematic uncertainties include the statistical and systematic components from both \(\mathrm{PbPb}\) and \(\mathrm{p}\mathrm{p}\) samples, added in quadrature. For these types of results, the systematic uncertainty on \(T_{\mathrm{AA}}\), the \(\mathrm{p}\mathrm{p}\) sample integrated luminosity uncertainty, the uncertainty in the \(N_{\mathrm{MB}}\) of \(\mathrm{PbPb}\) events, and the tracking efficiency are added in quadrature and shown as a global uncertainty.

For \(R_{\mathrm{AA}}\) results shown as a function of \(N_{\text {part}}\), the uncertainties on \(T_{\mathrm{AA}}\) are included in the systematic uncertainty, point-by-point. The global uncertainty plotted at \(R_{\mathrm{AA}} =1\) as a grey box includes in this case the statistical and systematic uncertainties from the \(\mathrm{p}\mathrm{p}\) measurement, the integrated luminosity uncertainty for the \(\mathrm{p}\mathrm{p}\) data, the uncertainty in the \(N_{\mathrm{MB}}\) of \(\mathrm{PbPb}\) events, and the tracking efficiency uncertainty, added in quadrature. When showing \(R_{\mathrm{AA}}\) vs. \(N_{\text {part}}\) separately for different \(p_{\mathrm{T}}\) or \(|{y}|\) intervals, the statistical and systematic uncertainties from the \(\mathrm{p}\mathrm{p}\) measurement are added together in quadrature and plotted as a coloured box at \(R_{\mathrm{AA}} =1\). In addition, a second global uncertainty, that is common for all the \(p_{\mathrm{T}}\) and \(|{y}|\) bins, is calculated as the quadratic sum of the integrated luminosity uncertainty for pp data, the uncertainty in \(N_{\mathrm{MB}}\) of \(\mathrm{PbPb}\) events, and the tracking efficiency uncertainty, and is plotted as an empty box at \(R_{\mathrm{AA}} =1\).

4 Results

For all results plotted versus \(p_{\mathrm{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. When plotted as a function of centrality, the abscissae are average \(N_{\text {part}}\) values corresponding to events flatly distributed across centrality. For the \(R_{\mathrm{AA}}\) results, the numerical values of the numerator and denominator of Eq. (3) are available in tabulated form in Appendix A.

4.1 Prompt \({\mathrm{J}}/\psi \)

The measured prompt \({\mathrm{J}}/\psi \) \(v_{2}\), for 10–60% event centrality and integrated over \(6.5<p_{\mathrm{T}} <30\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\) and \(|{y}|<2.4\), is \(0.066 \pm 0.014\,\text {(stat)} \pm 0.014\,\text {(syst)} \pm 0.002\,(\text {global})\). The significance corresponding to a deviation from a \(v_{2} =0\) value is 3.3 sigma. Figure 3 shows the dependence of \(v_{2}\) on centrality, \(|{y}|\), and \(p_{\mathrm{T}}\). For each of these results, the dependence on one variable is studied by integrating over the other two. A nonzero \(v_{2}\) value is measured in all the kinematic bins studied. The observed anisotropy shows no strong centrality, rapidity, or \(p_{\mathrm{T}}\) dependence.

Fig. 3
figure 3

Prompt \({\mathrm{J}}/\psi \) \(v_{2}\) as a function of centrality (top), rapidity (middle), and \(p_{\mathrm{T}}\) (bottom). The bars (boxes) represent statistical (systematic) point-by-point uncertainties. The global uncertainty, listed in the legend, is not included in the point-by-point uncertainties. Horizontal bars indicate the bin width. The average \(N_{\text {part}}\) values correspond to events flatly distributed across centrality

Fig. 4
figure 4

Prompt \({\mathrm{J}}/\psi \) \(R_{\mathrm{AA}}\) as a function of centrality (top), rapidity (middle), and \(p_{\mathrm{T}}\) (bottom). The bars (boxes) represent statistical (systematic) point-by-point uncertainties. The gray boxes plotted on the right side at \(R_{\mathrm{AA}} =1\) represent the scale of the global uncertainties. The average \(N_{\text {part}}\) values correspond to events flatly distributed across centrality

In Fig. 4, the \(R_{\mathrm{AA}}\) of prompt \({\mathrm{J}}/\psi \) as a function of centrality, \(|{y}|\), and \(p_{\mathrm{T}}\) are shown, integrating in each case over the other two variables. The \(R_{\mathrm{AA}}\) is suppressed even for the most peripheral bin (60–100%), with the suppression slowly increasing with \(N_{\text {part}}\). The \(R_{\mathrm{AA}}\) for the most central events (0–5%) is measured for \(6.5<p_{\mathrm{T}} <30\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\) and \(|{y}|<2.4\) to be \(0.282 \pm 0.010\,\text {(stat)} \pm 0.023\,\text {(syst)} \). No strong rapidity or \(p_{\mathrm{T}}\) dependence of the suppression is observed.

Fig. 5
figure 5

Top Prompt \({\mathrm{J}}/\psi \) \(R_{\mathrm{AA}}\) as a function of centrality at high \(p_{\mathrm{T}}\), \(6.5<p_{\mathrm{T}} <30\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\), for three different \(|{y}|\) regions. The high-\(p_{\mathrm{T}}\) mid- and forward-rapidity points are shifted horizontally by \(\Delta N_{\text {part}} =2\) for better visibility. Bottom Prompt \({\mathrm{J}}/\psi \) \(R_{\mathrm{AA}}\) as a function of centrality, at forward rapidity, \(1.6<|{y}|<2.4\), for two different \(p_{\mathrm{T}}\) regions. The bars (boxes) represent statistical (systematic) point-by-point uncertainties. The boxes plotted on the right side at \(R_{\mathrm{AA}} =1\) represent the scale of the global uncertainties: the coloured boxes show the statistical and systematic uncertainties from \(\mathrm{p}\mathrm{p}\) measurement, and the open box shows the global uncertainties common to all data points. The average \(N_{\text {part}}\) values correspond to events flatly distributed across centrality

Two double-differential studies are also made, in which a simultaneous binning in centrality and \(|{y}|\), or in centrality and \(p_{\mathrm{T}}\) is done. Figure 5 (top) shows the centrality dependence of high \(p_{\mathrm{T}}\) (\(6.5<p_{\mathrm{T}} <30\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\)) prompt \({\mathrm{J}}/\psi \) \(R_{\mathrm{AA}}\) measured in three \(|{y}|\) intervals. A similar suppression pattern is observed for all rapidities. Figure 5 (bottom) shows, for \(1.6<|{y}|<2.4\), the \(p_{\mathrm{T}}\) dependence of \(R_{\mathrm{AA}}\) vs. \(N_{\text {part}}\). The suppression at low \(p_{\mathrm{T}}\) (\(3<p_{\mathrm{T}} <6.5\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\)) is consistent with that at high \(p_{\mathrm{T}}\) (\(6.5<p_{\mathrm{T}} <30\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\)).

4.2 Nonprompt \({\mathrm{J}}/\psi \)

Figure 6 shows the nonprompt \({\mathrm{J}}/\psi \) \(v_{2}\) vs. \(p_{\mathrm{T}}\) for 10–60% event centrality, in two kinematic regions: \(6.5<p_{\mathrm{T}} <30\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\) and \(|{y}|<2.4\), and \(3<p_{\mathrm{T}} <6.5\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\) and \(1.6<|{y}|<2.4\). The measured \(v_{2}\) for the high-(low-) \(p_{\mathrm{T}}\) is \(0.032 \pm 0.027 \,\text {(stat)} \pm 0.032 \,\text {(syst)} \pm 0.001 \,(\text {global})\) (\(0.096 \pm 0.073 \,\text {(stat)} \pm 0.035 \,\text {(syst)} \pm 0.003 \,(\text {global})\)). This is obtained from the fit to the \(|\Delta \Phi |\) distribution (as described in Sect. 3.2) with a \(\chi ^2\) probability of 22(20)%. Fitting the same distribution with a constant (corresponding to the \(v_{2} =0\) case) the \(\chi ^2\) probability is 11(8)%. Both measurements are consistent with each other and with a \(v_{2}\) value of zero, though both nominal values are positive.

Fig. 6
figure 6

Nonprompt \({\mathrm{J}}/\psi \) \(v_{2}\) as a function of \(p_{\mathrm{T}}\). The bars (boxes) represent statistical (systematic) point-by-point uncertainties. The global uncertainty, listed in the legend, is not included in the point-by-point uncertainties. Horizontal bars indicate the bin width

In Fig. 7, the \(R_{\mathrm{AA}}\) of nonprompt \({\mathrm{J}}/\psi \) as a function of centrality, \(|{y}|\), and \(p_{\mathrm{T}}\) are shown, integrating in each case over the other two variables. A steady increase of the suppression is observed with increasing centrality of the collision. The \(R_{\mathrm{AA}}\) for the most central events (0–10%) measured for \(6.5<p_{\mathrm{T}} <30\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\) and \(|{y}|<2.4\) is \(0.332\pm 0.017\,\text {(stat)} \pm 0.028\,\text {(syst)} \). Stronger suppression is observed with both increasing rapidity and \(p_{\mathrm{T}}\).

Fig. 7
figure 7

Nonprompt \({\mathrm{J}}/\psi \) \(R_{\mathrm{AA}}\) as a function of centrality (top), rapidity (middle), and \(p_{\mathrm{T}}\) (bottom). The bars (boxes) represent statistical (systematic) point-by-point uncertainties. The gray boxes plotted on the right side at \(R_{\mathrm{AA}} =1\) represent the scale of the global uncertainties. For \(R_{\mathrm{AA}}\) vs. \(N_{\text {part}}\), the average \(N_{\text {part}}\) values correspond to events flatly distributed across centrality

Fig. 8
figure 8

Top Nonprompt \({\mathrm{J}}/\psi \) \(R_{\mathrm{AA}}\) as a function of centrality at high \(p_{\mathrm{T}}\), \(6.5<p_{\mathrm{T}} <30\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\), for three different \(|{y}|\) regions. The high-\(p_{\mathrm{T}}\) mid- and forward-rapidity points are shifted horizontally by \(\Delta N_{\text {part}} =2\) for better visibility. Bottom Nonprompt \({\mathrm{J}}/\psi \) \(R_{\mathrm{AA}}\) as a function of centrality, at forward rapidity, \(1.6<|{y}|<2.4\), for two different \(p_{\mathrm{T}}\) regions. The bars (boxes) represent statistical (systematic) point-by-point uncertainties. The boxes plotted on the right side at \(R_{\mathrm{AA}} =1\) represent the scale of the global uncertainties: the coloured boxes show the statistical and systematic uncertainties from \(\mathrm{p}\mathrm{p}\) measurement, and the open box shows the global uncertainties common to all data points. The average \(N_{\text {part}}\) values correspond to events flatly distributed across centrality

As for the prompt production case, two double-differential studies were done, simultaneously binning in centrality and \(|{y}|\) or \(p_{\mathrm{T}}\). Figure 8 (top) shows the rapidity dependence of \(R_{\mathrm{AA}}\) vs. \(N_{\text {part}}\) for high \(p_{\mathrm{T}}\) nonprompt \({\mathrm{J}}/\psi \). Figure 8 (bottom) shows, for \(1.6<|{y}|<2.4\), the \(p_{\mathrm{T}}\) dependence of \(R_{\mathrm{AA}}\) vs. \(N_{\text {part}}\). The centrality dependences of the three \(|{y}|\) intervals are quite similar, and the same is true for the two \(p_{\mathrm{T}}\) ranges. As was also seen in Fig. 7, smaller suppression is observed at lower \(|{y}|\) and lower \(p_{\mathrm{T}}\).

5 Discussion

In this section, the \(R_{\mathrm{AA}}\) and \(v_{2}\) results are compared first for open and hidden charm, and then for open charm and beauty, using data from the ALICE experiment [31, 61, 62]. For open charm, the measurements of \(R_{\mathrm{AA}}\) vs. \(N_{\text {part}}\) of prompt D\(^{0}\) mesons, and of averaged prompt \(\mathrm{D}\) mesons (\({\mathrm{D}^0}\), \({\mathrm{D}^+}\) and \(\mathrm{D}^{*+}\) combined), measured in \(|{y}|<0.5\) at low \(p_{\mathrm{T}}\) (\(2<p_{\mathrm{T}} <5\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\)), and high \(p_{\mathrm{T}}\) (\(6<p_{\mathrm{T}} <12\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\)) [61] are used. These are compared to hidden charm data from the prompt \({\mathrm{J}}/\psi \) results described in this paper, in two \(p_{\mathrm{T}}\) regions that are similar to the D measurement, i.e. (\(3<p_{\mathrm{T}} <6.5\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\), \(1.6<|{y}|<2.4\)) and (\(6.5<p_{\mathrm{T}} <30\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\), \(|{y}|<1.2\)). For the \(R_{\mathrm{AA}}\) comparison of open charm vs. beauty, the averaged prompt D mesons measured in \(|{y}|<0.5\) [62] are compared to the nonprompt \({\mathrm{J}}/\psi \) results reported in this paper for \(|{y}|<1.2\). The \(p_{\mathrm{T}}\) interval (\(8<p_{\mathrm{T}} <16\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\)) for the D is chosen to correspond to that of the parent B mesons of the CMS nonprompt \({\mathrm{J}}/\psi \) result [62].

For the \(v_{2}\) results, the \(p_{\mathrm{T}}\) dependence reported in this paper for both prompt and nonprompt \({\mathrm{J}}/\psi \) in the centrality 10–60% bin are compared with the \(v_{2}\) of the averaged D mesons [31] measured in the 30–50% centrality bin. In addition, the CMS charged-hadron \(v_{2}\) results, measured for \(|{\eta }|<0.5\), derived for 10–60% centrality bin from Refs. [60] and [58], are added to the comparison.

Fig. 9
figure 9

Prompt \({\mathrm{J}}/\psi \) and D meson [61] \(R_{\mathrm{AA}}\) vs. centrality for low \(p_{\mathrm{T}}\) (top) and high \(p_{\mathrm{T}}\) (middle). The average \(N_{\text {part}}\) values correspond to events flatly distributed across centrality. Bottom Prompt \({\mathrm{J}}/\psi \) and D meson [31], and charged hadron [58, 60] \(v_{2}\) vs. \(p_{\mathrm{T}}\)

5.1 Open versus hidden charm

The top two panels of Fig. 9 show the \(R_{\mathrm{AA}}\) dependence on the centrality of the prompt \({\mathrm{J}}/\psi \) (bound \(\mathrm{Q} \overline{\mathrm{Q}} \) state) and of prompt D (charm-light states \(\mathrm{Q} \overline{\mathrm{q}} \)) mesons, for low- (top) and high- (middle) \(p_{\mathrm{T}}\) selections. In both cases, the mesons suffer a similar suppression, over the whole \(N_{\text {part}}\) range, even though the charmonium yield should be affected by colour screening [4, 48], potentially by final-state nuclear interactions unrelated to the QGP [63,64,65,66,67], and by rather large feed-down contributions from excited states [68, 69]. Moreover, common processes (i.e. recombination or energy loss effects) are expected to affect differently the open and hidden charm [26, 27, 70, 71]. While the present results cannot resolve all these effects, the comparison of open and hidden charm could help to determine their admixture.

A comparison of the \(p_{\mathrm{T}}\) dependence of the azimuthal anisotropy \(v_{2}\) between the prompt \({\mathrm{J}}/\psi \) and D mesons is made in the bottom panel of Fig. 9. While the \(R_{\mathrm{AA}}\) is similar both at low and high \(p_{\mathrm{T}}\), the \(v_{2}\) of prompt \({\mathrm{J}}/\psi \) at low \(p_{\mathrm{T}}\) is lower than that of both D mesons and charged hadrons. At high \(p_{\mathrm{T}}\), all three results, within the uncertainties, are similar: the prompt \({\mathrm{J}}/\psi \) results seem to point to a similar anisotropy as the light-quarks hadrons, hinting at a flavour independence of the energy-loss path-length dependence. The prompt \({\mathrm{J}}/\psi \) results could help advance the theoretical knowledge on the relative contribution of the regenerated charmonium yield, as this is the only type of \({\mathrm{J}}/\psi \) expected to be affected by the collective expansion of the medium. Such prompt \({\mathrm{J}}/\psi \) should have higher \(v_{2}\) values, closer to those of light-quark hadrons [27].

5.2 Open charm versus beauty

The top panel of Fig. 10 shows the \(R_{\mathrm{AA}}\) dependence on centrality of the nonprompt \({\mathrm{J}}/\psi \) (decay product of B mesons originating from b quarks) and for D mesons (originating from c quarks). The D mesons are more suppressed than the nonprompt \({\mathrm{J}}/\psi \). This is expected in models that assume less radiative energy loss for the b quark compared to that of a c quark because of the ‘dead-cone effect’ (the suppression of gluon bremsstrahlung of a quark with mass m and energy E, for angles \(\theta < m/E\) [72, 73]), and smaller collisional energy loss for the much heavier b quark than for the c quark [15, 74]. The results bring extra information in a kinematic phase space not accessible with fully reconstructed b jet measurements, which show that for \(p_{\mathrm{T}} >80\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\) the \(R_{\mathrm{AA}}\) of b jets is compatible to that of light-quark or gluon jets [75]. However, assessing and quantifying the parton mass dependence of the in-medium phenomena is not trivial: one has to account among other things for different starting kinematics (different unmodified vacuum spectra of the beauty and charm quarks in the medium), and the effect of different fragmentation functions (and extra decay kinematics) [76]. Also, when considering the parton mass dependence, it should be noted that at high-\(p_{\mathrm{T}}\), the \(R_{\mathrm{AA}}\) of D mesons was found to be similar to that of charged pions over a wide range of event centrality [31].

Fig. 10
figure 10

Nonprompt \({\mathrm{J}}/\psi \) and prompt D meson [31, 62], and charged hadron [58, 60] \(R_{\mathrm{AA}}\) vs. centrality (top), and \(v_{2}\) vs. \(p_{\mathrm{T}}\) (bottom). For the top plot, the average \(N_{\text {part}}\) values correspond to events flatly distributed across centrality

The bottom panel of Fig. 10 shows the \(p_{\mathrm{T}}\) dependence of the measured \(v_{2}\) for nonprompt \({\mathrm{J}}/\psi \), prompt D mesons, and charged hadrons. The precision and statistical reach of the present LHC open beauty and charm \(v_{2}\) results can not answer: (a) at low \(p_{\mathrm{T}}\), whether the b quarks, with their mass much larger than that of the charm quarks, participate or not in the collective expansion of the medium as the charm quarks seem to do; (b) at high \(p_{\mathrm{T}}\), whether there is a difference in path-length dependence of energy loss between b and c quarks.

6 Summary

The production of prompt and nonprompt (coming from b hadron decay) \({\mathrm{J}}/\psi \) has been studied in pp and PbPb collisions at \(\sqrt{{s_{_{\text {NN}}}}} = 2.76\) \(\,\mathrm{TeV}\). The \(R_{\mathrm{AA}}\) of the prompt \({\mathrm{J}}/\psi \) mesons, integrated over the rapidity range \(|{y}|<2.4\) and high \(p_{\mathrm{T}}\), \(6.5<p_{\mathrm{T}} <30\) \(\,{\mathrm{GeV}}/{\mathrm{c}}\), is measured in 12 centrality bins. The \(R_{\mathrm{AA}}\) is less than unity even in the most peripheral bin, and the suppression becomes steadily stronger as centrality increases. Integrated over rapidity (\(p_{\mathrm{T}}\)) and centrality, no strong evidence for a \(p_{\mathrm{T}}\) (rapidity) dependence of the suppression is found. The azimuthal anisotropy of prompt \({\mathrm{J}}/\psi \) mesons shows a nonzero \(v_{2}\) value in all studied bins, while no strong dependence on centrality, rapidity, or \(p_{\mathrm{T}}\) is observed.

The \(R_{\mathrm{AA}}\) of nonprompt \({\mathrm{J}}/\psi \) mesons shows a slow decrease with increasing centrality and rapidity. The results show less suppression at low \(p_{\mathrm{T}}\). The first measurement of the nonprompt \({\mathrm{J}}/\psi \) \(v_{2}\) is also reported in two \(p_{\mathrm{T}}\) bins for 10–60% event centrality, and the values are consistent with zero elliptical azimuthal anisotropy, though both nominal values are positive.