Rivet analyses referenceCMSTOTEM_2014_I1294140Charged particle pseudorapidity distribution at $\sqrt{s}$=8 TeVExperiment: CMS, TOTEM (LHC) Inspire ID: 1294140 Status: VALIDATED Authors:
Beam energies: (4000.0, 4000.0) GeV Run details:
The pseudorapidity distribution of charged particles produced in proton-proton collisions at a centre-of-mass energy of 8 TeV are measured in the ranges $|\eta| < 2.2$ and $5.3 < |\eta| < 6.4$, with the CMS and TOTEM detectors, respectively. The measurement is performed with a one-side TOTEM trigger, which is sensitive to 99\% of non-diffractive interactions and diffractive interactions with masses above 3.6 GeV, for three different event selections. An inclusive sample with the least selection bias, a sample enhanced in non-single diffractive events, and a sample enhanced in single-diffractive events were selected. Source code: CMSTOTEM_2014_I1294140.cc 1// -*- C++ -*-
2#include "Rivet/Analysis.hh"
3#include "Rivet/Projections/ChargedFinalState.hh"
4#include "Rivet/Projections/Beam.hh"
5
6namespace Rivet {
7
8
9 class CMSTOTEM_2014_I1294140 : public Analysis {
10 public:
11
12 CMSTOTEM_2014_I1294140()
13 : Analysis("CMSTOTEM_2014_I1294140")
14 { }
15
16
17 void init() {
18 ChargedFinalState cfs((Cuts::etaIn(-7.0, 7.0)));
19 declare(cfs, "CFS");
20
21 book(_Nevt_after_cuts_or, "Nevt_or");
22 book(_Nevt_after_cuts_and, "Nevt_and");
23 book(_Nevt_after_cuts_xor, "Nevt_xor");
24 book(_h_dNch_dEta_OR ,1, 1, 1);
25 book(_h_dNch_dEta_AND ,2, 1, 1);
26 book(_h_dNch_dEta_XOR ,3, 1, 1);
27 }
28
29
30 void analyze(const Event& event) {
31 // Count forward and backward charged particles
32 const ChargedFinalState& charged = apply<ChargedFinalState>(event, "CFS");
33 int count_plus = 0, count_minus = 0;
34 for (const Particle& p : charged.particles()) {
35 if (inRange(p.eta(), 5.3, 6.5)) count_plus++;
36 if (inRange(p.eta(), -6.5, -5.3)) count_minus++;
37 }
38
39 // Cut combinations
40 const bool cutsor = (count_plus > 0 || count_minus > 0);
41 const bool cutsand = (count_plus > 0 && count_minus > 0);
42 const bool cutsxor = ( (count_plus > 0 && count_minus == 0) || (count_plus == 0 && count_minus > 0) );
43
44 // Increment counters and fill histos
45 if (cutsor) _Nevt_after_cuts_or ->fill();
46 if (cutsand) _Nevt_after_cuts_and ->fill();
47 if (cutsxor) _Nevt_after_cuts_xor ->fill();
48 for (const Particle& p : charged.particles()) {
49 if (cutsor) _h_dNch_dEta_OR ->fill(p.abseta());
50 if (cutsand) _h_dNch_dEta_AND->fill(p.abseta());
51 if (cutsxor) _h_dNch_dEta_XOR->fill(p.abseta());
52 }
53
54 }
55
56
57 void finalize() {
58 scale(_h_dNch_dEta_OR, 0.5 / *_Nevt_after_cuts_or);
59 scale(_h_dNch_dEta_AND, 0.5 / *_Nevt_after_cuts_and);
60 scale(_h_dNch_dEta_XOR, 0.5 / *_Nevt_after_cuts_xor);
61 }
62
63
64 private:
65
66 Histo1DPtr _h_dNch_dEta_OR, _h_dNch_dEta_AND, _h_dNch_dEta_XOR;
67 CounterPtr _Nevt_after_cuts_or, _Nevt_after_cuts_and, _Nevt_after_cuts_xor;
68
69 };
70
71
72 // Hook for the plugin system
73 RIVET_DECLARE_PLUGIN(CMSTOTEM_2014_I1294140);
74
75}
|