Rivet analyses referenceCMS_2017_I1605749Measurements of jet charge with dijet events in pp collisions at $\sqrt{s}=8$ TeVExperiment: CMS (LHC) Inspire ID: 1605749 Status: VALIDATED Authors:
Beam energies: (4000.0, 4000.0) GeV Run details:
Jet charge is an estimator of the electric charge of a quark, antiquark, or gluon initiating a jet. It is based on the momentum-weighted sum of the electric charges of the jet constituents. Measurements of three charge observables of the leading jet in transverse momentum $p_\mathrm{T}$ are performed with dijet events. The analysis is carried out with data collected by the CMS experiment at the CERN LHC in proton-proton collisions at $\sqrt{s}=8\text{TeV}$ corresponding to an integrated luminosity of 19.7 fb$^{-1}$. The results are presented in bins of the $p_\mathrm{T}$ of the leading jet. Source code: CMS_2017_I1605749.cc 1// -*- C++ -*-
2// Rivet framework
3#include "Rivet/Analysis.hh"
4
5// Projections
6#include "Rivet/Projections/FinalState.hh"
7#include "Rivet/Projections/FastJets.hh"
8
9namespace Rivet {
10
11 using namespace Cuts;
12
13 class CMS_2017_I1605749 : public Analysis {
14 public:
15
16 // Constructor
17 CMS_2017_I1605749()
18 : Analysis("CMS_2017_I1605749")
19 { }
20
21 // Book histograms and initialise projections before the run
22 void init() {
23 // Projections
24 const FinalState fs((Cuts::etaIn(-5.0, 5.0)));
25 declare(FastJets(fs, JetAlg::ANTIKT, 0.5), "Jets");
26
27 // Jet Charge Histos
28 for (int i = 1; i <= 18; i++) {
29 book(_h_Charge[i - 1], i, 1, 1);
30 }
31 }
32
33 // Perform the per-event analysis
34 void analyze(const Event& event) {
35 const Jets& jets = apply<FastJets>(event, "Jets").jetsByPt(Cuts::pT > 10.0*GeV);
36
37 if (jets.size() < 2) vetoEvent;
38
39 double leadingpt = jets[0].pt()/GeV;
40 double subleadingpt = jets[1].pt()/GeV;
41
42 if (jets.size() < 2 ||
43 jets[0].abseta() >= 1.5 ||
44 jets[1].abseta() >= 1.5 ||
45 leadingpt < 400.0 || subleadingpt < 100.0) {
46 vetoEvent;
47 }
48
49 vector<Particle> constituents1 = jets[0].constituents();
50 std::vector<double> numerator(9, 0), denominator(9, 0);
51
52 double t_jetcharge1, t_jetcharge1k6, t_jetcharge1k3;
53 double t_jetchargeL1, t_jetchargeL1k6, t_jetchargeL1k3;
54 double t_jetchargeT1, t_jetchargeT1k6, t_jetchargeT1k3;
55
56 denominator[0] = leadingpt;
57 denominator[1] = std::pow(leadingpt, 0.6);
58 denominator[2] = std::pow(leadingpt, 0.3);
59
60 if (constituents1.size() > 0) {
61 for (unsigned j = 0; j < constituents1.size(); j++) {
62 if (std::abs(constituents1[j].pid()) > 9 &&
63 std::abs(constituents1[j].pid())!= 21) {
64 if (constituents1[j].pt() > 1*GeV) {
65 double charge = constituents1[j].charge();
66 double mom = constituents1[j].pt();
67 double dotproduct = constituents1[j].p3().dot(jets[0].p3()) / jets[0].p();
68 double crossproduct = constituents1[j].p3().cross(jets[0].p3()).mod() / jets[0].p();
69
70 numerator[0] += (mom * charge);
71 numerator[1] += ((std::pow(mom, 0.6)) * charge);
72 numerator[2] += ((std::pow(mom, 0.3)) * charge);
73
74 numerator[3] += (dotproduct * charge);
75 numerator[4] += ((std::pow(dotproduct, 0.6)) * charge);
76 numerator[5] += ((std::pow(dotproduct, 0.3)) * charge);
77
78 denominator[3] += dotproduct;
79 denominator[4] += (std::pow(dotproduct, 0.6));
80 denominator[5] += (std::pow(dotproduct, 0.3));
81
82 numerator[6] += (crossproduct * charge);
83 numerator[7] += ((std::pow(crossproduct, 0.6)) * charge);
84 numerator[8] += ((std::pow(crossproduct, 0.3)) * charge);
85
86 denominator[6] += crossproduct;
87 denominator[7] += (std::pow(crossproduct, 0.6));
88 denominator[8] += (std::pow(crossproduct, 0.3));
89 }
90 }
91 }
92 }
93
94 t_jetcharge1 = (denominator[0] > 0) ? numerator[0] / denominator[0] : 0;
95 t_jetcharge1k6 = (denominator[1] > 0) ? numerator[1] / denominator[1] : 0;
96 t_jetcharge1k3 = (denominator[2] > 0) ? numerator[2] / denominator[2] : 0;
97 t_jetchargeL1 = (denominator[3] > 0) ? numerator[3] / denominator[3] : 0;
98 t_jetchargeL1k6 = (denominator[4] > 0) ? numerator[4] / denominator[4] : 0;
99 t_jetchargeL1k3 = (denominator[5] > 0) ? numerator[5] / denominator[5] : 0;
100 t_jetchargeT1 = (denominator[6] > 0) ? numerator[6] / denominator[6] : 0;
101 t_jetchargeT1k6 = (denominator[7] > 0) ? numerator[7] / denominator[7] : 0;
102 t_jetchargeT1k3 = (denominator[8] > 0) ? numerator[8] / denominator[8] : 0;
103
104 _h_Charge[0]->fill(t_jetcharge1);
105 _h_Charge[1]->fill(t_jetcharge1k6);
106 _h_Charge[2]->fill(t_jetcharge1k3);
107 _h_Charge[3]->fill(t_jetchargeL1);
108 _h_Charge[4]->fill(t_jetchargeL1k6);
109 _h_Charge[5]->fill(t_jetchargeL1k3);
110 _h_Charge[6]->fill(t_jetchargeT1);
111 _h_Charge[7]->fill(t_jetchargeT1k6);
112 _h_Charge[8]->fill(t_jetchargeT1k3);
113
114 if (leadingpt > 400 && leadingpt < 700) {
115 _h_Charge[9]->fill(t_jetcharge1k6);
116 _h_Charge[12]->fill(t_jetchargeL1k6);
117 _h_Charge[15]->fill(t_jetchargeT1k6);
118 } else if (leadingpt > 700 && leadingpt < 1000) {
119 _h_Charge[10]->fill(t_jetcharge1k6);
120 _h_Charge[13]->fill(t_jetchargeL1k6);
121 _h_Charge[16]->fill(t_jetchargeT1k6);
122 } else if (leadingpt > 1000 && leadingpt < 1800) {
123 _h_Charge[11]->fill(t_jetcharge1k6);
124 _h_Charge[14]->fill(t_jetchargeL1k6);
125 _h_Charge[17]->fill(t_jetchargeT1k6);
126 }
127 }
128
129 // Normalise histograms etc., after the run
130 void finalize() {
131 for (int j = 0; j < 18; ++j) {
132 normalize(_h_Charge[j]);
133 }
134 }
135
136 private:
137 Histo1DPtr _h_Charge[18];
138 };
139
140 RIVET_DECLARE_PLUGIN(CMS_2017_I1605749);
141}
|