Rivet analyses referenceCMS_2010_PAS_QCD_10_024Pseudorapidity distributions of charged particles at $\sqrt{s} = 0.9$ and 7 TeVExperiment: CMS (LHC) Status: VALIDATED Authors:
Beam energies: (450.0, 450.0); (3500.0, 3500.0) GeV Run details:
Pseudorapidity distributions of charged particles in $pp$ collisions at $\sqrt{s} = 0.9$ and 7 TeV with at least one central charged particle. 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
22 declare(ChargedFinalState(Cuts::abseta < 0.8 && Cuts::pT >= 0.5*GeV), "CFS_08_05");
23 declare(ChargedFinalState(Cuts::abseta < 0.8 && Cuts::pT >= 1.0*GeV), "CFS_08_10");
24 declare(ChargedFinalState(Cuts::abseta < 2.4 && Cuts::pT >= 0.5*GeV), "CFS_24_05");
25 declare(ChargedFinalState(Cuts::abseta < 2.4 && Cuts::pT >= 1.0*GeV), "CFS_24_10");
26
27 for (double eVal : allowedEnergies()) {
28 const string en = toString(int(eVal));
29 if (isCompatibleWithSqrtS(eVal)) _sqs = en;
30 size_t offset = (en == "900"s)? 4 : 0;
31
32 book(_h[en+"dNch_deta_pt05_eta08"], 1+offset, 1, 1);
33 book(_h[en+"dNch_deta_pt10_eta08"], 2+offset, 1, 1);
34 book(_h[en+"dNch_deta_pt05_eta24"], 3+offset, 1, 1);
35 book(_h[en+"dNch_deta_pt10_eta24"], 4+offset, 1, 1);
36
37 book(_c[en+"pt05_eta08"], "_pt05_eta08_"+en);
38 book(_c[en+"pt10_eta08"], "_pt10_eta08_"+en);
39 book(_c[en+"pt05_eta24"], "_pt05_eta24_"+en);
40 book(_c[en+"pt10_eta24"], "_pt10_eta24_"+en);
41 }
42 if (_sqs == "" && !merging()) {
43 throw BeamError("Invalid beam energy for " + name() + "\n");
44 }
45 }
46
47
48 void analyze(const Event& event) {
49
50 const ChargedFinalState& cfs_08_05 = apply<ChargedFinalState>(event, "CFS_08_05");
51 const ChargedFinalState& cfs_08_10 = apply<ChargedFinalState>(event, "CFS_08_10");
52 const ChargedFinalState& cfs_24_05 = apply<ChargedFinalState>(event, "CFS_24_05");
53 const ChargedFinalState& cfs_24_10 = apply<ChargedFinalState>(event, "CFS_24_10");
54
55 // Plot distributions
56 if (!cfs_08_05.particles().empty()) _c[_sqs+"pt05_eta08"]->fill();
57 if (!cfs_24_05.particles().empty()) _c[_sqs+"pt05_eta24"]->fill();
58 for (const Particle& p : cfs_24_05.particles()) {
59 _h[_sqs+"dNch_deta_pt05_eta24"]->fill(p.eta());
60 if (!cfs_08_05.particles().empty()) {
61 _h[_sqs+"dNch_deta_pt05_eta08"]->fill(p.eta());
62 }
63 }
64 if (!cfs_08_10.particles().empty()) _c[_sqs+"pt10_eta08"]->fill();
65 if (!cfs_24_10.particles().empty()) _c[_sqs+"pt10_eta24"]->fill();
66 for (const Particle& p : cfs_24_10.particles()) {
67 _h[_sqs+"dNch_deta_pt10_eta24"]->fill(p.eta());
68 if (!cfs_08_10.particles().empty()) {
69 _h[_sqs+"dNch_deta_pt10_eta08"]->fill(p.eta());
70 }
71 }
72 }
73
74
75 /// Normalise histograms etc., after the run
76 void finalize() {
77 for (double eVal : allowedEnergies()) {
78 const string en = toString(int(eVal));
79 if (dbl(*_c[en+"pt05_eta08"])) scale(_h[en+"dNch_deta_pt05_eta08"], 1./ *_c[en+"pt05_eta08"]);
80 if (dbl(*_c[en+"pt10_eta08"])) scale(_h[en+"dNch_deta_pt10_eta08"], 1./ *_c[en+"pt10_eta08"]);
81 if (dbl(*_c[en+"pt05_eta24"])) scale(_h[en+"dNch_deta_pt05_eta24"], 1./ *_c[en+"pt05_eta24"]);
82 if (dbl(*_c[en+"pt10_eta24"])) scale(_h[en+"dNch_deta_pt10_eta24"], 1./ *_c[en+"pt10_eta24"]);
83 }
84 }
85
86
87 private:
88
89 map<string, Histo1DPtr> _h;
90 map<string, CounterPtr> _c;
91 string _sqs = "";
92 };
93
94
95 RIVET_DECLARE_PLUGIN(CMS_2010_PAS_QCD_10_024);
96
97}
|