Rivet API documentation

Rivet 4.1.3
ExptSmearingFunctions.hh
1// -*- C++ -*-
2#ifndef RIVET_ExptSmearingFunctions_HH
3#define RIVET_ExptSmearingFunctions_HH
4
5#include "Rivet/Tools/MomentumSmearingFunctions.hh"
6#include "Rivet/Tools/ParticleSmearingFunctions.hh"
7#include "Rivet/Tools/JetSmearingFunctions.hh"
8
9namespace Rivet {
10
11
32
33
36
39 inline double ELECTRON_RECOEFF_ATLAS_RUN1(const Particle& e) {
40 if (e.abspid() != PID::ELECTRON) return 0;
41 if (e.abseta() > 2.5) return 0;
42 if (e.pT() < 10*GeV) return 0;
43 return (e.abseta() < 1.5) ? 0.95 : 0.85;
44 }
45
49 inline double ELECTRON_RECOEFF_ATLAS_RUN2(const Particle& e) {
50 if (e.abspid() != PID::ELECTRON) return 0;
51 const double et = e.Et();
52 if (e.abseta() > 2.5 || e.Et() < 2*GeV) return 0;
53 if (et > 25*GeV) return 0.97;
54 if (et > 10*GeV) return 0.92 + (et/GeV-10)/15.*0.05;
55 if (et > 6*GeV) return 0.85 + (et/GeV-6)/4.*0.07;
56 if (et > 5*GeV) return 0.70 + (et/GeV-5)/1.*0.15;
57 if (et > 2*GeV) return 0.00 + (et/GeV-2)/3.*0.70;
58 return 0;
59 }
60
61
67 inline double ELECTRON_EFF_ATLAS_RUN2_LOOSE(const Particle& e) {
68 if (e.abspid() != PID::ELECTRON) return 0;
69
70 // Manually symmetrised eta eff histogram
71 const static vector<double> edges_eta = { 0.0, 0.1, 0.8, 1.37, 1.52, 2.01, 2.37, 2.47 };
72 const static vector<double> effs_eta = { 0.950, 0.965, 0.955, 0.885, 0.950, 0.935, 0.90 };
73 // Et eff histogram (10-20 is a guess)
74 const static vector<double> edges_et = { 0, 10, 20, 25, 30, 35, 40, 45, 50, 60, 80 };
75 const static vector<double> effs_et = { 0.0, 0.90, 0.91, 0.92, 0.94, 0.95, 0.955, 0.965, 0.97, 0.98, 0.98 };//Extra value extrapolated for overflow
76
77 if (e.abseta() > 2.47) return 0.0; // no ID outside the tracker
78
79 const int i_eta = binIndex(e.abseta(), edges_eta);
80 const int i_et = binIndex(e.Et()/GeV, edges_et, true);
81 const double eff = effs_et[i_et] * effs_eta[i_eta] / 0.95; //< norm factor as approximate double differential
82 return min(eff, 1.0) * ELECTRON_RECOEFF_ATLAS_RUN2(e);
83 }
84
86 inline double ELECTRON_EFF_ATLAS_RUN1_LOOSE(const Particle& e) {
88 }
89
90
92 inline double ELECTRON_EFF_ATLAS_RUN1_MEDIUM(const Particle& e) {
93 if (e.abspid() != PID::ELECTRON) return 0;
94
95 const static vector<double> eta_edges_10 = {0.000, 0.049, 0.454, 1.107, 1.46, 1.790, 2.277, 2.500};
96 const static vector<double> eta_vals_10 = {0.730, 0.757, 0.780, 0.771, 0.77, 0.777, 0.778};
97
98 const static vector<double> eta_edges_15 = {0.000, 0.053, 0.456, 1.102, 1.463, 1.783, 2.263, 2.500};
99 const static vector<double> eta_vals_15 = {0.780, 0.800, 0.819, 0.759, 0.749, 0.813, 0.829};
100
101 const static vector<double> eta_edges_20 = {0.000, 0.065, 0.362, 0.719, 0.980, 1.289, 1.455, 1.681, 1.942, 2.239, 2.452, 2.500};
102 const static vector<double> eta_vals_20 = {0.794, 0.806, 0.816, 0.806, 0.797, 0.774, 0.764, 0.788, 0.793, 0.806, 0.825};
103
104 const static vector<double> eta_edges_25 = {0.000, 0.077, 0.338, 0.742, 1.004, 1.265, 1.467, 1.692, 1.940, 2.227, 2.452, 2.500};
105 const static vector<double> eta_vals_25 = {0.833, 0.843, 0.853, 0.845, 0.839, 0.804, 0.790, 0.825, 0.830, 0.833, 0.839};
106
107 const static vector<double> eta_edges_30 = {0.000, 0.077, 0.350, 0.707, 0.980, 1.289, 1.479, 1.681, 1.942, 2.239, 2.441, 2.500};
108 const static vector<double> eta_vals_30 = {0.863, 0.872, 0.881, 0.874, 0.870, 0.824, 0.808, 0.847, 0.845, 0.840, 0.842};
109
110 const static vector<double> eta_edges_35 = {0.000, 0.058, 0.344, 0.700, 1.009, 1.270, 1.458, 1.685, 1.935, 2.231, 2.468, 2.500};
111 const static vector<double> eta_vals_35 = {0.878, 0.889, 0.901, 0.895, 0.893, 0.849, 0.835, 0.868, 0.863, 0.845, 0.832};
112
113 const static vector<double> eta_edges_40 = {0.000, 0.047, 0.355, 0.699, 0.983, 1.280, 1.446, 1.694, 1.943, 2.227, 2.441, 2.500};
114 const static vector<double> eta_vals_40 = {0.894, 0.901, 0.909, 0.905, 0.904, 0.875, 0.868, 0.889, 0.876, 0.848, 0.827};
115
116 const static vector<double> eta_edges_45 = {0.000, 0.058, 0.356, 0.712, 0.997, 1.282, 1.459, 1.686, 1.935, 2.220, 2.444, 2.500};
117 const static vector<double> eta_vals_45 = {0.900, 0.911, 0.923, 0.918, 0.917, 0.897, 0.891, 0.904, 0.894, 0.843, 0.796};
118
119 const static vector<double> eta_edges_50 = {0.000, 0.059, 0.355, 0.711, 0.983, 1.280, 1.469, 1.682, 1.919, 2.227, 2.441, 2.500};
120 const static vector<double> eta_vals_50 = {0.903, 0.913, 0.923, 0.922, 0.923, 0.903, 0.898, 0.908, 0.895, 0.831, 0.774};
121
122 const static vector<double> eta_edges_60 = {0.000, 0.053, 0.351, 0.720, 1.006, 1.291, 1.469, 1.696, 1.946, 2.243, 2.455, 2.500};
123 const static vector<double> eta_vals_60 = {0.903, 0.917, 0.928, 0.924, 0.927, 0.915, 0.911, 0.915, 0.899, 0.827, 0.760};
124
125 const static vector<double> eta_edges_80 = {0.000, 0.053, 0.351, 0.720, 0.994, 1.292, 1.482, 1.708, 1.934, 2.220, 2.458, 2.500};
126 const static vector<double> eta_vals_80 = {0.936, 0.942, 0.952, 0.956, 0.956, 0.934, 0.931, 0.944, 0.933, 0.940, 0.948};
127
128 const static vector<double> et_edges = { 10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 80 };
129 const static vector< vector<double> > et_eta_edges = { eta_edges_10, eta_edges_15, eta_edges_20, eta_edges_25, eta_edges_30, eta_edges_35, eta_edges_40, eta_edges_45, eta_edges_50, eta_edges_60, eta_edges_80 };
130 const static vector< vector<double> > et_eta_vals = { eta_vals_10, eta_vals_15, eta_vals_20, eta_vals_25, eta_vals_30, eta_vals_35, eta_vals_40, eta_vals_45, eta_vals_50, eta_vals_60, eta_vals_80 };
131
132 if (e.abseta() > 2.5 || e.Et() < 10*GeV) return 0.0;
133 const int i_et = binIndex(e.Et()/GeV, et_edges, true);
134 const int i_eta = binIndex(e.abseta(), et_eta_edges[i_et]);
135 return et_eta_vals[i_et][i_eta] * ELECTRON_RECOEFF_ATLAS_RUN1(e);
136 }
137
141 inline double ELECTRON_EFF_ATLAS_RUN2_MEDIUM(const Particle& e) {
142 if (e.abspid() != PID::ELECTRON) return 0;
143 return 1.01 * ELECTRON_EFF_ATLAS_RUN1_MEDIUM(e);
144 }
145
146
148 inline double ELECTRON_EFF_ATLAS_RUN1_TIGHT(const Particle& e) {
149 if (e.abspid() != PID::ELECTRON) return 0;
150
151 const static vector<double> eta_edges_10 = {0.000, 0.049, 0.459, 1.100, 1.461, 1.789, 2.270, 2.500};
152 const static vector<double> eta_vals_10 = {0.581, 0.632, 0.668, 0.558, 0.548, 0.662, 0.690};
153
154 const static vector<double> eta_edges_15 = {0.000, 0.053, 0.450, 1.096, 1.463, 1.783, 2.269, 2.500};
155 const static vector<double> eta_vals_15 = {0.630, 0.678, 0.714, 0.633, 0.616, 0.700, 0.733};
156
157 const static vector<double> eta_edges_20 = {0.000, 0.065, 0.362, 0.719, 0.992, 1.277, 1.479, 1.692, 1.930, 2.227, 2.464, 2.500};
158 const static vector<double> eta_vals_20 = {0.653, 0.695, 0.735, 0.714, 0.688, 0.635, 0.625, 0.655, 0.680, 0.691, 0.674};
159
160 const static vector<double> eta_edges_25 = {0.000, 0.077, 0.362, 0.719, 0.992, 1.300, 1.479, 1.692, 1.942, 2.227, 2.464, 2.500};
161 const static vector<double> eta_vals_25 = {0.692, 0.732, 0.768, 0.750, 0.726, 0.677, 0.667, 0.692, 0.710, 0.706, 0.679};
162
163 const static vector<double> eta_edges_30 = {0.000, 0.053, 0.362, 0.719, 1.004, 1.277, 1.467, 1.681, 1.954, 2.239, 2.452, 2.500};
164 const static vector<double> eta_vals_30 = {0.724, 0.763, 0.804, 0.789, 0.762, 0.702, 0.690, 0.720, 0.731, 0.714, 0.681};
165
166 const static vector<double> eta_edges_35 = {0.000, 0.044, 0.342, 0.711, 0.971, 1.280, 1.456, 1.683, 1.944, 2.218, 2.442, 2.500};
167 const static vector<double> eta_vals_35 = {0.736, 0.778, 0.824, 0.811, 0.784, 0.730, 0.718, 0.739, 0.743, 0.718, 0.678};
168
169 const static vector<double> eta_edges_40 = {0.000, 0.047, 0.355, 0.699, 0.983, 1.268, 1.457, 1.671, 1.931, 2.204, 2.453, 2.500};
170 const static vector<double> eta_vals_40 = {0.741, 0.774, 0.823, 0.823, 0.802, 0.764, 0.756, 0.771, 0.771, 0.734, 0.684};
171
172 const static vector<double> eta_edges_45 = {0.000, 0.056, 0.354, 0.711, 0.984, 1.280, 1.458, 1.684, 1.945, 2.207, 2.442, 2.500};
173 const static vector<double> eta_vals_45 = {0.758, 0.792, 0.841, 0.841, 0.823, 0.792, 0.786, 0.796, 0.794, 0.734, 0.663};
174
175 const static vector<double> eta_edges_50 = {0.000, 0.059, 0.355, 0.699, 0.983, 1.268, 1.446, 1.682, 1.943, 2.216, 2.453, 2.500};
176 const static vector<double> eta_vals_50 = {0.771, 0.806, 0.855, 0.858, 0.843, 0.810, 0.800, 0.808, 0.802, 0.730, 0.653};
177
178 const static vector<double> eta_edges_60 = {0.000, 0.050, 0.350, 0.707, 0.981, 1.278, 1.468, 1.694, 1.944, 2.242, 2.453, 2.500};
179 const static vector<double> eta_vals_60 = {0.773, 0.816, 0.866, 0.865, 0.853, 0.820, 0.812, 0.817, 0.804, 0.726, 0.645};
180
181 const static vector<double> eta_edges_80 = {0.000, 0.051, 0.374, 0.720, 0.981, 1.279, 1.468, 1.707, 1.945, 2.207, 2.457, 2.500};
182 const static vector<double> eta_vals_80 = {0.819, 0.855, 0.899, 0.906, 0.900, 0.869, 0.865, 0.873, 0.869, 0.868, 0.859};
183
184 const static vector<double> et_edges = { 10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 80 };
185 const static vector< vector<double> > et_eta_edges = { eta_edges_10, eta_edges_15, eta_edges_20, eta_edges_25, eta_edges_30, eta_edges_35, eta_edges_40, eta_edges_45, eta_edges_50, eta_edges_60, eta_edges_80 };
186 const static vector< vector<double> > et_eta_vals = { eta_vals_10, eta_vals_15, eta_vals_20, eta_vals_25, eta_vals_30, eta_vals_35, eta_vals_40, eta_vals_45, eta_vals_50, eta_vals_60, eta_vals_80 };
187
188 if (e.abseta() > 2.5 || e.Et() < 10*GeV) return 0.0;
189 const int i_et = binIndex(e.Et()/GeV, et_edges, true);
190 const int i_eta = binIndex(e.abseta(), et_eta_edges[i_et]);
191 return et_eta_vals[i_et][i_eta] * ELECTRON_RECOEFF_ATLAS_RUN1(e);
192 }
193
197 inline double ELECTRON_EFF_ATLAS_RUN2_TIGHT(const Particle& e) {
198 if (e.abspid() != PID::ELECTRON) return 0;
199 const static vector<double> et_edges = { /* 10, 15, */ 20, 25, 30, 35, 40, 45, 50, 60, 80 };
200 const static vector<double> et_effs = { 0.785, 0.805, 0.820, 0.830, 0.840, 0.850, 0.875, 0.910, 0.910 }; //Extra value extrapolated for overflow
201 const static vector<double> eta_edges = {0.000, 0.051, 0.374, 0.720, 0.981, 1.279, 1.468, 1.707, 1.945, 2.207, 2.457, 2.500}; // from ET > 80 bin
202 const static vector<double> eta_refs = {0.819, 0.855, 0.899, 0.906, 0.900, 0.869, 0.865, 0.873, 0.869, 0.868, 0.859};
203 if (e.abseta() > 2.5 || e.Et() < 20*GeV) return 0.0;
204 const int i_et = binIndex(e.Et()/GeV, et_edges, true);
205 const int i_eta = binIndex(e.abseta(), eta_edges);
206 const double eff_et = et_effs[i_et]; //< integral eff
207 // Scale to |eta| shape, following the ~85% efficient high-ET bin from Run 1
208 const double eff = eff_et * (eta_refs[i_eta]/0.85) * ELECTRON_RECOEFF_ATLAS_RUN2(e);
209 //return ELECTRON_IDEFF_ATLAS_RUN1_TIGHT(e);
210 return eff;
211 }
212
213
214
217 static const vector<double> edges_eta = {0., 2.5, 3.};
218 static const vector<double> edges_pt = {0., 0.1, 25.};
219 static const vector<double> e2s = {0.000, 0.015, 0.005,
220 0.005, 0.005, 0.005,
221 0.107, 0.107, 0.107};
222 static const vector<double> es = {0.00, 0.00, 0.05,
223 0.05, 0.05, 0.05,
224 2.08, 2.08, 2.08};
225 static const vector<double> cs = {0.00, 0.00, 0.25,
226 0.25, 0.25, 0.25,
227 0.00, 0.00, 0.00};
228
229 const int i_eta = binIndex(e.abseta(), edges_eta, true);
230 const int i_pt = binIndex(e.pT()/GeV, edges_pt, true);
231 const int i = i_eta*edges_pt.size() + i_pt;
232
233 // Calculate absolute resolution in GeV
234 const double c1 = sqr(e2s[i]), c2 = sqr(es[i]), c3 = sqr(cs[i]);
235 const double resolution = sqrt(c1*e.E2() + c2*e.E() + c3) * GeV;
236
237 // normal_distribution<> d(e.E(), resolution);
238 // const double mass = e.mass2() > 0 ? e.mass() : 0; //< numerical carefulness...
239 // const double smeared_E = max(d(gen), mass); //< can't let the energy go below the mass!
240 // return Particle(e.pid(), FourMomentum::mkEtaPhiME(e.eta(), e.phi(), mass, smeared_E));
241 return Particle(e.pid(), P4_SMEAR_E_GAUSS(e, resolution));
242 }
243
244
251
252
254
255
256
258 inline double ELECTRON_EFF_CMS_RUN1(const Particle& e) {
259 if (e.abspid() != PID::ELECTRON) return 0;
260 if (e.abseta() > 2.5) return 0;
261 if (e.pT() < 10*GeV) return 0;
262 return (e.abseta() < 1.5) ? 0.95 : 0.85;
263 }
264
266 inline double ELECTRON_EFF_CMS_RUN1_LOOSE(const Particle& e) { return ELECTRON_EFF_CMS_RUN1(e); }
269 inline double ELECTRON_EFF_CMS_RUN1_MEDIUM(const Particle& e) { return ELECTRON_EFF_CMS_RUN1(e); }
272 inline double ELECTRON_EFF_CMS_RUN1_TIGHT(const Particle& e) { return ELECTRON_EFF_CMS_RUN1(e); }
273
274
278 inline double ELECTRON_EFF_CMS_RUN2(const Particle& e) {
279 if (e.abspid() != PID::ELECTRON) return 0;
280 return ELECTRON_EFF_CMS_RUN1(e);
281 }
282
284 inline double ELECTRON_EFF_CMS_RUN2_LOOSE(const Particle& e) { return ELECTRON_EFF_CMS_RUN2(e); }
287 inline double ELECTRON_EFF_CMS_RUN2_MEDIUM(const Particle& e) { return ELECTRON_EFF_CMS_RUN2(e); }
290 inline double ELECTRON_EFF_CMS_RUN2_TIGHT(const Particle& e) { return ELECTRON_EFF_CMS_RUN2(e); }
291
292
300 // Calculate absolute resolution in GeV from functional form
301 double resolution = 0;
302 const double abseta = e.abseta();
303 if (e.pT() > 0.1*GeV && abseta < 2.5) { //< should be a given from efficiencies
304 if (abseta < 0.5) {
305 resolution = add_quad(0.06, 1.3e-3 * e.pT()/GeV) * GeV;
306 } else if (abseta < 1.5) {
307 resolution = add_quad(0.10, 1.7e-3 * e.pT()/GeV) * GeV;
308 } else { // still |eta| < 2.5
309 resolution = add_quad(0.25, 3.1e-3 * e.pT()/GeV) * GeV;
310 }
311 }
312
313 // normal_distribution<> d(e.E(), resolution);
314 // const double mass = e.mass2() > 0 ? e.mass() : 0; //< numerical carefulness...
315 // const double smeared_E = max(d(gen), mass); //< can't let the energy go below the mass!
316 // return Particle(e.pid(), FourMomentum::mkEtaPhiME(e.eta(), e.phi(), mass, smeared_E));
317 return Particle(e.pid(), P4_SMEAR_E_GAUSS(e, resolution));
318 }
319
324 return ELECTRON_SMEAR_CMS_RUN1(e);
325 }
326
328
329
330
333
337 inline double PHOTON_EFF_ATLAS_RUN1(const Particle& y) {
338 if (y.abspid() != PID::PHOTON) return 0;
339
340 if (y.pT() < 10*GeV) return 0;
341 if (inRange(y.abseta(), 1.37, 1.52) || y.abseta() > 2.37) return 0;
342
343 static const vector<double> edges_eta = {0., 0.6, 1.37, 1.52, 1.81, 2.37};
344 static const vector<double> edges_pt = {10., 15., 20., 25., 30., 35., 40., 45.,
345 50., 60., 80., 100., 125., 150., 175., 250.};
346 static const vector<double> effs = {0.53, 0.65, 0.73, 0.83, 0.86, 0.93, 0.94, 0.96,
347 0.97, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98,//
348 0.45, 0.57, 0.67, 0.74, 0.84, 0.87, 0.93, 0.94,
349 0.95, 0.96, 0.97, 0.98, 0.98, 0.99, 0.99, 0.99,//
350 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00,
351 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00,//
352 0.48, 0.56, 0.68, 0.76, 0.86, 0.90, 0.93, 0.95,
353 0.96, 0.97, 0.98, 0.99, 0.99, 1.00, 1.00, 1.00,//
354 0.50, 0.61, 0.74, 0.82, 0.88, 0.92, 0.94, 0.95,
355 0.96, 0.97, 0.98, 0.98, 0.98, 0.98, 0.99, 0.99};
356
357 const int i_eta = binIndex(y.abseta(), edges_eta);
358 const int i_pt = binIndex(y.pT()/GeV, edges_pt, true);
359 const int i = i_eta*edges_pt.size() + i_pt;
360 const double eff = effs[i];
361 return eff;
362 }
363
365 inline double PHOTON_EFF_ATLAS_RUN1_LOOSE(const Particle& y) { return PHOTON_EFF_ATLAS_RUN1(y); }
368 inline double PHOTON_EFF_ATLAS_RUN1_MEDIUM(const Particle& y) { return PHOTON_EFF_ATLAS_RUN1(y); }
371 inline double PHOTON_EFF_ATLAS_RUN1_TIGHT(const Particle& y) { return PHOTON_EFF_ATLAS_RUN1(y); }
372
373
377 inline double PHOTON_EFF_ATLAS_RUN2(const Particle& y) {
378 if (y.abspid() != PID::PHOTON) return 0;
379
380 if (y.pT() < 10*GeV) return 0;
381 if (inRange(y.abseta(), 1.37, 1.52) || y.abseta() > 2.37) return 0;
382
383 static const vector<double> edges_eta = {0., 0.6, 1.37, 1.52, 1.81, 2.37};
384 static const vector<double> edges_pt = {10., 15., 20., 25., 30., 35., 40., 45.,
385 50., 60., 80., 100., 125., 150., 175., 250.};
386 static const vector<double> effs = {0.55, 0.70, 0.85, 0.89, 0.93, 0.95, 0.96, 0.96,
387 0.97, 0.97, 0.98, 0.97, 0.97, 0.97, 0.97, 0.97,//
388 0.47, 0.66, 0.79, 0.86, 0.89, 0.94, 0.96, 0.97,
389 0.97, 0.98, 0.97, 0.98, 0.98, 0.98, 0.98, 0.98,//
390 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00,
391 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00,//
392 0.54, 0.71, 0.84, 0.88, 0.92, 0.93, 0.94, 0.95,
393 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96,//
394 0.61, 0.74, 0.83, 0.88, 0.91, 0.94, 0.95, 0.96,
395 0.97, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98};
396
397 const int i_eta = binIndex(y.abseta(), edges_eta);
398 const int i_pt = binIndex(y.pT()/GeV, edges_pt, true);
399 const int i = i_eta*edges_pt.size() + i_pt;
400 const double eff = effs[i];
401 return eff;
402 }
403
405 inline double PHOTON_EFF_ATLAS_RUN2_LOOSE(const Particle& y) { return PHOTON_EFF_ATLAS_RUN2(y); }
408 inline double PHOTON_EFF_ATLAS_RUN2_MEDIUM(const Particle& y) { return PHOTON_EFF_ATLAS_RUN2(y); }
411 inline double PHOTON_EFF_ATLAS_RUN2_TIGHT(const Particle& y) { return PHOTON_EFF_ATLAS_RUN2(y); }
412
413
417 inline double PHOTON_EFF_CMS_RUN1(const Particle& y) {
418 if (y.abspid() != PID::PHOTON) return 0;
419 if (y.pT() < 10*GeV || y.abseta() > 2.5) return 0;
420 return (y.abseta() < 1.5) ? 0.95 : 0.85;
421 }
422
424 inline double PHOTON_EFF_CMS_RUN1_LOOSE(const Particle& y) { return PHOTON_EFF_CMS_RUN1(y); }
427 inline double PHOTON_EFF_CMS_RUN1_MEDIUM(const Particle& y) { return PHOTON_EFF_CMS_RUN1(y); }
430 inline double PHOTON_EFF_CMS_RUN1_TIGHT(const Particle& y) { return PHOTON_EFF_CMS_RUN1(y); }
431
432
436 inline double PHOTON_EFF_CMS_RUN2(const Particle& y) {
437 if (y.abspid() != PID::PHOTON) return 0;
438 return PHOTON_EFF_CMS_RUN1(y);
439 }
440
442 inline double PHOTON_EFF_CMS_RUN2_LOOSE(const Particle& y) { return PHOTON_EFF_CMS_RUN2(y); }
445 inline double PHOTON_EFF_CMS_RUN2_MEDIUM(const Particle& y) { return PHOTON_EFF_CMS_RUN2(y); }
448 inline double PHOTON_EFF_CMS_RUN2_TIGHT(const Particle& y) { return PHOTON_EFF_CMS_RUN2(y); }
449
450
452 inline Particle PHOTON_SMEAR_ATLAS_RUN1(const Particle& y) { return y; }
453 inline Particle PHOTON_SMEAR_ATLAS_RUN2(const Particle& y) { return y; }
454 inline Particle PHOTON_SMEAR_CMS_RUN1(const Particle& y) { return y; }
455 inline Particle PHOTON_SMEAR_CMS_RUN2(const Particle& y) { return y; }
456
458
459
460
463
465 inline double MUON_EFF_ATLAS_RUN1(const Particle& m) {
466 if (m.abspid() != PID::MUON) return 0;
467 if (m.abseta() > 2.7) return 0;
468 if (m.pT() < 10*GeV) return 0;
469 return (m.abseta() < 1.5) ? 0.95 : 0.85;
470 }
471
473 inline double MUON_EFF_ATLAS_RUN1_LOOSE(const Particle& m) { return MUON_EFF_ATLAS_RUN1(m); }
476 inline double MUON_EFF_ATLAS_RUN1_MEDIUM(const Particle& m) { return MUON_EFF_ATLAS_RUN1(m); }
479 inline double MUON_EFF_ATLAS_RUN1_TIGHT(const Particle& m) { return MUON_EFF_ATLAS_RUN1(m); }
480
481
485 inline double MUON_RECOEFF_ATLAS_RUN2(const Particle& m) {
486 if (m.abspid() != PID::MUON) return 0;
487 if (m.abseta() > 2.5) return 0;
488 if (m.abseta() < 0.1) return 0.61;
489 // if (m.pT() < 10*GeV) return 0;
490 return (m.abseta() < 1) ? 0.98 : 0.99;
491 }
492
493
497 inline double MUON_ISOEFF_ATLAS_RUN2_LOOSE(const Particle& m) {
498 if (m.abspid() != PID::MUON) return 0;
499 static const vector<double> edges_pt = {0., 3., 4., 5., 6., 7., 8., 9., 10., 15., 20., 30., 40.};
500 static const vector<double> effs_pt = {0., 0.58, 0.70, 0.75, 0.80, 0.82, 0.85, 0.87, 0.90, 0.95, 0.98, 1.00, 1.00};
501 const int i_pt = binIndex(m.pT()/GeV, edges_pt, true);
502 const double eff_pt = effs_pt[i_pt];
503 return eff_pt;
504 }
505
506
510 inline double MUON_EFF_ATLAS_RUN2_LOOSE(const Particle& m) {
511 if (m.abspid() != PID::MUON) return 0;
512 if (m.abseta() > 2.5) return 0;
513 static const vector<double> edges_pt = {0., 3.5, 4., 5., 6., 7., 8., 10.};
514 static const vector<double> effs = {0.00, 0.88, 0.92, 0.97, 0.98, 0.98, 0.98, 0.99};
515 const int i_pt = binIndex(m.pT()/GeV, edges_pt, true);
516 const double eff = effs[i_pt];
517 // no eta dependence
518 return eff * MUON_ISOEFF_ATLAS_RUN2_LOOSE(m);
519 }
520
521
525 inline double MUON_EFF_ATLAS_RUN2_MEDIUM(const Particle& m) {
526 if (m.abspid() != PID::MUON) return 0;
527 if (m.abseta() > 2.5) return 0;
528 static const vector<double> edges_pt = {0., 3.5, 4., 5., 6., 7., 8., 9., 10., 12., 14., 16., 18., 20., 25., 30., 35., 40., 45., 50.};
529 static const vector<double> effs_pt = {0.00, 0.48, 0.62, 0.82, 0.94, 0.95, 0.96, 0.96, 0.97, 0.97, 0.97, 0.97, 0.97, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98};
530 const int i_pt = binIndex(m.pT()/GeV, edges_pt, true);
531 const double eff_pt = effs_pt[i_pt];
532 static const vector<double> edges_eta = {0., 0.25, 0.50, 0.75, 1.00, 1.25, 1.50, 1.75, 2.00, 2.25, 2.50};
533 static const vector<double> effs_eta = {0.85, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99, 0.99};
534 const int i_eta = binIndex(m.abseta(), edges_eta, true);
535 const double eff_eta = effs_eta[i_eta] / 0.99; //< norm factor as approximate double differential
536 return eff_pt*eff_eta * MUON_ISOEFF_ATLAS_RUN2_LOOSE(m);
537 }
538
539
543 inline double MUON_EFF_ATLAS_RUN2_TIGHT(const Particle& m) {
544 if (m.abspid() != PID::MUON) return 0;
545 if (m.abseta() > 2.5) return 0;
546 static const vector<double> edges_pt = {0., 3.5, 4., 5., 6., 7., 8., 9., 10., 12., 14., 16., 18., 20.};
547 static const vector<double> effs_pt = {0.00, 0.00, 0.68, 0.81, 0.85, 0.88, 0.89, 0.90, 0.91, 0.92, 0.92, 0.92, 0.93, 0.93};
548 const int i_pt = binIndex(m.pT()/GeV, edges_pt, true);
549 const double eff_pt = effs_pt[i_pt];
550 static const vector<double> edges_eta = {0., 0.25, 0.50, 0.75, 1.00, 1.25, 1.50, 1.75, 2.00, 2.25, 2.50};
551 static const vector<double> effs_eta = {0.78, 0.94, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96};
552 const int i_eta = binIndex(m.abseta(), edges_eta, true);
553 const double eff_eta = effs_eta[i_eta] / 0.96; //< norm factor as approximate double differential
554 return eff_pt*eff_eta * MUON_ISOEFF_ATLAS_RUN2_LOOSE(m);
555 }
556
557
563 static const vector<double> edges_eta = {0, 1.5, 2.5};
564 static const vector<double> edges_pt = {0, 0.1, 1.0, 10., 200.};
565 static const vector<double> res = {0., 0.03, 0.02, 0.03, 0.05,
566 0., 0.04, 0.03, 0.04, 0.05};
567
568 const int i_eta = binIndex(m.abseta(), edges_eta);
569 const int i_pt = binIndex(m.pT()/GeV, edges_pt, true);
570 const int i = i_eta*edges_pt.size() + i_pt;
571 const double resolution_fixed = res[i];
572
573 // For pT > 200 GeV, add an ad-hoc linear scaling to follow the trend of
574 // https://arxiv.org/pdf/2012.00578 Fig 2 but without the high-pT working point,
575 // slightly generously hitting 45% rather than 66% at 2500 GeV.
576 const double resolution = resolution_fixed *
577 (1.0 + max(0.0, (((0.45-0.05)/0.05 - 1.0)/2300) * (m.pT() - 200*GeV)/GeV));
578
579 // Smear by a Gaussian centered on the current pT, with width given by the resolution
580 // normal_distribution<> d(m.pT(), resolution*m.pT());
581 // const double smeared_pt = max(d(gen), 0.);
582 // const double mass = m.mass2() > 0 ? m.mass() : 0; //< numerical carefulness...
583 // return Particle(m.pid(), FourMomentum::mkEtaPhiMPt(m.eta(), m.phi(), mass, smeared_pt));
584 return Particle(m.pid(), P4_SMEAR_PT_GAUSS(m, resolution*m.pT()));
585 }
586
594 // Low-pT res limit:
595 double mres_pt = 0.015;
596 // Hit sig_mm / m_mm ~ 0.025 at 100 GeV cf. Fig 12:
597 if (m.pT() > 50*GeV) mres_pt = 0.015 + 0.01*(m.pT() - 50*GeV)/(50*GeV);
598 // Hit sig(q/p) = 32% / sqrt(2) at pT = 2500 cf. Fig 2, degrade linearly:
599 if (m.pT() > 100*GeV) mres_pt = 0.025 + 0.0084*(m.pT() - 100*GeV)/(100*GeV);
600 const double ptres_pt = SQRT2 * mres_pt; //< from Eq (10)
601 const double resolution = (m.abseta() < 1.5 ? 1.0 : 1.25) * ptres_pt;
602 return Particle(m.pid(), P4_SMEAR_PT_GAUSS(m, resolution*m.pT()));
603 }
604
606 inline double MUON_EFF_CMS_RUN1(const Particle& m) {
607 if (m.abspid() != PID::MUON) return 0;
608 if (m.abseta() > 2.4) return 0;
609 if (m.pT() < 10*GeV) return 0;
610 return 0.95 * (m.abseta() < 1.5 ? 1 : exp(0.5 - 5e-4*m.pT()/GeV));
611 }
612
615 inline double MUON_EFF_CMS_RUN1_LOOSE(const Particle& m) { return MUON_EFF_CMS_RUN1(m); }
619 inline double MUON_EFF_CMS_RUN1_MEDIUM(const Particle& m) { return MUON_EFF_CMS_RUN1(m); }
623 inline double MUON_EFF_CMS_RUN1_TIGHT(const Particle& m) { return MUON_EFF_CMS_RUN1(m); }
624
625
629 inline double MUON_EFF_CMS_RUN2(const Particle& m) {
630 return MUON_EFF_CMS_RUN1(m);
631 }
632
635 inline double MUON_EFF_CMS_RUN2_LOOSE(const Particle& m) { return MUON_EFF_CMS_RUN2(m); }
639 inline double MUON_EFF_CMS_RUN2_MEDIUM(const Particle& m) { return MUON_EFF_CMS_RUN2(m); }
643 inline double MUON_EFF_CMS_RUN2_TIGHT(const Particle& m) { return MUON_EFF_CMS_RUN2(m); }
644
645
646
649 // Calculate fractional resolution
650 // for pT > 0.1 GeV, mom resolution = |eta| < 0.5 -> sqrt(0.01^2 + pt^2 * 2.0e-4^2)
651 // |eta| < 1.5 -> sqrt(0.02^2 + pt^2 * 3.0e-4^2)
652 // |eta| < 2.5 -> sqrt(0.05^2 + pt^2 * 2.6e-4^2)
653 double resolution = 0;
654 const double abseta = m.abseta();
655 if (m.pT() > 0.1*GeV && abseta < 2.5) {
656 if (abseta < 0.5) {
657 resolution = add_quad(0.01, 2.0e-4 * m.pT()/GeV);
658 } else if (abseta < 1.5) {
659 resolution = add_quad(0.02, 3.0e-4 * m.pT()/GeV);
660 } else { // still |eta| < 2.5... but isn't CMS' mu acceptance < 2.4?
661 resolution = add_quad(0.05, 2.6e-4 * m.pT()/GeV);
662 }
663 }
664
665 // Smear by a Gaussian centered on the current pT, with width given by the resolution
666 // normal_distribution<> d(m.pT(), resolution*m.pT());
667 // const double smeared_pt = max(d(gen), 0.);
668 // const double mass = m.mass2() > 0 ? m.mass() : 0; //< numerical carefulness...
669 // return Particle(m.pid(), FourMomentum::mkEtaPhiMPt(m.eta(), m.phi(), mass, smeared_pt));
670 return Particle(m.pid(), P4_SMEAR_PT_GAUSS(m, resolution*m.pT()));
671 }
672
677 return MUON_SMEAR_CMS_RUN1(m);
678 }
679
681
682
683
686
694 inline double TAU_EFF_ATLAS_RUN1_MEDIUM(const Particle& t) {
695 if (t.abseta() > 2.5) return 0; //< hmm... mostly
696 if (inRange(t.abseta(), 1.37, 1.52)) return 0; //< crack region
697 double pThadvis = 0;
698 Particles chargedhadrons;
699 for (const Particle& p : t.children()) {
700 if (p.isHadron()) {
701 pThadvis += p.pT(); //< right definition? Paper is unclear
702 if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1*GeV) chargedhadrons += p;
703 }
704 }
705 if (chargedhadrons.empty()) return 0; //< leptonic tau
706 if (pThadvis < 20*GeV) return 0; //< below threshold
707 if (pThadvis < 40*GeV) {
708 if (chargedhadrons.size() == 1) return (t.abspid() == PID::TAU) ? 0.56 : 0; //1/20.;
709 if (chargedhadrons.size() == 3) return (t.abspid() == PID::TAU) ? 0.38 : 0; //1/100.;
710 } else {
711 if (chargedhadrons.size() == 1) return (t.abspid() == PID::TAU) ? 0.56 : 0; //1/25.;
712 if (chargedhadrons.size() == 3) return (t.abspid() == PID::TAU) ? 0.38 : 0; //1/400.;
713 }
714 return 0;
715 }
716
718 inline double TAU_EFF_ATLAS_RUN1(const Particle& t) { return TAU_EFF_ATLAS_RUN1_MEDIUM(t); }
721 inline double TAU_EFF_ATLAS_RUN1_LOOSE(const Particle& t) { return TAU_EFF_ATLAS_RUN1(t); }
724 inline double TAU_EFF_ATLAS_RUN1_TIGHT(const Particle& t) { return TAU_EFF_ATLAS_RUN1(t); }
725
726
734 inline double TAUJET_EFF_ATLAS_RUN1(const Jet& j) {
735 if (j.abseta() > 2.5) return 0; //< hmm... mostly
736 if (inRange(j.abseta(), 1.37, 1.52)) return 0; //< crack region
737 double pThadvis = 0;
738 Particles chargedhadrons;
739 for (const Particle& p : j.particles()) {
740 if (p.isHadron()) {
741 pThadvis += p.pT(); //< right definition? Paper is unclear
742 if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1*GeV) chargedhadrons += p;
743 }
744 }
745
746 if (chargedhadrons.empty()) return 0; //< leptonic tau?
747 if (pThadvis < 20*GeV) return 0; //< below threshold
748
749 const Particles ttags = j.tauTags(Cuts::pT > 10*GeV);
750 // MisID rates for jets without truth tau label
751 if (ttags.empty()) {
752 if (pThadvis < 40*GeV)
753 return chargedhadrons.size() == 1 ? 1/20. : chargedhadrons.size() == 3 ? 1/100. : 0; //< fake rates
754 else
755 return chargedhadrons.size() == 1 ? 1/25. : chargedhadrons.size() == 3 ? 1/400. : 0; //< fake rates
756 }
757 // Efficiencies for jets with a truth tau label
758 const Particles prongs = ttags[0].stableDescendants(Cuts::charge3 > 0 && Cuts::pT > 1*GeV && Cuts::abseta < 2.5);
759 return prongs.size() == 1 ? 0.56 : 0.38;
760 }
761
762
768 inline double TAU_EFF_ATLAS_RUN2_MEDIUM(const Particle& t) {
769 if (t.abspid() != PID::TAU) return 0;
770 if (t.abseta() > 2.5) return 0; //< hmm... mostly
771 if (inRange(t.abseta(), 1.37, 1.52)) return 0; //< crack region
772 double pThadvis = 0;
773 Particles chargedhadrons;
774 for (const Particle& p : t.children()) {
775 if (p.isHadron()) {
776 pThadvis += p.pT(); //< right definition? Paper is unclear
777 if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1*GeV) chargedhadrons += p;
778 }
779 }
780 if (chargedhadrons.empty()) return 0; //< leptonic tau
781 if (pThadvis < 20*GeV) return 0; //< below threshold
782 if (chargedhadrons.size() == 1) return (t.abspid() == PID::TAU) ? 0.55 : 0; //1/50.;
783 if (chargedhadrons.size() == 3) return (t.abspid() == PID::TAU) ? 0.40 : 0; //1/110.;
784 return 0;
785 }
786
788 inline double TAU_EFF_ATLAS_RUN2(const Particle& t) { return TAU_EFF_ATLAS_RUN2_MEDIUM(t); }
791 inline double TAU_EFF_ATLAS_RUN2_LOOSE(const Particle& t) { return TAU_EFF_ATLAS_RUN2(t); }
794 inline double TAU_EFF_ATLAS_RUN2_TIGHT(const Particle& t) { return TAU_EFF_ATLAS_RUN2(t); }
795
796
802 inline double TAUJET_EFF_ATLAS_RUN2(const Jet& j) {
803 if (j.abseta() > 2.5) return 0; //< hmm... mostly
804 if (inRange(j.abseta(), 1.37, 1.52)) return 0; //< crack region
805 double pThadvis = 0;
806 Particles chargedhadrons;
807 for (const Particle& p : j.particles()) {
808 if (p.isHadron()) {
809 pThadvis += p.pT(); //< right definition? Paper is unclear
810 if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1*GeV) chargedhadrons += p;
811 }
812 }
813 if (chargedhadrons.empty()) return 0;
814 if (pThadvis < 20*GeV) return 0; //< below threshold
815 const Particles ttags = j.tauTags(Cuts::pT > 10*GeV);
816 // if (ttags.empty()) {
817 // if (pThadvis < 40*GeV)
818 // return chargedhadrons.size() == 1 ? 1/50. : 1/110.; //< fake rates
819 // else
820 // return chargedhadrons.size() == 1 ? 1/25. : 1/400.; //< fake rates
821 // }
822 if (ttags.empty()) return chargedhadrons.size() == 1 ? 1/50. : chargedhadrons.size() == 3 ? 1/110. : 0; //< fake rates
823 const Particles prongs = ttags[0].stableDescendants(Cuts::charge3 > 0 && Cuts::pT > 1*GeV && Cuts::abseta < 2.5);
824 return prongs.size() == 1 ? 0.55 : 0.40;
825 }
826
827
832 // // Const fractional resolution for now
833 // static const double resolution = 0.03;
834
835 // // Smear by a Gaussian centered on 1 with width given by the (fractional) resolution
836 // /// @todo Is this the best way to smear? Should we preserve the energy, or pT, or direction?
837 // const double fsmear = max(randnorm(1., resolution), 0.);
838 // const double mass = t.mass2() > 0 ? t.mass() : 0; //< numerical carefulness...
839 // return Particle(t.pid(), FourMomentum::mkXYZM(t.px()*fsmear, t.py()*fsmear, t.pz()*fsmear, mass));
840
841 // Jet energy resolution lookup
842 // Implemented by Matthias Danninger for GAMBIT, based roughly on
843 // https://atlas.web.cern.ch/Atlas/GROUPS/PHYSICS/CONFNOTES/ATLAS-CONF-2015-017/
844 // Parameterisation can be still improved, but eta dependence is minimal
846 static const vector<double> binedges_pt = {0., 50., 70., 100., 150., 200., 1000., 10000.};
847 static const vector<double> jer = {0.145, 0.115, 0.095, 0.075, 0.07, 0.05, 0.04, 0.04}; //< note overflow value
848 const int ipt = binIndex(t.pT()/GeV, binedges_pt, true);
849 if (ipt < 0) return t;
850 const double resolution = jer.at(ipt);
851
852 // Smear by a Gaussian centered on 1 with width given by the (fractional) resolution
854 const double fsmear = max(randnorm(1., resolution), 0.);
855 const double mass = t.mass2() > 0 ? t.mass() : 0; //< numerical carefulness...
856 Particle rtn(PID::TAU, FourMomentum::mkXYZM(t.px()*fsmear, t.py()*fsmear, t.pz()*fsmear, mass));
857 //if (deltaPhi(t, rtn) > 0.01) cout << "jdphi: " << deltaPhi(t, rtn) << endl;
858 return rtn;
859 }
860
861
866 return TAU_SMEAR_ATLAS_RUN1(t);
867 }
868
869
873 inline double TAU_EFF_CMS_RUN1(const Particle& t) {
874 if (t.abspid() != PID::TAU) return 0;
875 return (t.abspid() == PID::TAU) ? 0.6 : 0;
876 }
877
879 inline double TAU_EFF_CMS_RUN1_LOOSE(const Particle& t) { return TAU_EFF_CMS_RUN1(t); }
882 inline double TAU_EFF_CMS_RUN1_MEDIUM(const Particle& t) { return TAU_EFF_CMS_RUN1(t); }
885 inline double TAU_EFF_CMS_RUN1_TIGHT(const Particle& t) { return TAU_EFF_CMS_RUN1(t); }
886
890 inline double TAU_EFF_CMS_RUN2(const Particle& t) {
891 if (t.abspid() != PID::TAU) return 0;
892 return (t.abspid() == PID::TAU) ? 0.6 : 0;
893 }
894
896 inline double TAU_EFF_CMS_RUN2_LOOSE(const Particle& t) { return TAU_EFF_CMS_RUN2(t); }
899 inline double TAU_EFF_CMS_RUN2_MEDIUM(const Particle& t) { return TAU_EFF_CMS_RUN2(t); }
902 inline double TAU_EFF_CMS_RUN2_TIGHT(const Particle& t) { return TAU_EFF_CMS_RUN2(t); }
903
904
909 return TAU_SMEAR_ATLAS_RUN1(t);
910 }
911
912
917 return TAU_SMEAR_CMS_RUN1(t);
918 }
919
921
922
923
926
928 inline double JET_BTAG_ATLAS_RUN1(const Jet& j) {
930 if (j.abseta() > 2.5) return 0;
931 const auto ftagsel = [&](const Particle& p){ return p.pT() > 5*GeV && deltaR(p,j) < 0.3; };
932 if (j.bTagged(ftagsel)) return 0.80*tanh(0.003*j.pT()/GeV)*(30/(1+0.0860*j.pT()/GeV));
933 if (j.cTagged(ftagsel)) return 0.20*tanh(0.020*j.pT()/GeV)*( 1/(1+0.0034*j.pT()/GeV));
934 return 0.002 + 7.3e-6*j.pT()/GeV;
935 }
936
937 inline double JET_BTAG_ATLAS_RUN1_XXX(const Jet& j) { return JET_BTAG_ATLAS_RUN1(j); }
938
940 inline double JET_BTAG_ATLAS_RUN2_MV2C20(const Jet& j) {
941 if (j.abseta() > 2.5) return 0;
942 if (j.bTagged(Cuts::pT > 5*GeV)) return 0.77;
943 if (j.cTagged(Cuts::pT > 5*GeV)) return 1/4.5;
944 return 1/140.;
945 }
946
948 inline double JET_BTAG_ATLAS_RUN2_MV2C10(const Jet& j) {
949 if (j.abseta() > 2.5) return 0;
950 if (j.bTagged(Cuts::pT > 5*GeV)) return 0.77;
951 if (j.cTagged(Cuts::pT > 5*GeV)) return 1/6.0;
952 return 1/134.;
953 }
954
955 // pT-dependendent ATLAS Run 2 (2016 study) MV2c10 b-tagging efficiencies.
956 // If high-pT b-jets are important in your analysis, be careful!
957 // Based on ATL-PHYS-PUB-2016-012 fig 12
958 inline double JET_BTAG_ATLAS_RUN2_2016_MV2C10_77(const Jet & j){
959 if (j.bTagged()){
960 // N.B. !!! There is no overflow bin.
961 // There is a clear downward curve in efficiency as pT->inf, but the value to use for pT > 500
962 // is super-unclear. The used value (0.69) is certainly a reasonable extrapolation, but it should
963 // be noted that tuning this value can make a really significant difference to the bin counts O(10%)
964 // HOWEVER: atlas really needs to start increasing the range of this sort of plot
965 // The behaviour of jets pT>500 is much more interesting and significant than those in the range 20<pt<25.
966 const static vector<double>binedges_pt = {0.00, 30.0, 40.00, 50.00, 60.0, 75.00, 90.0, 105., 150., 200., 500 };
967 const static vector<double> eff_pt = {0.63, 0.705, 0.74, 0.76, 0.775, 0.785, 0.795, 0.80, 0.79, 0.75, 0.68};
968
969 return eff_pt[binIndex(j.pt(), binedges_pt, true)];
970 }
971 else if (j.cTagged()){
972 //n.b. there is also a pt/eta table for c mistags, but if that's significant I'll eat my hat.
973 return 1./5.;
974 }
975 else if (j.tauTagged()){
976 return 1./16.;
977 }
978 else return 1./110.;
979 }
980
981 // pT-dependendent ATLAS Run 2 DL1d b-tagging efficiencies.
982 // If high-pT b-jets are important in your analysis, be careful!
983 inline double JET_BTAG_ATLAS_RUN2_DL1d_77(const Jet &j){
984 if (j.bTagged()){
985 if (j.abseta() > 2.5) return 0.;
986
987 // Original Values from FTAG-2023-01 (up to 400 GeV)
988 // N.B. !!! There is no overflow bin.
989 // There is a clear downward curve in efficiency as pT->inf, but the value to use for pT > 500
990 // is super-unclear. The used value (0.69) is certainly a reasonable extrapolation, but it should
991 // be noted that tuning this value can make a really significant difference to the bin counts O(10%)
992 // HOWEVER: atlas really needs to start increasing the range of this sort of plot
993 // The behaviour of jets pT>500 is much more interesting and significant than those in the range 20<pt<25.
994 // N.B.2 Message above copied from my implementation of MV2c10. Plus ca change...
995 // Better distributions available for DL1r, but not here.
996 // I will use the DL1/DL1r plots in arXiv:2211.16345 to guess a good overflow value
997 // (the consistency between DL1, DL1r hopefully makes this not crazy)
998 const static vector<double>binedges_pt = {0.00, 20., 30., 40., 60., 85., 110., 140., 175., 250., 400., 800., 1200., 2000.};
999 const static vector<double> eff_pt = {0.0, 0.68, 0.74, 0.77, 0.79, 0.8, 0.81, 0.81, 0.805, 0.78, 0.75, 0.7, 0.65, 0.5};
1000
1001 return eff_pt[binIndex(j.pt(), binedges_pt, true)];
1002 }
1003 else if (j.cTagged()){
1004 //n.b. there is also a pt/eta table for c mistags, shouldn't be too significant
1005 return 0.155;
1006 }
1007 // Nothing in the paper, going to guess something small just in case.
1008 else if (j.tauTagged()){
1009 return 1./36.;
1010 }
1011 else return 0.0038;
1012 }
1013
1014 // Based on figs 11-12 of https://arxiv.org/pdf/2211.16345
1015 // As far as I can see, this is the only pre-GN2 b-tag paper
1016 // that includes efficiencies up to very high pt. Thankyou!!!
1017 // Though n.b. the 0-250 range is in ttbar and 250-3000 is in
1018 // simulated Z', hence the discontinuities going on.
1019 inline double JET_BTAG_ATLAS_RUN2_DL1r_77(const Jet & j){
1020 if (j.pt() <= 20*GeV || j.abseta() > 2.5) return 0.;
1021
1022 const static vector<double>binedges_pt = {20., 30., 40., 60., 85., 110., 140., 175., 210., 250.,
1023 400., 600., 800., 1000., 1200., 1400., 1500., 2000.0, 3000.0 };
1024
1025 if (j.bTagged()){
1026 // TODO: for pT < 250 we also have eta dependence... include somehow?
1027 const static vector<double> eff_pt = {0.667, 0.731, 0.771, 0.791, 0.801, 0.805, 0.806, 0.798, 0.795,
1028 0.825, 0.802, 0.771, 0.741, 0.706, 0.679, 0.674, 0.634, 0.5, 0.5};
1029 // 0.5 repeated for overflow just in case.
1030
1031 return eff_pt[binIndex(j.pt(), binedges_pt, true)];
1032 }
1033 else if (j.cTagged()){
1034 const static vector<double> c_rej_pt = {5.30, 5.23, 5.55, 5.91, 6.13, 6.30, 6.32, 6.50, 6.10,
1035 3.04, 3.05, 3.21, 3.37, 3.616, 3.83, 3.96, 4.01, 2.90, 2.90};
1036 // 2.90 repeated for overflow just in case.
1037 return 1./c_rej_pt[binIndex(j.pt(), binedges_pt, true)];
1038 }
1039 else {
1040 const static vector<double> light_rej_pt = {143, 191, 239, 261, 235, 257, 248, 189, 158,
1041 32.8, 19.1, 14.2, 12.4, 11.2, 11.0, 11.2, 12.4, 8.27, 8.27};
1042 // 8.27 repeated for overflow just in case.]
1043 return 1./light_rej_pt[binIndex(j.pt(), binedges_pt, true)];
1044 }
1045 }
1046
1047
1052 inline Jet JET_SMEAR_ATLAS_RUN1(const Jet& j) {
1053 // Jet energy resolution lookup
1054 // Parameterisation can be still improved, but eta dependence is minimal
1056 static const vector<double> binedges_pt = {0., 50., 70., 100., 150., 200., 1000., 10000.};
1057 static const vector<double> jer = {0.145, 0.115, 0.095, 0.075, 0.07, 0.05, 0.04, 0.04}; //< note overflow value
1058 const int ipt = binIndex(j.pT()/GeV, binedges_pt, true);
1059 if (ipt < 0) return j;
1060 const double resolution = jer.at(ipt);
1061
1062 // Smear by a Gaussian centered on 1 with width given by the (fractional) resolution
1064 const double fsmear = max(randnorm(1., resolution), 0.);
1065 const double mass = j.mass2() > 0 ? j.mass() : 0; //< numerical carefulness...
1066 Jet rtn(FourMomentum::mkXYZM(j.px()*fsmear, j.py()*fsmear, j.pz()*fsmear, mass));
1067 //if (deltaPhi(j, rtn) > 0.01) cout << "jdphi: " << deltaPhi(j, rtn) << endl;
1068 return rtn;
1069 }
1070
1074 inline Jet JET_SMEAR_ATLAS_RUN2(const Jet& j) { return JET_SMEAR_ATLAS_RUN1(j); }
1075
1079 inline Jet JET_SMEAR_CMS_RUN1(const Jet& j) { return JET_SMEAR_ATLAS_RUN1(j); }
1080
1084 inline Jet JET_SMEAR_CMS_RUN2(const Jet& j) { return JET_SMEAR_CMS_RUN1(j); }
1085
1087
1088
1091
1095 inline METSmearParams MET_SMEARPARAMS_ATLAS_RUN1(const Vector3& met, double set) {
1096 // Linearity offset (Fig 14)
1097 Vector3 smeared_met = met;
1098 if (met.mod() < 25*GeV) smeared_met *= 1.05;
1099 else if (met.mod() < 40*GeV) smeared_met *= (1.05 - (0.04/15)*(met.mod()/GeV - 25)); //< linear decrease
1100 else smeared_met *= 1.01;
1101
1102 return {smeared_met, 0.45*sqrt(set/GeV)*GeV, 0.0};
1103 }
1104
1106 inline Vector3 MET_SMEAR_ATLAS_RUN1(const Vector3& met, double set) {
1108 }
1109
1110
1114 inline METSmearParams MET_SMEARPARAMS_ATLAS_RUN2(const Vector3& met, double set) {
1115 // Linearity offset (Fig 6):
1116 //
1117 // Expn. approx to Fig 6 tt curve, flat below 25 GeV, suppressed
1118 // to fall between the W and tt curves (and match the flat) at 25 GeV,
1119 // and to approach -2% at high-MET.
1120 //
1122 const Vector3 smeared_met = met * (1 + 0.45*min(1.0, exp(-(met.mod() - 25*GeV)/(10*GeV))) - 0.02);
1123
1124 // Resolution(sumEt) ~ 0.45 sqrt(sumEt) GeV above SET = 180 GeV,
1125 // and with linear trend from SET = 180 -> 0 to resolution = 0 (Fig 7)
1126 const double resolution1 = (set < 180*GeV ? set/180. : 1) * 0.45 * sqrt(max(set/GeV, 180)) * GeV;
1128
1129 // Resolution(MET_true) (Fig 9)
1130 const double resolution2 = 15*GeV + 0.5*sqrt(met.mod()/GeV)*GeV;
1131
1132 // Smearing width is given by the minimum resolution estimator (should mean low-MET events
1133 // with high SET do not get a large smearing, and will be dominated by the linearity effect).
1135 const double sigma = min(resolution1, resolution2);
1136
1137 return {smeared_met, sigma, 0.0};
1138 }
1139
1141 inline Vector3 MET_SMEAR_ATLAS_RUN2(const Vector3& met, double set) {
1143 }
1144
1145
1151 inline METSmearParams MET_SMEARPARAMS_ATLAS_RUN2_PFLOW(const Vector3& met, double /* set */) {
1152 // Mean response (Fig 7), expn approximation to the ttbar curve guessing 2 e-foldings in 40 GeV.
1154 const Vector3 smeared_met = met * (1 + 1.15*exp(-met.mod()/(20*GeV)) - 0.01);
1155
1156 // Mean resolution ~ 15-25 GeV for mu ~ 33.7 (Run 2 avg), but significant dependence on event type (i.e. SET)
1157 // See Figures 4 and 5. The paper doesn't provide enough information for a general SET-dependence:
1158 // maybe prefer the older MET smearing. Not enough discrimination between WPs, mainly encoded vs mu or N_PV.
1159 const double resolution = 20*GeV;
1160
1161 return {smeared_met, resolution, 0.0};
1162 }
1163
1165 inline Vector3 MET_SMEAR_ATLAS_RUN2_PFLOW(const Vector3& met, double set) {
1167 }
1168
1169
1173 inline METSmearParams MET_SMEARPARAMS_CMS_RUN1(const Vector3& met, double set) {
1174 // Calculate parallel and perpendicular resolutions and combine in quadrature (?)
1175 const double resolution_x = (1.1 + 0.6*sqrt(set/GeV)) * GeV;
1176 const double resolution_y = (1.4 + 0.6*sqrt(set/GeV)) * GeV;
1177 const double resolution = sqrt(sqr(resolution_x) + sqr(resolution_y));
1178 return {met, resolution,0.0};
1179 }
1180
1182 inline Vector3 MET_SMEAR_CMS_RUN1(const Vector3& met, double set) {
1183 return MET_SMEAR_NORM(MET_SMEARPARAMS_CMS_RUN1(met, set));
1184 }
1185
1186
1190 inline METSmearParams MET_SMEARPARAMS_CMS_RUN2(const Vector3& met, double set) {
1191 // Calculate parallel and perpendicular resolutions and combine in quadrature (?)
1192 const double resolution_para = ( 2.0 + 0.64*sqrt(set/GeV)) * GeV;
1193 const double resolution_perp = (-1.5 + 0.68*sqrt(set/GeV)) * GeV;
1194 const double resolution = sqrt(sqr(resolution_para) + sqr(resolution_perp));
1195 return {met, resolution,0.0};
1196 }
1197
1199 inline Vector3 MET_SMEAR_CMS_RUN2(const Vector3& met, double set) {
1200 return MET_SMEAR_NORM(MET_SMEARPARAMS_CMS_RUN2(met, set));
1201 }
1202
1204
1205
1208
1210 inline double TRK_EFF_ATLAS_RUN1(const Particle& p) {
1211 if (p.charge3() == 0) return 0;
1212 if (p.abseta() > 2.5) return 0;
1213 if (p.pT() < 0.1*GeV) return 0;
1214
1215 if (p.abspid() == PID::ELECTRON) {
1216 if (p.abseta() < 1.5) {
1217 if (p.pT() < 1*GeV) return 0.73;
1218 if (p.pT() < 100*GeV) return 0.95;
1219 return 0.99;
1220 } else {
1221 if (p.pT() < 1*GeV) return 0.50;
1222 if (p.pT() < 100*GeV) return 0.83;
1223 else return 0.90;
1224 }
1225 } else if (p.abspid() == PID::MUON) {
1226 if (p.abseta() < 1.5) {
1227 return (p.pT() < 1*GeV) ? 0.75 : 0.99;
1228 } else {
1229 return (p.pT() < 1*GeV) ? 0.70 : 0.98;
1230 }
1231 } else { // charged hadrons
1232 if (p.abseta() < 1.5) {
1233 return (p.pT() < 1*GeV) ? 0.70 : 0.95;
1234 } else {
1235 return (p.pT() < 1*GeV) ? 0.60 : 0.85;
1236 }
1237 }
1238 }
1239
1243 inline double TRK_EFF_ATLAS_RUN2(const Particle& p) {
1244 return TRK_EFF_ATLAS_RUN1(p);
1245 }
1246
1247
1252 return PARTICLE_SMEAR_IDENTITY(t);
1253 }
1254
1258 return PARTICLE_SMEAR_IDENTITY(t);
1259 }
1260
1261
1263 inline double TRK_EFF_CMS_RUN1(const Particle& p) {
1264 if (p.charge3() == 0) return 0;
1265 if (p.abseta() > 2.5) return 0;
1266 if (p.pT() < 0.1*GeV) return 0;
1267
1268 if (p.abspid() == PID::ELECTRON) {
1269 if (p.abseta() < 1.5) {
1270 if (p.pT() < 1*GeV) return 0.73;
1271 if (p.pT() < 100*GeV) return 0.95;
1272 return 0.99;
1273 } else {
1274 if (p.pT() < 1*GeV) return 0.50;
1275 if (p.pT() < 100*GeV) return 0.83;
1276 else return 0.90;
1277 }
1278 } else if (p.abspid() == PID::MUON) {
1279 if (p.abseta() < 1.5) {
1280 return (p.pT() < 1*GeV) ? 0.75 : 0.99;
1281 } else {
1282 return (p.pT() < 1*GeV) ? 0.70 : 0.98;
1283 }
1284 } else { // charged hadrons
1285 if (p.abseta() < 1.5) {
1286 return (p.pT() < 1*GeV) ? 0.70 : 0.95;
1287 } else {
1288 return (p.pT() < 1*GeV) ? 0.60 : 0.85;
1289 }
1290 }
1291 }
1292
1296 inline double TRK_EFF_CMS_RUN2(const Particle& p) {
1297 return TRK_EFF_CMS_RUN1(p);
1298 }
1299
1300
1305 return PARTICLE_SMEAR_IDENTITY(t);
1306 }
1307
1311 return PARTICLE_SMEAR_IDENTITY(t);
1312 }
1313
1321 inline double ATLAS_JVT_EFF_LOOSE(const Jet & j){
1322 if (j.abseta() > 2.4) return 1.0;
1323 // No data for jets pt < 20, hopefully not relevant:
1324 if (j.pt() <= 20*GeV || j.pt() >= 60*GeV) return 1.0;
1325
1326 const static vector<double> binedges_pt = {20*GeV,25*GeV,30*GeV,35*GeV,40*GeV,45*GeV,50*GeV,55*GeV,60*GeV};
1327 const static vector<double> binvals = {0.9, 0.93, 0.94, 0.95, 0.96, 0.96, 0.97, 0.97};
1328
1329 const size_t bini = binIndex(j.pt(), binedges_pt);
1330 return binvals[bini];
1331 }
1332
1340 inline double ATLAS_JVT_EFF_MEDIUM(const Jet & j){
1341 if (j.abseta() > 2.4) return 1.0;
1342 // No data for jets pt < 20, hopefully not relevant:
1343 if (j.pt() <= 20*GeV || j.pt() >= 60*GeV) return 1.0;
1344
1345 const static vector<double> binedges_pt = {20*GeV,25*GeV,30*GeV,35*GeV,40*GeV,45*GeV,50*GeV,55*GeV,60*GeV};
1346 const static vector<double> binvals = {0.86, 0.9, 0.92, 0.93, 0.94, 0.95, 0.95, 0.96};
1347
1348 const size_t bini = binIndex(j.pt(), binedges_pt);
1349 return binvals[bini];
1350 }
1351
1359 inline double ATLAS_JVT_EFF_TIGHT(const Jet & j){
1360 if (j.abseta() > 2.4) return 1.0;
1361 // No data for jets pt < 20, hopefully not relevant:
1362 if (j.pt() <= 20*GeV || j.pt() >= 60*GeV) return 1.0;
1363
1364 const static vector<double> binedges_pt = {20*GeV,25*GeV,30*GeV,35*GeV,40*GeV,45*GeV,50*GeV,55*GeV,60*GeV};
1365 const static vector<double> binvals = {0.81, 0.84, 0.87, 0.90, 0.91, 0.92, 0.93, 0.94};
1366
1367 const size_t bini = binIndex(j.pt(), binedges_pt);
1368 return binvals[bini];
1369 }
1370
1372
1375
1376 inline double ELECTRON_EFF_IDENTITY_LOOSE(const Particle& e) { return PARTICLE_EFF_ONE(e); }
1377 inline double ELECTRON_EFF_IDENTITY_MEDIUM(const Particle& e) { return PARTICLE_EFF_ONE(e); }
1378 inline double ELECTRON_EFF_IDENTITY_TIGHT(const Particle& e) { return PARTICLE_EFF_ONE(e); }
1379 inline double MUON_EFF_IDENTITY_LOOSE(const Particle& m) { return PARTICLE_EFF_ONE(m); }
1380 inline double MUON_EFF_IDENTITY_MEDIUM(const Particle& m) { return PARTICLE_EFF_ONE(m); }
1381 inline double MUON_EFF_IDENTITY_TIGHT(const Particle& m) { return PARTICLE_EFF_ONE(m); }
1382 inline double PHOTON_EFF_IDENTITY_LOOSE(const Particle& y) { return PARTICLE_EFF_ONE(y); }
1383 inline double PHOTON_EFF_IDENTITY_MEDIUM(const Particle& y) { return PARTICLE_EFF_ONE(y); }
1384 inline double PHOTON_EFF_IDENTITY_TIGHT(const Particle& y) { return PARTICLE_EFF_ONE(y); }
1385 inline double TAU_EFF_IDENTITY_LOOSE(const Particle& t) { return PARTICLE_EFF_ONE(t); }
1386 inline double TAU_EFF_IDENTITY_MEDIUM(const Particle& t) { return PARTICLE_EFF_ONE(t); }
1387 inline double TAU_EFF_IDENTITY_TIGHT(const Particle& t) { return PARTICLE_EFF_ONE(t); }
1388
1389 inline Particle ELECTRON_SMEAR_IDENTITY(const Particle& e) { return PARTICLE_SMEAR_IDENTITY(e); }
1390 inline Particle MUON_SMEAR_IDENTITY(const Particle& m) { return PARTICLE_SMEAR_IDENTITY(m); }
1391 inline Particle PHOTON_SMEAR_IDENTITY(const Particle& y) { return PARTICLE_SMEAR_IDENTITY(y); }
1392 inline Particle TAU_SMEAR_IDENTITY(const Particle& t) { return PARTICLE_SMEAR_IDENTITY(t); }
1393
1394 inline double TRK_EFF_IDENTITY_TIGHT(const Particle& trk) { return PARTICLE_EFF_ONE(trk); }
1395 inline Particle TRK_SMEAR_IDENTITY(const Particle& trk) { return PARTICLE_SMEAR_IDENTITY(trk); }
1396
1397 inline double JET_BTAG_IDENTITY_IDENTITY(const Jet& j) { return JET_BTAG_IDENTITY(j); }
1398
1399 // Already defined: JET_SMEAR_IDENTITY and MET_SMEAR_IDENTITY
1400
1402
1404
1405
1406}
1407
1408#endif
static FourMomentum mkXYZM(double px, double py, double pz, double mass)
Make a vector from (px,py,pz) coordinates and the mass.
Definition Vector4.hh:773
Representation of a clustered jet of particles.
Definition Jet.hh:42
bool cTagged(const Cut &c=Cuts::open(), double dRmax=-1) const
Does this jet have at least one c-tag? (with optional Cut and dR restriction).
Definition Jet.hh:170
Particles & particles()
Get the particles in this jet.
Definition Jet.hh:71
bool bTagged(const Cut &c=Cuts::open(), double dRmax=-1) const
Does this jet have at least one b-tag? (with optional Cut and dR restriction).
Definition Jet.hh:147
Particles tauTags(const Cut &c=Cuts::open(), double dRmax=-1) const
Get the tau particles tag-matched to this jet.
double py() const
y component of momentum.
Definition ParticleBase.hh:124
double pT() const
Get the directly (alias).
Definition ParticleBase.hh:65
double mass2() const
Get the mass**2 directly.
Definition ParticleBase.hh:84
double abseta() const
Get the directly (alias).
Definition ParticleBase.hh:93
double mass() const
Get the mass directly.
Definition ParticleBase.hh:82
double pz() const
z component of momentum.
Definition ParticleBase.hh:126
double pt() const
Get the directly.
Definition ParticleBase.hh:63
double px() const
x component of momentum.
Definition ParticleBase.hh:122
double Et() const
Get the directly.
Definition ParticleBase.hh:77
double E() const
Get the energy directly.
Definition ParticleBase.hh:53
double E2() const
Get the energy-squared.
Definition ParticleBase.hh:58
Particle representation, either from a HepMC::GenEvent or reconstructed.
Definition Particle.hh:45
PdgId pid() const
This Particle's PDG ID code.
Definition Particle.hh:212
PdgId abspid() const
Absolute value of the PDG ID code.
Definition Particle.hh:214
Particles children(const Cut &c=Cuts::OPEN) const
Get a list of the direct descendants from the current particle (with optional selection Cut).
Specialised vector of Particle objects.
Definition Particle.hh:21
Three-dimensional specialisation of Vector.
Definition Vector3.hh:40
double mod() const
Calculate the modulus of a vector. .
Definition VectorN.hh:95
STL class.
double mass(const FourMomentum &a, const FourMomentum &b)
Calculate mass of two 4-vectors.
Definition Vector4.hh:1482
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:653
double abseta(const ParticleBase &p)
Unbound function access to abseta.
Definition ParticleBaseUtils.hh:668
double ELECTRON_EFF_ATLAS_RUN1_MEDIUM(const Particle &e)
ATLAS Run 1 'medium' electron reco+identification efficiency.
Definition ExptSmearingFunctions.hh:92
double ELECTRON_EFF_ATLAS_RUN1_TIGHT(const Particle &e)
ATLAS Run 1 'tight' electron reco+identification efficiency.
Definition ExptSmearingFunctions.hh:148
double ELECTRON_EFF_ATLAS_RUN2_LOOSE(const Particle &e)
ATLAS Run 2 'loose' electron reco+identification efficiency.
Definition ExptSmearingFunctions.hh:67
double ELECTRON_EFF_CMS_RUN1(const Particle &e)
CMS Run 1 electron reconstruction efficiency.
Definition ExptSmearingFunctions.hh:258
Particle ELECTRON_SMEAR_ATLAS_RUN1(const Particle &e)
ATLAS Run 1 electron reco smearing.
Definition ExptSmearingFunctions.hh:216
double ELECTRON_EFF_CMS_RUN2_TIGHT(const Particle &e)
Definition ExptSmearingFunctions.hh:290
double ELECTRON_EFF_ATLAS_RUN2_TIGHT(const Particle &e)
ATLAS Run 2 'tight' electron reco+identification efficiency.
Definition ExptSmearingFunctions.hh:197
double ELECTRON_EFF_CMS_RUN1_MEDIUM(const Particle &e)
Definition ExptSmearingFunctions.hh:269
double ELECTRON_RECOEFF_ATLAS_RUN2(const Particle &e)
Definition ExptSmearingFunctions.hh:49
Particle ELECTRON_SMEAR_CMS_RUN1(const Particle &e)
CMS electron energy smearing, preserving direction.
Definition ExptSmearingFunctions.hh:299
double ELECTRON_EFF_CMS_RUN2(const Particle &e)
Definition ExptSmearingFunctions.hh:278
double ELECTRON_EFF_ATLAS_RUN2_MEDIUM(const Particle &e)
ATLAS Run 2 'medium' electron reco+identification efficiency.
Definition ExptSmearingFunctions.hh:141
double ELECTRON_EFF_CMS_RUN2_MEDIUM(const Particle &e)
Definition ExptSmearingFunctions.hh:287
Particle ELECTRON_SMEAR_ATLAS_RUN2(const Particle &e)
Definition ExptSmearingFunctions.hh:248
double ELECTRON_EFF_ATLAS_RUN1_LOOSE(const Particle &e)
Pretend that ATLAS Run 1 loose was the same as in Run 2.
Definition ExptSmearingFunctions.hh:86
double ELECTRON_EFF_CMS_RUN1_LOOSE(const Particle &e)
Definition ExptSmearingFunctions.hh:266
double ELECTRON_RECOEFF_ATLAS_RUN1(const Particle &e)
Definition ExptSmearingFunctions.hh:39
Particle ELECTRON_SMEAR_CMS_RUN2(const Particle &e)
Definition ExptSmearingFunctions.hh:323
double ELECTRON_EFF_CMS_RUN2_LOOSE(const Particle &e)
Definition ExptSmearingFunctions.hh:284
double ELECTRON_EFF_CMS_RUN1_TIGHT(const Particle &e)
Definition ExptSmearingFunctions.hh:272
Jet JET_SMEAR_ATLAS_RUN2(const Jet &j)
Definition ExptSmearingFunctions.hh:1074
double JET_BTAG_ATLAS_RUN2_MV2C20(const Jet &j)
Return the ATLAS Run 2 MC2c20 77% WP jet flavour tagging efficiency for the given Jet.
Definition ExptSmearingFunctions.hh:940
Jet JET_SMEAR_ATLAS_RUN1(const Jet &j)
ATLAS Run 1 jet smearing.
Definition ExptSmearingFunctions.hh:1052
Jet JET_SMEAR_CMS_RUN1(const Jet &j)
Definition ExptSmearingFunctions.hh:1079
Jet JET_SMEAR_CMS_RUN2(const Jet &j)
Definition ExptSmearingFunctions.hh:1084
double JET_BTAG_ATLAS_RUN2_MV2C10(const Jet &j)
Return the ATLAS Run 2 MC2c10 77% WP jet flavour tagging efficiency for the given Jet.
Definition ExptSmearingFunctions.hh:948
double JET_BTAG_ATLAS_RUN1_XXX(const Jet &j)
Alias for naming scheme.
Definition ExptSmearingFunctions.hh:937
double JET_BTAG_ATLAS_RUN1(const Jet &j)
Return the ATLAS Run 1 jet flavour tagging efficiency for the given Jet, from Delphes.
Definition ExptSmearingFunctions.hh:928
METSmearParams MET_SMEARPARAMS_ATLAS_RUN2(const Vector3 &met, double set)
Definition ExptSmearingFunctions.hh:1114
Vector3 MET_SMEAR_ATLAS_RUN2(const Vector3 &met, double set)
ATLAS Run 2 ETmiss smearing.
Definition ExptSmearingFunctions.hh:1141
Vector3 MET_SMEAR_ATLAS_RUN2_PFLOW(const Vector3 &met, double set)
ATLAS Run 2 pflow ETmiss smearing.
Definition ExptSmearingFunctions.hh:1165
METSmearParams MET_SMEARPARAMS_ATLAS_RUN2_PFLOW(const Vector3 &met, double)
Definition ExptSmearingFunctions.hh:1151
METSmearParams MET_SMEARPARAMS_ATLAS_RUN1(const Vector3 &met, double set)
ATLAS Run 1 ETmiss resolution.
Definition ExptSmearingFunctions.hh:1095
Vector3 MET_SMEAR_CMS_RUN1(const Vector3 &met, double set)
CMS Run 1 ETmiss smearing.
Definition ExptSmearingFunctions.hh:1182
Vector3 MET_SMEAR_NORM(const METSmearParams &msps)
Smear a nominal vector magnitude by Gaussian with the given absolute resolutions.
Definition MomentumSmearingFunctions.hh:156
Vector3 MET_SMEAR_ATLAS_RUN1(const Vector3 &met, double set)
ATLAS Run 1 ETmiss smearing.
Definition ExptSmearingFunctions.hh:1106
Vector3 MET_SMEAR_CMS_RUN2(const Vector3 &met, double set)
CMS Run 2 ETmiss smearing.
Definition ExptSmearingFunctions.hh:1199
METSmearParams MET_SMEARPARAMS_CMS_RUN1(const Vector3 &met, double set)
Definition ExptSmearingFunctions.hh:1173
METSmearParams MET_SMEARPARAMS_CMS_RUN2(const Vector3 &met, double set)
CMS Run 2 ETmiss smearing.
Definition ExptSmearingFunctions.hh:1190
FourMomentum P4_SMEAR_E_GAUSS(const FourMomentum &p, double resolution)
Definition MomentumSmearingFunctions.hh:58
FourMomentum P4_SMEAR_PT_GAUSS(const FourMomentum &p, double resolution)
Smear a FourMomentum's transverse momentum using a Gaussian of absolute width resolution.
Definition MomentumSmearingFunctions.hh:65
double MUON_EFF_ATLAS_RUN1_LOOSE(const Particle &m)
Definition ExptSmearingFunctions.hh:473
double MUON_EFF_ATLAS_RUN2_TIGHT(const Particle &m)
ATLAS Run 2 muon reco+ID efficiency.
Definition ExptSmearingFunctions.hh:543
Particle MUON_SMEAR_ATLAS_RUN1(const Particle &m)
Definition ExptSmearingFunctions.hh:562
Particle MUON_SMEAR_CMS_RUN1(const Particle &m)
CMS Run 1 muon reco smearing.
Definition ExptSmearingFunctions.hh:648
double MUON_EFF_ATLAS_RUN2_LOOSE(const Particle &m)
ATLAS Run 2 muon reco+ID efficiency.
Definition ExptSmearingFunctions.hh:510
double MUON_EFF_CMS_RUN2(const Particle &m)
Definition ExptSmearingFunctions.hh:629
double MUON_EFF_ATLAS_RUN1(const Particle &m)
ATLAS Run 1 muon reco efficiency.
Definition ExptSmearingFunctions.hh:465
double MUON_EFF_CMS_RUN2_TIGHT(const Particle &m)
Definition ExptSmearingFunctions.hh:643
double MUON_ISOEFF_ATLAS_RUN2_LOOSE(const Particle &m)
ATLAS Run 2 muon isolation efficiency.
Definition ExptSmearingFunctions.hh:497
double MUON_EFF_CMS_RUN2_LOOSE(const Particle &m)
Definition ExptSmearingFunctions.hh:635
Particle MUON_SMEAR_ATLAS_RUN2(const Particle &m)
Definition ExptSmearingFunctions.hh:593
double MUON_RECOEFF_ATLAS_RUN2(const Particle &m)
Definition ExptSmearingFunctions.hh:485
double MUON_EFF_CMS_RUN1(const Particle &m)
CMS Run 1 muon reco efficiency.
Definition ExptSmearingFunctions.hh:606
double MUON_EFF_CMS_RUN1_TIGHT(const Particle &m)
Definition ExptSmearingFunctions.hh:623
double MUON_EFF_ATLAS_RUN1_TIGHT(const Particle &m)
Definition ExptSmearingFunctions.hh:479
double MUON_EFF_CMS_RUN2_MEDIUM(const Particle &m)
Definition ExptSmearingFunctions.hh:639
double MUON_EFF_CMS_RUN1_LOOSE(const Particle &m)
Definition ExptSmearingFunctions.hh:615
double MUON_EFF_CMS_RUN1_MEDIUM(const Particle &m)
Definition ExptSmearingFunctions.hh:619
double MUON_EFF_ATLAS_RUN1_MEDIUM(const Particle &m)
Definition ExptSmearingFunctions.hh:476
Particle MUON_SMEAR_CMS_RUN2(const Particle &m)
Definition ExptSmearingFunctions.hh:676
double MUON_EFF_ATLAS_RUN2_MEDIUM(const Particle &m)
ATLAS Run 2 muon reco+ID efficiency.
Definition ExptSmearingFunctions.hh:525
double PARTICLE_EFF_ONE(const Particle &)
Take a Particle and return 1.
Definition ParticleSmearingFunctions.hh:33
Particle PARTICLE_SMEAR_IDENTITY(const Particle &p)
Take a Particle and return it unmodified.
Definition ParticleSmearingFunctions.hh:50
double JET_BTAG_IDENTITY(const Jet &j)
Alias for JET_BTAG_PERFECT.
Definition JetSmearingFunctions.hh:58
double PHOTON_EFF_CMS_RUN1_TIGHT(const Particle &y)
Definition ExptSmearingFunctions.hh:430
double PHOTON_EFF_CMS_RUN2_TIGHT(const Particle &y)
Definition ExptSmearingFunctions.hh:448
double PHOTON_EFF_CMS_RUN2_LOOSE(const Particle &y)
Definition ExptSmearingFunctions.hh:442
double PHOTON_EFF_ATLAS_RUN2_TIGHT(const Particle &y)
Definition ExptSmearingFunctions.hh:411
double PHOTON_EFF_ATLAS_RUN1_MEDIUM(const Particle &y)
Definition ExptSmearingFunctions.hh:368
Particle PHOTON_SMEAR_ATLAS_RUN1(const Particle &y)
Definition ExptSmearingFunctions.hh:452
double PHOTON_EFF_ATLAS_RUN1_TIGHT(const Particle &y)
Definition ExptSmearingFunctions.hh:371
double PHOTON_EFF_ATLAS_RUN2_LOOSE(const Particle &y)
Definition ExptSmearingFunctions.hh:405
double PHOTON_EFF_ATLAS_RUN2_MEDIUM(const Particle &y)
Definition ExptSmearingFunctions.hh:408
double PHOTON_EFF_ATLAS_RUN1(const Particle &y)
ATLAS Run 2 photon reco efficiency.
Definition ExptSmearingFunctions.hh:337
double PHOTON_EFF_CMS_RUN2_MEDIUM(const Particle &y)
Definition ExptSmearingFunctions.hh:445
double PHOTON_EFF_CMS_RUN1_LOOSE(const Particle &y)
Definition ExptSmearingFunctions.hh:424
double PHOTON_EFF_CMS_RUN2(const Particle &y)
Definition ExptSmearingFunctions.hh:436
double PHOTON_EFF_CMS_RUN1(const Particle &y)
Definition ExptSmearingFunctions.hh:417
double PHOTON_EFF_ATLAS_RUN2(const Particle &y)
ATLAS Run 2 photon reco efficiency.
Definition ExptSmearingFunctions.hh:377
double PHOTON_EFF_ATLAS_RUN1_LOOSE(const Particle &y)
Definition ExptSmearingFunctions.hh:365
double PHOTON_EFF_CMS_RUN1_MEDIUM(const Particle &y)
Definition ExptSmearingFunctions.hh:427
double TAU_EFF_ATLAS_RUN2_LOOSE(const Particle &t)
Definition ExptSmearingFunctions.hh:791
double TAU_EFF_ATLAS_RUN2_MEDIUM(const Particle &t)
ATLAS Run 2 13 TeV tau efficiencies (medium working point).
Definition ExptSmearingFunctions.hh:768
double TAUJET_EFF_ATLAS_RUN1(const Jet &j)
ATLAS Run 1 8 TeV tau misID rates (medium working point).
Definition ExptSmearingFunctions.hh:734
double TAU_EFF_ATLAS_RUN2_TIGHT(const Particle &t)
Definition ExptSmearingFunctions.hh:794
double TAU_EFF_ATLAS_RUN1(const Particle &t)
Definition ExptSmearingFunctions.hh:718
Particle TAU_SMEAR_CMS_RUN1(const Particle &t)
Definition ExptSmearingFunctions.hh:908
double TAU_EFF_ATLAS_RUN1_MEDIUM(const Particle &t)
ATLAS Run 1 8 TeV tau efficiencies (medium working point).
Definition ExptSmearingFunctions.hh:694
double TAU_EFF_ATLAS_RUN1_TIGHT(const Particle &t)
Definition ExptSmearingFunctions.hh:724
Particle TAU_SMEAR_CMS_RUN2(const Particle &t)
Definition ExptSmearingFunctions.hh:916
double TAU_EFF_CMS_RUN2_TIGHT(const Particle &t)
Definition ExptSmearingFunctions.hh:902
double TAU_EFF_CMS_RUN1_TIGHT(const Particle &t)
Definition ExptSmearingFunctions.hh:885
double TAU_EFF_ATLAS_RUN2(const Particle &t)
Definition ExptSmearingFunctions.hh:788
Particle TAU_SMEAR_ATLAS_RUN1(const Particle &t)
Definition ExptSmearingFunctions.hh:831
double TAUJET_EFF_ATLAS_RUN2(const Jet &j)
ATLAS Run 2 13 TeV tau misID rate (medium working point).
Definition ExptSmearingFunctions.hh:802
double TAU_EFF_ATLAS_RUN1_LOOSE(const Particle &t)
Definition ExptSmearingFunctions.hh:721
double TAU_EFF_CMS_RUN1_LOOSE(const Particle &t)
Definition ExptSmearingFunctions.hh:879
double TAU_EFF_CMS_RUN2(const Particle &t)
Definition ExptSmearingFunctions.hh:890
double TAU_EFF_CMS_RUN2_MEDIUM(const Particle &t)
Definition ExptSmearingFunctions.hh:899
double TAU_EFF_CMS_RUN1_MEDIUM(const Particle &t)
Definition ExptSmearingFunctions.hh:882
double TAU_EFF_CMS_RUN2_LOOSE(const Particle &t)
Definition ExptSmearingFunctions.hh:896
double TAU_EFF_CMS_RUN1(const Particle &t)
Definition ExptSmearingFunctions.hh:873
Particle TAU_SMEAR_ATLAS_RUN2(const Particle &t)
Definition ExptSmearingFunctions.hh:865
double ATLAS_JVT_EFF_MEDIUM(const Jet &j)
Return the efficiency of the ATLAS JVT tagger at > 0.4 W.P.
Definition ExptSmearingFunctions.hh:1340
Particle TRK_SMEAR_CMS_RUN2(const Particle &t)
Definition ExptSmearingFunctions.hh:1310
double TRK_EFF_CMS_RUN2(const Particle &p)
Definition ExptSmearingFunctions.hh:1296
Particle TRK_SMEAR_ATLAS_RUN1(const Particle &t)
Definition ExptSmearingFunctions.hh:1251
double ATLAS_JVT_EFF_TIGHT(const Jet &j)
Return the efficiency of the ATLAS JVT tagger at > 0.7 W.P.
Definition ExptSmearingFunctions.hh:1359
double TRK_EFF_CMS_RUN1(const Particle &p)
CMS Run 1 tracking efficiency.
Definition ExptSmearingFunctions.hh:1263
double ATLAS_JVT_EFF_LOOSE(const Jet &j)
Return the efficiency of the ATLAS JVT tagger at > 0.2 W.P.
Definition ExptSmearingFunctions.hh:1321
Particle TRK_SMEAR_CMS_RUN1(const Particle &t)
Definition ExptSmearingFunctions.hh:1304
Particle TRK_SMEAR_ATLAS_RUN2(const Particle &t)
Definition ExptSmearingFunctions.hh:1257
double TRK_EFF_ATLAS_RUN1(const Particle &p)
ATLAS Run 1 tracking efficiency.
Definition ExptSmearingFunctions.hh:1210
double TRK_EFF_ATLAS_RUN2(const Particle &p)
Definition ExptSmearingFunctions.hh:1243
Definition MC_CENT_PPB_Projections.hh:10
double deltaR(double rap1, double phi1, double rap2, double phi2)
Definition MathUtils.hh:708
std::enable_if_t< std::is_arithmetic_v< N1 > &&std::is_arithmetic_v< N2 >, signed_if_mixed_t< N1, N2 > > max(N1 a, N2 b)
Get the maximum of two numbers.
Definition MathUtils.hh:115
std::enable_if_t< std::is_arithmetic_v< NUM >, NUM > add_quad(NUM a, NUM b)
Named number-type addition in quadrature operation.
Definition MathUtils.hh:241
std::enable_if_t< std::is_arithmetic_v< NUM >, NUM > sqr(NUM a)
Named number-type squaring operation.
Definition MathUtils.hh:218
double randnorm(double loc, double scale)
Return a random number sampled from a Gaussian/normal distribution.
std::enable_if_t< std::is_arithmetic_v< N1 > &&std::is_arithmetic_v< N2 >, signed_if_mixed_t< N1, N2 > > min(N1 a, N2 b)
Get the minimum of two numbers.
Definition MathUtils.hh:104
std::enable_if_t< std::is_arithmetic_v< N1 > &&std::is_arithmetic_v< N2 > &&std::is_arithmetic_v< N3 >, bool > inRange(N1 value, N2 low, N3 high, RangeBoundary lowbound=CLOSED, RangeBoundary highbound=OPEN)
Determine if value is in the range low to high, for floating point numbers.
Definition MathUtils.hh:137
constexpr double SQRT2
A pre-defined value of .
Definition MathConstants.hh:22
std::enable_if_t< std::is_arithmetic_v< NUM1 > &&std::is_arithmetic_v< NUM2 >, int > binIndex(NUM1 val, std::initializer_list< NUM2 > binedges, bool allow_overflow=false)
Return the bin index of the given value, val, given a vector of bin edges.
Definition MathUtils.hh:465
Struct for holding MET-smearing parameters.
Definition MomentumSmearingFunctions.hh:121