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