Rivet analyses referenceALICE_2019_I1735351Central J$/\psi$ production at $5.02$ TeVExperiment: ALICE (LHC) Inspire ID: 1735351 Status: VALIDATED Authors:
Beam energies: (2510.0, 2510.0) GeV Run details:
Measurement of central J$/\psi$ production at $5.02$ TeV by the ALICE collaboration. Source code: ALICE_2019_I1735351.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/UnstableParticles.hh"
4
5namespace Rivet {
6
7
8 /// @brief J/psi at 5.02 TeV
9 class ALICE_2019_I1735351 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(ALICE_2019_I1735351);
14
15
16 /// @name Analysis methods
17 /// @{
18
19 /// Book histograms and initialise projections before the run
20 void init() {
21 declare(UnstableParticles(Cuts::pid==443), "UFS");
22 book(_h_JPsi_pT,2,1,1);
23 _axis = YODA::Axis<double>({ 0., 1., 2., 3., 4., 5., 7., 10. });
24 }
25
26 /// Perform the per-event analysis
27 void analyze(const Event& event) {
28 if (_edges.empty()) _edges = _h_JPsi_pT->xEdges();
29 // loop over J/Psi
30 for (const Particle& p : apply<UnstableParticles>(event, "UFS").particles()) {
31 // rapidity cut
32 if (p.absrap()>0.9) continue;
33 _h_JPsi_pT->fill(discEdge(p.perp()));
34 }
35 }
36
37 string discEdge(double val) const {
38 string edge("OTHER");
39 size_t idx = _axis.index(val);
40 if (0 < idx && idx <= _axis.numBins()) return _edges[idx-1];
41 return edge;
42 }
43
44
45 /// Normalise histograms etc., after the run
46 void finalize() {
47 // factor 1/2 due folding +/- rap and 1.8 due y range
48 double fact = 0.5/1.8*crossSection()/nanobarn/sumOfWeights();
49 scale(_h_JPsi_pT,fact);
50 for(auto & b : _h_JPsi_pT->bins()) {
51 b.scaleW(1./_axis.width(b.index()));
52 }
53 }
54
55 /// @}
56
57
58 /// @name Histograms
59 /// @{
60 BinnedHistoPtr<string> _h_JPsi_pT;
61 YODA::Axis<double> _axis;
62 vector<string> _edges;
63 /// @}
64
65
66 };
67
68
69 RIVET_DECLARE_PLUGIN(ALICE_2019_I1735351);
70
71}
|