rivet is hosted by Hepforge, IPPP Durham

Rivet analyses reference

CMS_2010_PAS_QCD_10_024

Pseudorapidity distributions of charged particles at $\sqrt{s} = 0.9$ and 7 TeV
Experiment: CMS (LHC)
Status: VALIDATED
Authors:
  • P. Katsas
  • A. Knutsson
References: Beams: p+ p+
Beam energies: (450.0, 450.0); (3500.0, 3500.0) GeV
Run details:
  • $pp$ collisions at 0.9 and 7 TeV. Minimum bias events. Beam energy must be specified as analysis option "ENERGY" when rivet-merge'ing samples.

Pseudorapidity distributions of charged particles in $pp$ collisions at $\sqrt{s} = 0.9$ and 7 TeV with at least one central charged particle. Beam energy must be specified (in GeV) as analysis option "ENERGY" when rivet-merging samples.

Source code: CMS_2010_PAS_QCD_10_024.cc
 1// -*- C++ -*-
 2#include "Rivet/Analysis.hh"
 3#include "Rivet/Projections/ChargedFinalState.hh"
 4#include "Rivet/Particle.hh"
 5
 6namespace Rivet {
 7
 8
 9  /// @brief Pseudorapidity distributions of charged particles at sqrt{s} = 0.9 and 7 TeV
10  class CMS_2010_PAS_QCD_10_024 : public Analysis {
11  public:
12
13    /// @name Constructors etc.
14    /// @{
15
16    /// Constructor
17    RIVET_DEFAULT_ANALYSIS_CTOR(CMS_2010_PAS_QCD_10_024);
18
19
20    void init() {
21      declare(ChargedFinalState((Cuts::etaIn(-0.8, 0.8) && Cuts::pT >= 0.5*GeV)), "CFS_08_05");
22      declare(ChargedFinalState((Cuts::etaIn(-0.8, 0.8) && Cuts::pT >= 1.0*GeV)), "CFS_08_10");
23      declare(ChargedFinalState((Cuts::etaIn(-2.4, 2.4) && Cuts::pT >= 0.5*GeV)), "CFS_24_05");
24      declare(ChargedFinalState((Cuts::etaIn(-2.4, 2.4) && Cuts::pT >= 1.0*GeV)), "CFS_24_10");
25
26      size_t offset = 0;
27      if (isCompatibleWithSqrtS(7000*GeV)) offset = 0;
28      if (isCompatibleWithSqrtS(900*GeV)) offset = 4;
29      book(_hist_dNch_deta_pt05_eta08 ,1+offset, 1, 1);
30      book(_hist_dNch_deta_pt10_eta08 ,2+offset, 1, 1);
31      book(_hist_dNch_deta_pt05_eta24 ,3+offset, 1, 1);
32      book(_hist_dNch_deta_pt10_eta24 ,4+offset, 1, 1);
33
34      book(_weight_pt05_eta08, "_pt05_eta08");
35      book(_weight_pt10_eta08, "_pt10_eta08");
36      book(_weight_pt05_eta24, "_pt05_eta24");
37      book(_weight_pt10_eta24, "_pt10_eta24");
38    }
39
40
41    void analyze(const Event& event) {
42      const ChargedFinalState& cfs_08_05 = apply<ChargedFinalState>(event, "CFS_08_05");
43      const ChargedFinalState& cfs_08_10 = apply<ChargedFinalState>(event, "CFS_08_10");
44      const ChargedFinalState& cfs_24_05 = apply<ChargedFinalState>(event, "CFS_24_05");
45      const ChargedFinalState& cfs_24_10 = apply<ChargedFinalState>(event, "CFS_24_10");
46
47      // Plot distributions
48      if(!cfs_08_05.particles().empty()) _weight_pt05_eta08->fill();
49      if(!cfs_24_05.particles().empty()) _weight_pt05_eta24->fill();
50      for (const Particle& p : cfs_24_05.particles()) {
51        _hist_dNch_deta_pt05_eta24->fill(p.eta());
52        if(!cfs_08_05.particles().empty())
53          _hist_dNch_deta_pt05_eta08->fill(p.eta());
54      }
55      if(!cfs_08_10.particles().empty()) _weight_pt10_eta08->fill();
56      if(!cfs_24_10.particles().empty()) _weight_pt10_eta24->fill();
57      for (const Particle& p : cfs_24_10.particles()) {
58        _hist_dNch_deta_pt10_eta24->fill(p.eta());
59        if(!cfs_08_10.particles().empty())
60          _hist_dNch_deta_pt10_eta08->fill(p.eta());
61      }
62    }
63
64
65    /// Normalise histograms etc., after the run
66    void finalize() {
67      scale(_hist_dNch_deta_pt05_eta08,1./ *_weight_pt05_eta08);
68      scale(_hist_dNch_deta_pt10_eta08,1./ *_weight_pt10_eta08);
69      scale(_hist_dNch_deta_pt05_eta24,1./ *_weight_pt05_eta24);
70      scale(_hist_dNch_deta_pt10_eta24,1./ *_weight_pt10_eta24);
71    }
72
73
74  private:
75
76    Histo1DPtr _hist_dNch_deta_pt05_eta08;
77    Histo1DPtr _hist_dNch_deta_pt10_eta08;
78    Histo1DPtr _hist_dNch_deta_pt05_eta24;
79    Histo1DPtr _hist_dNch_deta_pt10_eta24;
80    CounterPtr _weight_pt05_eta08,_weight_pt10_eta08,_weight_pt05_eta24,_weight_pt10_eta24;
81  };
82
83
84  RIVET_DECLARE_PLUGIN(CMS_2010_PAS_QCD_10_024);
85
86}