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/JetSmearingFunctions.hh"
6#include "Rivet/Tools/MomentumSmearingFunctions.hh"
7#include "Rivet/Tools/ParticleSmearingFunctions.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 = {
76 0.0, 0.90, 0.91, 0.92, 0.94, 0.95,
77 0.955, 0.965, 0.97, 0.98, 0.98}; //Extra value extrapolated for overflow
78
79 if (e.abseta() > 2.47) return 0.0; // no ID outside the tracker
80
81 const int i_eta = binIndex(e.abseta(), edges_eta);
82 const int i_et = binIndex(e.Et() / GeV, edges_et, true);
83 const double eff = effs_et[i_et] * effs_eta[i_eta]
84 / 0.95; //< norm factor as approximate double differential
85 return min(eff, 1.0) * ELECTRON_RECOEFF_ATLAS_RUN2(e);
86 }
87
89 inline double ELECTRON_EFF_ATLAS_RUN1_LOOSE(const Particle& e) {
91 }
92
93
95 inline double ELECTRON_EFF_ATLAS_RUN1_MEDIUM(const Particle& e) {
96 if (e.abspid() != PID::ELECTRON) return 0;
97
98 const static vector<double> eta_edges_10 = {0.000, 0.049, 0.454, 1.107, 1.46, 1.790, 2.277, 2.500};
99 const static vector<double> eta_vals_10 = {0.730, 0.757, 0.780, 0.771, 0.77, 0.777, 0.778};
100
101 const static vector<double> eta_edges_15 = {0.000, 0.053, 0.456, 1.102, 1.463, 1.783, 2.263, 2.500};
102 const static vector<double> eta_vals_15 = {0.780, 0.800, 0.819, 0.759, 0.749, 0.813, 0.829};
103
104 const static vector<double> eta_edges_20 = {0.000, 0.065, 0.362, 0.719, 0.980, 1.289,
105 1.455, 1.681, 1.942, 2.239, 2.452, 2.500};
106 const static vector<double> eta_vals_20 = {0.794, 0.806, 0.816, 0.806, 0.797, 0.774,
107 0.764, 0.788, 0.793, 0.806, 0.825};
108
109 const static vector<double> eta_edges_25 = {0.000, 0.077, 0.338, 0.742, 1.004, 1.265,
110 1.467, 1.692, 1.940, 2.227, 2.452, 2.500};
111 const static vector<double> eta_vals_25 = {0.833, 0.843, 0.853, 0.845, 0.839, 0.804,
112 0.790, 0.825, 0.830, 0.833, 0.839};
113
114 const static vector<double> eta_edges_30 = {0.000, 0.077, 0.350, 0.707, 0.980, 1.289,
115 1.479, 1.681, 1.942, 2.239, 2.441, 2.500};
116 const static vector<double> eta_vals_30 = {0.863, 0.872, 0.881, 0.874, 0.870, 0.824,
117 0.808, 0.847, 0.845, 0.840, 0.842};
118
119 const static vector<double> eta_edges_35 = {0.000, 0.058, 0.344, 0.700, 1.009, 1.270,
120 1.458, 1.685, 1.935, 2.231, 2.468, 2.500};
121 const static vector<double> eta_vals_35 = {0.878, 0.889, 0.901, 0.895, 0.893, 0.849,
122 0.835, 0.868, 0.863, 0.845, 0.832};
123
124 const static vector<double> eta_edges_40 = {0.000, 0.047, 0.355, 0.699, 0.983, 1.280,
125 1.446, 1.694, 1.943, 2.227, 2.441, 2.500};
126 const static vector<double> eta_vals_40 = {0.894, 0.901, 0.909, 0.905, 0.904, 0.875,
127 0.868, 0.889, 0.876, 0.848, 0.827};
128
129 const static vector<double> eta_edges_45 = {0.000, 0.058, 0.356, 0.712, 0.997, 1.282,
130 1.459, 1.686, 1.935, 2.220, 2.444, 2.500};
131 const static vector<double> eta_vals_45 = {0.900, 0.911, 0.923, 0.918, 0.917, 0.897,
132 0.891, 0.904, 0.894, 0.843, 0.796};
133
134 const static vector<double> eta_edges_50 = {0.000, 0.059, 0.355, 0.711, 0.983, 1.280,
135 1.469, 1.682, 1.919, 2.227, 2.441, 2.500};
136 const static vector<double> eta_vals_50 = {0.903, 0.913, 0.923, 0.922, 0.923, 0.903,
137 0.898, 0.908, 0.895, 0.831, 0.774};
138
139 const static vector<double> eta_edges_60 = {0.000, 0.053, 0.351, 0.720, 1.006, 1.291,
140 1.469, 1.696, 1.946, 2.243, 2.455, 2.500};
141 const static vector<double> eta_vals_60 = {0.903, 0.917, 0.928, 0.924, 0.927, 0.915,
142 0.911, 0.915, 0.899, 0.827, 0.760};
143
144 const static vector<double> eta_edges_80 = {0.000, 0.053, 0.351, 0.720, 0.994, 1.292,
145 1.482, 1.708, 1.934, 2.220, 2.458, 2.500};
146 const static vector<double> eta_vals_80 = {0.936, 0.942, 0.952, 0.956, 0.956, 0.934,
147 0.931, 0.944, 0.933, 0.940, 0.948};
148
149 const static vector<double> et_edges = {10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 80};
150 const static vector<vector<double>> et_eta_edges = {eta_edges_10, eta_edges_15, eta_edges_20,
151 eta_edges_25, eta_edges_30, eta_edges_35,
152 eta_edges_40, eta_edges_45, eta_edges_50,
153 eta_edges_60, eta_edges_80};
154 const static vector<vector<double>> et_eta_vals = {eta_vals_10, eta_vals_15, eta_vals_20, eta_vals_25,
155 eta_vals_30, eta_vals_35, eta_vals_40, eta_vals_45,
156 eta_vals_50, eta_vals_60, eta_vals_80};
157
158 if (e.abseta() > 2.5 || e.Et() < 10 * GeV) return 0.0;
159 const int i_et = binIndex(e.Et() / GeV, et_edges, true);
160 const int i_eta = binIndex(e.abseta(), et_eta_edges[i_et]);
161 return et_eta_vals[i_et][i_eta] * ELECTRON_RECOEFF_ATLAS_RUN1(e);
162 }
163
167 inline double ELECTRON_EFF_ATLAS_RUN2_MEDIUM(const Particle& e) {
168 if (e.abspid() != PID::ELECTRON) return 0;
169 return 1.01 * ELECTRON_EFF_ATLAS_RUN1_MEDIUM(e);
170 }
171
172
174 inline double ELECTRON_EFF_ATLAS_RUN1_TIGHT(const Particle& e) {
175 if (e.abspid() != PID::ELECTRON) return 0;
176
177 const static vector<double> eta_edges_10 = {0.000, 0.049, 0.459, 1.100, 1.461, 1.789, 2.270, 2.500};
178 const static vector<double> eta_vals_10 = {0.581, 0.632, 0.668, 0.558, 0.548, 0.662, 0.690};
179
180 const static vector<double> eta_edges_15 = {0.000, 0.053, 0.450, 1.096, 1.463, 1.783, 2.269, 2.500};
181 const static vector<double> eta_vals_15 = {0.630, 0.678, 0.714, 0.633, 0.616, 0.700, 0.733};
182
183 const static vector<double> eta_edges_20 = {0.000, 0.065, 0.362, 0.719, 0.992, 1.277,
184 1.479, 1.692, 1.930, 2.227, 2.464, 2.500};
185 const static vector<double> eta_vals_20 = {0.653, 0.695, 0.735, 0.714, 0.688, 0.635,
186 0.625, 0.655, 0.680, 0.691, 0.674};
187
188 const static vector<double> eta_edges_25 = {0.000, 0.077, 0.362, 0.719, 0.992, 1.300,
189 1.479, 1.692, 1.942, 2.227, 2.464, 2.500};
190 const static vector<double> eta_vals_25 = {0.692, 0.732, 0.768, 0.750, 0.726, 0.677,
191 0.667, 0.692, 0.710, 0.706, 0.679};
192
193 const static vector<double> eta_edges_30 = {0.000, 0.053, 0.362, 0.719, 1.004, 1.277,
194 1.467, 1.681, 1.954, 2.239, 2.452, 2.500};
195 const static vector<double> eta_vals_30 = {0.724, 0.763, 0.804, 0.789, 0.762, 0.702,
196 0.690, 0.720, 0.731, 0.714, 0.681};
197
198 const static vector<double> eta_edges_35 = {0.000, 0.044, 0.342, 0.711, 0.971, 1.280,
199 1.456, 1.683, 1.944, 2.218, 2.442, 2.500};
200 const static vector<double> eta_vals_35 = {0.736, 0.778, 0.824, 0.811, 0.784, 0.730,
201 0.718, 0.739, 0.743, 0.718, 0.678};
202
203 const static vector<double> eta_edges_40 = {0.000, 0.047, 0.355, 0.699, 0.983, 1.268,
204 1.457, 1.671, 1.931, 2.204, 2.453, 2.500};
205 const static vector<double> eta_vals_40 = {0.741, 0.774, 0.823, 0.823, 0.802, 0.764,
206 0.756, 0.771, 0.771, 0.734, 0.684};
207
208 const static vector<double> eta_edges_45 = {0.000, 0.056, 0.354, 0.711, 0.984, 1.280,
209 1.458, 1.684, 1.945, 2.207, 2.442, 2.500};
210 const static vector<double> eta_vals_45 = {0.758, 0.792, 0.841, 0.841, 0.823, 0.792,
211 0.786, 0.796, 0.794, 0.734, 0.663};
212
213 const static vector<double> eta_edges_50 = {0.000, 0.059, 0.355, 0.699, 0.983, 1.268,
214 1.446, 1.682, 1.943, 2.216, 2.453, 2.500};
215 const static vector<double> eta_vals_50 = {0.771, 0.806, 0.855, 0.858, 0.843, 0.810,
216 0.800, 0.808, 0.802, 0.730, 0.653};
217
218 const static vector<double> eta_edges_60 = {0.000, 0.050, 0.350, 0.707, 0.981, 1.278,
219 1.468, 1.694, 1.944, 2.242, 2.453, 2.500};
220 const static vector<double> eta_vals_60 = {0.773, 0.816, 0.866, 0.865, 0.853, 0.820,
221 0.812, 0.817, 0.804, 0.726, 0.645};
222
223 const static vector<double> eta_edges_80 = {0.000, 0.051, 0.374, 0.720, 0.981, 1.279,
224 1.468, 1.707, 1.945, 2.207, 2.457, 2.500};
225 const static vector<double> eta_vals_80 = {0.819, 0.855, 0.899, 0.906, 0.900, 0.869,
226 0.865, 0.873, 0.869, 0.868, 0.859};
227
228 const static vector<double> et_edges = {10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 80};
229 const static vector<vector<double>> et_eta_edges = {eta_edges_10, eta_edges_15, eta_edges_20,
230 eta_edges_25, eta_edges_30, eta_edges_35,
231 eta_edges_40, eta_edges_45, eta_edges_50,
232 eta_edges_60, eta_edges_80};
233 const static vector<vector<double>> et_eta_vals = {eta_vals_10, eta_vals_15, eta_vals_20, eta_vals_25,
234 eta_vals_30, eta_vals_35, eta_vals_40, eta_vals_45,
235 eta_vals_50, eta_vals_60, eta_vals_80};
236
237 if (e.abseta() > 2.5 || e.Et() < 10 * GeV) return 0.0;
238 const int i_et = binIndex(e.Et() / GeV, et_edges, true);
239 const int i_eta = binIndex(e.abseta(), et_eta_edges[i_et]);
240 return et_eta_vals[i_et][i_eta] * ELECTRON_RECOEFF_ATLAS_RUN1(e);
241 }
242
246 inline double ELECTRON_EFF_ATLAS_RUN2_TIGHT(const Particle& e) {
247 if (e.abspid() != PID::ELECTRON) return 0;
248 const static vector<double> et_edges = {/* 10, 15, */ 20, 25, 30, 35, 40, 45, 50, 60, 80};
249 const static vector<double> et_effs = {
250 0.785, 0.805, 0.820, 0.830, 0.840,
251 0.850, 0.875, 0.910, 0.910}; //Extra value extrapolated for overflow
252 const static vector<double> eta_edges = {0.000, 0.051, 0.374, 0.720, 0.981, 1.279,
253 1.468, 1.707, 1.945, 2.207, 2.457, 2.500}; // from ET > 80 bin
254 const static vector<double> eta_refs = {0.819, 0.855, 0.899, 0.906, 0.900, 0.869,
255 0.865, 0.873, 0.869, 0.868, 0.859};
256 if (e.abseta() > 2.5 || e.Et() < 20 * GeV) return 0.0;
257 const int i_et = binIndex(e.Et() / GeV, et_edges, true);
258 const int i_eta = binIndex(e.abseta(), eta_edges);
259 const double eff_et = et_effs[i_et]; //< integral eff
260 // Scale to |eta| shape, following the ~85% efficient high-ET bin from Run 1
261 const double eff = eff_et * (eta_refs[i_eta] / 0.85) * ELECTRON_RECOEFF_ATLAS_RUN2(e);
262 //return ELECTRON_IDEFF_ATLAS_RUN1_TIGHT(e);
263 return eff;
264 }
265
266
269 static const vector<double> edges_eta = {0., 2.5, 3.};
270 static const vector<double> edges_pt = {0., 0.1, 25.};
271 static const vector<double> e2s = {0.000, 0.015, 0.005, 0.005, 0.005, 0.005, 0.107, 0.107, 0.107};
272 static const vector<double> es = {0.00, 0.00, 0.05, 0.05, 0.05, 0.05, 2.08, 2.08, 2.08};
273 static const vector<double> cs = {0.00, 0.00, 0.25, 0.25, 0.25, 0.25, 0.00, 0.00, 0.00};
274
275 const int i_eta = binIndex(e.abseta(), edges_eta, true);
276 const int i_pt = binIndex(e.pT() / GeV, edges_pt, true);
277 const int i = i_eta * edges_pt.size() + i_pt;
278
279 // Calculate absolute resolution in GeV
280 const double c1 = sqr(e2s[i]), c2 = sqr(es[i]), c3 = sqr(cs[i]);
281 const double resolution = sqrt(c1 * e.E2() + c2 * e.E() + c3) * GeV;
282
283 // normal_distribution<> d(e.E(), resolution);
284 // const double mass = e.mass2() > 0 ? e.mass() : 0; //< numerical carefulness...
285 // const double smeared_E = max(d(gen), mass); //< can't let the energy go below the mass!
286 // return Particle(e.pid(), FourMomentum::mkEtaPhiME(e.eta(), e.phi(), mass, smeared_E));
287 return Particle(e.pid(), P4_SMEAR_E_GAUSS(e, resolution));
288 }
289
290
297
298
300
301
303 inline double ELECTRON_EFF_CMS_RUN1(const Particle& e) {
304 if (e.abspid() != PID::ELECTRON) return 0;
305 if (e.abseta() > 2.5) return 0;
306 if (e.pT() < 10 * GeV) return 0;
307 return (e.abseta() < 1.5) ? 0.95 : 0.85;
308 }
309
311 inline double ELECTRON_EFF_CMS_RUN1_LOOSE(const Particle& e) {
312 return ELECTRON_EFF_CMS_RUN1(e);
313 }
314
316 inline double ELECTRON_EFF_CMS_RUN1_MEDIUM(const Particle& e) {
317 return ELECTRON_EFF_CMS_RUN1(e);
318 }
319
321 inline double ELECTRON_EFF_CMS_RUN1_TIGHT(const Particle& e) {
322 return ELECTRON_EFF_CMS_RUN1(e);
323 }
324
325
329 inline double ELECTRON_EFF_CMS_RUN2(const Particle& e) {
330 if (e.abspid() != PID::ELECTRON) return 0;
331 return ELECTRON_EFF_CMS_RUN1(e);
332 }
333
335 inline double ELECTRON_EFF_CMS_RUN2_LOOSE(const Particle& e) {
336 return ELECTRON_EFF_CMS_RUN2(e);
337 }
338
340 inline double ELECTRON_EFF_CMS_RUN2_MEDIUM(const Particle& e) {
341 return ELECTRON_EFF_CMS_RUN2(e);
342 }
343
345 inline double ELECTRON_EFF_CMS_RUN2_TIGHT(const Particle& e) {
346 return ELECTRON_EFF_CMS_RUN2(e);
347 }
348
349
357 // Calculate absolute resolution in GeV from functional form
358 double resolution = 0;
359 const double abseta = e.abseta();
360 if (e.pT() > 0.1 * GeV && abseta < 2.5) { //< should be a given from efficiencies
361 if (abseta < 0.5) {
362 resolution = add_quad(0.06, 1.3e-3 * e.pT() / GeV) * GeV;
363 }
364 else if (abseta < 1.5) {
365 resolution = add_quad(0.10, 1.7e-3 * e.pT() / GeV) * GeV;
366 }
367 else { // still |eta| < 2.5
368 resolution = add_quad(0.25, 3.1e-3 * e.pT() / GeV) * GeV;
369 }
370 }
371
372 // normal_distribution<> d(e.E(), resolution);
373 // const double mass = e.mass2() > 0 ? e.mass() : 0; //< numerical carefulness...
374 // const double smeared_E = max(d(gen), mass); //< can't let the energy go below the mass!
375 // return Particle(e.pid(), FourMomentum::mkEtaPhiME(e.eta(), e.phi(), mass, smeared_E));
376 return Particle(e.pid(), P4_SMEAR_E_GAUSS(e, resolution));
377 }
378
383 return ELECTRON_SMEAR_CMS_RUN1(e);
384 }
385
387
388
391
395 inline double PHOTON_EFF_ATLAS_RUN1(const Particle& y) {
396 if (y.abspid() != PID::PHOTON) return 0;
397
398 if (y.pT() < 10 * GeV) return 0;
399 if (inRange(y.abseta(), 1.37, 1.52) || y.abseta() > 2.37) return 0;
400
401 static const vector<double> edges_eta = {0., 0.6, 1.37, 1.52, 1.81, 2.37};
402 static const vector<double> edges_pt = {10., 15., 20., 25., 30., 35., 40., 45.,
403 50., 60., 80., 100., 125., 150., 175., 250.};
404 static const vector<double> effs = {
405 0.53, 0.65, 0.73, 0.83, 0.86, 0.93, 0.94, 0.96, 0.97, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98, //
406 0.45, 0.57, 0.67, 0.74, 0.84, 0.87, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98, 0.98, 0.99, 0.99, 0.99, //
407 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, //
408 0.48, 0.56, 0.68, 0.76, 0.86, 0.90, 0.93, 0.95, 0.96, 0.97, 0.98, 0.99, 0.99, 1.00, 1.00, 1.00, //
409 0.50, 0.61, 0.74, 0.82, 0.88, 0.92, 0.94, 0.95, 0.96, 0.97, 0.98, 0.98, 0.98, 0.98, 0.99, 0.99};
410
411 const int i_eta = binIndex(y.abseta(), edges_eta);
412 const int i_pt = binIndex(y.pT() / GeV, edges_pt, true);
413 const int i = i_eta * edges_pt.size() + i_pt;
414 const double eff = effs[i];
415 return eff;
416 }
417
419 inline double PHOTON_EFF_ATLAS_RUN1_LOOSE(const Particle& y) {
420 return PHOTON_EFF_ATLAS_RUN1(y);
421 }
422
424 inline double PHOTON_EFF_ATLAS_RUN1_MEDIUM(const Particle& y) {
425 return PHOTON_EFF_ATLAS_RUN1(y);
426 }
427
429 inline double PHOTON_EFF_ATLAS_RUN1_TIGHT(const Particle& y) {
430 return PHOTON_EFF_ATLAS_RUN1(y);
431 }
432
433
437 inline double PHOTON_EFF_ATLAS_RUN2(const Particle& y) {
438 if (y.abspid() != PID::PHOTON) return 0;
439
440 if (y.pT() < 10 * GeV) return 0;
441 if (inRange(y.abseta(), 1.37, 1.52) || y.abseta() > 2.37) return 0;
442
443 static const vector<double> edges_eta = {0., 0.6, 1.37, 1.52, 1.81, 2.37};
444 static const vector<double> edges_pt = {10., 15., 20., 25., 30., 35., 40., 45.,
445 50., 60., 80., 100., 125., 150., 175., 250.};
446 static const vector<double> effs = {
447 0.55, 0.70, 0.85, 0.89, 0.93, 0.95, 0.96, 0.96, 0.97, 0.97, 0.98, 0.97, 0.97, 0.97, 0.97, 0.97, //
448 0.47, 0.66, 0.79, 0.86, 0.89, 0.94, 0.96, 0.97, 0.97, 0.98, 0.97, 0.98, 0.98, 0.98, 0.98, 0.98, //
449 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, //
450 0.54, 0.71, 0.84, 0.88, 0.92, 0.93, 0.94, 0.95, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, //
451 0.61, 0.74, 0.83, 0.88, 0.91, 0.94, 0.95, 0.96, 0.97, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98};
452
453 const int i_eta = binIndex(y.abseta(), edges_eta);
454 const int i_pt = binIndex(y.pT() / GeV, edges_pt, true);
455 const int i = i_eta * edges_pt.size() + i_pt;
456 const double eff = effs[i];
457 return eff;
458 }
459
461 inline double PHOTON_EFF_ATLAS_RUN2_LOOSE(const Particle& y) {
462 return PHOTON_EFF_ATLAS_RUN2(y);
463 }
464
466 inline double PHOTON_EFF_ATLAS_RUN2_MEDIUM(const Particle& y) {
467 return PHOTON_EFF_ATLAS_RUN2(y);
468 }
469
471 inline double PHOTON_EFF_ATLAS_RUN2_TIGHT(const Particle& y) {
472 return PHOTON_EFF_ATLAS_RUN2(y);
473 }
474
475
479 inline double PHOTON_EFF_CMS_RUN1(const Particle& y) {
480 if (y.abspid() != PID::PHOTON) return 0;
481 if (y.pT() < 10 * GeV || y.abseta() > 2.5) return 0;
482 return (y.abseta() < 1.5) ? 0.95 : 0.85;
483 }
484
486 inline double PHOTON_EFF_CMS_RUN1_LOOSE(const Particle& y) {
487 return PHOTON_EFF_CMS_RUN1(y);
488 }
489
491 inline double PHOTON_EFF_CMS_RUN1_MEDIUM(const Particle& y) {
492 return PHOTON_EFF_CMS_RUN1(y);
493 }
494
496 inline double PHOTON_EFF_CMS_RUN1_TIGHT(const Particle& y) {
497 return PHOTON_EFF_CMS_RUN1(y);
498 }
499
500
504 inline double PHOTON_EFF_CMS_RUN2(const Particle& y) {
505 if (y.abspid() != PID::PHOTON) return 0;
506 return PHOTON_EFF_CMS_RUN1(y);
507 }
508
510 inline double PHOTON_EFF_CMS_RUN2_LOOSE(const Particle& y) {
511 return PHOTON_EFF_CMS_RUN2(y);
512 }
513
515 inline double PHOTON_EFF_CMS_RUN2_MEDIUM(const Particle& y) {
516 return PHOTON_EFF_CMS_RUN2(y);
517 }
518
520 inline double PHOTON_EFF_CMS_RUN2_TIGHT(const Particle& y) {
521 return PHOTON_EFF_CMS_RUN2(y);
522 }
523
524
527 return y;
528 }
529 inline Particle PHOTON_SMEAR_ATLAS_RUN2(const Particle& y) {
530 return y;
531 }
532 inline Particle PHOTON_SMEAR_CMS_RUN1(const Particle& y) {
533 return y;
534 }
535 inline Particle PHOTON_SMEAR_CMS_RUN2(const Particle& y) {
536 return y;
537 }
538
540
541
544
546 inline double MUON_EFF_ATLAS_RUN1(const Particle& m) {
547 if (m.abspid() != PID::MUON) return 0;
548 if (m.abseta() > 2.7) return 0;
549 if (m.pT() < 10 * GeV) return 0;
550 return (m.abseta() < 1.5) ? 0.95 : 0.85;
551 }
552
554 inline double MUON_EFF_ATLAS_RUN1_LOOSE(const Particle& m) {
555 return MUON_EFF_ATLAS_RUN1(m);
556 }
557
559 inline double MUON_EFF_ATLAS_RUN1_MEDIUM(const Particle& m) {
560 return MUON_EFF_ATLAS_RUN1(m);
561 }
562
564 inline double MUON_EFF_ATLAS_RUN1_TIGHT(const Particle& m) {
565 return MUON_EFF_ATLAS_RUN1(m);
566 }
567
568
572 inline double MUON_RECOEFF_ATLAS_RUN2(const Particle& m) {
573 if (m.abspid() != PID::MUON) return 0;
574 if (m.abseta() > 2.5) return 0;
575 if (m.abseta() < 0.1) return 0.61;
576 // if (m.pT() < 10*GeV) return 0;
577 return (m.abseta() < 1) ? 0.98 : 0.99;
578 }
579
580
584 inline double MUON_ISOEFF_ATLAS_RUN2_LOOSE(const Particle& m) {
585 if (m.abspid() != PID::MUON) return 0;
586 static const vector<double> edges_pt = {0., 3., 4., 5., 6., 7., 8., 9., 10., 15., 20., 30., 40.};
587 static const vector<double> effs_pt = {0., 0.58, 0.70, 0.75, 0.80, 0.82, 0.85,
588 0.87, 0.90, 0.95, 0.98, 1.00, 1.00};
589 const int i_pt = binIndex(m.pT() / GeV, edges_pt, true);
590 const double eff_pt = effs_pt[i_pt];
591 return eff_pt;
592 }
593
594
598 inline double MUON_EFF_ATLAS_RUN2_LOOSE(const Particle& m) {
599 if (m.abspid() != PID::MUON) return 0;
600 if (m.abseta() > 2.5) return 0;
601 static const vector<double> edges_pt = {0., 3.5, 4., 5., 6., 7., 8., 10.};
602 static const vector<double> effs = {0.00, 0.88, 0.92, 0.97, 0.98, 0.98, 0.98, 0.99};
603 const int i_pt = binIndex(m.pT() / GeV, edges_pt, true);
604 const double eff = effs[i_pt];
605 // no eta dependence
606 return eff * MUON_ISOEFF_ATLAS_RUN2_LOOSE(m);
607 }
608
609
613 inline double MUON_EFF_ATLAS_RUN2_MEDIUM(const Particle& m) {
614 if (m.abspid() != PID::MUON) return 0;
615 if (m.abseta() > 2.5) return 0;
616 static const vector<double> edges_pt = {0., 3.5, 4., 5., 6., 7., 8., 9., 10., 12.,
617 14., 16., 18., 20., 25., 30., 35., 40., 45., 50.};
618 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,
619 0.97, 0.97, 0.97, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98};
620 const int i_pt = binIndex(m.pT() / GeV, edges_pt, true);
621 const double eff_pt = effs_pt[i_pt];
622 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};
623 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};
624 const int i_eta = binIndex(m.abseta(), edges_eta, true);
625 const double eff_eta = effs_eta[i_eta] / 0.99; //< norm factor as approximate double differential
626 return eff_pt * eff_eta * MUON_ISOEFF_ATLAS_RUN2_LOOSE(m);
627 }
628
629
633 inline double MUON_EFF_ATLAS_RUN2_TIGHT(const Particle& m) {
634 if (m.abspid() != PID::MUON) return 0;
635 if (m.abseta() > 2.5) return 0;
636 static const vector<double> edges_pt = {0., 3.5, 4., 5., 6., 7., 8., 9., 10., 12., 14., 16., 18., 20.};
637 static const vector<double> effs_pt = {0.00, 0.00, 0.68, 0.81, 0.85, 0.88, 0.89,
638 0.90, 0.91, 0.92, 0.92, 0.92, 0.93, 0.93};
639 const int i_pt = binIndex(m.pT() / GeV, edges_pt, true);
640 const double eff_pt = effs_pt[i_pt];
641 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};
642 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};
643 const int i_eta = binIndex(m.abseta(), edges_eta, true);
644 const double eff_eta = effs_eta[i_eta] / 0.96; //< norm factor as approximate double differential
645 return eff_pt * eff_eta * MUON_ISOEFF_ATLAS_RUN2_LOOSE(m);
646 }
647
648
654 static const vector<double> edges_eta = {0, 1.5, 2.5};
655 static const vector<double> edges_pt = {0, 0.1, 1.0, 10., 200.};
656 static const vector<double> res = {0., 0.03, 0.02, 0.03, 0.05, 0., 0.04, 0.03, 0.04, 0.05};
657
658 const int i_eta = binIndex(m.abseta(), edges_eta);
659 const int i_pt = binIndex(m.pT() / GeV, edges_pt, true);
660 const int i = i_eta * edges_pt.size() + i_pt;
661 const double resolution_fixed = res[i];
662
663 // For pT > 200 GeV, add an ad-hoc linear scaling to follow the trend of
664 // https://arxiv.org/pdf/2012.00578 Fig 2 but without the high-pT working point,
665 // slightly generously hitting 45% rather than 66% at 2500 GeV.
666 const double resolution = resolution_fixed
667 * (1.0 + max(0.0, (((0.45 - 0.05) / 0.05 - 1.0) / 2300) * (m.pT() - 200 * GeV) / GeV));
668
669 // Smear by a Gaussian centered on the current pT, with width given by the resolution
670 // normal_distribution<> d(m.pT(), resolution*m.pT());
671 // const double smeared_pt = max(d(gen), 0.);
672 // const double mass = m.mass2() > 0 ? m.mass() : 0; //< numerical carefulness...
673 // return Particle(m.pid(), FourMomentum::mkEtaPhiMPt(m.eta(), m.phi(), mass, smeared_pt));
674 return Particle(m.pid(), P4_SMEAR_PT_GAUSS(m, resolution * m.pT()));
675 }
676
684 // Low-pT res limit:
685 double mres_pt = 0.015;
686 // Hit sig_mm / m_mm ~ 0.025 at 100 GeV cf. Fig 12:
687 if (m.pT() > 50 * GeV) mres_pt = 0.015 + 0.01 * (m.pT() - 50 * GeV) / (50 * GeV);
688 // Hit sig(q/p) = 32% / sqrt(2) at pT = 2500 cf. Fig 2, degrade linearly:
689 if (m.pT() > 100 * GeV) mres_pt = 0.025 + 0.0084 * (m.pT() - 100 * GeV) / (100 * GeV);
690 const double ptres_pt = SQRT2 * mres_pt; //< from Eq (10)
691 const double resolution = (m.abseta() < 1.5 ? 1.0 : 1.25) * ptres_pt;
692 return Particle(m.pid(), P4_SMEAR_PT_GAUSS(m, resolution * m.pT()));
693 }
694
696 inline double MUON_EFF_CMS_RUN1(const Particle& m) {
697 if (m.abspid() != PID::MUON) return 0;
698 if (m.abseta() > 2.4) return 0;
699 if (m.pT() < 10 * GeV) return 0;
700 return 0.95 * (m.abseta() < 1.5 ? 1 : exp(0.5 - 5e-4 * m.pT() / GeV));
701 }
702
705 inline double MUON_EFF_CMS_RUN1_LOOSE(const Particle& m) {
706 return MUON_EFF_CMS_RUN1(m);
707 }
708
711 inline double MUON_EFF_CMS_RUN1_MEDIUM(const Particle& m) {
712 return MUON_EFF_CMS_RUN1(m);
713 }
714
717 inline double MUON_EFF_CMS_RUN1_TIGHT(const Particle& m) {
718 return MUON_EFF_CMS_RUN1(m);
719 }
720
721
725 inline double MUON_EFF_CMS_RUN2(const Particle& m) {
726 return MUON_EFF_CMS_RUN1(m);
727 }
728
731 inline double MUON_EFF_CMS_RUN2_LOOSE(const Particle& m) {
732 return MUON_EFF_CMS_RUN2(m);
733 }
734
737 inline double MUON_EFF_CMS_RUN2_MEDIUM(const Particle& m) {
738 return MUON_EFF_CMS_RUN2(m);
739 }
740
743 inline double MUON_EFF_CMS_RUN2_TIGHT(const Particle& m) {
744 return MUON_EFF_CMS_RUN2(m);
745 }
746
747
750 // Calculate fractional resolution
751 // for pT > 0.1 GeV, mom resolution = |eta| < 0.5 -> sqrt(0.01^2 + pt^2 * 2.0e-4^2)
752 // |eta| < 1.5 -> sqrt(0.02^2 + pt^2 * 3.0e-4^2)
753 // |eta| < 2.5 -> sqrt(0.05^2 + pt^2 * 2.6e-4^2)
754 double resolution = 0;
755 const double abseta = m.abseta();
756 if (m.pT() > 0.1 * GeV && abseta < 2.5) {
757 if (abseta < 0.5) {
758 resolution = add_quad(0.01, 2.0e-4 * m.pT() / GeV);
759 }
760 else if (abseta < 1.5) {
761 resolution = add_quad(0.02, 3.0e-4 * m.pT() / GeV);
762 }
763 else { // still |eta| < 2.5... but isn't CMS' mu acceptance < 2.4?
764 resolution = add_quad(0.05, 2.6e-4 * m.pT() / GeV);
765 }
766 }
767
768 // Smear by a Gaussian centered on the current pT, with width given by the resolution
769 // normal_distribution<> d(m.pT(), resolution*m.pT());
770 // const double smeared_pt = max(d(gen), 0.);
771 // const double mass = m.mass2() > 0 ? m.mass() : 0; //< numerical carefulness...
772 // return Particle(m.pid(), FourMomentum::mkEtaPhiMPt(m.eta(), m.phi(), mass, smeared_pt));
773 return Particle(m.pid(), P4_SMEAR_PT_GAUSS(m, resolution * m.pT()));
774 }
775
780 return MUON_SMEAR_CMS_RUN1(m);
781 }
782
784
785
788
796 inline double TAU_EFF_ATLAS_RUN1_MEDIUM(const Particle& t) {
797 if (t.abseta() > 2.5) return 0; //< hmm... mostly
798 if (inRange(t.abseta(), 1.37, 1.52)) return 0; //< crack region
799 double pThadvis = 0;
800 Particles chargedhadrons;
801 for (const Particle& p : t.children()) {
802 if (p.isHadron()) {
803 pThadvis += p.pT(); //< right definition? Paper is unclear
804 if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1 * GeV) chargedhadrons += p;
805 }
806 }
807 if (chargedhadrons.empty()) return 0; //< leptonic tau
808 if (pThadvis < 20 * GeV) return 0; //< below threshold
809 if (pThadvis < 40 * GeV) {
810 if (chargedhadrons.size() == 1) return (t.abspid() == PID::TAU) ? 0.56 : 0; //1/20.;
811 if (chargedhadrons.size() == 3) return (t.abspid() == PID::TAU) ? 0.38 : 0; //1/100.;
812 }
813 else {
814 if (chargedhadrons.size() == 1) return (t.abspid() == PID::TAU) ? 0.56 : 0; //1/25.;
815 if (chargedhadrons.size() == 3) return (t.abspid() == PID::TAU) ? 0.38 : 0; //1/400.;
816 }
817 return 0;
818 }
819
821 inline double TAU_EFF_ATLAS_RUN1(const Particle& t) {
823 }
824
826 inline double TAU_EFF_ATLAS_RUN1_LOOSE(const Particle& t) {
827 return TAU_EFF_ATLAS_RUN1(t);
828 }
829
831 inline double TAU_EFF_ATLAS_RUN1_TIGHT(const Particle& t) {
832 return TAU_EFF_ATLAS_RUN1(t);
833 }
834
835
843 inline double TAUJET_EFF_ATLAS_RUN1(const Jet& j) {
844 if (j.abseta() > 2.5) return 0; //< hmm... mostly
845 if (inRange(j.abseta(), 1.37, 1.52)) return 0; //< crack region
846 double pThadvis = 0;
847 Particles chargedhadrons;
848 for (const Particle& p : j.particles()) {
849 if (p.isHadron()) {
850 pThadvis += p.pT(); //< right definition? Paper is unclear
851 if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1 * GeV) chargedhadrons += p;
852 }
853 }
854
855 if (chargedhadrons.empty()) return 0; //< leptonic tau?
856 if (pThadvis < 20 * GeV) return 0; //< below threshold
857
858 const Particles ttags = j.tauTags(Cuts::pT > 10 * GeV);
859 // MisID rates for jets without truth tau label
860 if (ttags.empty()) {
861 if (pThadvis < 40 * GeV)
862 return chargedhadrons.size() == 1 ? 1 / 20.
863 : chargedhadrons.size() == 3 ? 1 / 100.
864 : 0; //< fake rates
865 else
866 return chargedhadrons.size() == 1 ? 1 / 25.
867 : chargedhadrons.size() == 3 ? 1 / 400.
868 : 0; //< fake rates
869 }
870 // Efficiencies for jets with a truth tau label
871 const Particles prongs = ttags[0].stableDescendants(Cuts::charge3 > 0 && Cuts::pT > 1 * GeV
872 && Cuts::abseta < 2.5);
873 return prongs.size() == 1 ? 0.56 : 0.38;
874 }
875
876
882 inline double TAU_EFF_ATLAS_RUN2_MEDIUM(const Particle& t) {
883 if (t.abspid() != PID::TAU) return 0;
884 if (t.abseta() > 2.5) return 0; //< hmm... mostly
885 if (inRange(t.abseta(), 1.37, 1.52)) return 0; //< crack region
886 double pThadvis = 0;
887 Particles chargedhadrons;
888 for (const Particle& p : t.children()) {
889 if (p.isHadron()) {
890 pThadvis += p.pT(); //< right definition? Paper is unclear
891 if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1 * GeV) chargedhadrons += p;
892 }
893 }
894 if (chargedhadrons.empty()) return 0; //< leptonic tau
895 if (pThadvis < 20 * GeV) return 0; //< below threshold
896 if (chargedhadrons.size() == 1) return (t.abspid() == PID::TAU) ? 0.55 : 0; //1/50.;
897 if (chargedhadrons.size() == 3) return (t.abspid() == PID::TAU) ? 0.40 : 0; //1/110.;
898 return 0;
899 }
900
902 inline double TAU_EFF_ATLAS_RUN2(const Particle& t) {
904 }
905
907 inline double TAU_EFF_ATLAS_RUN2_LOOSE(const Particle& t) {
908 return TAU_EFF_ATLAS_RUN2(t);
909 }
910
912 inline double TAU_EFF_ATLAS_RUN2_TIGHT(const Particle& t) {
913 return TAU_EFF_ATLAS_RUN2(t);
914 }
915
916
922 inline double TAUJET_EFF_ATLAS_RUN2(const Jet& j) {
923 if (j.abseta() > 2.5) return 0; //< hmm... mostly
924 if (inRange(j.abseta(), 1.37, 1.52)) return 0; //< crack region
925 double pThadvis = 0;
926 Particles chargedhadrons;
927 for (const Particle& p : j.particles()) {
928 if (p.isHadron()) {
929 pThadvis += p.pT(); //< right definition? Paper is unclear
930 if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1 * GeV) chargedhadrons += p;
931 }
932 }
933 if (chargedhadrons.empty()) return 0;
934 if (pThadvis < 20 * GeV) return 0; //< below threshold
935 const Particles ttags = j.tauTags(Cuts::pT > 10 * GeV);
936 // if (ttags.empty()) {
937 // if (pThadvis < 40*GeV)
938 // return chargedhadrons.size() == 1 ? 1/50. : 1/110.; //< fake rates
939 // else
940 // return chargedhadrons.size() == 1 ? 1/25. : 1/400.; //< fake rates
941 // }
942 if (ttags.empty())
943 return chargedhadrons.size() == 1 ? 1 / 50. : chargedhadrons.size() == 3 ? 1 / 110. : 0; //< fake rates
944 const Particles prongs = ttags[0].stableDescendants(Cuts::charge3 > 0 && Cuts::pT > 1 * GeV
945 && Cuts::abseta < 2.5);
946 return prongs.size() == 1 ? 0.55 : 0.40;
947 }
948
949
954 // // Const fractional resolution for now
955 // static const double resolution = 0.03;
956
957 // // Smear by a Gaussian centered on 1 with width given by the (fractional) resolution
958 // /// @todo Is this the best way to smear? Should we preserve the energy, or pT, or direction?
959 // const double fsmear = max(randnorm(1., resolution), 0.);
960 // const double mass = t.mass2() > 0 ? t.mass() : 0; //< numerical carefulness...
961 // return Particle(t.pid(), FourMomentum::mkXYZM(t.px()*fsmear, t.py()*fsmear, t.pz()*fsmear, mass));
962
963 // Jet energy resolution lookup
964 // Implemented by Matthias Danninger for GAMBIT, based roughly on
965 // https://atlas.web.cern.ch/Atlas/GROUPS/PHYSICS/CONFNOTES/ATLAS-CONF-2015-017/
966 // Parameterisation can be still improved, but eta dependence is minimal
968 static const vector<double> binedges_pt = {0., 50., 70., 100., 150., 200., 1000., 10000.};
969 static const vector<double> jer = {0.145, 0.115, 0.095, 0.075,
970 0.07, 0.05, 0.04, 0.04}; //< note overflow value
971 const int ipt = binIndex(t.pT() / GeV, binedges_pt, true);
972 if (ipt < 0) return t;
973 const double resolution = jer.at(ipt);
974
975 // Smear by a Gaussian centered on 1 with width given by the (fractional) resolution
977 const double fsmear = max(randnorm(1., resolution), 0.);
978 const double mass = t.mass2() > 0 ? t.mass() : 0; //< numerical carefulness...
979 Particle rtn(PID::TAU, FourMomentum::mkXYZM(t.px() * fsmear, t.py() * fsmear, t.pz() * fsmear, mass));
980 //if (deltaPhi(t, rtn) > 0.01) cout << "jdphi: " << deltaPhi(t, rtn) << endl;
981 return rtn;
982 }
983
984
989 return TAU_SMEAR_ATLAS_RUN1(t);
990 }
991
992
996 inline double TAU_EFF_CMS_RUN1(const Particle& t) {
997 if (t.abspid() != PID::TAU) return 0;
998 return (t.abspid() == PID::TAU) ? 0.6 : 0;
999 }
1000
1002 inline double TAU_EFF_CMS_RUN1_LOOSE(const Particle& t) {
1003 return TAU_EFF_CMS_RUN1(t);
1004 }
1005
1007 inline double TAU_EFF_CMS_RUN1_MEDIUM(const Particle& t) {
1008 return TAU_EFF_CMS_RUN1(t);
1009 }
1010
1012 inline double TAU_EFF_CMS_RUN1_TIGHT(const Particle& t) {
1013 return TAU_EFF_CMS_RUN1(t);
1014 }
1015
1019 inline double TAU_EFF_CMS_RUN2(const Particle& t) {
1020 if (t.abspid() != PID::TAU) return 0;
1021 return (t.abspid() == PID::TAU) ? 0.6 : 0;
1022 }
1023
1025 inline double TAU_EFF_CMS_RUN2_LOOSE(const Particle& t) {
1026 return TAU_EFF_CMS_RUN2(t);
1027 }
1028
1030 inline double TAU_EFF_CMS_RUN2_MEDIUM(const Particle& t) {
1031 return TAU_EFF_CMS_RUN2(t);
1032 }
1033
1035 inline double TAU_EFF_CMS_RUN2_TIGHT(const Particle& t) {
1036 return TAU_EFF_CMS_RUN2(t);
1037 }
1038
1039
1044 return TAU_SMEAR_ATLAS_RUN1(t);
1045 }
1046
1047
1052 return TAU_SMEAR_CMS_RUN1(t);
1053 }
1054
1056
1057
1060
1062 inline double JET_BTAG_ATLAS_RUN1(const Jet& j) {
1064 if (j.abseta() > 2.5) return 0;
1065 const auto ftagsel = [&](const Particle& p) {
1066 return p.pT() > 5 * GeV && deltaR(p, j) < 0.3;
1067 };
1068 if (j.bTagged(ftagsel)) return 0.80 * tanh(0.003 * j.pT() / GeV) * (30 / (1 + 0.0860 * j.pT() / GeV));
1069 if (j.cTagged(ftagsel)) return 0.20 * tanh(0.020 * j.pT() / GeV) * (1 / (1 + 0.0034 * j.pT() / GeV));
1070 return 0.002 + 7.3e-6 * j.pT() / GeV;
1071 }
1072
1073 inline double JET_BTAG_ATLAS_RUN1_XXX(const Jet& j) {
1074 return JET_BTAG_ATLAS_RUN1(j);
1075 }
1076
1078 inline double JET_BTAG_ATLAS_RUN2_MV2C20(const Jet& j) {
1079 if (j.abseta() > 2.5) return 0;
1080 if (j.bTagged(Cuts::pT > 5 * GeV)) return 0.77;
1081 if (j.cTagged(Cuts::pT > 5 * GeV)) return 1 / 4.5;
1082 return 1 / 140.;
1083 }
1084
1086 inline double JET_BTAG_ATLAS_RUN2_MV2C10(const Jet& j) {
1087 if (j.abseta() > 2.5) return 0;
1088 if (j.bTagged(Cuts::pT > 5 * GeV)) return 0.77;
1089 if (j.cTagged(Cuts::pT > 5 * GeV)) return 1 / 6.0;
1090 return 1 / 134.;
1091 }
1092
1093 // pT-dependendent ATLAS Run 2 (2016 study) MV2c10 b-tagging efficiencies.
1094 // If high-pT b-jets are important in your analysis, be careful!
1095 // Based on ATL-PHYS-PUB-2016-012 fig 12
1096 inline double JET_BTAG_ATLAS_RUN2_2016_MV2C10_77(const Jet& j) {
1097 if (j.bTagged()) {
1098 // N.B. !!! There is no overflow bin.
1099 // There is a clear downward curve in efficiency as pT->inf, but the value to use for pT > 500
1100 // is super-unclear. The used value (0.69) is certainly a reasonable extrapolation, but it should
1101 // be noted that tuning this value can make a really significant difference to the bin counts O(10%)
1102 // HOWEVER: atlas really needs to start increasing the range of this sort of plot
1103 // The behaviour of jets pT>500 is much more interesting and significant than those in the range 20<pt<25.
1104 const static vector<double> binedges_pt = {0.00, 30.0, 40.00, 50.00, 60.0, 75.00,
1105 90.0, 105., 150., 200., 500};
1106 const static vector<double> eff_pt = {0.63, 0.705, 0.74, 0.76, 0.775, 0.785,
1107 0.795, 0.80, 0.79, 0.75, 0.68};
1108
1109 return eff_pt[binIndex(j.pt(), binedges_pt, true)];
1110 }
1111 else if (j.cTagged()) {
1112 //n.b. there is also a pt/eta table for c mistags, but if that's significant I'll eat my hat.
1113 return 1. / 5.;
1114 }
1115 else if (j.tauTagged()) {
1116 return 1. / 16.;
1117 }
1118 else
1119 return 1. / 110.;
1120 }
1121
1122 // pT-dependendent ATLAS Run 2 DL1d b-tagging efficiencies.
1123 // If high-pT b-jets are important in your analysis, be careful!
1124 inline double JET_BTAG_ATLAS_RUN2_DL1d_77(const Jet& j) {
1125 if (j.bTagged()) {
1126 if (j.abseta() > 2.5) return 0.;
1127
1128 // Original Values from FTAG-2023-01 (up to 400 GeV)
1129 // N.B. !!! There is no overflow bin.
1130 // There is a clear downward curve in efficiency as pT->inf, but the value to use for pT > 500
1131 // is super-unclear. The used value (0.69) is certainly a reasonable extrapolation, but it should
1132 // be noted that tuning this value can make a really significant difference to the bin counts O(10%)
1133 // HOWEVER: atlas really needs to start increasing the range of this sort of plot
1134 // The behaviour of jets pT>500 is much more interesting and significant than those in the range 20<pt<25.
1135 // N.B.2 Message above copied from my implementation of MV2c10. Plus ca change...
1136 // Better distributions available for DL1r, but not here.
1137 // I will use the DL1/DL1r plots in arXiv:2211.16345 to guess a good overflow value
1138 // (the consistency between DL1, DL1r hopefully makes this not crazy)
1139 const static vector<double> binedges_pt = {0.00, 20., 30., 40., 60., 85., 110.,
1140 140., 175., 250., 400., 800., 1200., 2000.};
1141 const static vector<double> eff_pt = {0.0, 0.68, 0.74, 0.77, 0.79, 0.8, 0.81,
1142 0.81, 0.805, 0.78, 0.75, 0.7, 0.65, 0.5};
1143
1144 return eff_pt[binIndex(j.pt(), binedges_pt, true)];
1145 }
1146 else if (j.cTagged()) {
1147 //n.b. there is also a pt/eta table for c mistags, shouldn't be too significant
1148 return 0.155;
1149 }
1150 // Nothing in the paper, going to guess something small just in case.
1151 else if (j.tauTagged()) {
1152 return 1. / 36.;
1153 }
1154 else
1155 return 0.0038;
1156 }
1157
1158 // Based on figs 11-12 of https://arxiv.org/pdf/2211.16345
1159 // As far as I can see, this is the only pre-GN2 b-tag paper
1160 // that includes efficiencies up to very high pt. Thankyou!!!
1161 // Though n.b. the 0-250 range is in ttbar and 250-3000 is in
1162 // simulated Z', hence the discontinuities going on.
1163 inline double JET_BTAG_ATLAS_RUN2_DL1r_77(const Jet& j) {
1164 if (j.pt() <= 20 * GeV || j.abseta() > 2.5) return 0.;
1165
1166 const static vector<double> binedges_pt = {20., 30., 40., 60., 85., 110., 140.,
1167 175., 210., 250., 400., 600., 800., 1000.,
1168 1200., 1400., 1500., 2000.0, 3000.0};
1169
1170 if (j.bTagged()) {
1171 // TODO: for pT < 250 we also have eta dependence... include somehow?
1172 const static vector<double> eff_pt = {0.667, 0.731, 0.771, 0.791, 0.801, 0.805, 0.806,
1173 0.798, 0.795, 0.825, 0.802, 0.771, 0.741, 0.706,
1174 0.679, 0.674, 0.634, 0.5, 0.5};
1175 // 0.5 repeated for overflow just in case.
1176
1177 return eff_pt[binIndex(j.pt(), binedges_pt, true)];
1178 }
1179 else if (j.cTagged()) {
1180 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, 3.04,
1181 3.05, 3.21, 3.37, 3.616, 3.83, 3.96, 4.01, 2.90, 2.90};
1182 // 2.90 repeated for overflow just in case.
1183 return 1. / c_rej_pt[binIndex(j.pt(), binedges_pt, true)];
1184 }
1185 else {
1186 const static vector<double> light_rej_pt = {143, 191, 239, 261, 235, 257, 248, 189, 158, 32.8,
1187 19.1, 14.2, 12.4, 11.2, 11.0, 11.2, 12.4, 8.27, 8.27};
1188 // 8.27 repeated for overflow just in case.]
1189 return 1. / light_rej_pt[binIndex(j.pt(), binedges_pt, true)];
1190 }
1191 }
1192
1193
1198 inline Jet JET_SMEAR_ATLAS_RUN1(const Jet& j) {
1199 // Jet energy resolution lookup
1200 // Parameterisation can be still improved, but eta dependence is minimal
1202 static const vector<double> binedges_pt = {0., 50., 70., 100., 150., 200., 1000., 10000.};
1203 static const vector<double> jer = {0.145, 0.115, 0.095, 0.075,
1204 0.07, 0.05, 0.04, 0.04}; //< note overflow value
1205 const int ipt = binIndex(j.pT() / GeV, binedges_pt, true);
1206 if (ipt < 0) return j;
1207 const double resolution = jer.at(ipt);
1208
1209 // Smear by a Gaussian centered on 1 with width given by the (fractional) resolution
1211 const double fsmear = max(randnorm(1., resolution), 0.);
1212 const double mass = j.mass2() > 0 ? j.mass() : 0; //< numerical carefulness...
1213 Jet rtn(FourMomentum::mkXYZM(j.px() * fsmear, j.py() * fsmear, j.pz() * fsmear, mass));
1214 //if (deltaPhi(j, rtn) > 0.01) cout << "jdphi: " << deltaPhi(j, rtn) << endl;
1215 return rtn;
1216 }
1217
1221 inline Jet JET_SMEAR_ATLAS_RUN2(const Jet& j) {
1222 return JET_SMEAR_ATLAS_RUN1(j);
1223 }
1224
1228 inline Jet JET_SMEAR_CMS_RUN1(const Jet& j) {
1229 return JET_SMEAR_ATLAS_RUN1(j);
1230 }
1231
1235 inline Jet JET_SMEAR_CMS_RUN2(const Jet& j) {
1236 return JET_SMEAR_CMS_RUN1(j);
1237 }
1238
1240
1241
1244
1248 inline METSmearParams MET_SMEARPARAMS_ATLAS_RUN1(const Vector3& met, double set) {
1249 // Linearity offset (Fig 14)
1250 Vector3 smeared_met = met;
1251 if (met.mod() < 25 * GeV)
1252 smeared_met *= 1.05;
1253 else if (met.mod() < 40 * GeV)
1254 smeared_met *= (1.05 - (0.04 / 15) * (met.mod() / GeV - 25)); //< linear decrease
1255 else
1256 smeared_met *= 1.01;
1257
1258 return {smeared_met, 0.45 * sqrt(set / GeV) * GeV, 0.0};
1259 }
1260
1262 inline Vector3 MET_SMEAR_ATLAS_RUN1(const Vector3& met, double set) {
1264 }
1265
1266
1270 inline METSmearParams MET_SMEARPARAMS_ATLAS_RUN2(const Vector3& met, double set) {
1271 // Linearity offset (Fig 6):
1272 //
1273 // Expn. approx to Fig 6 tt curve, flat below 25 GeV, suppressed
1274 // to fall between the W and tt curves (and match the flat) at 25 GeV,
1275 // and to approach -2% at high-MET.
1276 //
1278 const Vector3 smeared_met = met * (1 + 0.45 * min(1.0, exp(-(met.mod() - 25 * GeV) / (10 * GeV))) - 0.02);
1279
1280 // Resolution(sumEt) ~ 0.45 sqrt(sumEt) GeV above SET = 180 GeV,
1281 // and with linear trend from SET = 180 -> 0 to resolution = 0 (Fig 7)
1282 const double resolution1 = (set < 180 * GeV ? set / 180. : 1) * 0.45 * sqrt(max(set / GeV, 180)) * GeV;
1284
1285 // Resolution(MET_true) (Fig 9)
1286 const double resolution2 = 15 * GeV + 0.5 * sqrt(met.mod() / GeV) * GeV;
1287
1288 // Smearing width is given by the minimum resolution estimator (should mean low-MET events
1289 // with high SET do not get a large smearing, and will be dominated by the linearity effect).
1291 const double sigma = min(resolution1, resolution2);
1292
1293 return {smeared_met, sigma, 0.0};
1294 }
1295
1297 inline Vector3 MET_SMEAR_ATLAS_RUN2(const Vector3& met, double set) {
1299 }
1300
1301
1307 inline METSmearParams MET_SMEARPARAMS_ATLAS_RUN2_PFLOW(const Vector3& met, double /* set */) {
1308 // Mean response (Fig 7), expn approximation to the ttbar curve guessing 2 e-foldings in 40 GeV.
1310 const Vector3 smeared_met = met * (1 + 1.15 * exp(-met.mod() / (20 * GeV)) - 0.01);
1311
1312 // Mean resolution ~ 15-25 GeV for mu ~ 33.7 (Run 2 avg), but significant dependence on event type (i.e. SET)
1313 // See Figures 4 and 5. The paper doesn't provide enough information for a general SET-dependence:
1314 // maybe prefer the older MET smearing. Not enough discrimination between WPs, mainly encoded vs mu or N_PV.
1315 const double resolution = 20 * GeV;
1316
1317 return {smeared_met, resolution, 0.0};
1318 }
1319
1321 inline Vector3 MET_SMEAR_ATLAS_RUN2_PFLOW(const Vector3& met, double set) {
1323 }
1324
1325
1329 inline METSmearParams MET_SMEARPARAMS_CMS_RUN1(const Vector3& met, double set) {
1330 // Calculate parallel and perpendicular resolutions and combine in quadrature (?)
1331 const double resolution_x = (1.1 + 0.6 * sqrt(set / GeV)) * GeV;
1332 const double resolution_y = (1.4 + 0.6 * sqrt(set / GeV)) * GeV;
1333 const double resolution = sqrt(sqr(resolution_x) + sqr(resolution_y));
1334 return {met, resolution, 0.0};
1335 }
1336
1338 inline Vector3 MET_SMEAR_CMS_RUN1(const Vector3& met, double set) {
1339 return MET_SMEAR_NORM(MET_SMEARPARAMS_CMS_RUN1(met, set));
1340 }
1341
1342
1346 inline METSmearParams MET_SMEARPARAMS_CMS_RUN2(const Vector3& met, double set) {
1347 // Calculate parallel and perpendicular resolutions and combine in quadrature (?)
1348 const double resolution_para = (2.0 + 0.64 * sqrt(set / GeV)) * GeV;
1349 const double resolution_perp = (-1.5 + 0.68 * sqrt(set / GeV)) * GeV;
1350 const double resolution = sqrt(sqr(resolution_para) + sqr(resolution_perp));
1351 return {met, resolution, 0.0};
1352 }
1353
1355 inline Vector3 MET_SMEAR_CMS_RUN2(const Vector3& met, double set) {
1356 return MET_SMEAR_NORM(MET_SMEARPARAMS_CMS_RUN2(met, set));
1357 }
1358
1360
1361
1364
1366 inline double TRK_EFF_ATLAS_RUN1(const Particle& p) {
1367 if (p.charge3() == 0) return 0;
1368 if (p.abseta() > 2.5) return 0;
1369 if (p.pT() < 0.1 * GeV) return 0;
1370
1371 if (p.abspid() == PID::ELECTRON) {
1372 if (p.abseta() < 1.5) {
1373 if (p.pT() < 1 * GeV) return 0.73;
1374 if (p.pT() < 100 * GeV) return 0.95;
1375 return 0.99;
1376 }
1377 else {
1378 if (p.pT() < 1 * GeV) return 0.50;
1379 if (p.pT() < 100 * GeV)
1380 return 0.83;
1381 else
1382 return 0.90;
1383 }
1384 }
1385 else if (p.abspid() == PID::MUON) {
1386 if (p.abseta() < 1.5) {
1387 return (p.pT() < 1 * GeV) ? 0.75 : 0.99;
1388 }
1389 else {
1390 return (p.pT() < 1 * GeV) ? 0.70 : 0.98;
1391 }
1392 }
1393 else { // charged hadrons
1394 if (p.abseta() < 1.5) {
1395 return (p.pT() < 1 * GeV) ? 0.70 : 0.95;
1396 }
1397 else {
1398 return (p.pT() < 1 * GeV) ? 0.60 : 0.85;
1399 }
1400 }
1401 }
1402
1406 inline double TRK_EFF_ATLAS_RUN2(const Particle& p) {
1407 return TRK_EFF_ATLAS_RUN1(p);
1408 }
1409
1410
1415 return PARTICLE_SMEAR_IDENTITY(t);
1416 }
1417
1421 return PARTICLE_SMEAR_IDENTITY(t);
1422 }
1423
1424
1426 inline double TRK_EFF_CMS_RUN1(const Particle& p) {
1427 if (p.charge3() == 0) return 0;
1428 if (p.abseta() > 2.5) return 0;
1429 if (p.pT() < 0.1 * GeV) return 0;
1430
1431 if (p.abspid() == PID::ELECTRON) {
1432 if (p.abseta() < 1.5) {
1433 if (p.pT() < 1 * GeV) return 0.73;
1434 if (p.pT() < 100 * GeV) return 0.95;
1435 return 0.99;
1436 }
1437 else {
1438 if (p.pT() < 1 * GeV) return 0.50;
1439 if (p.pT() < 100 * GeV)
1440 return 0.83;
1441 else
1442 return 0.90;
1443 }
1444 }
1445 else if (p.abspid() == PID::MUON) {
1446 if (p.abseta() < 1.5) {
1447 return (p.pT() < 1 * GeV) ? 0.75 : 0.99;
1448 }
1449 else {
1450 return (p.pT() < 1 * GeV) ? 0.70 : 0.98;
1451 }
1452 }
1453 else { // charged hadrons
1454 if (p.abseta() < 1.5) {
1455 return (p.pT() < 1 * GeV) ? 0.70 : 0.95;
1456 }
1457 else {
1458 return (p.pT() < 1 * GeV) ? 0.60 : 0.85;
1459 }
1460 }
1461 }
1462
1466 inline double TRK_EFF_CMS_RUN2(const Particle& p) {
1467 return TRK_EFF_CMS_RUN1(p);
1468 }
1469
1470
1475 return PARTICLE_SMEAR_IDENTITY(t);
1476 }
1477
1481 return PARTICLE_SMEAR_IDENTITY(t);
1482 }
1483
1491 inline double ATLAS_JVT_EFF_LOOSE(const Jet& j) {
1492 if (j.abseta() > 2.4) return 1.0;
1493 // No data for jets pt < 20, hopefully not relevant:
1494 if (j.pt() <= 20 * GeV || j.pt() >= 60 * GeV) return 1.0;
1495
1496 const static vector<double> binedges_pt = {20 * GeV, 25 * GeV, 30 * GeV, 35 * GeV, 40 * GeV,
1497 45 * GeV, 50 * GeV, 55 * GeV, 60 * GeV};
1498 const static vector<double> binvals = {0.9, 0.93, 0.94, 0.95, 0.96, 0.96, 0.97, 0.97};
1499
1500 const size_t bini = binIndex(j.pt(), binedges_pt);
1501 return binvals[bini];
1502 }
1503
1511 inline double ATLAS_JVT_EFF_MEDIUM(const Jet& j) {
1512 if (j.abseta() > 2.4) return 1.0;
1513 // No data for jets pt < 20, hopefully not relevant:
1514 if (j.pt() <= 20 * GeV || j.pt() >= 60 * GeV) return 1.0;
1515
1516 const static vector<double> binedges_pt = {20 * GeV, 25 * GeV, 30 * GeV, 35 * GeV, 40 * GeV,
1517 45 * GeV, 50 * GeV, 55 * GeV, 60 * GeV};
1518 const static vector<double> binvals = {0.86, 0.9, 0.92, 0.93, 0.94, 0.95, 0.95, 0.96};
1519
1520 const size_t bini = binIndex(j.pt(), binedges_pt);
1521 return binvals[bini];
1522 }
1523
1531 inline double ATLAS_JVT_EFF_TIGHT(const Jet& j) {
1532 if (j.abseta() > 2.4) return 1.0;
1533 // No data for jets pt < 20, hopefully not relevant:
1534 if (j.pt() <= 20 * GeV || j.pt() >= 60 * GeV) return 1.0;
1535
1536 const static vector<double> binedges_pt = {20 * GeV, 25 * GeV, 30 * GeV, 35 * GeV, 40 * GeV,
1537 45 * GeV, 50 * GeV, 55 * GeV, 60 * GeV};
1538 const static vector<double> binvals = {0.81, 0.84, 0.87, 0.90, 0.91, 0.92, 0.93, 0.94};
1539
1540 const size_t bini = binIndex(j.pt(), binedges_pt);
1541 return binvals[bini];
1542 }
1543
1545
1548
1549 inline double ELECTRON_EFF_IDENTITY_LOOSE(const Particle& e) {
1550 return PARTICLE_EFF_ONE(e);
1551 }
1552 inline double ELECTRON_EFF_IDENTITY_MEDIUM(const Particle& e) {
1553 return PARTICLE_EFF_ONE(e);
1554 }
1555 inline double ELECTRON_EFF_IDENTITY_TIGHT(const Particle& e) {
1556 return PARTICLE_EFF_ONE(e);
1557 }
1558 inline double MUON_EFF_IDENTITY_LOOSE(const Particle& m) {
1559 return PARTICLE_EFF_ONE(m);
1560 }
1561 inline double MUON_EFF_IDENTITY_MEDIUM(const Particle& m) {
1562 return PARTICLE_EFF_ONE(m);
1563 }
1564 inline double MUON_EFF_IDENTITY_TIGHT(const Particle& m) {
1565 return PARTICLE_EFF_ONE(m);
1566 }
1567 inline double PHOTON_EFF_IDENTITY_LOOSE(const Particle& y) {
1568 return PARTICLE_EFF_ONE(y);
1569 }
1570 inline double PHOTON_EFF_IDENTITY_MEDIUM(const Particle& y) {
1571 return PARTICLE_EFF_ONE(y);
1572 }
1573 inline double PHOTON_EFF_IDENTITY_TIGHT(const Particle& y) {
1574 return PARTICLE_EFF_ONE(y);
1575 }
1576 inline double TAU_EFF_IDENTITY_LOOSE(const Particle& t) {
1577 return PARTICLE_EFF_ONE(t);
1578 }
1579 inline double TAU_EFF_IDENTITY_MEDIUM(const Particle& t) {
1580 return PARTICLE_EFF_ONE(t);
1581 }
1582 inline double TAU_EFF_IDENTITY_TIGHT(const Particle& t) {
1583 return PARTICLE_EFF_ONE(t);
1584 }
1585
1586 inline Particle ELECTRON_SMEAR_IDENTITY(const Particle& e) {
1587 return PARTICLE_SMEAR_IDENTITY(e);
1588 }
1589 inline Particle MUON_SMEAR_IDENTITY(const Particle& m) {
1590 return PARTICLE_SMEAR_IDENTITY(m);
1591 }
1592 inline Particle PHOTON_SMEAR_IDENTITY(const Particle& y) {
1593 return PARTICLE_SMEAR_IDENTITY(y);
1594 }
1595 inline Particle TAU_SMEAR_IDENTITY(const Particle& t) {
1596 return PARTICLE_SMEAR_IDENTITY(t);
1597 }
1598
1599 inline double TRK_EFF_IDENTITY_TIGHT(const Particle& trk) {
1600 return PARTICLE_EFF_ONE(trk);
1601 }
1602 inline Particle TRK_SMEAR_IDENTITY(const Particle& trk) {
1603 return PARTICLE_SMEAR_IDENTITY(trk);
1604 }
1605
1606 inline double JET_BTAG_IDENTITY_IDENTITY(const Jet& j) {
1607 return JET_BTAG_IDENTITY(j);
1608 }
1609
1610 // Already defined: JET_SMEAR_IDENTITY and MET_SMEAR_IDENTITY
1611
1613
1615
1616
1617}
1618
1619#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:809
Representation of a clustered jet of particles.
Definition Jet.hh:47
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:217
Particles & particles()
Get the particles in this jet.
Definition Jet.hh:84
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:188
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:190
double pT() const
Get the directly (alias).
Definition ParticleBase.hh:81
double mass2() const
Get the mass**2 directly.
Definition ParticleBase.hh:116
double abseta() const
Get the directly (alias).
Definition ParticleBase.hh:133
double mass() const
Get the mass directly.
Definition ParticleBase.hh:112
double pz() const
z component of momentum.
Definition ParticleBase.hh:194
double pt() const
Get the directly.
Definition ParticleBase.hh:77
double px() const
x component of momentum.
Definition ParticleBase.hh:186
double Et() const
Get the directly.
Definition ParticleBase.hh:103
double E() const
Get the energy directly.
Definition ParticleBase.hh:59
double E2() const
Get the energy-squared.
Definition ParticleBase.hh:68
Particle representation, either from a HepMC::GenEvent or reconstructed.
Definition Particle.hh:50
PdgId pid() const
This Particle's PDG ID code.
Definition Particle.hh:221
PdgId abspid() const
Absolute value of the PDG ID code.
Definition Particle.hh:225
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:39
double mod() const
Calculate the modulus of a vector. .
Definition VectorN.hh:99
STL class.
double mass(const FourMomentum &a, const FourMomentum &b)
Calculate mass of two 4-vectors.
Definition Vector4.hh:1474
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:819
double abseta(const ParticleBase &p)
Unbound function access to abseta.
Definition ParticleBaseUtils.hh:844
double ELECTRON_EFF_ATLAS_RUN1_MEDIUM(const Particle &e)
ATLAS Run 1 'medium' electron reco+identification efficiency.
Definition ExptSmearingFunctions.hh:95
double ELECTRON_EFF_ATLAS_RUN1_TIGHT(const Particle &e)
ATLAS Run 1 'tight' electron reco+identification efficiency.
Definition ExptSmearingFunctions.hh:174
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:303
Particle ELECTRON_SMEAR_ATLAS_RUN1(const Particle &e)
ATLAS Run 1 electron reco smearing.
Definition ExptSmearingFunctions.hh:268
double ELECTRON_EFF_CMS_RUN2_TIGHT(const Particle &e)
Definition ExptSmearingFunctions.hh:345
double ELECTRON_EFF_ATLAS_RUN2_TIGHT(const Particle &e)
ATLAS Run 2 'tight' electron reco+identification efficiency.
Definition ExptSmearingFunctions.hh:246
double ELECTRON_EFF_CMS_RUN1_MEDIUM(const Particle &e)
Definition ExptSmearingFunctions.hh:316
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:356
double ELECTRON_EFF_CMS_RUN2(const Particle &e)
Definition ExptSmearingFunctions.hh:329
double ELECTRON_EFF_ATLAS_RUN2_MEDIUM(const Particle &e)
ATLAS Run 2 'medium' electron reco+identification efficiency.
Definition ExptSmearingFunctions.hh:167
double ELECTRON_EFF_CMS_RUN2_MEDIUM(const Particle &e)
Definition ExptSmearingFunctions.hh:340
Particle ELECTRON_SMEAR_ATLAS_RUN2(const Particle &e)
Definition ExptSmearingFunctions.hh:294
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:89
double ELECTRON_EFF_CMS_RUN1_LOOSE(const Particle &e)
Definition ExptSmearingFunctions.hh:311
double ELECTRON_RECOEFF_ATLAS_RUN1(const Particle &e)
Definition ExptSmearingFunctions.hh:39
Particle ELECTRON_SMEAR_CMS_RUN2(const Particle &e)
Definition ExptSmearingFunctions.hh:382
double ELECTRON_EFF_CMS_RUN2_LOOSE(const Particle &e)
Definition ExptSmearingFunctions.hh:335
double ELECTRON_EFF_CMS_RUN1_TIGHT(const Particle &e)
Definition ExptSmearingFunctions.hh:321
Jet JET_SMEAR_ATLAS_RUN2(const Jet &j)
Definition ExptSmearingFunctions.hh:1221
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:1078
Jet JET_SMEAR_ATLAS_RUN1(const Jet &j)
ATLAS Run 1 jet smearing.
Definition ExptSmearingFunctions.hh:1198
Jet JET_SMEAR_CMS_RUN1(const Jet &j)
Definition ExptSmearingFunctions.hh:1228
Jet JET_SMEAR_CMS_RUN2(const Jet &j)
Definition ExptSmearingFunctions.hh:1235
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:1086
double JET_BTAG_ATLAS_RUN1_XXX(const Jet &j)
Alias for naming scheme.
Definition ExptSmearingFunctions.hh:1073
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:1062
METSmearParams MET_SMEARPARAMS_ATLAS_RUN2(const Vector3 &met, double set)
Definition ExptSmearingFunctions.hh:1270
Vector3 MET_SMEAR_ATLAS_RUN2(const Vector3 &met, double set)
ATLAS Run 2 ETmiss smearing.
Definition ExptSmearingFunctions.hh:1297
Vector3 MET_SMEAR_ATLAS_RUN2_PFLOW(const Vector3 &met, double set)
ATLAS Run 2 pflow ETmiss smearing.
Definition ExptSmearingFunctions.hh:1321
METSmearParams MET_SMEARPARAMS_ATLAS_RUN2_PFLOW(const Vector3 &met, double)
Definition ExptSmearingFunctions.hh:1307
METSmearParams MET_SMEARPARAMS_ATLAS_RUN1(const Vector3 &met, double set)
ATLAS Run 1 ETmiss resolution.
Definition ExptSmearingFunctions.hh:1248
Vector3 MET_SMEAR_CMS_RUN1(const Vector3 &met, double set)
CMS Run 1 ETmiss smearing.
Definition ExptSmearingFunctions.hh:1338
Vector3 MET_SMEAR_NORM(const METSmearParams &msps)
Smear a nominal vector magnitude by Gaussian with the given absolute resolutions.
Definition MomentumSmearingFunctions.hh:185
Vector3 MET_SMEAR_ATLAS_RUN1(const Vector3 &met, double set)
ATLAS Run 1 ETmiss smearing.
Definition ExptSmearingFunctions.hh:1262
Vector3 MET_SMEAR_CMS_RUN2(const Vector3 &met, double set)
CMS Run 2 ETmiss smearing.
Definition ExptSmearingFunctions.hh:1355
METSmearParams MET_SMEARPARAMS_CMS_RUN1(const Vector3 &met, double set)
Definition ExptSmearingFunctions.hh:1329
METSmearParams MET_SMEARPARAMS_CMS_RUN2(const Vector3 &met, double set)
CMS Run 2 ETmiss smearing.
Definition ExptSmearingFunctions.hh:1346
FourMomentum P4_SMEAR_E_GAUSS(const FourMomentum &p, double resolution)
Definition MomentumSmearingFunctions.hh:76
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:84
double MUON_EFF_ATLAS_RUN1_LOOSE(const Particle &m)
Definition ExptSmearingFunctions.hh:554
double MUON_EFF_ATLAS_RUN2_TIGHT(const Particle &m)
ATLAS Run 2 muon reco+ID efficiency.
Definition ExptSmearingFunctions.hh:633
Particle MUON_SMEAR_ATLAS_RUN1(const Particle &m)
Definition ExptSmearingFunctions.hh:653
Particle MUON_SMEAR_CMS_RUN1(const Particle &m)
CMS Run 1 muon reco smearing.
Definition ExptSmearingFunctions.hh:749
double MUON_EFF_ATLAS_RUN2_LOOSE(const Particle &m)
ATLAS Run 2 muon reco+ID efficiency.
Definition ExptSmearingFunctions.hh:598
double MUON_EFF_CMS_RUN2(const Particle &m)
Definition ExptSmearingFunctions.hh:725
double MUON_EFF_ATLAS_RUN1(const Particle &m)
ATLAS Run 1 muon reco efficiency.
Definition ExptSmearingFunctions.hh:546
double MUON_EFF_CMS_RUN2_TIGHT(const Particle &m)
Definition ExptSmearingFunctions.hh:743
double MUON_ISOEFF_ATLAS_RUN2_LOOSE(const Particle &m)
ATLAS Run 2 muon isolation efficiency.
Definition ExptSmearingFunctions.hh:584
double MUON_EFF_CMS_RUN2_LOOSE(const Particle &m)
Definition ExptSmearingFunctions.hh:731
Particle MUON_SMEAR_ATLAS_RUN2(const Particle &m)
Definition ExptSmearingFunctions.hh:683
double MUON_RECOEFF_ATLAS_RUN2(const Particle &m)
Definition ExptSmearingFunctions.hh:572
double MUON_EFF_CMS_RUN1(const Particle &m)
CMS Run 1 muon reco efficiency.
Definition ExptSmearingFunctions.hh:696
double MUON_EFF_CMS_RUN1_TIGHT(const Particle &m)
Definition ExptSmearingFunctions.hh:717
double MUON_EFF_ATLAS_RUN1_TIGHT(const Particle &m)
Definition ExptSmearingFunctions.hh:564
double MUON_EFF_CMS_RUN2_MEDIUM(const Particle &m)
Definition ExptSmearingFunctions.hh:737
double MUON_EFF_CMS_RUN1_LOOSE(const Particle &m)
Definition ExptSmearingFunctions.hh:705
double MUON_EFF_CMS_RUN1_MEDIUM(const Particle &m)
Definition ExptSmearingFunctions.hh:711
double MUON_EFF_ATLAS_RUN1_MEDIUM(const Particle &m)
Definition ExptSmearingFunctions.hh:559
Particle MUON_SMEAR_CMS_RUN2(const Particle &m)
Definition ExptSmearingFunctions.hh:779
double MUON_EFF_ATLAS_RUN2_MEDIUM(const Particle &m)
ATLAS Run 2 muon reco+ID efficiency.
Definition ExptSmearingFunctions.hh:613
double PARTICLE_EFF_ONE(const Particle &)
Take a Particle and return 1.
Definition ParticleSmearingFunctions.hh:39
Particle PARTICLE_SMEAR_IDENTITY(const Particle &p)
Take a Particle and return it unmodified.
Definition ParticleSmearingFunctions.hh:67
double JET_BTAG_IDENTITY(const Jet &j)
Alias for JET_BTAG_PERFECT.
Definition JetSmearingFunctions.hh:78
double PHOTON_EFF_CMS_RUN1_TIGHT(const Particle &y)
Definition ExptSmearingFunctions.hh:496
double PHOTON_EFF_CMS_RUN2_TIGHT(const Particle &y)
Definition ExptSmearingFunctions.hh:520
double PHOTON_EFF_CMS_RUN2_LOOSE(const Particle &y)
Definition ExptSmearingFunctions.hh:510
double PHOTON_EFF_ATLAS_RUN2_TIGHT(const Particle &y)
Definition ExptSmearingFunctions.hh:471
double PHOTON_EFF_ATLAS_RUN1_MEDIUM(const Particle &y)
Definition ExptSmearingFunctions.hh:424
Particle PHOTON_SMEAR_ATLAS_RUN1(const Particle &y)
Definition ExptSmearingFunctions.hh:526
double PHOTON_EFF_ATLAS_RUN1_TIGHT(const Particle &y)
Definition ExptSmearingFunctions.hh:429
double PHOTON_EFF_ATLAS_RUN2_LOOSE(const Particle &y)
Definition ExptSmearingFunctions.hh:461
double PHOTON_EFF_ATLAS_RUN2_MEDIUM(const Particle &y)
Definition ExptSmearingFunctions.hh:466
double PHOTON_EFF_ATLAS_RUN1(const Particle &y)
ATLAS Run 2 photon reco efficiency.
Definition ExptSmearingFunctions.hh:395
double PHOTON_EFF_CMS_RUN2_MEDIUM(const Particle &y)
Definition ExptSmearingFunctions.hh:515
double PHOTON_EFF_CMS_RUN1_LOOSE(const Particle &y)
Definition ExptSmearingFunctions.hh:486
double PHOTON_EFF_CMS_RUN2(const Particle &y)
Definition ExptSmearingFunctions.hh:504
double PHOTON_EFF_CMS_RUN1(const Particle &y)
Definition ExptSmearingFunctions.hh:479
double PHOTON_EFF_ATLAS_RUN2(const Particle &y)
ATLAS Run 2 photon reco efficiency.
Definition ExptSmearingFunctions.hh:437
double PHOTON_EFF_ATLAS_RUN1_LOOSE(const Particle &y)
Definition ExptSmearingFunctions.hh:419
double PHOTON_EFF_CMS_RUN1_MEDIUM(const Particle &y)
Definition ExptSmearingFunctions.hh:491
double TAU_EFF_ATLAS_RUN2_LOOSE(const Particle &t)
Definition ExptSmearingFunctions.hh:907
double TAU_EFF_ATLAS_RUN2_MEDIUM(const Particle &t)
ATLAS Run 2 13 TeV tau efficiencies (medium working point).
Definition ExptSmearingFunctions.hh:882
double TAUJET_EFF_ATLAS_RUN1(const Jet &j)
ATLAS Run 1 8 TeV tau misID rates (medium working point).
Definition ExptSmearingFunctions.hh:843
double TAU_EFF_ATLAS_RUN2_TIGHT(const Particle &t)
Definition ExptSmearingFunctions.hh:912
double TAU_EFF_ATLAS_RUN1(const Particle &t)
Definition ExptSmearingFunctions.hh:821
Particle TAU_SMEAR_CMS_RUN1(const Particle &t)
Definition ExptSmearingFunctions.hh:1043
double TAU_EFF_ATLAS_RUN1_MEDIUM(const Particle &t)
ATLAS Run 1 8 TeV tau efficiencies (medium working point).
Definition ExptSmearingFunctions.hh:796
double TAU_EFF_ATLAS_RUN1_TIGHT(const Particle &t)
Definition ExptSmearingFunctions.hh:831
Particle TAU_SMEAR_CMS_RUN2(const Particle &t)
Definition ExptSmearingFunctions.hh:1051
double TAU_EFF_CMS_RUN2_TIGHT(const Particle &t)
Definition ExptSmearingFunctions.hh:1035
double TAU_EFF_CMS_RUN1_TIGHT(const Particle &t)
Definition ExptSmearingFunctions.hh:1012
double TAU_EFF_ATLAS_RUN2(const Particle &t)
Definition ExptSmearingFunctions.hh:902
Particle TAU_SMEAR_ATLAS_RUN1(const Particle &t)
Definition ExptSmearingFunctions.hh:953
double TAUJET_EFF_ATLAS_RUN2(const Jet &j)
ATLAS Run 2 13 TeV tau misID rate (medium working point).
Definition ExptSmearingFunctions.hh:922
double TAU_EFF_ATLAS_RUN1_LOOSE(const Particle &t)
Definition ExptSmearingFunctions.hh:826
double TAU_EFF_CMS_RUN1_LOOSE(const Particle &t)
Definition ExptSmearingFunctions.hh:1002
double TAU_EFF_CMS_RUN2(const Particle &t)
Definition ExptSmearingFunctions.hh:1019
double TAU_EFF_CMS_RUN2_MEDIUM(const Particle &t)
Definition ExptSmearingFunctions.hh:1030
double TAU_EFF_CMS_RUN1_MEDIUM(const Particle &t)
Definition ExptSmearingFunctions.hh:1007
double TAU_EFF_CMS_RUN2_LOOSE(const Particle &t)
Definition ExptSmearingFunctions.hh:1025
double TAU_EFF_CMS_RUN1(const Particle &t)
Definition ExptSmearingFunctions.hh:996
Particle TAU_SMEAR_ATLAS_RUN2(const Particle &t)
Definition ExptSmearingFunctions.hh:988
double ATLAS_JVT_EFF_MEDIUM(const Jet &j)
Return the efficiency of the ATLAS JVT tagger at > 0.4 W.P.
Definition ExptSmearingFunctions.hh:1511
Particle TRK_SMEAR_CMS_RUN2(const Particle &t)
Definition ExptSmearingFunctions.hh:1480
double TRK_EFF_CMS_RUN2(const Particle &p)
Definition ExptSmearingFunctions.hh:1466
Particle TRK_SMEAR_ATLAS_RUN1(const Particle &t)
Definition ExptSmearingFunctions.hh:1414
double ATLAS_JVT_EFF_TIGHT(const Jet &j)
Return the efficiency of the ATLAS JVT tagger at > 0.7 W.P.
Definition ExptSmearingFunctions.hh:1531
double TRK_EFF_CMS_RUN1(const Particle &p)
CMS Run 1 tracking efficiency.
Definition ExptSmearingFunctions.hh:1426
double ATLAS_JVT_EFF_LOOSE(const Jet &j)
Return the efficiency of the ATLAS JVT tagger at > 0.2 W.P.
Definition ExptSmearingFunctions.hh:1491
Particle TRK_SMEAR_CMS_RUN1(const Particle &t)
Definition ExptSmearingFunctions.hh:1474
Particle TRK_SMEAR_ATLAS_RUN2(const Particle &t)
Definition ExptSmearingFunctions.hh:1420
double TRK_EFF_ATLAS_RUN1(const Particle &p)
ATLAS Run 1 tracking efficiency.
Definition ExptSmearingFunctions.hh:1366
double TRK_EFF_ATLAS_RUN2(const Particle &p)
Definition ExptSmearingFunctions.hh:1406
Definition LHCbCommon.hh:9
double deltaR(double rap1, double phi1, double rap2, double phi2)
Definition MathUtils.hh:754
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:124
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:260
std::enable_if_t< std::is_arithmetic_v< NUM >, NUM > sqr(NUM a)
Named number-type squaring operation.
Definition MathUtils.hh:237
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:113
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:147
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:503
Struct for holding MET-smearing parameters.
Definition MomentumSmearingFunctions.hh:150