Rivet analyses referenceCMS_2015_I1384119Pseudorapidity distribution of charged hadrons in proton--proton collisions at $\sqrt{s} = 13$ TeVExperiment: CMS (LHC) Inspire ID: 1384119 Status: VALIDATED Authors:
Beam energies: (6500.0, 6500.0) GeV Run details:
The pseudorapidity distribution of charged hadrons in $pp$ collisions at $\sqrt{s} =13$ TeV is measured using a data sample obtained with the CMS detector, operated at zero magnetic field, at the CERN LHC. The yield of primary charged long-lived hadrons produced in inelastic $pp$ collisions is determined in the central region of the CMS pixel detector ($|eta| < 2$) using both hit pairs and reconstructed tracks. Source code: CMS_2015_I1384119.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/ChargedFinalState.hh"
4#include "Rivet/Projections/FinalState.hh"
5
6namespace Rivet {
7
8
9 class CMS_2015_I1384119 : public Analysis {
10 public:
11
12 /// Constructor
13 RIVET_DEFAULT_ANALYSIS_CTOR(CMS_2015_I1384119);
14
15
16 /// Book histograms and initialise projections before the run
17 void init() {
18 const FinalState fsa(Cuts::abseta < 20);
19 declare(fsa, "FSA");
20 const ChargedFinalState cfs(Cuts::abseta < 2);
21 declare(cfs, "CFS");
22
23 book(_hist_dNch_dEta_inel ,1, 1, 1);
24 }
25
26
27 /// Perform the per-event analysis
28 void analyze(const Event& event) {
29 // Apply inelastic selection (veto pp -> pp elastic events)
30 const FinalState& fsa = apply<FinalState>(event, "FSA");
31 if (fsa.size() <= 2) vetoEvent;
32
33 const ChargedFinalState& cfs = apply<ChargedFinalState>(event, "CFS");
34 for (const Particle& p : cfs.particles()) {
35 const int id = p.abspid();
36 // continue if particle is a proton, a kaon or a pion
37 if (id == 211 || id == 321 || id == 2212) ///< @todo Use PID:: ID constants
38 _hist_dNch_dEta_inel->fill(p.eta(), 1.0);
39 }
40 }
41
42
43 /// Normalise histograms etc., after the run
44 void finalize() {
45 scale(_hist_dNch_dEta_inel, 1/sumOfWeights());
46 }
47
48
49 private:
50
51 /// Histograms
52 Histo1DPtr _hist_dNch_dEta_inel;
53
54 };
55
56
57 RIVET_DECLARE_PLUGIN(CMS_2015_I1384119);
58
59}
|