Rivet analyses referenceLHCB_2021_I1915030Prompt and non-prompt J$/\psi$ production at 5.02 TeVExperiment: LHCB (LHC) Inspire ID: 1915030 Status: VALIDATED Authors:
Beam energies: (2510.0, 2510.0) GeV Run details:
Measurement of the double differential cross section for prompt and non-prompt J$/\psi$ production at 5.02 TeV by the LHCb collaboration. Source code: LHCB_2021_I1915030.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/UnstableParticles.hh"
4
5namespace Rivet {
6
7
8 /// @brief J/psi production at 5.02 TeV
9 class LHCB_2021_I1915030 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(LHCB_2021_I1915030);
14
15
16 /// @name Analysis methods
17 /// @{
18
19 /// Book histograms and initialise projections before the run
20 void init() {
21 declare(UnstableParticles(), "UFS");
22 // histograms
23 for(int ix=0;ix<3;++ix) {
24 book(_h_JPsi[ix],{2.0,2.5,3.0,3.5,4.0,4.5});
25 for(int iy=0;iy<5;++iy) {
26 if(ix<2)
27 book(_h_JPsi[ix]->bin(iy+1),ix+1,1,iy+1);
28 else
29 book(_h_JPsi[ix]->bin(iy+1),"TMP/JPsi_"+toString(iy) , refData(1,1,iy+1));
30 }
31 }
32 book(_h_JPsi_pT[0],3,1,1);
33 book(_h_JPsi_pT[1],4,1,1);
34 book(_h_JPsi_y [0],5,1,1);
35 book(_h_JPsi_y [2],5,1,2);
36 book(_h_JPsi_y [1],6,1,1);
37 }
38
39
40 /// Perform the per-event analysis
41 void analyze(const Event& event) {
42
43 // Final state of unstable particles to get particle spectra
44 const UnstableParticles& ufs = apply<UnstableParticles>(event, "UFS");
45
46 for (const Particle& p : ufs.particles(Cuts::pid==443)) {
47 // prompt/non-prompt
48 bool nonPrompt = p.fromBottom();
49 double absrap = p.absrap();
50 double xp = p.perp();
51 _h_JPsi[nonPrompt]->fill(absrap,xp);
52 _h_JPsi[2 ]->fill(absrap,xp);
53 if(absrap>2. && absrap<4.5)
54 _h_JPsi_pT[nonPrompt]->fill(xp);
55 if(xp<14.)
56 _h_JPsi_y [nonPrompt]->fill(absrap);
57 if(xp<8. && !nonPrompt)
58 _h_JPsi_y [2]->fill(absrap);
59 }
60 }
61
62
63 /// Normalise histograms etc., after the run
64 void finalize() {
65 // factor of 2 due rapidity +/-
66 double factor = 0.5*crossSection()/nanobarn/sumOfWeights();
67 for(unsigned int ix=0;ix<3;++ix) {
68 scale(_h_JPsi[ix], factor);
69 divByGroupWidth(_h_JPsi[ix]);
70 scale(_h_JPsi_y[ix],factor);
71 if(ix<2)
72 scale(_h_JPsi_pT[ix],factor);
73 }
74 for(unsigned int iy=0;iy<_h_JPsi[0]->numBins();++iy) {
75 // non-prompt J/psi percentage
76 Estimate1DPtr tmp;
77 book(tmp,7,1,iy+1);
78 efficiency(_h_JPsi[1]->bin(iy+1),_h_JPsi[2]->bin(iy+1),tmp);
79 tmp->scale(100.);
80 }
81 }
82
83 /// @}
84
85
86 /// @name Histograms
87 /// @{
88 Histo1DGroupPtr _h_JPsi[3];
89 Histo1DPtr _h_JPsi_pT[2],_h_JPsi_y[3];
90 /// @}
91
92
93 };
94
95
96 RIVET_DECLARE_PLUGIN(LHCB_2021_I1915030);
97
98}
|