rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

ALICE_2019_I1716440

$D^0$, $D^{*\pm}$, $D^\pm$ and $D^\pm_s$ meson production at 5.02 and 7 TeV
Experiment: ALICE (LHC)
Inspire ID: 1716440
Status: VALIDATED
Authors:
  • Peter Richardson
References:
  • Eur.Phys.J.C 79 (2019) 388, 2019
Beams: p+ p+
Beam energies: (2510.0, 2510.0); (3500.0, 3500.0) GeV
Run details:
  • D meson production

Measurement of the transverse momentum spectra and ratios for $D^0$, $D^{*\pm}$, $D^\pm$ and $D^\pm_s$ meson production at 5.02 TeV by the ALICE collaboration. The 7 TeV results are based on those from ALICE_2017_I1511870 and are mainly used to take ratios between the two energies. Beam energy must be specified as analysis option "ENERGY" when rivet-merging samples.

Source code: ALICE_2019_I1716440.cc
  1// -*- C++ -*-
  2#include "Rivet/Analysis.hh"
  3#include "Rivet/Projections/UnstableParticles.hh"
  4
  5
  6namespace Rivet {
  7
  8
  9  /// @brief D meson production at 5.02 and 7 TeV
 10  class ALICE_2019_I1716440 : public Analysis {
 11  public:
 12
 13    /// Constructor
 14    RIVET_DEFAULT_ANALYSIS_CTOR(ALICE_2019_I1716440);
 15
 16
 17    /// @name Analysis methods
 18    /// @{
 19
 20    /// Book histograms and initialise projections before the run
 21    void init() {
 22      // projections
 23      declare(UnstableParticles(Cuts::abspid==411 || Cuts::abspid==421 || Cuts::abspid==431 || Cuts::abspid==413), "UFS");
 24
 25      for (double eVal : allowedEnergies()) {
 26        const string en = toString(int(eVal/GeV));
 27        if (isCompatibleWithSqrtS(eVal))  _sqs = en;
 28        bool is7TeV(en == "7000"s);
 29
 30        size_t offset = is7TeV? 10 : 6;
 31        for (size_t ix=0; ix<4; ++ix) {
 32          const string mode = en+toString(ix+1);
 33          book(_h[mode+"ratio_num"], "TMP/h_ratio_num_"+mode, refData(offset+ix,1,1));
 34          book(_h[mode+"ratio_den"], "TMP/h_ratio_den_"+mode, refData(offset+ix,1,1));
 35          book(_h[mode+"energy"],    "h_energy_"+mode,        refData(offset+ix,1,1));
 36          if (!is7TeV)  book(_h[mode+"prompt"], 1+ix, 1, 1);
 37        }
 38      }
 39      if (_sqs == "" && !merging()) {
 40        throw BeamError("Invalid beam energy for " + name() + "\n");
 41      }
 42      book(_h["incl"], 5, 1, 1);
 43      book(_total, 18, 1, 1);
 44    }
 45
 46
 47    /// Perform the per-event analysis
 48    void analyze(const Event& event) {
 49      // Final state of unstable particles to get particle spectra
 50      const UnstableParticles& ufs = apply<UnstableParticles>(event, "UFS");
 51      for (const Particle& p : ufs.particles()) {
 52        // no mixing and |y|<0.5
 53        if (p.children().size()==1 || p.absrap()>0.5) continue;
 54        unsigned int imeson=0;
 55        if (p.abspid()==411)       imeson=1;
 56        else if (p.abspid()==413)  imeson=2;
 57        else if (p.abspid()==431)  imeson=3;
 58        const double pT = p.perp();
 59        if (p.fromBottom()) {
 60          if (_sqs == "5020"s && imeson==0) _h["incl"]->fill(pT);
 61          continue;
 62        }
 63        // prompt at 5.02 TeV
 64        if (_sqs == "7000"s) {
 65          _h[_sqs+toString(imeson)+"prompt"]->fill(pT);
 66          _total->fill(_edges[imeson]);
 67        }
 68        if (imeson==0) {
 69          _h[_sqs+"0ratio_den"]->fill(pT/GeV);
 70          _h[_sqs+"1ratio_den"]->fill(pT/GeV);
 71          _h[_sqs+"2ratio_den"]->fill(pT/GeV);
 72          if (_sqs == "5020"s) _h["incl"]->fill(pT/GeV);
 73        }
 74        else if (imeson==1) {
 75          _h[_sqs+"0ratio_num"]->fill(pT/GeV);
 76          _h[_sqs+"3ratio_den"]->fill(pT/GeV);
 77        }
 78        else if (imeson==2) {
 79          _h[_sqs+"1ratio_num"]->fill(pT/GeV);
 80        }
 81        else if (imeson==3) {
 82          _h[_sqs+"2ratio_num"]->fill(pT/GeV);
 83          _h[_sqs+"3ratio_num"]->fill(pT/GeV);
 84        }
 85        _h[_sqs+toString(imeson)+"energy"]->fill(pT/GeV);
 86      }
 87    }
 88
 89
 90    /// Normalise histograms etc., after the run
 91    void finalize() {
 92      const double factor = crossSection()/microbarn/sumOfWeights();
 93      scale(_total, factor);
 94      scale(_h,factor);
 95
 96      Estimate1DPtr tmp;
 97      for (double eVal : allowedEnergies()) {
 98        const string en = toString(int(eVal/GeV));
 99        for (size_t ix=0; ix<4; ++ix) {
100          const string mode = en+toString(ix+1);
101          bool is7TeV(en == "7000"s);
102          book(tmp, 6+4*is7TeV+ix, 1, 1);
103          divide(_h[mode+"ratio_num"], _h[mode+"ratio_den"], tmp);
104        }
105      }
106    }
107
108    /// @}
109
110
111    /// @name Histograms
112    /// @{
113    map<string,Histo1DPtr> _h;
114    BinnedHistoPtr<string> _total;
115    vector<string> _edges = { "P P --> D0 (Q=PROMPT) X",
116                              "P P --> D+ (Q=PROMPT) X",
117                              "P P --> D*+ (Q=PROMPT) X",
118                              "P P --> D/s+ (Q=PROMPT) X" };
119    string _sqs = "";
120    /// @}
121
122
123  };
124
125
126  RIVET_DECLARE_PLUGIN(ALICE_2019_I1716440);
127
128}