Rivet API documentation

Rivet 4.1.5
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
39
40
43
47 inline double ELECTRON_RECOEFF_ATLAS_RUN1(const Particle& e) {
48 if (e.abspid() != PID::ELECTRON) return 0;
49 if (e.abseta() > 2.5) return 0;
50 if (e.pT() < 10*GeV) return 0;
51 return (e.abseta() < 1.5) ? 0.95 : 0.85;
52 }
53
57 inline double ELECTRON_RECOEFF_ATLAS_RUN2(const Particle& e) {
58 if (e.abspid() != PID::ELECTRON) return 0;
59 const double et = e.Et();
60 if (e.abseta() > 2.5 || e.Et() < 2*GeV) return 0;
61 if (et > 25*GeV) return 0.97;
62 if (et > 10*GeV) return 0.92 + (et / GeV - 10) / 15. * 0.05;
63 if (et > 6*GeV) return 0.85 + (et / GeV - 6) / 4. * 0.07;
64 if (et > 5*GeV) return 0.70 + (et / GeV - 5) / 1. * 0.15;
65 if (et > 2*GeV) return 0.00 + (et / GeV - 2) / 3. * 0.70;
66 return 0;
67 }
68
69
75 inline double ELECTRON_EFF_ATLAS_RUN2_LOOSE(const Particle& e) {
76 if (e.abspid() != PID::ELECTRON) return 0;
77
78 // Manually symmetrised eta eff histogram
79 const static vector<double> edges_eta = {0.0, 0.1, 0.8, 1.37, 1.52, 2.01, 2.37, 2.47};
80 const static vector<double> effs_eta = {0.950, 0.965, 0.955, 0.885, 0.950, 0.935, 0.90};
81 // Et eff histogram (10-20 is a guess)
82 const static vector<double> edges_et = {0, 10, 20, 25, 30, 35, 40, 45, 50, 60, 80};
83 const static vector<double> effs_et = {
84 0.0, 0.90, 0.91, 0.92, 0.94, 0.95,
85 0.955, 0.965, 0.97, 0.98, 0.98}; //Extra value extrapolated for overflow
86
87 if (e.abseta() > 2.47) return 0.0; // no ID outside the tracker
88
89 const int i_eta = binIndex(e.abseta(), edges_eta);
90 const int i_et = binIndex(e.Et() / GeV, edges_et, true);
91 const double eff = effs_et[i_et] * effs_eta[i_eta]
92 / 0.95; //< norm factor as approximate double differential
93 return min(eff, 1.0) * ELECTRON_RECOEFF_ATLAS_RUN2(e);
94 }
95
97 inline double ELECTRON_EFF_ATLAS_RUN1_LOOSE(const Particle& e) {
99 }
100
101
103 inline double ELECTRON_EFF_ATLAS_RUN1_MEDIUM(const Particle& e) {
104 if (e.abspid() != PID::ELECTRON) return 0;
105
106 const static vector<double> eta_edges_10 = {0.000, 0.049, 0.454, 1.107, 1.46, 1.790, 2.277, 2.500};
107 const static vector<double> eta_vals_10 = {0.730, 0.757, 0.780, 0.771, 0.77, 0.777, 0.778};
108
109 const static vector<double> eta_edges_15 = {0.000, 0.053, 0.456, 1.102, 1.463, 1.783, 2.263, 2.500};
110 const static vector<double> eta_vals_15 = {0.780, 0.800, 0.819, 0.759, 0.749, 0.813, 0.829};
111
112 const static vector<double> eta_edges_20 = {0.000, 0.065, 0.362, 0.719, 0.980, 1.289,
113 1.455, 1.681, 1.942, 2.239, 2.452, 2.500};
114 const static vector<double> eta_vals_20 = {0.794, 0.806, 0.816, 0.806, 0.797, 0.774,
115 0.764, 0.788, 0.793, 0.806, 0.825};
116
117 const static vector<double> eta_edges_25 = {0.000, 0.077, 0.338, 0.742, 1.004, 1.265,
118 1.467, 1.692, 1.940, 2.227, 2.452, 2.500};
119 const static vector<double> eta_vals_25 = {0.833, 0.843, 0.853, 0.845, 0.839, 0.804,
120 0.790, 0.825, 0.830, 0.833, 0.839};
121
122 const static vector<double> eta_edges_30 = {0.000, 0.077, 0.350, 0.707, 0.980, 1.289,
123 1.479, 1.681, 1.942, 2.239, 2.441, 2.500};
124 const static vector<double> eta_vals_30 = {0.863, 0.872, 0.881, 0.874, 0.870, 0.824,
125 0.808, 0.847, 0.845, 0.840, 0.842};
126
127 const static vector<double> eta_edges_35 = {0.000, 0.058, 0.344, 0.700, 1.009, 1.270,
128 1.458, 1.685, 1.935, 2.231, 2.468, 2.500};
129 const static vector<double> eta_vals_35 = {0.878, 0.889, 0.901, 0.895, 0.893, 0.849,
130 0.835, 0.868, 0.863, 0.845, 0.832};
131
132 const static vector<double> eta_edges_40 = {0.000, 0.047, 0.355, 0.699, 0.983, 1.280,
133 1.446, 1.694, 1.943, 2.227, 2.441, 2.500};
134 const static vector<double> eta_vals_40 = {0.894, 0.901, 0.909, 0.905, 0.904, 0.875,
135 0.868, 0.889, 0.876, 0.848, 0.827};
136
137 const static vector<double> eta_edges_45 = {0.000, 0.058, 0.356, 0.712, 0.997, 1.282,
138 1.459, 1.686, 1.935, 2.220, 2.444, 2.500};
139 const static vector<double> eta_vals_45 = {0.900, 0.911, 0.923, 0.918, 0.917, 0.897,
140 0.891, 0.904, 0.894, 0.843, 0.796};
141
142 const static vector<double> eta_edges_50 = {0.000, 0.059, 0.355, 0.711, 0.983, 1.280,
143 1.469, 1.682, 1.919, 2.227, 2.441, 2.500};
144 const static vector<double> eta_vals_50 = {0.903, 0.913, 0.923, 0.922, 0.923, 0.903,
145 0.898, 0.908, 0.895, 0.831, 0.774};
146
147 const static vector<double> eta_edges_60 = {0.000, 0.053, 0.351, 0.720, 1.006, 1.291,
148 1.469, 1.696, 1.946, 2.243, 2.455, 2.500};
149 const static vector<double> eta_vals_60 = {0.903, 0.917, 0.928, 0.924, 0.927, 0.915,
150 0.911, 0.915, 0.899, 0.827, 0.760};
151
152 const static vector<double> eta_edges_80 = {0.000, 0.053, 0.351, 0.720, 0.994, 1.292,
153 1.482, 1.708, 1.934, 2.220, 2.458, 2.500};
154 const static vector<double> eta_vals_80 = {0.936, 0.942, 0.952, 0.956, 0.956, 0.934,
155 0.931, 0.944, 0.933, 0.940, 0.948};
156
157 const static vector<double> et_edges = {10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 80};
158 const static vector<vector<double>> et_eta_edges = {eta_edges_10, eta_edges_15, eta_edges_20,
159 eta_edges_25, eta_edges_30, eta_edges_35,
160 eta_edges_40, eta_edges_45, eta_edges_50,
161 eta_edges_60, eta_edges_80};
162 const static vector<vector<double>> et_eta_vals = {eta_vals_10, eta_vals_15, eta_vals_20, eta_vals_25,
163 eta_vals_30, eta_vals_35, eta_vals_40, eta_vals_45,
164 eta_vals_50, eta_vals_60, eta_vals_80};
165
166 if (e.abseta() > 2.5 || e.Et() < 10*GeV) return 0.0;
167 const int i_et = binIndex(e.Et() / GeV, et_edges, true);
168 const int i_eta = binIndex(e.abseta(), et_eta_edges[i_et]);
169 return et_eta_vals[i_et][i_eta] * ELECTRON_RECOEFF_ATLAS_RUN1(e);
170 }
171
175 inline double ELECTRON_EFF_ATLAS_RUN2_MEDIUM(const Particle& e) {
176 if (e.abspid() != PID::ELECTRON) return 0;
177 return 1.01 * ELECTRON_EFF_ATLAS_RUN1_MEDIUM(e);
178 }
179
180
182 inline double ELECTRON_EFF_ATLAS_RUN1_TIGHT(const Particle& e) {
183 if (e.abspid() != PID::ELECTRON) return 0;
184
185 const static vector<double> eta_edges_10 = {0.000, 0.049, 0.459, 1.100, 1.461, 1.789, 2.270, 2.500};
186 const static vector<double> eta_vals_10 = {0.581, 0.632, 0.668, 0.558, 0.548, 0.662, 0.690};
187
188 const static vector<double> eta_edges_15 = {0.000, 0.053, 0.450, 1.096, 1.463, 1.783, 2.269, 2.500};
189 const static vector<double> eta_vals_15 = {0.630, 0.678, 0.714, 0.633, 0.616, 0.700, 0.733};
190
191 const static vector<double> eta_edges_20 = {0.000, 0.065, 0.362, 0.719, 0.992, 1.277,
192 1.479, 1.692, 1.930, 2.227, 2.464, 2.500};
193 const static vector<double> eta_vals_20 = {0.653, 0.695, 0.735, 0.714, 0.688, 0.635,
194 0.625, 0.655, 0.680, 0.691, 0.674};
195
196 const static vector<double> eta_edges_25 = {0.000, 0.077, 0.362, 0.719, 0.992, 1.300,
197 1.479, 1.692, 1.942, 2.227, 2.464, 2.500};
198 const static vector<double> eta_vals_25 = {0.692, 0.732, 0.768, 0.750, 0.726, 0.677,
199 0.667, 0.692, 0.710, 0.706, 0.679};
200
201 const static vector<double> eta_edges_30 = {0.000, 0.053, 0.362, 0.719, 1.004, 1.277,
202 1.467, 1.681, 1.954, 2.239, 2.452, 2.500};
203 const static vector<double> eta_vals_30 = {0.724, 0.763, 0.804, 0.789, 0.762, 0.702,
204 0.690, 0.720, 0.731, 0.714, 0.681};
205
206 const static vector<double> eta_edges_35 = {0.000, 0.044, 0.342, 0.711, 0.971, 1.280,
207 1.456, 1.683, 1.944, 2.218, 2.442, 2.500};
208 const static vector<double> eta_vals_35 = {0.736, 0.778, 0.824, 0.811, 0.784, 0.730,
209 0.718, 0.739, 0.743, 0.718, 0.678};
210
211 const static vector<double> eta_edges_40 = {0.000, 0.047, 0.355, 0.699, 0.983, 1.268,
212 1.457, 1.671, 1.931, 2.204, 2.453, 2.500};
213 const static vector<double> eta_vals_40 = {0.741, 0.774, 0.823, 0.823, 0.802, 0.764,
214 0.756, 0.771, 0.771, 0.734, 0.684};
215
216 const static vector<double> eta_edges_45 = {0.000, 0.056, 0.354, 0.711, 0.984, 1.280,
217 1.458, 1.684, 1.945, 2.207, 2.442, 2.500};
218 const static vector<double> eta_vals_45 = {0.758, 0.792, 0.841, 0.841, 0.823, 0.792,
219 0.786, 0.796, 0.794, 0.734, 0.663};
220
221 const static vector<double> eta_edges_50 = {0.000, 0.059, 0.355, 0.699, 0.983, 1.268,
222 1.446, 1.682, 1.943, 2.216, 2.453, 2.500};
223 const static vector<double> eta_vals_50 = {0.771, 0.806, 0.855, 0.858, 0.843, 0.810,
224 0.800, 0.808, 0.802, 0.730, 0.653};
225
226 const static vector<double> eta_edges_60 = {0.000, 0.050, 0.350, 0.707, 0.981, 1.278,
227 1.468, 1.694, 1.944, 2.242, 2.453, 2.500};
228 const static vector<double> eta_vals_60 = {0.773, 0.816, 0.866, 0.865, 0.853, 0.820,
229 0.812, 0.817, 0.804, 0.726, 0.645};
230
231 const static vector<double> eta_edges_80 = {0.000, 0.051, 0.374, 0.720, 0.981, 1.279,
232 1.468, 1.707, 1.945, 2.207, 2.457, 2.500};
233 const static vector<double> eta_vals_80 = {0.819, 0.855, 0.899, 0.906, 0.900, 0.869,
234 0.865, 0.873, 0.869, 0.868, 0.859};
235
236 const static vector<double> et_edges = {10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 80};
237 const static vector<vector<double>> et_eta_edges = {eta_edges_10, eta_edges_15, eta_edges_20,
238 eta_edges_25, eta_edges_30, eta_edges_35,
239 eta_edges_40, eta_edges_45, eta_edges_50,
240 eta_edges_60, eta_edges_80};
241 const static vector<vector<double>> et_eta_vals = {eta_vals_10, eta_vals_15, eta_vals_20, eta_vals_25,
242 eta_vals_30, eta_vals_35, eta_vals_40, eta_vals_45,
243 eta_vals_50, eta_vals_60, eta_vals_80};
244
245 if (e.abseta() > 2.5 || e.Et() < 10*GeV) return 0.0;
246 const int i_et = binIndex(e.Et() / GeV, et_edges, true);
247 const int i_eta = binIndex(e.abseta(), et_eta_edges[i_et]);
248 return et_eta_vals[i_et][i_eta] * ELECTRON_RECOEFF_ATLAS_RUN1(e);
249 }
250
254 inline double ELECTRON_EFF_ATLAS_RUN2_TIGHT(const Particle& e) {
255 if (e.abspid() != PID::ELECTRON) return 0;
256 const static vector<double> et_edges = {/* 10, 15, */ 20, 25, 30, 35, 40, 45, 50, 60, 80};
257 const static vector<double> et_effs = {
258 0.785, 0.805, 0.820, 0.830, 0.840,
259 0.850, 0.875, 0.910, 0.910}; //Extra value extrapolated for overflow
260 const static vector<double> eta_edges = {0.000, 0.051, 0.374, 0.720, 0.981, 1.279,
261 1.468, 1.707, 1.945, 2.207, 2.457, 2.500}; // from ET > 80 bin
262 const static vector<double> eta_refs = {0.819, 0.855, 0.899, 0.906, 0.900, 0.869,
263 0.865, 0.873, 0.869, 0.868, 0.859};
264 if (e.abseta() > 2.5 || e.Et() < 20*GeV) return 0.0;
265 const int i_et = binIndex(e.Et() / GeV, et_edges, true);
266 const int i_eta = binIndex(e.abseta(), eta_edges);
267 const double eff_et = et_effs[i_et]; //< integral eff
268 // Scale to |eta| shape, following the 87.8% efficient high-ET bin from Run 1
269 const double eff = eff_et * (eta_refs[i_eta] / 0.878) * ELECTRON_RECOEFF_ATLAS_RUN2(e);
270 //return ELECTRON_IDEFF_ATLAS_RUN1_TIGHT(e);
271 return eff;
272 }
273
274
287 if (e.abspid() != PID::ELECTRON) return 0;
288 if (e.abseta() > 2.47 || e.Et() < 4.5*GeV) return 0;
289 static const vector<double> edges_et = {4.5, 7., 10., 15., 20., 25., 30., 35., 40., 45., 50., 60., 80.};
290 static const vector<double> effs_et = {0.976, 0.929, 0.883, 0.830, 0.865, 0.884, 0.902,
291 0.920, 0.930, 0.937, 0.939, 0.944, 0.950};
292 static const vector<double> edges_eta = {0., 0.1, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37};
293 static const vector<double> effs_eta = {0.905, 0.937, 0.939, 0.935, 0.924,
294 0.868, 0.921, 0.898, 0.871, 0.825};
295 static const double norm_eta = 0.9110; //< bin-width-weighted mean of effs_eta
296 const double eff_et = effs_et[binIndex(e.Et() / GeV, edges_et, true)];
297 const double eff_eta = effs_eta[binIndex(e.abseta(), edges_eta, true)];
298 return min(1.0, eff_et * eff_eta / norm_eta);
299 }
300
313 if (e.abspid() != PID::ELECTRON) return 0;
314 if (e.abseta() > 2.47 || e.Et() < 4.5*GeV) return 0;
315 static const vector<double> edges_et = {4.5, 7., 10., 15., 20., 25., 30., 35., 40., 45., 50., 60., 80.};
316 static const vector<double> effs_et = {0.791, 0.798, 0.816, 0.753, 0.795, 0.828, 0.848,
317 0.869, 0.882, 0.888, 0.898, 0.917, 0.933};
318 static const vector<double> edges_eta = {0., 0.1, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37};
319 static const vector<double> effs_eta = {0.857, 0.899, 0.896, 0.885, 0.857,
320 0.807, 0.866, 0.834, 0.811, 0.766};
321 static const double norm_eta = 0.8584; //< bin-width-weighted mean of effs_eta
322 const double eff_et = effs_et[binIndex(e.Et() / GeV, edges_et, true)];
323 const double eff_eta = effs_eta[binIndex(e.abseta(), edges_eta, true)];
324 return min(1.0, eff_et * eff_eta / norm_eta);
325 }
326
339 if (e.abspid() != PID::ELECTRON) return 0;
340 if (e.abseta() > 2.47 || e.Et() < 4.5*GeV) return 0;
341 static const vector<double> edges_et = {4.5, 7., 10., 15., 20., 25., 30., 35., 40., 45., 50., 60., 80.};
342 static const vector<double> effs_et = {0.583, 0.609, 0.671, 0.652, 0.684, 0.716, 0.747,
343 0.768, 0.783, 0.796, 0.816, 0.854, 0.885};
344 static const vector<double> edges_eta = {0., 0.1, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37};
345 static const vector<double> effs_eta = {0.755, 0.813, 0.808, 0.782, 0.755,
346 0.638, 0.768, 0.740, 0.725, 0.662};
347 static const double norm_eta = 0.7599; //< bin-width-weighted mean of effs_eta
348 const double eff_et = effs_et[binIndex(e.Et() / GeV, edges_et, true)];
349 const double eff_eta = effs_eta[binIndex(e.abseta(), edges_eta, true)];
350 return min(1.0, eff_et * eff_eta / norm_eta);
351 }
352
353
366 if (e.abspid() != PID::ELECTRON) return 0;
367 if (e.abseta() > 2.47 || e.Et() < 4.5*GeV) return 0;
368 static const vector<double> edges_et = {4.5, 7., 10., 15., 20., 25., 30., 35., 40.,
369 45., 50., 60., 80., 150., 200., 250., 300., 350.};
370 static const vector<double> effs_et = {0.741, 0.827, 0.906, 0.952, 0.973, 0.984, 0.990, 0.994, 0.997,
371 0.998, 0.998, 0.999, 0.999, 0.999, 0.999, 0.999, 0.997, 0.998};
372 static const vector<double> edges_eta = {0., 0.1, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37};
373 static const vector<double> effs_eta = {0.992, 0.991, 0.992, 0.993, 0.994,
374 0.988, 0.991, 0.989, 0.988, 0.987};
375 static const double norm_eta = 0.9907; //< bin-width-weighted mean of effs_eta
376 const double eff_et = effs_et[binIndex(e.Et() / GeV, edges_et, true)];
377 const double eff_eta = effs_eta[binIndex(e.abseta(), edges_eta, true)];
378 return min(1.0, eff_et * eff_eta / norm_eta);
379 }
380
393 if (e.abspid() != PID::ELECTRON) return 0;
394 if (e.abseta() > 2.47 || e.Et() < 4.5*GeV) return 0;
395 static const vector<double> edges_et = {4.5, 7., 10., 15., 20., 25., 30., 35., 40.,
396 45., 50., 60., 80., 150., 200., 250., 300., 350.};
397 static const vector<double> effs_et = {0.459, 0.541, 0.618, 0.698, 0.770, 0.822, 0.863, 0.896, 0.925,
398 0.941, 0.953, 0.971, 0.986, 0.992, 0.993, 0.994, 0.991, 0.992};
399 static const vector<double> edges_eta = {0., 0.1, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37};
400 static const vector<double> effs_eta = {0.888, 0.881, 0.900, 0.913, 0.925,
401 0.919, 0.881, 0.873, 0.893, 0.881};
402 static const double norm_eta = 0.8947; //< bin-width-weighted mean of effs_eta
403 const double eff_et = effs_et[binIndex(e.Et() / GeV, edges_et, true)];
404 const double eff_eta = effs_eta[binIndex(e.abseta(), edges_eta, true)];
405 return min(1.0, eff_et * eff_eta / norm_eta);
406 }
407
420 if (e.abspid() != PID::ELECTRON) return 0;
421 if (e.abseta() > 2.47 || e.Et() < 4.5*GeV) return 0;
422 static const vector<double> edges_et = {4.5, 7., 10., 15., 20., 25., 30., 35., 40.,
423 45., 50., 60., 80., 150., 200., 250., 300., 350.};
424 static const vector<double> effs_et = {0.800, 0.881, 0.927, 0.880, 0.889, 0.896, 0.908, 0.920, 0.929,
425 0.941, 0.961, 0.979, 0.982, 0.994, 0.994, 0.995, 0.993, 0.993};
426 static const vector<double> edges_eta = {0., 0.1, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37};
427 static const vector<double> effs_eta = {0.934, 0.929, 0.929, 0.931, 0.929,
428 0.936, 0.921, 0.914, 0.911, 0.906};
429 static const double norm_eta = 0.9242; //< bin-width-weighted mean of effs_eta
430 const double eff_et = effs_et[binIndex(e.Et() / GeV, edges_et, true)];
431 const double eff_eta = effs_eta[binIndex(e.abseta(), edges_eta, true)];
432 return min(1.0, eff_et * eff_eta / norm_eta);
433 }
434
447 if (e.abspid() != PID::ELECTRON) return 0;
448 if (e.abseta() > 2.47 || e.Et() < 4.5*GeV) return 0;
449 static const vector<double> edges_et = {4.5, 7., 10., 15., 20., 25., 30., 35., 40.,
450 45., 50., 60., 80., 150., 200., 250., 300., 350.};
451 static const vector<double> effs_et = {0.982, 0.975, 0.970, 0.968, 0.967, 0.966, 0.966, 0.967, 0.971,
452 0.971, 0.967, 0.962, 0.951, 0.926, 0.904, 0.909, 0.926, 0.929};
453 static const vector<double> edges_eta = {0., 0.1, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37};
454 static const vector<double> effs_eta = {0.960, 0.957, 0.966, 0.974, 0.980,
455 0.971, 0.969, 0.966, 0.975, 0.972};
456 static const double norm_eta = 0.9685; //< bin-width-weighted mean of effs_eta
457 const double eff_et = effs_et[binIndex(e.Et() / GeV, edges_et, true)];
458 const double eff_eta = effs_eta[binIndex(e.abseta(), edges_eta, true)];
459 return min(1.0, eff_et * eff_eta / norm_eta);
460 }
461
462
465 static const vector<double> edges_eta = {0., 2.5, 3.};
466 static const vector<double> edges_pt = {0., 0.1, 25.};
467 static const vector<double> e2s = {0.000, 0.015, 0.005, 0.005, 0.005, 0.005, 0.107, 0.107, 0.107};
468 static const vector<double> es = {0.00, 0.00, 0.05, 0.05, 0.05, 0.05, 2.08, 2.08, 2.08};
469 static const vector<double> cs = {0.00, 0.00, 0.25, 0.25, 0.25, 0.25, 0.00, 0.00, 0.00};
470
471 const int i_eta = binIndex(e.abseta(), edges_eta, true);
472 const int i_pt = binIndex(e.pT() / GeV, edges_pt, true);
473 const int i = i_eta * edges_pt.size() + i_pt;
474
475 // Calculate absolute resolution in GeV
476 const double c1 = sqr(e2s[i]), c2 = sqr(es[i]), c3 = sqr(cs[i]);
477 const double resolution = sqrt(c1 * e.E2() + c2 * e.E() + c3) * GeV;
478
479 // normal_distribution<> d(e.E(), resolution);
480 // const double mass = e.mass2() > 0 ? e.mass() : 0; //< numerical carefulness...
481 // const double smeared_E = max(d(gen), mass); //< can't let the energy go below the mass!
482 // return Particle(e.pid(), FourMomentum::mkEtaPhiME(e.eta(), e.phi(), mass, smeared_E));
483 return Particle(e.pid(), P4_SMEAR_E_GAUSS(e, resolution));
484 }
485
486
493
494
496
497
499 inline double ELECTRON_EFF_CMS_RUN1(const Particle& e) {
500 if (e.abspid() != PID::ELECTRON) return 0;
501 if (e.abseta() > 2.5) return 0;
502 if (e.pT() < 10*GeV) return 0;
503 return (e.abseta() < 1.5) ? 0.95 : 0.85;
504 }
505
508 inline double ELECTRON_EFF_CMS_RUN1_LOOSE(const Particle& e) {
509 return ELECTRON_EFF_CMS_RUN1(e);
510 }
511
514 inline double ELECTRON_EFF_CMS_RUN1_MEDIUM(const Particle& e) {
515 return ELECTRON_EFF_CMS_RUN1(e);
516 }
517
520 inline double ELECTRON_EFF_CMS_RUN1_TIGHT(const Particle& e) {
521 return ELECTRON_EFF_CMS_RUN1(e);
522 }
523
524
528 inline double ELECTRON_EFF_CMS_RUN2(const Particle& e) {
529 if (e.abspid() != PID::ELECTRON) return 0;
530 return ELECTRON_EFF_CMS_RUN1(e);
531 }
532
535 inline double ELECTRON_EFF_CMS_RUN2_LOOSE(const Particle& e) {
536 return ELECTRON_EFF_CMS_RUN2(e);
537 }
538
541 inline double ELECTRON_EFF_CMS_RUN2_MEDIUM(const Particle& e) {
542 return ELECTRON_EFF_CMS_RUN2(e);
543 }
544
547 inline double ELECTRON_EFF_CMS_RUN2_TIGHT(const Particle& e) {
548 return ELECTRON_EFF_CMS_RUN2(e);
549 }
550
551
559 // Calculate absolute resolution in GeV from functional form
560 double resolution = 0;
561 const double abseta = e.abseta();
562 if (e.pT() > 0.1*GeV && abseta < 2.5) { //< should be a given from efficiencies
563 if (abseta < 0.5) {
564 resolution = add_quad(0.06, 1.3e-3 * e.pT() / GeV) * GeV;
565 }
566 else if (abseta < 1.5) {
567 resolution = add_quad(0.10, 1.7e-3 * e.pT() / GeV) * GeV;
568 }
569 else { // still |eta| < 2.5
570 resolution = add_quad(0.25, 3.1e-3 * e.pT() / GeV) * GeV;
571 }
572 }
573
574 // normal_distribution<> d(e.E(), resolution);
575 // const double mass = e.mass2() > 0 ? e.mass() : 0; //< numerical carefulness...
576 // const double smeared_E = max(d(gen), mass); //< can't let the energy go below the mass!
577 // return Particle(e.pid(), FourMomentum::mkEtaPhiME(e.eta(), e.phi(), mass, smeared_E));
578 return Particle(e.pid(), P4_SMEAR_E_GAUSS(e, resolution));
579 }
580
585 return ELECTRON_SMEAR_CMS_RUN1(e);
586 }
587
589
590
593
597 inline double PHOTON_EFF_ATLAS_RUN1(const Particle& y) {
598 if (y.abspid() != PID::PHOTON) return 0;
599
600 if (y.pT() < 10*GeV) return 0;
601 if (inRange(y.abseta(), 1.37, 1.52) || y.abseta() > 2.37) return 0;
602
603 static const vector<double> edges_eta = {0., 0.6, 1.37, 1.52, 1.81, 2.37};
604 static const vector<double> edges_pt = {10., 15., 20., 25., 30., 35., 40., 45.,
605 50., 60., 80., 100., 125., 150., 175., 250.};
606 static const vector<double> effs = {
607 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, //
608 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, //
609 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, //
610 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, //
611 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};
612
613 const int i_eta = binIndex(y.abseta(), edges_eta);
614 const int i_pt = binIndex(y.pT() / GeV, edges_pt, true);
615 const int i = i_eta * edges_pt.size() + i_pt;
616 const double eff = effs[i];
617 return eff;
618 }
619
622 inline double PHOTON_EFF_ATLAS_RUN1_LOOSE(const Particle& y) {
623 return PHOTON_EFF_ATLAS_RUN1(y);
624 }
625
628 inline double PHOTON_EFF_ATLAS_RUN1_MEDIUM(const Particle& y) {
629 return PHOTON_EFF_ATLAS_RUN1(y);
630 }
631
634 inline double PHOTON_EFF_ATLAS_RUN1_TIGHT(const Particle& y) {
635 return PHOTON_EFF_ATLAS_RUN1(y);
636 }
637
638
643 inline double PHOTON_EFF_ATLAS_RUN2(const Particle& y) {
644 if (y.abspid() != PID::PHOTON) return 0;
645
646 if (y.pT() < 10*GeV) return 0;
647 if (inRange(y.abseta(), 1.37, 1.52) || y.abseta() > 2.37) return 0;
648
649 static const vector<double> edges_eta = {0., 0.6, 1.37, 1.52, 1.81, 2.37};
650 static const vector<double> edges_pt = {10., 15., 20., 25., 30., 35., 40., 45.,
651 50., 60., 80., 100., 125., 150., 175., 250.};
652 static const vector<double> effs = {
653 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, //
654 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, //
655 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, //
656 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, //
657 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};
658
659 const int i_eta = binIndex(y.abseta(), edges_eta);
660 const int i_pt = binIndex(y.pT() / GeV, edges_pt, true);
661 const int i = i_eta * edges_pt.size() + i_pt;
662 const double eff = effs[i];
663 return eff;
664 }
665
668 inline double PHOTON_EFF_ATLAS_RUN2_LOOSE(const Particle& y) {
669 return PHOTON_EFF_ATLAS_RUN2(y);
670 }
671
674 inline double PHOTON_EFF_ATLAS_RUN2_MEDIUM(const Particle& y) {
675 return PHOTON_EFF_ATLAS_RUN2(y);
676 }
677
680 inline double PHOTON_EFF_ATLAS_RUN2_TIGHT(const Particle& y) {
681 return PHOTON_EFF_ATLAS_RUN2(y);
682 }
683
684
688 inline double PHOTON_EFF_CMS_RUN1(const Particle& y) {
689 if (y.abspid() != PID::PHOTON) return 0;
690 if (y.pT() < 10*GeV || y.abseta() > 2.5) return 0;
691 return (y.abseta() < 1.5) ? 0.95 : 0.85;
692 }
693
696 inline double PHOTON_EFF_CMS_RUN1_LOOSE(const Particle& y) {
697 return PHOTON_EFF_CMS_RUN1(y);
698 }
699
702 inline double PHOTON_EFF_CMS_RUN1_MEDIUM(const Particle& y) {
703 return PHOTON_EFF_CMS_RUN1(y);
704 }
705
708 inline double PHOTON_EFF_CMS_RUN1_TIGHT(const Particle& y) {
709 return PHOTON_EFF_CMS_RUN1(y);
710 }
711
712
716 inline double PHOTON_EFF_CMS_RUN2(const Particle& y) {
717 if (y.abspid() != PID::PHOTON) return 0;
718 return PHOTON_EFF_CMS_RUN1(y);
719 }
720
723 inline double PHOTON_EFF_CMS_RUN2_LOOSE(const Particle& y) {
724 return PHOTON_EFF_CMS_RUN2(y);
725 }
726
729 inline double PHOTON_EFF_CMS_RUN2_MEDIUM(const Particle& y) {
730 return PHOTON_EFF_CMS_RUN2(y);
731 }
732
735 inline double PHOTON_EFF_CMS_RUN2_TIGHT(const Particle& y) {
736 return PHOTON_EFF_CMS_RUN2(y);
737 }
738
739
742 return y;
743 }
744 inline Particle PHOTON_SMEAR_ATLAS_RUN2(const Particle& y) {
745 return y;
746 }
747 inline Particle PHOTON_SMEAR_CMS_RUN1(const Particle& y) {
748 return y;
749 }
750 inline Particle PHOTON_SMEAR_CMS_RUN2(const Particle& y) {
751 return y;
752 }
753
755
756
759
761 inline double MUON_EFF_ATLAS_RUN1(const Particle& m) {
762 if (m.abspid() != PID::MUON) return 0;
763 if (m.abseta() > 2.7) return 0;
764 if (m.pT() < 10*GeV) return 0;
765 return (m.abseta() < 1.5) ? 0.95 : 0.85;
766 }
767
770 inline double MUON_EFF_ATLAS_RUN1_LOOSE(const Particle& m) {
771 return MUON_EFF_ATLAS_RUN1(m);
772 }
773
776 inline double MUON_EFF_ATLAS_RUN1_MEDIUM(const Particle& m) {
777 return MUON_EFF_ATLAS_RUN1(m);
778 }
779
782 inline double MUON_EFF_ATLAS_RUN1_TIGHT(const Particle& m) {
783 return MUON_EFF_ATLAS_RUN1(m);
784 }
785
786
790 inline double MUON_RECOEFF_ATLAS_RUN2(const Particle& m) {
791 if (m.abspid() != PID::MUON) return 0;
792 if (m.abseta() > 2.5) return 0;
793 if (m.abseta() < 0.1) return 0.61;
794 // if (m.pT() < 10*GeV) return 0;
795 return (m.abseta() < 1) ? 0.98 : 0.99;
796 }
797
798
804 inline double MUON_ISOEFF_ATLAS_RUN2_LOOSE(const Particle& m) {
805 if (m.abspid() != PID::MUON) return 0;
806 static const vector<double> edges_pt = {0., 3., 4., 5., 6., 7., 8., 9., 10., 15., 20., 30., 40.};
807 static const vector<double> effs_pt = {0., 0.58, 0.70, 0.75, 0.80, 0.82, 0.85,
808 0.87, 0.90, 0.95, 0.98, 1.00, 1.00};
809 const int i_pt = binIndex(m.pT() / GeV, edges_pt, true);
810 const double eff_pt = effs_pt[i_pt];
811 return eff_pt;
812 }
813
814
820 inline double MUON_EFF_ATLAS_RUN2_LOOSE(const Particle& m) {
821 if (m.abspid() != PID::MUON) return 0;
822 if (m.abseta() > 2.5) return 0;
823 static const vector<double> edges_pt = {0., 3., 3.5, 4., 5., 6., 7., 8., 10.};
824 static const vector<double> effs = {0.00, 0.88, 0.92, 0.97, 0.98, 0.98, 0.98, 0.99, 0.99};
825 const int i_pt = binIndex(m.pT() / GeV, edges_pt, true);
826 const double eff = effs[i_pt];
827 // no eta dependence
828 return eff * MUON_ISOEFF_ATLAS_RUN2_LOOSE(m);
829 }
830
831
837 inline double MUON_EFF_ATLAS_RUN2_MEDIUM(const Particle& m) {
838 if (m.abspid() != PID::MUON) return 0;
839 if (m.abseta() > 2.5) return 0;
840 static const vector<double> edges_pt = {0., 3., 3.5, 4., 5., 6., 7., 8., 9., 10., 12.,
841 14., 16., 18., 20., 25., 30., 35., 40., 45., 50.};
842 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,
843 0.97, 0.97, 0.97, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98};
844 const int i_pt = binIndex(m.pT() / GeV, edges_pt, true);
845 const double eff_pt = effs_pt[i_pt];
846 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};
847 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};
848 const int i_eta = binIndex(m.abseta(), edges_eta, true);
849 const double eff_eta = effs_eta[i_eta] / 0.99; //< norm factor as approximate double differential
850 return eff_pt * eff_eta * MUON_ISOEFF_ATLAS_RUN2_LOOSE(m);
851 }
852
853
859 inline double MUON_EFF_ATLAS_RUN2_TIGHT(const Particle& m) {
860 if (m.abspid() != PID::MUON) return 0;
861 if (m.abseta() > 2.5) return 0;
862 static const vector<double> edges_pt = {0., 3.5, 4., 5., 6., 7., 8., 9., 10., 12., 14., 16., 18., 20.};
863 static const vector<double> effs_pt = {0.00, 0.00, 0.68, 0.81, 0.85, 0.88, 0.89,
864 0.90, 0.91, 0.92, 0.92, 0.92, 0.93, 0.93};
865 const int i_pt = binIndex(m.pT() / GeV, edges_pt, true);
866 const double eff_pt = effs_pt[i_pt];
867 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};
868 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};
869 const int i_eta = binIndex(m.abseta(), edges_eta, true);
870 const double eff_eta = effs_eta[i_eta] / 0.96; //< norm factor as approximate double differential
871 return eff_pt * eff_eta * MUON_ISOEFF_ATLAS_RUN2_LOOSE(m);
872 }
873
874
888 if (m.abspid() != PID::MUON) return 0;
889 if (m.abseta() > 2.7 || m.pT() < 3*GeV) return 0;
890 static const vector<double> edges_pt = {3., 3.5, 4., 5., 7.};
891 static const vector<double> effs_pt = {0.870, 0.935, 0.975, 0.990, 0.988};
892 const double eff_pt = effs_pt[binIndex(m.pT() / GeV, edges_pt, true)];
893 if (m.abseta() > 2.5) return eff_pt * (m.abseta() < 2.6 ? 0.775 : 0.633);
894 return eff_pt;
895 }
896
909 if (m.abspid() != PID::MUON) return 0;
910 if (m.abseta() > 2.7 || m.pT() < 3*GeV) return 0;
911 static const vector<double> edges_pt = {3., 3.5, 4., 5., 6., 7., 8., 20.};
912 static const vector<double> effs_pt = {0.455, 0.615, 0.810, 0.945, 0.975, 0.980, 0.985, 0.987};
913 const double eff_pt = effs_pt[binIndex(m.pT() / GeV, edges_pt, true)];
914 if (m.abseta() < 0.1) return eff_pt * 0.67;
915 if (m.abseta() > 2.5) return eff_pt * (m.abseta() < 2.6 ? 0.775 : 0.633);
916 return eff_pt;
917 }
918
933 if (m.abspid() != PID::MUON) return 0;
934 if (m.abseta() > 2.5 || m.pT() < 4*GeV) return 0;
935 static const vector<double> edges_pt = {4., 5., 6., 7., 8., 9., 10., 12., 14., 16., 18., 20.};
936 static const vector<double> effs_pt = {0.681, 0.827, 0.869, 0.894, 0.908, 0.920,
937 0.930, 0.934, 0.936, 0.942, 0.956, 0.953};
938 const double eff_pt = effs_pt[binIndex(m.pT() / GeV, edges_pt, true)];
939 if (m.abseta() < 0.1) return eff_pt * 0.606;
940 return eff_pt;
941 }
942
943
955 inline double MUON_ISOEFF_ATLAS_RUN2_FCLOOSE(const Particle& m) {
956 if (m.abspid() != PID::MUON) return 0;
957 if (m.abseta() > 2.5 || m.pT() < 3*GeV) return 0;
958 static const vector<double> edges_pt = {3., 4., 5., 6., 7., 8., 9., 10.,
959 15., 20., 30., 40., 55., 70., 90., 150.};
960 static const vector<double> effs_pt = {0.656, 0.726, 0.766, 0.789, 0.822, 0.853, 0.879, 0.921,
961 0.958, 0.983, 0.994, 0.998, 0.999, 0.999, 0.999, 0.997};
962 return effs_pt[binIndex(m.pT() / GeV, edges_pt, true)];
963 }
964
976 inline double MUON_ISOEFF_ATLAS_RUN2_FCTIGHT(const Particle& m) {
977 if (m.abspid() != PID::MUON) return 0;
978 if (m.abseta() > 2.5 || m.pT() < 3*GeV) return 0;
979 static const vector<double> edges_pt = {3., 4., 5., 6., 7., 8., 9., 10.,
980 15., 20., 30., 40., 55., 70., 90., 150.};
981 static const vector<double> effs_pt = {0.569, 0.635, 0.668, 0.691, 0.703, 0.719, 0.733, 0.760,
982 0.794, 0.844, 0.920, 0.970, 0.992, 0.997, 0.998, 0.996};
983 return effs_pt[binIndex(m.pT() / GeV, edges_pt, true)];
984 }
985
998 if (m.abspid() != PID::MUON) return 0;
999 if (m.abseta() > 2.5 || m.pT() < 3*GeV) return 0;
1000 static const vector<double> edges_pt = {3., 4., 5., 6., 7., 8., 9., 10.,
1001 15., 20., 30., 40., 55., 70., 90., 150.};
1002 static const vector<double> effs_pt = {0.479, 0.559, 0.594, 0.623, 0.636, 0.650, 0.667, 0.730,
1003 0.773, 0.828, 0.868, 0.909, 0.959, 0.979, 0.989, 0.989};
1004 return effs_pt[binIndex(m.pT() / GeV, edges_pt, true)];
1005 }
1006
1007
1013 static const vector<double> edges_eta = {0, 1.5, 2.5};
1014 static const vector<double> edges_pt = {0, 0.1, 1.0, 10., 200.};
1015 static const vector<double> res = {0., 0.03, 0.02, 0.03, 0.05, 0., 0.04, 0.03, 0.04, 0.05};
1016
1017 const int i_eta = binIndex(m.abseta(), edges_eta);
1018 const int i_pt = binIndex(m.pT() / GeV, edges_pt, true);
1019 const int i = i_eta * edges_pt.size() + i_pt;
1020 const double resolution_fixed = res[i];
1021
1022 // For pT > 200 GeV, add an ad-hoc linear scaling to follow the trend of
1023 // https://arxiv.org/pdf/2012.00578 Fig 2 but without the high-pT working point,
1024 // slightly generously hitting 45% rather than 66% at 2500 GeV.
1025 const double resolution = resolution_fixed
1026 * (1.0 + max(0.0, (((0.45 - 0.05) / 0.05 - 1.0) / 2300) * (m.pT() - 200*GeV) / GeV));
1027
1028 // Smear by a Gaussian centered on the current pT, with width given by the resolution
1029 // normal_distribution<> d(m.pT(), resolution*m.pT());
1030 // const double smeared_pt = max(d(gen), 0.);
1031 // const double mass = m.mass2() > 0 ? m.mass() : 0; //< numerical carefulness...
1032 // return Particle(m.pid(), FourMomentum::mkEtaPhiMPt(m.eta(), m.phi(), mass, smeared_pt));
1033 return Particle(m.pid(), P4_SMEAR_PT_GAUSS(m, resolution * m.pT()));
1034 }
1035
1043 // Low-pT res limit:
1044 double mres_pt = 0.015;
1045 // Hit sig_mm / m_mm ~ 0.025 at 100 GeV cf. Fig 12:
1046 if (m.pT() > 50*GeV) mres_pt = 0.015 + 0.01 * (m.pT() - 50*GeV) / (50*GeV);
1047 // Hit sig(q/p) = 32% / sqrt(2) at pT = 2500 cf. Fig 2, degrade linearly:
1048 if (m.pT() > 100*GeV) mres_pt = 0.025 + 0.0084 * (m.pT() - 100*GeV) / (100*GeV);
1049 const double ptres_pt = SQRT2 * mres_pt; //< from Eq (10)
1050 const double resolution = (m.abseta() < 1.5 ? 1.0 : 1.25) * ptres_pt;
1051 return Particle(m.pid(), P4_SMEAR_PT_GAUSS(m, resolution * m.pT()));
1052 }
1053
1054 // ATLAS Run 3: from public ATLAS results, cited per function; no complete family yet.
1055 // Combine efficiency steps with PARTICLE_EFF_PRODUCT.
1056 // <NAME>_<YEAR> is one year; <NAME> is the luminosity-weighted average of the published years.
1057
1065 if (m.abspid() != PID::MUON) return 0;
1066 if (m.abseta() > 2.5) return 0;
1067 if (m.pT() < 5*GeV) return 0;
1068 // rows: 5 <= pT < 10 GeV (J/psi), pT >= 10 GeV (Z, held); columns: signed eta
1069 static const vector<double> edges_pT = {5., 10., 15.};
1070 static const vector<double> edges_eta = {-2.5, -2.27273, -2.04545, -1.81818, -1.59091, -1.36364,
1071 -1.13636, -0.90909, -0.68182, -0.45455, -0.22727, 0.,
1072 0.22727, 0.45455, 0.68182, 0.90909, 1.13636, 1.36364,
1073 1.59091, 1.81818, 2.04545, 2.27273, 2.5};
1074 static const vector<double> vals_pT_eta = {
1075 0.96, 0.955, 0.973, 0.969, 0.951, 0.932, 0.976, 0.968, 0.972, 0.98, 0.859, 0.887, 0.978, 0.975,
1076 0.974, 0.974, 0.925, 0.949, 0.975, 0.974, 0.967, 0.965, 0.965, 0.97, 0.96, 0.976, 0.976, 0.976,
1077 0.943, 0.984, 0.988, 0.988, 0.982, 0.83, 0.84, 0.982, 0.988, 0.989, 0.983, 0.944, 0.973, 0.969,
1078 0.976, 0.961, 0.971, 0.971, 0.97, 0.96, 0.976, 0.976, 0.976, 0.943, 0.984, 0.988, 0.988, 0.982,
1079 0.83, 0.84, 0.982, 0.988, 0.989, 0.983, 0.944, 0.973, 0.969, 0.976, 0.961, 0.971, 0.971};
1080 const int i_pT = binIndex(m.pT() / GeV, edges_pT, true);
1081 const int i_eta = binIndex(m.eta(), edges_eta, true);
1082 return vals_pT_eta[i_pT * edges_eta.size() + i_eta];
1083 }
1084
1091 if (m.abspid() != PID::MUON) return 0;
1092 if (m.abseta() > 2.5) return 0;
1093 if (m.pT() < 5*GeV) return 0;
1094 // rows: 5 <= pT < 10 GeV (J/psi), pT >= 10 GeV (Z, held); columns: signed eta
1095 static const vector<double> edges_pT = {5., 10., 15.};
1096 static const vector<double> edges_eta = {-2.5, -2.27273, -2.04545, -1.81818, -1.59091, -1.36364,
1097 -1.13636, -0.90909, -0.68182, -0.45455, -0.22727, 0.,
1098 0.22727, 0.45455, 0.68182, 0.90909, 1.13636, 1.36364,
1099 1.59091, 1.81818, 2.04545, 2.27273, 2.5};
1100 static const vector<double> vals_pT_eta = {
1101 0.98, 0.972, 0.981, 0.979, 0.984, 0.963, 0.965, 0.978, 0.973, 0.981, 0.85, 0.867, 0.975, 0.975,
1102 0.982, 0.959, 0.963, 0.982, 0.984, 0.974, 0.98, 0.97, 0.97, 0.981, 0.984, 0.984, 0.987, 0.983,
1103 0.971, 0.982, 0.986, 0.986, 0.98, 0.83, 0.841, 0.982, 0.989, 0.99, 0.983, 0.975, 0.98, 0.976,
1104 0.984, 0.98, 0.979, 0.979, 0.981, 0.984, 0.984, 0.987, 0.983, 0.971, 0.982, 0.986, 0.986, 0.98,
1105 0.83, 0.841, 0.982, 0.989, 0.99, 0.983, 0.975, 0.98, 0.976, 0.984, 0.98, 0.979, 0.979};
1106 const int i_pT = binIndex(m.pT() / GeV, edges_pT, true);
1107 const int i_eta = binIndex(m.eta(), edges_eta, true);
1108 return vals_pT_eta[i_pT * edges_eta.size() + i_eta];
1109 }
1110
1117 if (m.abspid() != PID::MUON) return 0;
1118 if (m.abseta() > 2.5) return 0;
1119 if (m.pT() < 5*GeV) return 0;
1120 // rows: 5 <= pT < 10 GeV (J/psi), pT >= 10 GeV (Z, held); columns: signed eta
1121 static const vector<double> edges_pT = {5., 10., 15.};
1122 static const vector<double> edges_eta = {-2.5, -2.27273, -2.04545, -1.81818, -1.59091, -1.36364,
1123 -1.13636, -0.90909, -0.68182, -0.45455, -0.22727, 0.,
1124 0.22727, 0.45455, 0.68182, 0.90909, 1.13636, 1.36364,
1125 1.59091, 1.81818, 2.04545, 2.27273, 2.5};
1126 static const vector<double> vals_pT_eta = {
1127 0.975, 0.978, 0.979, 0.985, 0.979, 0.969, 0.974, 0.976, 0.974, 0.977, 0.855, 0.873, 0.98, 0.977,
1128 0.974, 0.974, 0.963, 0.983, 0.988, 0.981, 0.978, 0.966, 0.966, 0.979, 0.983, 0.986, 0.988, 0.989,
1129 0.974, 0.984, 0.987, 0.986, 0.979, 0.828, 0.839, 0.979, 0.988, 0.99, 0.984, 0.975, 0.988, 0.985,
1130 0.985, 0.98, 0.975, 0.975, 0.979, 0.983, 0.986, 0.988, 0.989, 0.974, 0.984, 0.987, 0.986, 0.979,
1131 0.828, 0.839, 0.979, 0.988, 0.99, 0.984, 0.975, 0.988, 0.985, 0.985, 0.98, 0.975, 0.975};
1132 const int i_pT = binIndex(m.pT() / GeV, edges_pT, true);
1133 const int i_eta = binIndex(m.eta(), edges_eta, true);
1134 return vals_pT_eta[i_pT * edges_eta.size() + i_eta];
1135 }
1136
1149 // luminosity-weighted: 2022 (29 fb^-1), 2023 (28 fb^-1), 2024 (109 fb^-1)
1152 / 166.;
1153 }
1154
1163 if (m.abspid() != PID::MUON) return 0;
1164 if (m.abseta() > 2.5) return 0;
1165 if (m.pT() < 5*GeV) return 0;
1166 // rows: 5 <= pT < 10 GeV (J/psi), pT >= 10 GeV (Z, held); columns: signed eta
1167 static const vector<double> edges_pT = {5., 10., 15.};
1168 static const vector<double> edges_eta = {-2.5, -2.27273, -2.04545, -1.81818, -1.59091, -1.36364,
1169 -1.13636, -0.90909, -0.68182, -0.45455, -0.22727, 0.,
1170 0.22727, 0.45455, 0.68182, 0.90909, 1.13636, 1.36364,
1171 1.59091, 1.81818, 2.04545, 2.27273, 2.5};
1172 static const vector<double> vals_pT_eta = {
1173 0.96, 0.955, 0.973, 0.969, 0.951, 0.936, 0.982, 0.982, 0.982, 0.99, 0.874, 0.898, 0.987, 0.985,
1174 0.988, 0.98, 0.93, 0.949, 0.975, 0.974, 0.967, 0.965, 0.965, 0.97, 0.96, 0.976, 0.976, 0.976,
1175 0.943, 0.984, 0.988, 0.988, 0.982, 0.98, 0.978, 0.982, 0.988, 0.989, 0.983, 0.944, 0.973, 0.969,
1176 0.976, 0.961, 0.971, 0.971, 0.97, 0.96, 0.976, 0.976, 0.976, 0.943, 0.984, 0.988, 0.988, 0.982,
1177 0.98, 0.978, 0.982, 0.988, 0.989, 0.983, 0.944, 0.973, 0.969, 0.976, 0.961, 0.971, 0.971};
1178 const int i_pT = binIndex(m.pT() / GeV, edges_pT, true);
1179 const int i_eta = binIndex(m.eta(), edges_eta, true);
1180 return vals_pT_eta[i_pT * edges_eta.size() + i_eta];
1181 }
1182
1190 if (m.abspid() != PID::MUON) return 0;
1191 if (m.abseta() > 2.5) return 0;
1192 if (m.pT() < 5*GeV) return 0;
1193 // rows: 5 <= pT < 10 GeV (J/psi), pT >= 10 GeV (Z, held); columns: signed eta
1194 static const vector<double> edges_pT = {5., 10., 15.};
1195 static const vector<double> edges_eta = {-2.5, -2.27273, -2.04545, -1.81818, -1.59091, -1.36364,
1196 -1.13636, -0.90909, -0.68182, -0.45455, -0.22727, 0.,
1197 0.22727, 0.45455, 0.68182, 0.90909, 1.13636, 1.36364,
1198 1.59091, 1.81818, 2.04545, 2.27273, 2.5};
1199 static const vector<double> vals_pT_eta = {
1200 0.98, 0.972, 0.981, 0.979, 0.984, 0.967, 0.971, 0.992, 0.983, 0.99, 0.865, 0.878, 0.984, 0.986,
1201 0.996, 0.965, 0.968, 0.982, 0.984, 0.974, 0.98, 0.97, 0.97, 0.981, 0.984, 0.984, 0.987, 0.983,
1202 0.971, 0.983, 0.986, 0.986, 0.98, 0.978, 0.977, 0.982, 0.989, 0.99, 0.983, 0.975, 0.98, 0.976,
1203 0.984, 0.98, 0.979, 0.979, 0.981, 0.984, 0.984, 0.987, 0.983, 0.971, 0.983, 0.986, 0.986, 0.98,
1204 0.978, 0.977, 0.982, 0.989, 0.99, 0.983, 0.975, 0.98, 0.976, 0.984, 0.98, 0.979, 0.979};
1205 const int i_pT = binIndex(m.pT() / GeV, edges_pT, true);
1206 const int i_eta = binIndex(m.eta(), edges_eta, true);
1207 return vals_pT_eta[i_pT * edges_eta.size() + i_eta];
1208 }
1209
1216 if (m.abspid() != PID::MUON) return 0;
1217 if (m.abseta() > 2.5) return 0;
1218 if (m.pT() < 5*GeV) return 0;
1219 // rows: 5 <= pT < 10 GeV (J/psi), pT >= 10 GeV (Z, held); columns: signed eta
1220 static const vector<double> edges_pT = {5., 10., 15.};
1221 static const vector<double> edges_eta = {-2.5, -2.27273, -2.04545, -1.81818, -1.59091, -1.36364,
1222 -1.13636, -0.90909, -0.68182, -0.45455, -0.22727, 0.,
1223 0.22727, 0.45455, 0.68182, 0.90909, 1.13636, 1.36364,
1224 1.59091, 1.81818, 2.04545, 2.27273, 2.5};
1225 static const vector<double> vals_pT_eta = {
1226 0.975, 0.978, 0.979, 0.985, 0.979, 0.972, 0.98, 0.989, 0.984, 0.987, 0.87, 0.885, 0.989, 0.987,
1227 0.988, 0.98, 0.968, 0.984, 0.988, 0.981, 0.978, 0.966, 0.966, 0.979, 0.983, 0.986, 0.988, 0.989,
1228 0.974, 0.984, 0.987, 0.986, 0.979, 0.972, 0.973, 0.979, 0.988, 0.99, 0.984, 0.975, 0.988, 0.985,
1229 0.985, 0.98, 0.975, 0.975, 0.979, 0.983, 0.986, 0.988, 0.989, 0.974, 0.984, 0.987, 0.986, 0.979,
1230 0.972, 0.973, 0.979, 0.988, 0.99, 0.984, 0.975, 0.988, 0.985, 0.985, 0.98, 0.975, 0.975};
1231 const int i_pT = binIndex(m.pT() / GeV, edges_pT, true);
1232 const int i_eta = binIndex(m.eta(), edges_eta, true);
1233 return vals_pT_eta[i_pT * edges_eta.size() + i_eta];
1234 }
1235
1249 // luminosity-weighted: 2022 (29 fb^-1), 2023 (28 fb^-1), 2024 (109 fb^-1)
1252 / 166.;
1253 }
1254
1261 if (m.abspid() != PID::MUON) return 0;
1262 if (m.abseta() > 2.5) return 0;
1263 if (m.pT() < 3*GeV) return 0;
1264 static const vector<double> edges_pT = {3., 4., 5., 6., 7., 8., 9., 10., 15.,
1265 20., 30., 40., 55., 70., 90., 150., 250.};
1266 static const vector<double> vals_pT = {0.648, 0.739, 0.781, 0.808, 0.836, 0.851, 0.864, 0.903, 0.935,
1267 0.969, 0.991, 0.999, 0.998, 0.998, 0.998, 0.999, 0.999};
1268 return vals_pT[binIndex(m.pT() / GeV, edges_pT, true)];
1269 }
1270
1277 if (m.abspid() != PID::MUON) return 0;
1278 if (m.abseta() > 2.5) return 0;
1279 if (m.pT() < 3*GeV) return 0;
1280 static const vector<double> edges_pT = {3., 4., 5., 6., 7., 8., 9., 10., 15.,
1281 20., 30., 40., 55., 70., 90., 150., 250.};
1282 static const vector<double> vals_pT = {0.639, 0.731, 0.768, 0.803, 0.825, 0.849, 0.867, 0.9, 0.933,
1283 0.966, 0.99, 0.999, 0.998, 0.999, 0.999, 1., 1.};
1284 return vals_pT[binIndex(m.pT() / GeV, edges_pT, true)];
1285 }
1286
1293 if (m.abspid() != PID::MUON) return 0;
1294 if (m.abseta() > 2.5) return 0;
1295 if (m.pT() < 3*GeV) return 0;
1296 static const vector<double> edges_pT = {3., 4., 5., 6., 7., 8., 9., 10., 15.,
1297 20., 30., 40., 55., 70., 90., 150., 250.};
1298 static const vector<double> vals_pT = {0.617, 0.705, 0.753, 0.787, 0.815, 0.837, 0.857, 0.894, 0.931,
1299 0.968, 0.99, 0.999, 0.998, 0.998, 0.999, 1., 1.};
1300 return vals_pT[binIndex(m.pT() / GeV, edges_pT, true)];
1301 }
1302
1315 // luminosity-weighted: 2022 (29 fb^-1), 2023 (28 fb^-1), 2024 (109 fb^-1)
1319 / 166.;
1320 }
1321
1322
1324 inline double MUON_EFF_CMS_RUN1(const Particle& m) {
1325 if (m.abspid() != PID::MUON) return 0;
1326 if (m.abseta() > 2.4) return 0;
1327 if (m.pT() < 10*GeV) return 0;
1328 return 0.95 * (m.abseta() < 1.5 ? 1 : exp(0.5 - 5e-4 * m.pT() / GeV));
1329 }
1330
1334 inline double MUON_EFF_CMS_RUN1_LOOSE(const Particle& m) {
1335 return MUON_EFF_CMS_RUN1(m);
1336 }
1337
1341 inline double MUON_EFF_CMS_RUN1_MEDIUM(const Particle& m) {
1342 return MUON_EFF_CMS_RUN1(m);
1343 }
1344
1348 inline double MUON_EFF_CMS_RUN1_TIGHT(const Particle& m) {
1349 return MUON_EFF_CMS_RUN1(m);
1350 }
1351
1352
1356 inline double MUON_EFF_CMS_RUN2(const Particle& m) {
1357 return MUON_EFF_CMS_RUN1(m);
1358 }
1359
1363 inline double MUON_EFF_CMS_RUN2_LOOSE(const Particle& m) {
1364 return MUON_EFF_CMS_RUN2(m);
1365 }
1366
1370 inline double MUON_EFF_CMS_RUN2_MEDIUM(const Particle& m) {
1371 return MUON_EFF_CMS_RUN2(m);
1372 }
1373
1377 inline double MUON_EFF_CMS_RUN2_TIGHT(const Particle& m) {
1378 return MUON_EFF_CMS_RUN2(m);
1379 }
1380
1381
1384 // Calculate fractional resolution
1385 // for pT > 0.1 GeV, mom resolution = |eta| < 0.5 -> sqrt(0.01^2 + pt^2 * 2.0e-4^2)
1386 // |eta| < 1.5 -> sqrt(0.02^2 + pt^2 * 3.0e-4^2)
1387 // |eta| < 2.5 -> sqrt(0.05^2 + pt^2 * 2.6e-4^2)
1388 double resolution = 0;
1389 const double abseta = m.abseta();
1390 if (m.pT() > 0.1*GeV && abseta < 2.5) {
1391 if (abseta < 0.5) {
1392 resolution = add_quad(0.01, 2.0e-4 * m.pT() / GeV);
1393 }
1394 else if (abseta < 1.5) {
1395 resolution = add_quad(0.02, 3.0e-4 * m.pT() / GeV);
1396 }
1397 else { // still |eta| < 2.5... but isn't CMS' mu acceptance < 2.4?
1398 resolution = add_quad(0.05, 2.6e-4 * m.pT() / GeV);
1399 }
1400 }
1401
1402 // Smear by a Gaussian centered on the current pT, with width given by the resolution
1403 // normal_distribution<> d(m.pT(), resolution*m.pT());
1404 // const double smeared_pt = max(d(gen), 0.);
1405 // const double mass = m.mass2() > 0 ? m.mass() : 0; //< numerical carefulness...
1406 // return Particle(m.pid(), FourMomentum::mkEtaPhiMPt(m.eta(), m.phi(), mass, smeared_pt));
1407 return Particle(m.pid(), P4_SMEAR_PT_GAUSS(m, resolution * m.pT()));
1408 }
1409
1414 return MUON_SMEAR_CMS_RUN1(m);
1415 }
1416
1418
1419
1422
1430 inline double TAU_EFF_ATLAS_RUN1_MEDIUM(const Particle& t) {
1431 if (t.abseta() > 2.5) return 0; //< hmm... mostly
1432 if (inRange(t.abseta(), 1.37, 1.52)) return 0; //< crack region
1433 double pThadvis = 0;
1434 Particles chargedhadrons;
1435 for (const Particle& p : t.children()) {
1436 if (p.isHadron()) {
1437 pThadvis += p.pT(); //< right definition? Paper is unclear
1438 if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1*GeV) chargedhadrons += p;
1439 }
1440 }
1441 if (chargedhadrons.empty()) return 0; //< leptonic tau
1442 if (pThadvis < 20*GeV) return 0; //< below threshold
1443 if (pThadvis < 40*GeV) {
1444 if (chargedhadrons.size() == 1) return (t.abspid() == PID::TAU) ? 0.56 : 0; //1/20.;
1445 if (chargedhadrons.size() == 3) return (t.abspid() == PID::TAU) ? 0.38 : 0; //1/100.;
1446 }
1447 else {
1448 if (chargedhadrons.size() == 1) return (t.abspid() == PID::TAU) ? 0.56 : 0; //1/25.;
1449 if (chargedhadrons.size() == 3) return (t.abspid() == PID::TAU) ? 0.38 : 0; //1/400.;
1450 }
1451 return 0;
1452 }
1453
1456 inline double TAU_EFF_ATLAS_RUN1(const Particle& t) {
1457 return TAU_EFF_ATLAS_RUN1_MEDIUM(t);
1458 }
1459
1462 inline double TAU_EFF_ATLAS_RUN1_LOOSE(const Particle& t) {
1463 return TAU_EFF_ATLAS_RUN1(t);
1464 }
1465
1468 inline double TAU_EFF_ATLAS_RUN1_TIGHT(const Particle& t) {
1469 return TAU_EFF_ATLAS_RUN1(t);
1470 }
1471
1472
1480 inline double TAUJET_EFF_ATLAS_RUN1(const Jet& j) {
1481 if (j.abseta() > 2.5) return 0; //< hmm... mostly
1482 if (inRange(j.abseta(), 1.37, 1.52)) return 0; //< crack region
1483 double pThadvis = 0;
1484 Particles chargedhadrons;
1485 for (const Particle& p : j.particles()) {
1486 if (p.isHadron()) {
1487 pThadvis += p.pT(); //< right definition? Paper is unclear
1488 if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1*GeV) chargedhadrons += p;
1489 }
1490 }
1491
1492 if (chargedhadrons.empty()) return 0; //< leptonic tau?
1493 if (pThadvis < 20*GeV) return 0; //< below threshold
1494
1495 const Particles ttags = j.tauTags(Cuts::pT > 10*GeV);
1496 // MisID rates for jets without truth tau label
1497 if (ttags.empty()) {
1498 if (pThadvis < 40*GeV)
1499 return chargedhadrons.size() == 1 ? 1 / 20.
1500 : chargedhadrons.size() == 3 ? 1 / 100.
1501 : 0; //< fake rates
1502 else
1503 return chargedhadrons.size() == 1 ? 1 / 25.
1504 : chargedhadrons.size() == 3 ? 1 / 400.
1505 : 0; //< fake rates
1506 }
1507 // Efficiencies for jets with a truth tau label
1508 const Particles prongs = ttags[0].stableDescendants(Cuts::charge3 != 0 && Cuts::pT > 1*GeV
1509 && Cuts::abseta < 2.5);
1510 return prongs.size() == 1 ? 0.56 : 0.38;
1511 }
1512
1513
1519 inline double TAU_EFF_ATLAS_RUN2_MEDIUM(const Particle& t) {
1520 if (t.abspid() != PID::TAU) return 0;
1521 if (t.abseta() > 2.5) return 0; //< hmm... mostly
1522 if (inRange(t.abseta(), 1.37, 1.52)) return 0; //< crack region
1523 double pThadvis = 0;
1524 Particles chargedhadrons;
1525 for (const Particle& p : t.children()) {
1526 if (p.isHadron()) {
1527 pThadvis += p.pT(); //< right definition? Paper is unclear
1528 if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1*GeV) chargedhadrons += p;
1529 }
1530 }
1531 if (chargedhadrons.empty()) return 0; //< leptonic tau
1532 if (pThadvis < 20*GeV) return 0; //< below threshold
1533 if (chargedhadrons.size() == 1) return (t.abspid() == PID::TAU) ? 0.55 : 0; //1/50.;
1534 if (chargedhadrons.size() == 3) return (t.abspid() == PID::TAU) ? 0.40 : 0; //1/110.;
1535 return 0;
1536 }
1537
1540 inline double TAU_EFF_ATLAS_RUN2(const Particle& t) {
1541 return TAU_EFF_ATLAS_RUN2_MEDIUM(t);
1542 }
1543
1546 inline double TAU_EFF_ATLAS_RUN2_LOOSE(const Particle& t) {
1547 return TAU_EFF_ATLAS_RUN2(t);
1548 }
1549
1552 inline double TAU_EFF_ATLAS_RUN2_TIGHT(const Particle& t) {
1553 return TAU_EFF_ATLAS_RUN2(t);
1554 }
1555
1556
1562 inline double TAUJET_EFF_ATLAS_RUN2(const Jet& j) {
1563 if (j.abseta() > 2.5) return 0; //< hmm... mostly
1564 if (inRange(j.abseta(), 1.37, 1.52)) return 0; //< crack region
1565 double pThadvis = 0;
1566 Particles chargedhadrons;
1567 for (const Particle& p : j.particles()) {
1568 if (p.isHadron()) {
1569 pThadvis += p.pT(); //< right definition? Paper is unclear
1570 if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1*GeV) chargedhadrons += p;
1571 }
1572 }
1573 if (chargedhadrons.empty()) return 0;
1574 if (pThadvis < 20*GeV) return 0; //< below threshold
1575 if (chargedhadrons.size() != 1 && chargedhadrons.size() != 3) return 0; //< tau ID needs 1 or 3 tracks
1576 const Particles ttags = j.tauTags(Cuts::pT > 10*GeV);
1577 // if (ttags.empty()) {
1578 // if (pThadvis < 40*GeV)
1579 // return chargedhadrons.size() == 1 ? 1/50. : 1/110.; //< fake rates
1580 // else
1581 // return chargedhadrons.size() == 1 ? 1/25. : 1/400.; //< fake rates
1582 // }
1583 if (ttags.empty())
1584 return chargedhadrons.size() == 1 ? 1 / 50. : 1 / 110.; //< fake rates
1585 const Particles prongs = ttags[0].stableDescendants(Cuts::charge3 != 0 && Cuts::pT > 1*GeV
1586 && Cuts::abseta < 2.5);
1587 return prongs.size() == 1 ? 0.55 : 0.40;
1588 }
1589
1593 inline double TAUJET_EFF_ATLAS_RUN2_LOOSE(const Jet& j) {
1594 if (j.abseta() > 2.5) return 0; //< hmm... mostly
1595 if (inRange(j.abseta(), 1.37, 1.52)) return 0; //< crack region
1596 double pThadvis = 0;
1597 Particles chargedhadrons;
1598 for (const Particle& p : j.particles()) {
1599 if (p.isHadron()) {
1600 pThadvis += p.pT(); //< right definition? Paper is unclear
1601 if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1*GeV) chargedhadrons += p;
1602 }
1603 }
1604 if (chargedhadrons.empty()) return 0;
1605 if (pThadvis < 20*GeV) return 0; //< below threshold
1606 if (chargedhadrons.size() != 1 && chargedhadrons.size() != 3) return 0; //< tau ID needs 1 or 3 tracks
1607 const Particles ttags = j.tauTags(Cuts::pT > 10*GeV);
1608 if (ttags.empty()) return 1 / 30.; //< fake rate, same for 1 and 3 tracks
1609 const Particles prongs = ttags[0].stableDescendants(Cuts::charge3 != 0 && Cuts::pT > 1*GeV
1610 && Cuts::abseta < 2.5);
1611 return prongs.size() == 1 ? 0.60 : 0.50;
1612 }
1613
1617 inline double TAUJET_EFF_ATLAS_RUN2_TIGHT(const Jet& j) {
1618 if (j.abseta() > 2.5) return 0; //< hmm... mostly
1619 if (inRange(j.abseta(), 1.37, 1.52)) return 0; //< crack region
1620 double pThadvis = 0;
1621 Particles chargedhadrons;
1622 for (const Particle& p : j.particles()) {
1623 if (p.isHadron()) {
1624 pThadvis += p.pT(); //< right definition? Paper is unclear
1625 if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1*GeV) chargedhadrons += p;
1626 }
1627 }
1628 if (chargedhadrons.empty()) return 0;
1629 if (pThadvis < 20*GeV) return 0; //< below threshold
1630 if (chargedhadrons.size() != 1 && chargedhadrons.size() != 3) return 0; //< tau ID needs 1 or 3 tracks
1631 const Particles ttags = j.tauTags(Cuts::pT > 10*GeV);
1632 if (ttags.empty())
1633 return chargedhadrons.size() == 1 ? 1 / 120. : 1 / 300.; //< fake rates
1634 const Particles prongs = ttags[0].stableDescendants(Cuts::charge3 != 0 && Cuts::pT > 1*GeV
1635 && Cuts::abseta < 2.5);
1636 return prongs.size() == 1 ? 0.45 : 0.30;
1637 }
1638
1639
1644 // // Const fractional resolution for now
1645 // static const double resolution = 0.03;
1646
1647 // // Smear by a Gaussian centered on 1 with width given by the (fractional) resolution
1648 // /// @todo Is this the best way to smear? Should we preserve the energy, or pT, or direction?
1649 // const double fsmear = max(randnorm(1., resolution), 0.);
1650 // const double mass = t.mass2() > 0 ? t.mass() : 0; //< numerical carefulness...
1651 // return Particle(t.pid(), FourMomentum::mkXYZM(t.px()*fsmear, t.py()*fsmear, t.pz()*fsmear, mass));
1652
1653 // Jet energy resolution lookup
1654 // Implemented by Matthias Danninger for GAMBIT, based roughly on
1655 // https://atlas.web.cern.ch/Atlas/GROUPS/PHYSICS/CONFNOTES/ATLAS-CONF-2015-017/
1656 // Parameterisation can be still improved, but eta dependence is minimal
1658 static const vector<double> binedges_pt = {0., 50., 70., 100., 150., 200., 1000., 10000.};
1659 static const vector<double> jer = {0.145, 0.115, 0.095, 0.075,
1660 0.07, 0.05, 0.04, 0.04}; //< note overflow value
1661 const int ipt = binIndex(t.pT() / GeV, binedges_pt, true);
1662 if (ipt < 0) return t;
1663 const double resolution = jer.at(ipt);
1664
1665 // Smear by a Gaussian centered on 1 with width given by the (fractional) resolution
1668 const double fsmear = max(randnorm(1., resolution), 0.);
1669 const double mass = t.mass2() > 0 ? t.mass() : 0; //< numerical carefulness...
1670 Particle rtn(t.pid(), FourMomentum::mkXYZM(t.px() * fsmear, t.py() * fsmear, t.pz() * fsmear, mass));
1671 //if (deltaPhi(t, rtn) > 0.01) cout << "jdphi: " << deltaPhi(t, rtn) << endl;
1672 return rtn;
1673 }
1674
1675
1680 return TAU_SMEAR_ATLAS_RUN1(t);
1681 }
1682
1683
1687 inline double TAU_EFF_CMS_RUN1(const Particle& t) {
1688 if (t.abspid() != PID::TAU) return 0;
1689 return (t.abspid() == PID::TAU) ? 0.6 : 0;
1690 }
1691
1694 inline double TAU_EFF_CMS_RUN1_LOOSE(const Particle& t) {
1695 return TAU_EFF_CMS_RUN1(t);
1696 }
1697
1700 inline double TAU_EFF_CMS_RUN1_MEDIUM(const Particle& t) {
1701 return TAU_EFF_CMS_RUN1(t);
1702 }
1703
1706 inline double TAU_EFF_CMS_RUN1_TIGHT(const Particle& t) {
1707 return TAU_EFF_CMS_RUN1(t);
1708 }
1709
1713 inline double TAU_EFF_CMS_RUN2(const Particle& t) {
1714 if (t.abspid() != PID::TAU) return 0;
1715 return (t.abspid() == PID::TAU) ? 0.6 : 0;
1716 }
1717
1720 inline double TAU_EFF_CMS_RUN2_LOOSE(const Particle& t) {
1721 return TAU_EFF_CMS_RUN2(t);
1722 }
1723
1726 inline double TAU_EFF_CMS_RUN2_MEDIUM(const Particle& t) {
1727 return TAU_EFF_CMS_RUN2(t);
1728 }
1729
1732 inline double TAU_EFF_CMS_RUN2_TIGHT(const Particle& t) {
1733 return TAU_EFF_CMS_RUN2(t);
1734 }
1735
1736
1741 return TAU_SMEAR_ATLAS_RUN1(t);
1742 }
1743
1744
1749 return TAU_SMEAR_CMS_RUN1(t);
1750 }
1751
1753
1754
1757
1759 inline double JET_BTAG_ATLAS_RUN1(const Jet& j) {
1761 if (j.abseta() > 2.5) return 0;
1762 if (j.bTagged(Cuts::pT > 5*GeV, 0.3))
1763 return 0.80 * tanh(0.003 * j.pT() / GeV) * (30 / (1 + 0.0860 * j.pT() / GeV));
1764 if (j.cTagged(Cuts::pT > 5*GeV, 0.3))
1765 return 0.20 * tanh(0.020 * j.pT() / GeV) * (1 / (1 + 0.0034 * j.pT() / GeV));
1766 return 0.002 + 7.3e-6 * j.pT() / GeV;
1767 }
1768
1769 inline double JET_BTAG_ATLAS_RUN1_XXX(const Jet& j) {
1770 return JET_BTAG_ATLAS_RUN1(j);
1771 }
1772
1774 inline double JET_BTAG_ATLAS_RUN2_MV2C20(const Jet& j) {
1775 if (j.abseta() > 2.5) return 0;
1776 if (j.bTagged(Cuts::pT > 5*GeV, 0.3)) return 0.77;
1777 if (j.cTagged(Cuts::pT > 5*GeV, 0.3)) return 1 / 4.5;
1778 return 1 / 140.;
1779 }
1780
1782 inline double JET_BTAG_ATLAS_RUN2_MV2C10(const Jet& j) {
1783 if (j.abseta() > 2.5) return 0;
1784 if (j.bTagged(Cuts::pT > 5*GeV, 0.3)) return 0.77;
1785 if (j.cTagged(Cuts::pT > 5*GeV, 0.3)) return 1 / 6.0;
1786 return 1 / 134.;
1787 }
1788
1793 inline double JET_BTAG_ATLAS_RUN2_2016_MV2C10_77(const Jet& j) {
1794 if (j.abseta() > 2.5) return 0;
1795 if (j.bTagged(Cuts::pT > 5*GeV, 0.3)) {
1796 // N.B. !!! There is no overflow bin.
1797 // There is a clear downward curve in efficiency as pT->inf, but the value to use for pT > 500
1798 // is super-unclear. The used value (0.69) is certainly a reasonable extrapolation, but it should
1799 // be noted that tuning this value can make a really significant difference to the bin counts O(10%)
1800 // HOWEVER: atlas really needs to start increasing the range of this sort of plot
1801 // The behaviour of jets pT > 500 GeV is much more interesting and significant than those in the
1802 // range 20 < pT < 25 GeV.
1803 const static vector<double> binedges_pt = {0.00, 30.0, 40.00, 50.00, 60.0, 75.00,
1804 90.0, 105., 150., 200., 500};
1805 const static vector<double> eff_pt = {0.63, 0.705, 0.74, 0.76, 0.775, 0.785,
1806 0.795, 0.80, 0.79, 0.75, 0.68};
1807
1808 return eff_pt[binIndex(j.pt(), binedges_pt, true)];
1809 }
1810 else if (j.cTagged(Cuts::pT > 5*GeV, 0.3)) {
1811 // N.B. there is also a pt/eta table for c mistags, but if that's significant I'll eat my hat.
1812 return 1. / 5.;
1813 }
1814 else if (j.tauTagged()) {
1815 return 1. / 16.;
1816 }
1817 else {
1818 return 1. / 110.;
1819 }
1820 }
1821
1825 inline double JET_BTAG_ATLAS_RUN2_DL1d_77(const Jet& j) {
1826 if (j.abseta() > 2.5) return 0.;
1827
1828 if (j.bTagged(Cuts::pT > 5*GeV, 0.3)) {
1829
1830 // Original values from FTAG-2023-01 (up to 400 GeV)
1831 // N.B. !!! There is no overflow bin.
1832 // There is a clear downward curve in efficiency as pT->inf, but the value to use for pT > 500
1833 // is super-unclear. The used value (0.69) is certainly a reasonable extrapolation, but it should
1834 // be noted that tuning this value can make a really significant difference to the bin counts O(10%)
1835 // HOWEVER: atlas really needs to start increasing the range of this sort of plot
1836 // The behaviour of jets pT>500 is much more interesting and significant than those in the range 20<pt<25.
1837 // N.B.2 Message above copied from my implementation of MV2c10. Plus ca change...
1838 // Better distributions available for DL1r, but not here.
1839 // I will use the DL1/DL1r plots in arXiv:2211.16345 to guess a good overflow value
1840 // (the consistency between DL1, DL1r hopefully makes this not crazy)
1841 const static vector<double> binedges_pt = {0.00, 20., 30., 40., 60., 85., 110.,
1842 140., 175., 250., 400., 800., 1200., 2000.};
1843 const static vector<double> eff_pt = {0.0, 0.68, 0.74, 0.77, 0.79, 0.8, 0.81,
1844 0.81, 0.805, 0.78, 0.75, 0.7, 0.65, 0.5};
1845
1846 return eff_pt[binIndex(j.pt(), binedges_pt, true)];
1847 }
1848 else if (j.cTagged(Cuts::pT > 5*GeV, 0.3)) {
1849 // NB. there is also a pt/eta table for c mistags, shouldn't be too significant
1850 return 0.155;
1851 }
1852 // Nothing in the paper, going to guess something small just in case.
1853 else if (j.tauTagged()) {
1854 return 1. / 36.;
1855 }
1856 else
1857 return 0.0038;
1858 }
1859
1862 // As far as I can see, this is the only pre-GN2 b-tag paper
1866 inline double JET_BTAG_ATLAS_RUN2_DL1r_77(const Jet& j) {
1867 if (j.abseta() > 2.5) return 0;
1868 if (j.pt() <= 20*GeV) return 0.;
1869
1870 const static vector<double> binedges_pt = {20., 30., 40., 60., 85., 110., 140.,
1871 175., 210., 250., 400., 600., 800., 1000.,
1872 1200., 1400., 1500., 2000.0, 3000.0};
1873
1874 if (j.bTagged(Cuts::pT > 5*GeV, 0.3)) {
1875 // @todo For pT < 250 we also have eta dependence... include somehow?
1876 const static vector<double> eff_pt = {0.667, 0.731, 0.771, 0.791, 0.801, 0.805, 0.806,
1877 0.798, 0.795, 0.825, 0.802, 0.771, 0.741, 0.706,
1878 0.679, 0.674, 0.634, 0.5, 0.5};
1879 // 0.5 repeated for overflow just in case
1880 return eff_pt[binIndex(j.pt(), binedges_pt, true)];
1881 }
1882 else if (j.cTagged(Cuts::pT > 5*GeV, 0.3)) {
1883 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,
1884 3.05, 3.21, 3.37, 3.616, 3.83, 3.96, 4.01, 2.90, 2.90};
1885 // 2.90 repeated for overflow just in case
1886 return 1. / c_rej_pt[binIndex(j.pt(), binedges_pt, true)];
1887 }
1888 else {
1889 const static vector<double> light_rej_pt = {143, 191, 239, 261, 235, 257, 248, 189, 158, 32.8,
1890 19.1, 14.2, 12.4, 11.2, 11.0, 11.2, 12.4, 8.27, 8.27};
1891 // 8.27 repeated for overflow just in case
1892 return 1. / light_rej_pt[binIndex(j.pt(), binedges_pt, true)];
1893 }
1894 }
1895
1896
1901 inline Jet JET_SMEAR_ATLAS_RUN1(const Jet& j) {
1902 // Jet energy resolution lookup
1903 // Parameterisation can be still improved, but eta dependence is minimal
1905 static const vector<double> binedges_pt = {0., 50., 70., 100., 150., 200., 1000., 10000.};
1906 static const vector<double> jer = {0.145, 0.115, 0.095, 0.075,
1907 0.07, 0.05, 0.04, 0.04}; //< note overflow value
1908 const int ipt = binIndex(j.pT() / GeV, binedges_pt, true);
1909 if (ipt < 0) return j;
1910 const double resolution = jer.at(ipt);
1911
1912 // Smear by a Gaussian centered on 1 with width given by the (fractional) resolution
1915 const double fsmear = max(randnorm(1., resolution), 0.);
1916 const double mass = j.mass2() > 0 ? j.mass() : 0; //< numerical carefulness...
1917 Jet rtn(FourMomentum::mkXYZM(j.px() * fsmear, j.py() * fsmear, j.pz() * fsmear, mass));
1918 //if (deltaPhi(j, rtn) > 0.01) cout << "jdphi: " << deltaPhi(j, rtn) << endl;
1919 return rtn;
1920 }
1921
1925 inline Jet JET_SMEAR_ATLAS_RUN2(const Jet& j) {
1926 return JET_SMEAR_ATLAS_RUN1(j);
1927 }
1928
1932 inline Jet JET_SMEAR_CMS_RUN1(const Jet& j) {
1933 return JET_SMEAR_ATLAS_RUN1(j);
1934 }
1935
1939 inline Jet JET_SMEAR_CMS_RUN2(const Jet& j) {
1940 return JET_SMEAR_CMS_RUN1(j);
1941 }
1942
1944
1945
1948
1952 inline METSmearParams MET_SMEARPARAMS_ATLAS_RUN1(const Vector3& met, double set) {
1953 // Linearity offset (Fig 14)
1954 Vector3 smeared_met = met;
1955 if (met.mod() < 25*GeV)
1956 smeared_met *= 1.05;
1957 else if (met.mod() < 40*GeV)
1958 smeared_met *= (1.05 - (0.04 / 15) * (met.mod() / GeV - 25)); //< linear decrease
1959 else
1960 smeared_met *= 1.01;
1961
1962 return {smeared_met, 0.45 * sqrt(set / GeV) * GeV, 0.0};
1963 }
1964
1966 inline Vector3 MET_SMEAR_ATLAS_RUN1(const Vector3& met, double set) {
1968 }
1969
1970
1974 inline METSmearParams MET_SMEARPARAMS_ATLAS_RUN2(const Vector3& met, double set) {
1975 // Linearity offset (Fig 6):
1976 //
1977 // Expn. approx to Fig 6 tt curve, flat below 25 GeV, suppressed
1978 // to fall between the W and tt curves (and match the flat) at 25 GeV,
1979 // and to approach -2% at high-MET.
1980 //
1982 const Vector3 smeared_met = met * (1 + 0.45 * min(1.0, exp(-(met.mod() - 25*GeV) / (10*GeV))) - 0.02);
1983
1984 // Resolution(sumEt) ~ 0.45 sqrt(sumEt) GeV above SET = 180 GeV,
1985 // and with linear trend from SET = 180 -> 0 to resolution = 0 (Fig 7)
1986 const double resolution1 = (set < 180*GeV ? set / 180. : 1) * 0.45 * sqrt(max(set / GeV, 180)) * GeV;
1988
1989 // Resolution(MET_true) (Fig 9)
1990 const double resolution2 = 15*GeV + 0.5 * sqrt(met.mod() / GeV) * GeV;
1991
1992 // Smearing width is given by the minimum resolution estimator (should mean low-MET events
1993 // with high SET do not get a large smearing, and will be dominated by the linearity effect).
1995 const double sigma = min(resolution1, resolution2);
1996
1997 return {smeared_met, sigma, 0.0};
1998 }
1999
2001 inline Vector3 MET_SMEAR_ATLAS_RUN2(const Vector3& met, double set) {
2003 }
2004
2005
2011 inline METSmearParams MET_SMEARPARAMS_ATLAS_RUN2_PFLOW(const Vector3& met, double /* set */) {
2012 // Mean response (Fig 7), expn approximation to the ttbar curve guessing 2 e-foldings in 40 GeV.
2014 const Vector3 smeared_met = met * (1 + 1.15 * exp(-met.mod() / (20*GeV)) - 0.01);
2015
2016 // Mean resolution ~ 15-25 GeV for mu ~ 33.7 (Run 2 avg), but significant dependence on event type (i.e. SET)
2017 // See Figures 4 and 5. The paper doesn't provide enough information for a general SET-dependence:
2018 // maybe prefer the older MET smearing. Not enough discrimination between WPs, mainly encoded vs mu or N_PV.
2019 const double resolution = 20*GeV;
2020
2021 return {smeared_met, resolution, 0.0};
2022 }
2023
2025 inline Vector3 MET_SMEAR_ATLAS_RUN2_PFLOW(const Vector3& met, double set) {
2027 }
2028
2029
2033 inline METSmearParams MET_SMEARPARAMS_CMS_RUN1(const Vector3& met, double set) {
2034 // Calculate parallel and perpendicular resolutions and combine in quadrature (?)
2035 const double resolution_x = (1.1 + 0.6 * sqrt(set / GeV)) * GeV;
2036 const double resolution_y = (1.4 + 0.6 * sqrt(set / GeV)) * GeV;
2037 const double resolution = sqrt(sqr(resolution_x) + sqr(resolution_y));
2038 return {met, resolution, 0.0};
2039 }
2040
2042 inline Vector3 MET_SMEAR_CMS_RUN1(const Vector3& met, double set) {
2043 return MET_SMEAR_NORM(MET_SMEARPARAMS_CMS_RUN1(met, set));
2044 }
2045
2046
2050 inline METSmearParams MET_SMEARPARAMS_CMS_RUN2(const Vector3& met, double set) {
2051 // Calculate parallel and perpendicular resolutions and combine in quadrature (?)
2052 const double resolution_para = (2.0 + 0.64 * sqrt(set / GeV)) * GeV;
2053 const double resolution_perp = (-1.5 + 0.68 * sqrt(set / GeV)) * GeV;
2054 const double resolution = sqrt(sqr(resolution_para) + sqr(resolution_perp));
2055 return {met, resolution, 0.0};
2056 }
2057
2059 inline Vector3 MET_SMEAR_CMS_RUN2(const Vector3& met, double set) {
2060 return MET_SMEAR_NORM(MET_SMEARPARAMS_CMS_RUN2(met, set));
2061 }
2062
2064
2065
2068
2070 inline double TRK_EFF_ATLAS_RUN1(const Particle& p) {
2071 if (p.charge3() == 0) return 0;
2072 if (p.abseta() > 2.5) return 0;
2073 if (p.pT() < 0.1*GeV) return 0;
2074
2075 if (p.abspid() == PID::ELECTRON) {
2076 if (p.abseta() < 1.5) {
2077 if (p.pT() < 1*GeV) return 0.73;
2078 if (p.pT() < 100*GeV) return 0.95;
2079 return 0.99;
2080 }
2081 else {
2082 if (p.pT() < 1*GeV) return 0.50;
2083 if (p.pT() < 100*GeV)
2084 return 0.83;
2085 else
2086 return 0.90;
2087 }
2088 }
2089 else if (p.abspid() == PID::MUON) {
2090 if (p.abseta() < 1.5) {
2091 return (p.pT() < 1*GeV) ? 0.75 : 0.99;
2092 }
2093 else {
2094 return (p.pT() < 1*GeV) ? 0.70 : 0.98;
2095 }
2096 }
2097 else { // charged hadrons
2098 if (p.abseta() < 1.5) {
2099 return (p.pT() < 1*GeV) ? 0.70 : 0.95;
2100 }
2101 else {
2102 return (p.pT() < 1*GeV) ? 0.60 : 0.85;
2103 }
2104 }
2105 }
2106
2110 inline double TRK_EFF_ATLAS_RUN2(const Particle& p) {
2111 return TRK_EFF_ATLAS_RUN1(p);
2112 }
2113
2114
2119 return PARTICLE_SMEAR_IDENTITY(t);
2120 }
2121
2125 return PARTICLE_SMEAR_IDENTITY(t);
2126 }
2127
2128
2130 inline double TRK_EFF_CMS_RUN1(const Particle& p) {
2131 if (p.charge3() == 0) return 0;
2132 if (p.abseta() > 2.5) return 0;
2133 if (p.pT() < 0.1*GeV) return 0;
2134
2135 if (p.abspid() == PID::ELECTRON) {
2136 if (p.abseta() < 1.5) {
2137 if (p.pT() < 1*GeV) return 0.73;
2138 if (p.pT() < 100*GeV) return 0.95;
2139 return 0.99;
2140 }
2141 else {
2142 if (p.pT() < 1*GeV) return 0.50;
2143 if (p.pT() < 100*GeV)
2144 return 0.83;
2145 else
2146 return 0.90;
2147 }
2148 }
2149 else if (p.abspid() == PID::MUON) {
2150 if (p.abseta() < 1.5) {
2151 return (p.pT() < 1*GeV) ? 0.75 : 0.99;
2152 }
2153 else {
2154 return (p.pT() < 1*GeV) ? 0.70 : 0.98;
2155 }
2156 }
2157 else { // charged hadrons
2158 if (p.abseta() < 1.5) {
2159 return (p.pT() < 1*GeV) ? 0.70 : 0.95;
2160 }
2161 else {
2162 return (p.pT() < 1*GeV) ? 0.60 : 0.85;
2163 }
2164 }
2165 }
2166
2170 inline double TRK_EFF_CMS_RUN2(const Particle& p) {
2171 return TRK_EFF_CMS_RUN1(p);
2172 }
2173
2174
2179 return PARTICLE_SMEAR_IDENTITY(t);
2180 }
2181
2185 return PARTICLE_SMEAR_IDENTITY(t);
2186 }
2187
2195 inline double ATLAS_JVT_EFF_LOOSE(const Jet& j) {
2196 if (j.abseta() > 2.4) return 1.0;
2197 // No data for jets pt < 20, hopefully not relevant:
2198 if (j.pt() <= 20*GeV || j.pt() >= 60*GeV) return 1.0;
2199
2200 const static vector<double> binedges_pt = {20*GeV, 25*GeV, 30*GeV, 35*GeV, 40*GeV,
2201 45*GeV, 50*GeV, 55*GeV, 60*GeV};
2202 const static vector<double> binvals = {0.9, 0.93, 0.94, 0.95, 0.96, 0.96, 0.97, 0.97};
2203
2204 const size_t bini = binIndex(j.pt(), binedges_pt);
2205 return binvals[bini];
2206 }
2207
2215 inline double ATLAS_JVT_EFF_MEDIUM(const Jet& j) {
2216 if (j.abseta() > 2.4) return 1.0;
2217 // No data for jets pt < 20, hopefully not relevant:
2218 if (j.pt() <= 20*GeV || j.pt() >= 60*GeV) return 1.0;
2219
2220 const static vector<double> binedges_pt = {20*GeV, 25*GeV, 30*GeV, 35*GeV, 40*GeV,
2221 45*GeV, 50*GeV, 55*GeV, 60*GeV};
2222 const static vector<double> binvals = {0.86, 0.9, 0.92, 0.93, 0.94, 0.95, 0.95, 0.96};
2223
2224 const size_t bini = binIndex(j.pt(), binedges_pt);
2225 return binvals[bini];
2226 }
2227
2235 inline double ATLAS_JVT_EFF_TIGHT(const Jet& j) {
2236 if (j.abseta() > 2.4) return 1.0;
2237 // No data for jets pt < 20, hopefully not relevant:
2238 if (j.pt() <= 20*GeV || j.pt() >= 60*GeV) return 1.0;
2239
2240 const static vector<double> binedges_pt = {20*GeV, 25*GeV, 30*GeV, 35*GeV, 40*GeV,
2241 45*GeV, 50*GeV, 55*GeV, 60*GeV};
2242 const static vector<double> binvals = {0.81, 0.84, 0.87, 0.90, 0.91, 0.92, 0.93, 0.94};
2243
2244 const size_t bini = binIndex(j.pt(), binedges_pt);
2245 return binvals[bini];
2246 }
2247
2249
2252
2256 template <typename T>
2257 inline function<double(const T&)> lumiWeightedEff(
2258 const vector<pair<function<double(const T&)>, double>>& effs) {
2259 double sumlumi = 0;
2260 for (const auto& el : effs) {
2261 if (!(el.second >= 0)) throw UserError("lumiWeightedEff: luminosities must be >= 0");
2262 sumlumi += el.second;
2263 }
2264 if (!(sumlumi > 0)) throw UserError("lumiWeightedEff: needs a positive total luminosity");
2265 return [effs, sumlumi](const T& x) {
2266 double sum = 0;
2267 for (const auto& el : effs) sum += el.second * el.first(x);
2268 return sum / sumlumi;
2269 };
2270 }
2271
2273
2274
2277
2278 inline double ELECTRON_EFF_IDENTITY_LOOSE(const Particle& e) {
2279 return PARTICLE_EFF_ONE(e);
2280 }
2281 inline double ELECTRON_EFF_IDENTITY_MEDIUM(const Particle& e) {
2282 return PARTICLE_EFF_ONE(e);
2283 }
2284 inline double ELECTRON_EFF_IDENTITY_TIGHT(const Particle& e) {
2285 return PARTICLE_EFF_ONE(e);
2286 }
2287 inline double MUON_EFF_IDENTITY_LOOSE(const Particle& m) {
2288 return PARTICLE_EFF_ONE(m);
2289 }
2290 inline double MUON_EFF_IDENTITY_MEDIUM(const Particle& m) {
2291 return PARTICLE_EFF_ONE(m);
2292 }
2293 inline double MUON_EFF_IDENTITY_TIGHT(const Particle& m) {
2294 return PARTICLE_EFF_ONE(m);
2295 }
2296 inline double PHOTON_EFF_IDENTITY_LOOSE(const Particle& y) {
2297 return PARTICLE_EFF_ONE(y);
2298 }
2299 inline double PHOTON_EFF_IDENTITY_MEDIUM(const Particle& y) {
2300 return PARTICLE_EFF_ONE(y);
2301 }
2302 inline double PHOTON_EFF_IDENTITY_TIGHT(const Particle& y) {
2303 return PARTICLE_EFF_ONE(y);
2304 }
2305 inline double TAU_EFF_IDENTITY_LOOSE(const Particle& t) {
2306 return PARTICLE_EFF_ONE(t);
2307 }
2308 inline double TAU_EFF_IDENTITY_MEDIUM(const Particle& t) {
2309 return PARTICLE_EFF_ONE(t);
2310 }
2311 inline double TAU_EFF_IDENTITY_TIGHT(const Particle& t) {
2312 return PARTICLE_EFF_ONE(t);
2313 }
2314
2315 inline Particle ELECTRON_SMEAR_IDENTITY(const Particle& e) {
2316 return PARTICLE_SMEAR_IDENTITY(e);
2317 }
2318 inline Particle MUON_SMEAR_IDENTITY(const Particle& m) {
2319 return PARTICLE_SMEAR_IDENTITY(m);
2320 }
2321 inline Particle PHOTON_SMEAR_IDENTITY(const Particle& y) {
2322 return PARTICLE_SMEAR_IDENTITY(y);
2323 }
2324 inline Particle TAU_SMEAR_IDENTITY(const Particle& t) {
2325 return PARTICLE_SMEAR_IDENTITY(t);
2326 }
2327
2328 inline double TRK_EFF_IDENTITY_TIGHT(const Particle& trk) {
2329 return PARTICLE_EFF_ONE(trk);
2330 }
2331 inline Particle TRK_SMEAR_IDENTITY(const Particle& trk) {
2332 return PARTICLE_SMEAR_IDENTITY(trk);
2333 }
2334
2335 inline double JET_BTAG_IDENTITY_IDENTITY(const Jet& j) {
2336 return JET_BTAG_IDENTITY(j);
2337 }
2338
2339 // Already defined: JET_SMEAR_IDENTITY and MET_SMEAR_IDENTITY
2340
2342
2344
2345
2346}
2347
2348#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 tauTagged(const Cut &c=Cuts::open(), double dRmax=-1) const
Does this jet have at least one tau-tag (with optional Cut and dR restriction).
Definition Jet.hh:246
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 eta() const
Get the directly (alias).
Definition ParticleBase.hh:125
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
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:103
double ELECTRON_EFF_ATLAS_RUN1_TIGHT(const Particle &e)
ATLAS Run 1 'tight' electron reco+identification efficiency.
Definition ExptSmearingFunctions.hh:182
double ELECTRON_EFF_ATLAS_RUN2_LOOSE(const Particle &e)
ATLAS Run 2 'loose' electron reco+identification efficiency.
Definition ExptSmearingFunctions.hh:75
double ELECTRON_EFF_CMS_RUN1(const Particle &e)
CMS Run 1 electron reconstruction efficiency.
Definition ExptSmearingFunctions.hh:499
Particle ELECTRON_SMEAR_ATLAS_RUN1(const Particle &e)
ATLAS Run 1 electron reco smearing.
Definition ExptSmearingFunctions.hh:464
double ELECTRON_EFF_CMS_RUN2_TIGHT(const Particle &e)
Definition ExptSmearingFunctions.hh:547
function< double(const T &)> lumiWeightedEff(const vector< pair< function< double(const T &)>, double > > &effs)
Luminosity-weighted average of per-period efficiency functions, sum_i L_i eff_i / sum_i L_i.
Definition ExptSmearingFunctions.hh:2257
double ELECTRON_IDEFF_ATLAS_RUN2_TIGHT(const Particle &e)
ATLAS Run 2 electron identification efficiency, Tight likelihood working point.
Definition ExptSmearingFunctions.hh:338
double ELECTRON_ISOEFF_ATLAS_RUN2_FCLOOSE(const Particle &e)
ATLAS Run 2 electron isolation efficiency, FCLoose working point.
Definition ExptSmearingFunctions.hh:365
double ELECTRON_ISOEFF_ATLAS_RUN2_FCTIGHT(const Particle &e)
ATLAS Run 2 electron isolation efficiency, FCTight working point.
Definition ExptSmearingFunctions.hh:392
double ELECTRON_EFF_ATLAS_RUN2_TIGHT(const Particle &e)
ATLAS Run 2 'tight' electron reco+identification efficiency.
Definition ExptSmearingFunctions.hh:254
double ELECTRON_EFF_CMS_RUN1_MEDIUM(const Particle &e)
Definition ExptSmearingFunctions.hh:514
double ELECTRON_RECOEFF_ATLAS_RUN2(const Particle &e)
Definition ExptSmearingFunctions.hh:57
Particle ELECTRON_SMEAR_CMS_RUN1(const Particle &e)
CMS electron energy smearing, preserving direction.
Definition ExptSmearingFunctions.hh:558
double ELECTRON_EFF_CMS_RUN2(const Particle &e)
Definition ExptSmearingFunctions.hh:528
double ELECTRON_IDEFF_ATLAS_RUN2_MEDIUM(const Particle &e)
ATLAS Run 2 electron identification efficiency, Medium likelihood working point.
Definition ExptSmearingFunctions.hh:312
double ELECTRON_EFF_ATLAS_RUN2_MEDIUM(const Particle &e)
ATLAS Run 2 'medium' electron reco+identification efficiency.
Definition ExptSmearingFunctions.hh:175
double ELECTRON_EFF_CMS_RUN2_MEDIUM(const Particle &e)
Definition ExptSmearingFunctions.hh:541
Particle ELECTRON_SMEAR_ATLAS_RUN2(const Particle &e)
Definition ExptSmearingFunctions.hh:490
double ELECTRON_ISOEFF_ATLAS_RUN2_GRADIENT(const Particle &e)
ATLAS Run 2 electron isolation efficiency, "Gradient" working point.
Definition ExptSmearingFunctions.hh:419
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:97
double ELECTRON_EFF_CMS_RUN1_LOOSE(const Particle &e)
Definition ExptSmearingFunctions.hh:508
double ELECTRON_RECOEFF_ATLAS_RUN1(const Particle &e)
Definition ExptSmearingFunctions.hh:47
Particle ELECTRON_SMEAR_CMS_RUN2(const Particle &e)
Definition ExptSmearingFunctions.hh:584
double ELECTRON_IDEFF_ATLAS_RUN2_LOOSE(const Particle &e)
ATLAS Run 2 electron identification efficiency, Loose likelihood working point.
Definition ExptSmearingFunctions.hh:286
double ELECTRON_EFF_CMS_RUN2_LOOSE(const Particle &e)
Definition ExptSmearingFunctions.hh:535
double ELECTRON_ISOEFF_ATLAS_RUN2_HIGHPTCALOONLY(const Particle &e)
ATLAS Run 2 electron isolation efficiency, HighPtCaloOnly working point.
Definition ExptSmearingFunctions.hh:446
double ELECTRON_EFF_CMS_RUN1_TIGHT(const Particle &e)
Definition ExptSmearingFunctions.hh:520
Jet JET_SMEAR_ATLAS_RUN2(const Jet &j)
Definition ExptSmearingFunctions.hh:1925
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:1774
Jet JET_SMEAR_ATLAS_RUN1(const Jet &j)
ATLAS Run 1 jet smearing.
Definition ExptSmearingFunctions.hh:1901
double JET_BTAG_ATLAS_RUN2_DL1d_77(const Jet &j)
Definition ExptSmearingFunctions.hh:1825
double JET_BTAG_ATLAS_RUN2_2016_MV2C10_77(const Jet &j)
Definition ExptSmearingFunctions.hh:1793
double JET_BTAG_ATLAS_RUN2_DL1r_77(const Jet &j)
Definition ExptSmearingFunctions.hh:1866
Jet JET_SMEAR_CMS_RUN1(const Jet &j)
Definition ExptSmearingFunctions.hh:1932
Jet JET_SMEAR_CMS_RUN2(const Jet &j)
Definition ExptSmearingFunctions.hh:1939
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:1782
double JET_BTAG_ATLAS_RUN1_XXX(const Jet &j)
Alias for naming scheme.
Definition ExptSmearingFunctions.hh:1769
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:1759
METSmearParams MET_SMEARPARAMS_ATLAS_RUN2(const Vector3 &met, double set)
Definition ExptSmearingFunctions.hh:1974
Vector3 MET_SMEAR_ATLAS_RUN2(const Vector3 &met, double set)
ATLAS Run 2 ETmiss smearing.
Definition ExptSmearingFunctions.hh:2001
Vector3 MET_SMEAR_ATLAS_RUN2_PFLOW(const Vector3 &met, double set)
ATLAS Run 2 pflow ETmiss smearing.
Definition ExptSmearingFunctions.hh:2025
METSmearParams MET_SMEARPARAMS_ATLAS_RUN2_PFLOW(const Vector3 &met, double)
Definition ExptSmearingFunctions.hh:2011
METSmearParams MET_SMEARPARAMS_ATLAS_RUN1(const Vector3 &met, double set)
ATLAS Run 1 ETmiss resolution.
Definition ExptSmearingFunctions.hh:1952
Vector3 MET_SMEAR_CMS_RUN1(const Vector3 &met, double set)
CMS Run 1 ETmiss smearing.
Definition ExptSmearingFunctions.hh:2042
Vector3 MET_SMEAR_NORM(const METSmearParams &msps)
Smear a nominal vector magnitude by Gaussian with the given absolute resolutions.
Definition MomentumSmearingFunctions.hh:187
Vector3 MET_SMEAR_ATLAS_RUN1(const Vector3 &met, double set)
ATLAS Run 1 ETmiss smearing.
Definition ExptSmearingFunctions.hh:1966
Vector3 MET_SMEAR_CMS_RUN2(const Vector3 &met, double set)
CMS Run 2 ETmiss smearing.
Definition ExptSmearingFunctions.hh:2059
METSmearParams MET_SMEARPARAMS_CMS_RUN1(const Vector3 &met, double set)
Definition ExptSmearingFunctions.hh:2033
METSmearParams MET_SMEARPARAMS_CMS_RUN2(const Vector3 &met, double set)
CMS Run 2 ETmiss smearing.
Definition ExptSmearingFunctions.hh:2050
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_RECOIDEFF_ATLAS_RUN2_MEDIUM(const Particle &m)
ATLAS Run 2 muon reconstruction x identification efficiency, Medium working point.
Definition ExptSmearingFunctions.hh:908
double MUON_EFF_ATLAS_RUN1_LOOSE(const Particle &m)
Definition ExptSmearingFunctions.hh:770
double MUON_RECOIDEFF_ATLAS_RUN2_LOOSE(const Particle &m)
ATLAS Run 2 muon reconstruction x identification efficiency, Loose working point.
Definition ExptSmearingFunctions.hh:887
double MUON_EFF_ATLAS_RUN2_TIGHT(const Particle &m)
ATLAS Run 2 muon reco+ID efficiency.
Definition ExptSmearingFunctions.hh:859
Particle MUON_SMEAR_ATLAS_RUN1(const Particle &m)
Definition ExptSmearingFunctions.hh:1012
Particle MUON_SMEAR_CMS_RUN1(const Particle &m)
CMS Run 1 muon reco smearing.
Definition ExptSmearingFunctions.hh:1383
double MUON_ISOEFF_ATLAS_RUN3_PFLOWLOOSE_VARRAD_2022(const Particle &m)
ATLAS Run 3 muon isolation efficiency, PflowLoose_VarRad working point, 2022 data.
Definition ExptSmearingFunctions.hh:1260
double MUON_ISOEFF_ATLAS_RUN2_FCLOOSE(const Particle &m)
ATLAS Run 2 muon isolation efficiency, FCLoose working point.
Definition ExptSmearingFunctions.hh:955
double MUON_EFF_ATLAS_RUN2_LOOSE(const Particle &m)
ATLAS Run 2 muon reco+ID efficiency.
Definition ExptSmearingFunctions.hh:820
double MUON_EFF_CMS_RUN2(const Particle &m)
Definition ExptSmearingFunctions.hh:1356
double MUON_EFF_ATLAS_RUN1(const Particle &m)
ATLAS Run 1 muon reco efficiency.
Definition ExptSmearingFunctions.hh:761
double MUON_RECOIDEFF_ATLAS_RUN3_MEDIUM_2024(const Particle &m)
ATLAS Run 3 Medium muon reconstruction x identification efficiency, 2024 data.
Definition ExptSmearingFunctions.hh:1116
double MUON_EFF_CMS_RUN2_TIGHT(const Particle &m)
Definition ExptSmearingFunctions.hh:1377
double MUON_ISOEFF_ATLAS_RUN2_LOOSE(const Particle &m)
ATLAS Run 2 muon isolation efficiency, PflowLoose working point.
Definition ExptSmearingFunctions.hh:804
double MUON_EFF_CMS_RUN2_LOOSE(const Particle &m)
Definition ExptSmearingFunctions.hh:1363
double MUON_ISOEFF_ATLAS_RUN3_PFLOWLOOSE_VARRAD_2024(const Particle &m)
ATLAS Run 3 muon isolation efficiency, PflowLoose_VarRad working point, 2024 data.
Definition ExptSmearingFunctions.hh:1292
Particle MUON_SMEAR_ATLAS_RUN2(const Particle &m)
Definition ExptSmearingFunctions.hh:1042
double MUON_RECOIDEFF_ATLAS_RUN3_LOOSE_2022(const Particle &m)
ATLAS Run 3 Loose muon reconstruction x identification efficiency, 2022 data.
Definition ExptSmearingFunctions.hh:1162
double MUON_RECOEFF_ATLAS_RUN2(const Particle &m)
Definition ExptSmearingFunctions.hh:790
double MUON_RECOIDEFF_ATLAS_RUN3_LOOSE(const Particle &m)
ATLAS Run 3 Loose muon reconstruction x identification efficiency, all published years.
Definition ExptSmearingFunctions.hh:1248
double MUON_ISOEFF_ATLAS_RUN2_FCTIGHT(const Particle &m)
ATLAS Run 2 muon isolation efficiency, FCTight working point.
Definition ExptSmearingFunctions.hh:976
double MUON_ISOEFF_ATLAS_RUN2_PLBDTTIGHT(const Particle &m)
ATLAS Run 2 muon isolation efficiency, PLBDTTight working point.
Definition ExptSmearingFunctions.hh:997
double MUON_RECOIDEFF_ATLAS_RUN3_MEDIUM_2022(const Particle &m)
ATLAS Run 3 Medium muon reconstruction x identification efficiency, 2022 data.
Definition ExptSmearingFunctions.hh:1064
double MUON_ISOEFF_ATLAS_RUN3_PFLOWLOOSE_VARRAD(const Particle &m)
ATLAS Run 3 muon isolation efficiency, PflowLoose_VarRad working point, all published years.
Definition ExptSmearingFunctions.hh:1314
double MUON_ISOEFF_ATLAS_RUN3_PFLOWLOOSE_VARRAD_2023(const Particle &m)
ATLAS Run 3 muon isolation efficiency, PflowLoose_VarRad working point, 2023 data.
Definition ExptSmearingFunctions.hh:1276
double MUON_EFF_CMS_RUN1(const Particle &m)
CMS Run 1 muon reco efficiency.
Definition ExptSmearingFunctions.hh:1324
double MUON_EFF_CMS_RUN1_TIGHT(const Particle &m)
Definition ExptSmearingFunctions.hh:1348
double MUON_RECOIDEFF_ATLAS_RUN3_MEDIUM(const Particle &m)
ATLAS Run 3 Medium muon reconstruction x identification efficiency, all published years.
Definition ExptSmearingFunctions.hh:1148
double MUON_RECOIDEFF_ATLAS_RUN3_LOOSE_2024(const Particle &m)
ATLAS Run 3 Loose muon reconstruction x identification efficiency, 2024 data.
Definition ExptSmearingFunctions.hh:1215
double MUON_RECOIDEFF_ATLAS_RUN2_TIGHT(const Particle &m)
ATLAS Run 2 muon reconstruction x identification efficiency, Tight working point.
Definition ExptSmearingFunctions.hh:932
double MUON_RECOIDEFF_ATLAS_RUN3_MEDIUM_2023(const Particle &m)
ATLAS Run 3 Medium muon reconstruction x identification efficiency, 2023 data.
Definition ExptSmearingFunctions.hh:1090
double MUON_EFF_ATLAS_RUN1_TIGHT(const Particle &m)
Definition ExptSmearingFunctions.hh:782
double MUON_RECOIDEFF_ATLAS_RUN3_LOOSE_2023(const Particle &m)
ATLAS Run 3 Loose muon reconstruction x identification efficiency, 2023 data.
Definition ExptSmearingFunctions.hh:1189
double MUON_EFF_CMS_RUN2_MEDIUM(const Particle &m)
Definition ExptSmearingFunctions.hh:1370
double MUON_EFF_CMS_RUN1_LOOSE(const Particle &m)
Definition ExptSmearingFunctions.hh:1334
double MUON_EFF_CMS_RUN1_MEDIUM(const Particle &m)
Definition ExptSmearingFunctions.hh:1341
double MUON_EFF_ATLAS_RUN1_MEDIUM(const Particle &m)
Definition ExptSmearingFunctions.hh:776
Particle MUON_SMEAR_CMS_RUN2(const Particle &m)
Definition ExptSmearingFunctions.hh:1413
double MUON_EFF_ATLAS_RUN2_MEDIUM(const Particle &m)
ATLAS Run 2 muon reco+ID efficiency.
Definition ExptSmearingFunctions.hh:837
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:80
double JET_BTAG_IDENTITY(const Jet &j)
Alias for JET_BTAG_PERFECT.
Definition JetSmearingFunctions.hh:91
double PHOTON_EFF_CMS_RUN1_TIGHT(const Particle &y)
Definition ExptSmearingFunctions.hh:708
double PHOTON_EFF_CMS_RUN2_TIGHT(const Particle &y)
Definition ExptSmearingFunctions.hh:735
double PHOTON_EFF_CMS_RUN2_LOOSE(const Particle &y)
Definition ExptSmearingFunctions.hh:723
double PHOTON_EFF_ATLAS_RUN2_TIGHT(const Particle &y)
Definition ExptSmearingFunctions.hh:680
double PHOTON_EFF_ATLAS_RUN1_MEDIUM(const Particle &y)
Definition ExptSmearingFunctions.hh:628
Particle PHOTON_SMEAR_ATLAS_RUN1(const Particle &y)
Definition ExptSmearingFunctions.hh:741
double PHOTON_EFF_ATLAS_RUN1_TIGHT(const Particle &y)
Definition ExptSmearingFunctions.hh:634
double PHOTON_EFF_ATLAS_RUN2_LOOSE(const Particle &y)
Definition ExptSmearingFunctions.hh:668
double PHOTON_EFF_ATLAS_RUN2_MEDIUM(const Particle &y)
Definition ExptSmearingFunctions.hh:674
double PHOTON_EFF_ATLAS_RUN1(const Particle &y)
ATLAS Run 2 photon reco efficiency.
Definition ExptSmearingFunctions.hh:597
double PHOTON_EFF_CMS_RUN2_MEDIUM(const Particle &y)
Definition ExptSmearingFunctions.hh:729
double PHOTON_EFF_CMS_RUN1_LOOSE(const Particle &y)
Definition ExptSmearingFunctions.hh:696
double PHOTON_EFF_CMS_RUN2(const Particle &y)
Definition ExptSmearingFunctions.hh:716
double PHOTON_EFF_CMS_RUN1(const Particle &y)
Definition ExptSmearingFunctions.hh:688
double PHOTON_EFF_ATLAS_RUN2(const Particle &y)
ATLAS Run 2 photon identification efficiency (tight ID).
Definition ExptSmearingFunctions.hh:643
double PHOTON_EFF_ATLAS_RUN1_LOOSE(const Particle &y)
Definition ExptSmearingFunctions.hh:622
double PHOTON_EFF_CMS_RUN1_MEDIUM(const Particle &y)
Definition ExptSmearingFunctions.hh:702
double TAU_EFF_ATLAS_RUN2_LOOSE(const Particle &t)
Definition ExptSmearingFunctions.hh:1546
double TAU_EFF_ATLAS_RUN2_MEDIUM(const Particle &t)
ATLAS Run 2 13 TeV tau efficiencies (medium working point).
Definition ExptSmearingFunctions.hh:1519
double TAUJET_EFF_ATLAS_RUN1(const Jet &j)
ATLAS Run 1 8 TeV tau misID rates (medium working point).
Definition ExptSmearingFunctions.hh:1480
double TAU_EFF_ATLAS_RUN2_TIGHT(const Particle &t)
Definition ExptSmearingFunctions.hh:1552
double TAU_EFF_ATLAS_RUN1(const Particle &t)
Definition ExptSmearingFunctions.hh:1456
double TAUJET_EFF_ATLAS_RUN2_LOOSE(const Jet &j)
ATLAS Run 2 13 TeV jet tau-tag efficiency and misID rate (loose working point).
Definition ExptSmearingFunctions.hh:1593
Particle TAU_SMEAR_CMS_RUN1(const Particle &t)
Definition ExptSmearingFunctions.hh:1740
double TAU_EFF_ATLAS_RUN1_MEDIUM(const Particle &t)
ATLAS Run 1 8 TeV tau efficiencies (medium working point).
Definition ExptSmearingFunctions.hh:1430
double TAU_EFF_ATLAS_RUN1_TIGHT(const Particle &t)
Definition ExptSmearingFunctions.hh:1468
Particle TAU_SMEAR_CMS_RUN2(const Particle &t)
Definition ExptSmearingFunctions.hh:1748
double TAU_EFF_CMS_RUN2_TIGHT(const Particle &t)
Definition ExptSmearingFunctions.hh:1732
double TAU_EFF_CMS_RUN1_TIGHT(const Particle &t)
Definition ExptSmearingFunctions.hh:1706
double TAUJET_EFF_ATLAS_RUN2_TIGHT(const Jet &j)
ATLAS Run 2 13 TeV jet tau-tag efficiency and misID rate (tight working point).
Definition ExptSmearingFunctions.hh:1617
double TAU_EFF_ATLAS_RUN2(const Particle &t)
Definition ExptSmearingFunctions.hh:1540
Particle TAU_SMEAR_ATLAS_RUN1(const Particle &t)
Definition ExptSmearingFunctions.hh:1643
double TAUJET_EFF_ATLAS_RUN2(const Jet &j)
ATLAS Run 2 13 TeV jet tau-tag efficiency and misID rate (medium working point).
Definition ExptSmearingFunctions.hh:1562
double TAU_EFF_ATLAS_RUN1_LOOSE(const Particle &t)
Definition ExptSmearingFunctions.hh:1462
double TAU_EFF_CMS_RUN1_LOOSE(const Particle &t)
Definition ExptSmearingFunctions.hh:1694
double TAU_EFF_CMS_RUN2(const Particle &t)
Definition ExptSmearingFunctions.hh:1713
double TAU_EFF_CMS_RUN2_MEDIUM(const Particle &t)
Definition ExptSmearingFunctions.hh:1726
double TAU_EFF_CMS_RUN1_MEDIUM(const Particle &t)
Definition ExptSmearingFunctions.hh:1700
double TAU_EFF_CMS_RUN2_LOOSE(const Particle &t)
Definition ExptSmearingFunctions.hh:1720
double TAU_EFF_CMS_RUN1(const Particle &t)
Definition ExptSmearingFunctions.hh:1687
Particle TAU_SMEAR_ATLAS_RUN2(const Particle &t)
Definition ExptSmearingFunctions.hh:1679
double ATLAS_JVT_EFF_MEDIUM(const Jet &j)
Return the efficiency of the ATLAS JVT tagger at > 0.4 W.P.
Definition ExptSmearingFunctions.hh:2215
Particle TRK_SMEAR_CMS_RUN2(const Particle &t)
Definition ExptSmearingFunctions.hh:2184
double TRK_EFF_CMS_RUN2(const Particle &p)
Definition ExptSmearingFunctions.hh:2170
Particle TRK_SMEAR_ATLAS_RUN1(const Particle &t)
Definition ExptSmearingFunctions.hh:2118
double ATLAS_JVT_EFF_TIGHT(const Jet &j)
Return the efficiency of the ATLAS JVT tagger at > 0.7 W.P.
Definition ExptSmearingFunctions.hh:2235
double TRK_EFF_CMS_RUN1(const Particle &p)
CMS Run 1 tracking efficiency.
Definition ExptSmearingFunctions.hh:2130
double ATLAS_JVT_EFF_LOOSE(const Jet &j)
Return the efficiency of the ATLAS JVT tagger at > 0.2 W.P.
Definition ExptSmearingFunctions.hh:2195
Particle TRK_SMEAR_CMS_RUN1(const Particle &t)
Definition ExptSmearingFunctions.hh:2178
Particle TRK_SMEAR_ATLAS_RUN2(const Particle &t)
Definition ExptSmearingFunctions.hh:2124
double TRK_EFF_ATLAS_RUN1(const Particle &p)
ATLAS Run 1 tracking efficiency.
Definition ExptSmearingFunctions.hh:2070
double TRK_EFF_ATLAS_RUN2(const Particle &p)
Definition ExptSmearingFunctions.hh:2110
Definition LHCbCommon.hh:9
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.
T sum(const DressedLeptons &c, FN &&fn, const T &start=T())
Generic sum function, adding fn(x) for all x in container c, starting with start.
Definition DressedLepton.hh:66
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:152
Error specialisation for where the problem is between the chair and the computer.
Definition Exceptions.hh:75