2 #ifndef RIVET_ExptSmearingFunctions_HH 3 #define RIVET_ExptSmearingFunctions_HH 5 #include "Rivet/Tools/MomentumSmearingFunctions.hh" 6 #include "Rivet/Tools/ParticleSmearingFunctions.hh" 7 #include "Rivet/Tools/JetSmearingFunctions.hh" 21 if (e.
abspid() != PID::ELECTRON)
return 0;
22 if (e.
abseta() > 2.5)
return 0;
23 if (e.
pT() < 10*GeV)
return 0;
24 return (e.
abseta() < 1.5) ? 0.95 : 0.85;
31 if (e.
abspid() != PID::ELECTRON)
return 0;
32 const double et = e.
Et();
33 if (e.
abseta() > 2.5 || e.
Et() < 2*GeV)
return 0;
34 if (et > 25*GeV)
return 0.97;
35 if (et > 10*GeV)
return 0.92 + (et/GeV-10)/15.*0.05;
36 if (et > 6*GeV)
return 0.85 + (et/GeV-6)/4.*0.07;
37 if (et > 5*GeV)
return 0.70 + (et/GeV-5)/1.*0.15;
38 if (et > 2*GeV)
return 0.00 + (et/GeV-2)/3.*0.70;
48 if (e.
abspid() != PID::ELECTRON)
return 0;
51 const static vector<double> edges_eta = { 0.0, 0.1, 0.8, 1.37, 1.52, 2.01, 2.37, 2.47 };
52 const static vector<double> effs_eta = { 0.950, 0.965, 0.955, 0.885, 0.950, 0.935, 0.90 };
54 const static vector<double> edges_et = { 0, 10, 20, 25, 30, 35, 40, 45, 50, 60, 80 };
55 const static vector<double> effs_et = { 0.0, 0.90, 0.91, 0.92, 0.94, 0.95, 0.955, 0.965, 0.97, 0.98 };
57 if (e.
abseta() > 2.47)
return 0.0;
60 const int i_et =
binIndex(e.
Et()/GeV, edges_et,
true);
61 const double eff = effs_et[i_et] * effs_eta[i_eta] / 0.95;
68 if (e.
abspid() != PID::ELECTRON)
return 0;
70 const static vector<double> eta_edges_10 = {0.000, 0.049, 0.454, 1.107, 1.46, 1.790, 2.277, 2.500};
71 const static vector<double> eta_vals_10 = {0.730, 0.757, 0.780, 0.771, 0.77, 0.777, 0.778};
73 const static vector<double> eta_edges_15 = {0.000, 0.053, 0.456, 1.102, 1.463, 1.783, 2.263, 2.500};
74 const static vector<double> eta_vals_15 = {0.780, 0.800, 0.819, 0.759, 0.749, 0.813, 0.829};
76 const static vector<double> eta_edges_20 = {0.000, 0.065, 0.362, 0.719, 0.980, 1.289, 1.455, 1.681, 1.942, 2.239, 2.452, 2.500};
77 const static vector<double> eta_vals_20 = {0.794, 0.806, 0.816, 0.806, 0.797, 0.774, 0.764, 0.788, 0.793, 0.806, 0.825};
79 const static vector<double> eta_edges_25 = {0.000, 0.077, 0.338, 0.742, 1.004, 1.265, 1.467, 1.692, 1.940, 2.227, 2.452, 2.500};
80 const static vector<double> eta_vals_25 = {0.833, 0.843, 0.853, 0.845, 0.839, 0.804, 0.790, 0.825, 0.830, 0.833, 0.839};
82 const static vector<double> eta_edges_30 = {0.000, 0.077, 0.350, 0.707, 0.980, 1.289, 1.479, 1.681, 1.942, 2.239, 2.441, 2.500};
83 const static vector<double> eta_vals_30 = {0.863, 0.872, 0.881, 0.874, 0.870, 0.824, 0.808, 0.847, 0.845, 0.840, 0.842};
85 const static vector<double> eta_edges_35 = {0.000, 0.058, 0.344, 0.700, 1.009, 1.270, 1.458, 1.685, 1.935, 2.231, 2.468, 2.500};
86 const static vector<double> eta_vals_35 = {0.878, 0.889, 0.901, 0.895, 0.893, 0.849, 0.835, 0.868, 0.863, 0.845, 0.832};
88 const static vector<double> eta_edges_40 = {0.000, 0.047, 0.355, 0.699, 0.983, 1.280, 1.446, 1.694, 1.943, 2.227, 2.441, 2.500};
89 const static vector<double> eta_vals_40 = {0.894, 0.901, 0.909, 0.905, 0.904, 0.875, 0.868, 0.889, 0.876, 0.848, 0.827};
91 const static vector<double> eta_edges_45 = {0.000, 0.058, 0.356, 0.712, 0.997, 1.282, 1.459, 1.686, 1.935, 2.220, 2.444, 2.500};
92 const static vector<double> eta_vals_45 = {0.900, 0.911, 0.923, 0.918, 0.917, 0.897, 0.891, 0.904, 0.894, 0.843, 0.796};
94 const static vector<double> eta_edges_50 = {0.000, 0.059, 0.355, 0.711, 0.983, 1.280, 1.469, 1.682, 1.919, 2.227, 2.441, 2.500};
95 const static vector<double> eta_vals_50 = {0.903, 0.913, 0.923, 0.922, 0.923, 0.903, 0.898, 0.908, 0.895, 0.831, 0.774};
97 const static vector<double> eta_edges_60 = {0.000, 0.053, 0.351, 0.720, 1.006, 1.291, 1.469, 1.696, 1.946, 2.243, 2.455, 2.500};
98 const static vector<double> eta_vals_60 = {0.903, 0.917, 0.928, 0.924, 0.927, 0.915, 0.911, 0.915, 0.899, 0.827, 0.760};
100 const static vector<double> eta_edges_80 = {0.000, 0.053, 0.351, 0.720, 0.994, 1.292, 1.482, 1.708, 1.934, 2.220, 2.458, 2.500};
101 const static vector<double> eta_vals_80 = {0.936, 0.942, 0.952, 0.956, 0.956, 0.934, 0.931, 0.944, 0.933, 0.940, 0.948};
103 const static vector<double> et_edges = { 10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 80 };
104 const static vector< vector<double> > et_eta_edges = { eta_edges_10, eta_edges_15, eta_edges_20, eta_edges_25, eta_edges_30, eta_edges_35, eta_edges_40, eta_edges_45, eta_edges_50, eta_edges_60, eta_edges_80 };
105 const static vector< vector<double> > et_eta_vals = { eta_vals_10, eta_vals_15, eta_vals_20, eta_vals_25, eta_vals_30, eta_vals_35, eta_vals_40, eta_vals_45, eta_vals_50, eta_vals_60, eta_vals_80 };
107 if (e.
abseta() > 2.5 || e.
Et() < 10*GeV)
return 0.0;
108 const int i_et =
binIndex(e.
Et()/GeV, et_edges,
true);
117 if (e.
abspid() != PID::ELECTRON)
return 0;
124 if (e.
abspid() != PID::ELECTRON)
return 0;
126 const static vector<double> eta_edges_10 = {0.000, 0.049, 0.459, 1.100, 1.461, 1.789, 2.270, 2.500};
127 const static vector<double> eta_vals_10 = {0.581, 0.632, 0.668, 0.558, 0.548, 0.662, 0.690};
129 const static vector<double> eta_edges_15 = {0.000, 0.053, 0.450, 1.096, 1.463, 1.783, 2.269, 2.500};
130 const static vector<double> eta_vals_15 = {0.630, 0.678, 0.714, 0.633, 0.616, 0.700, 0.733};
132 const static vector<double> eta_edges_20 = {0.000, 0.065, 0.362, 0.719, 0.992, 1.277, 1.479, 1.692, 1.930, 2.227, 2.464, 2.500};
133 const static vector<double> eta_vals_20 = {0.653, 0.695, 0.735, 0.714, 0.688, 0.635, 0.625, 0.655, 0.680, 0.691, 0.674};
135 const static vector<double> eta_edges_25 = {0.000, 0.077, 0.362, 0.719, 0.992, 1.300, 1.479, 1.692, 1.942, 2.227, 2.464, 2.500};
136 const static vector<double> eta_vals_25 = {0.692, 0.732, 0.768, 0.750, 0.726, 0.677, 0.667, 0.692, 0.710, 0.706, 0.679};
138 const static vector<double> eta_edges_30 = {0.000, 0.053, 0.362, 0.719, 1.004, 1.277, 1.467, 1.681, 1.954, 2.239, 2.452, 2.500};
139 const static vector<double> eta_vals_30 = {0.724, 0.763, 0.804, 0.789, 0.762, 0.702, 0.690, 0.720, 0.731, 0.714, 0.681};
141 const static vector<double> eta_edges_35 = {0.000, 0.044, 0.342, 0.711, 0.971, 1.280, 1.456, 1.683, 1.944, 2.218, 2.442, 2.500};
142 const static vector<double> eta_vals_35 = {0.736, 0.778, 0.824, 0.811, 0.784, 0.730, 0.718, 0.739, 0.743, 0.718, 0.678};
144 const static vector<double> eta_edges_40 = {0.000, 0.047, 0.355, 0.699, 0.983, 1.268, 1.457, 1.671, 1.931, 2.204, 2.453, 2.500};
145 const static vector<double> eta_vals_40 = {0.741, 0.774, 0.823, 0.823, 0.802, 0.764, 0.756, 0.771, 0.771, 0.734, 0.684};
147 const static vector<double> eta_edges_45 = {0.000, 0.056, 0.354, 0.711, 0.984, 1.280, 1.458, 1.684, 1.945, 2.207, 2.442, 2.500};
148 const static vector<double> eta_vals_45 = {0.758, 0.792, 0.841, 0.841, 0.823, 0.792, 0.786, 0.796, 0.794, 0.734, 0.663};
150 const static vector<double> eta_edges_50 = {0.000, 0.059, 0.355, 0.699, 0.983, 1.268, 1.446, 1.682, 1.943, 2.216, 2.453, 2.500};
151 const static vector<double> eta_vals_50 = {0.771, 0.806, 0.855, 0.858, 0.843, 0.810, 0.800, 0.808, 0.802, 0.730, 0.653};
153 const static vector<double> eta_edges_60 = {0.000, 0.050, 0.350, 0.707, 0.981, 1.278, 1.468, 1.694, 1.944, 2.242, 2.453, 2.500};
154 const static vector<double> eta_vals_60 = {0.773, 0.816, 0.866, 0.865, 0.853, 0.820, 0.812, 0.817, 0.804, 0.726, 0.645};
156 const static vector<double> eta_edges_80 = {0.000, 0.051, 0.374, 0.720, 0.981, 1.279, 1.468, 1.707, 1.945, 2.207, 2.457, 2.500};
157 const static vector<double> eta_vals_80 = {0.819, 0.855, 0.899, 0.906, 0.900, 0.869, 0.865, 0.873, 0.869, 0.868, 0.859};
159 const static vector<double> et_edges = { 10, 15, 20, 25, 30, 35, 40, 45, 50, 60, 80 };
160 const static vector< vector<double> > et_eta_edges = { eta_edges_10, eta_edges_15, eta_edges_20, eta_edges_25, eta_edges_30, eta_edges_35, eta_edges_40, eta_edges_45, eta_edges_50, eta_edges_60, eta_edges_80 };
161 const static vector< vector<double> > et_eta_vals = { eta_vals_10, eta_vals_15, eta_vals_20, eta_vals_25, eta_vals_30, eta_vals_35, eta_vals_40, eta_vals_45, eta_vals_50, eta_vals_60, eta_vals_80 };
163 if (e.
abseta() > 2.5 || e.
Et() < 10*GeV)
return 0.0;
164 const int i_et =
binIndex(e.
Et()/GeV, et_edges,
true);
173 if (e.
abspid() != PID::ELECTRON)
return 0;
174 const static vector<double> et_edges = { 20, 25, 30, 35, 40, 45, 50, 60, 80 };
175 const static vector<double> et_effs = { 0.785, 0.805, 0.820, 0.830, 0.840, 0.850, 0.875, 0.910 };
176 const static vector<double> eta_edges = {0.000, 0.051, 0.374, 0.720, 0.981, 1.279, 1.468, 1.707, 1.945, 2.207, 2.457, 2.500};
177 const static vector<double> eta_refs = {0.819, 0.855, 0.899, 0.906, 0.900, 0.869, 0.865, 0.873, 0.869, 0.868, 0.859};
178 if (e.
abseta() > 2.5 || e.
Et() < 20*GeV)
return 0.0;
179 const int i_et =
binIndex(e.
Et()/GeV, et_edges,
true);
181 const double eff_et = et_effs[i_et];
192 static const vector<double> edges_eta = {0., 2.5, 3.};
193 static const vector<double> edges_pt = {0., 0.1, 25.};
194 static const vector<double> e2s = {0.000, 0.015, 0.005,
196 0.107, 0.107, 0.107};
197 static const vector<double> es = {0.00, 0.00, 0.05,
200 static const vector<double> cs = {0.00, 0.00, 0.25,
205 const int i_pt =
binIndex(e.
pT()/GeV, edges_pt,
true);
206 const int i = i_eta*edges_pt.size() + i_pt;
209 const double c1 =
sqr(e2s[i]), c2 =
sqr(es[i]), c3 =
sqr(cs[i]);
210 const double resolution = sqrt(c1*e.
E2() + c2*e.
E() + c3) * GeV;
233 if (e.
abspid() != PID::ELECTRON)
return 0;
234 if (e.
abseta() > 2.5)
return 0;
235 if (e.
pT() < 10*GeV)
return 0;
236 return (e.
abseta() < 1.5) ? 0.95 : 0.85;
243 if (e.
abspid() != PID::ELECTRON)
return 0;
256 double resolution = 0;
257 const double abseta = e.
abseta();
258 if (e.
pT() > 0.1*GeV && abseta < 2.5) {
260 resolution =
add_quad(0.06, 1.3e-3 * e.
pT()/GeV) * GeV;
261 }
else if (abseta < 1.5) {
262 resolution =
add_quad(0.10, 1.7e-3 * e.
pT()/GeV) * GeV;
264 resolution =
add_quad(0.25, 3.1e-3 * e.
pT()/GeV) * GeV;
292 if (y.
abspid() != PID::PHOTON)
return 0;
294 if (y.
pT() < 10*GeV)
return 0;
297 static const vector<double> edges_eta = {0., 0.6, 1.37, 1.52, 1.81, 2.37};
298 static const vector<double> edges_pt = {10., 15., 20., 25., 30., 35., 40., 45.,
299 50., 60., 80., 100., 125., 150., 175., 250.};
300 static const vector<double> effs = {0.53, 0.65, 0.73, 0.83, 0.86, 0.93, 0.94, 0.96,
301 0.97, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98,
302 0.45, 0.57, 0.67, 0.74, 0.84, 0.87, 0.93, 0.94,
303 0.95, 0.96, 0.97, 0.98, 0.98, 0.99, 0.99, 0.99,
304 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00,
305 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00,
306 0.48, 0.56, 0.68, 0.76, 0.86, 0.90, 0.93, 0.95,
307 0.96, 0.97, 0.98, 0.99, 0.99, 1.00, 1.00, 1.00,
308 0.50, 0.61, 0.74, 0.82, 0.88, 0.92, 0.94, 0.95,
309 0.96, 0.97, 0.98, 0.98, 0.98, 0.98, 0.99, 0.99};
312 const int i_pt =
binIndex(y.
pT()/GeV, edges_pt,
true);
313 const int i = i_eta*edges_pt.size() + i_pt;
314 const double eff = effs[i];
322 if (y.
abspid() != PID::PHOTON)
return 0;
324 if (y.
pT() < 10*GeV)
return 0;
327 static const vector<double> edges_eta = {0., 0.6, 1.37, 1.52, 1.81, 2.37};
328 static const vector<double> edges_pt = {10., 15., 20., 25., 30., 35., 40., 45.,
329 50., 60., 80., 100., 125., 150., 175., 250.};
330 static const vector<double> effs = {0.55, 0.70, 0.85, 0.89, 0.93, 0.95, 0.96, 0.96,
331 0.97, 0.97, 0.98, 0.97, 0.97, 0.97, 0.97, 0.97,
332 0.47, 0.66, 0.79, 0.86, 0.89, 0.94, 0.96, 0.97,
333 0.97, 0.98, 0.97, 0.98, 0.98, 0.98, 0.98, 0.98,
334 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00,
335 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00,
336 0.54, 0.71, 0.84, 0.88, 0.92, 0.93, 0.94, 0.95,
337 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96, 0.96,
338 0.61, 0.74, 0.83, 0.88, 0.91, 0.94, 0.95, 0.96,
339 0.97, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98, 0.98};
342 const int i_pt =
binIndex(y.
pT()/GeV, edges_pt,
true);
343 const int i = i_eta*edges_pt.size() + i_pt;
344 const double eff = effs[i];
351 if (y.
abspid() != PID::PHOTON)
return 0;
352 if (y.
pT() < 10*GeV || y.
abseta() > 2.5)
return 0;
353 return (y.
abseta() < 1.5) ? 0.95 : 0.85;
359 if (y.
abspid() != PID::PHOTON)
return 0;
379 if (m.
abspid() != PID::MUON)
return 0;
380 if (m.
abseta() > 2.7)
return 0;
381 if (m.
pT() < 10*GeV)
return 0;
382 return (m.
abseta() < 1.5) ? 0.95 : 0.85;
389 if (m.
abspid() != PID::MUON)
return 0;
390 if (m.
abseta() > 2.5)
return 0;
391 if (m.
abseta() < 0.1)
return 0.61;
393 return (m.
abseta() < 1) ? 0.98 : 0.99;
401 if (m.
abspid() != PID::MUON)
return 0;
402 if (m.
abseta() > 2.7)
return 0;
403 static const vector<double> edges_pt = {0., 3.5, 4., 5., 6., 7., 8., 10.};
404 static const vector<double> effs = {0.00, 0.76, 0.94, 0.97, 0.98, 0.98, 0.98, 0.99};
405 const int i_pt =
binIndex(m.
pT()/GeV, edges_pt,
true);
416 static const vector<double> edges_eta = {0, 1.5, 2.5};
417 static const vector<double> edges_pt = {0, 0.1, 1.0, 10., 200.};
418 static const vector<double> res = {0., 0.03, 0.02, 0.03, 0.05,
419 0., 0.04, 0.03, 0.04, 0.05};
422 const int i_pt =
binIndex(m.
pT()/GeV, edges_pt,
true);
423 const int i = i_eta*edges_pt.size() + i_pt;
425 const double resolution = res[i];
438 double mres_pt = 0.015;
439 if (m.
pT() > 50*GeV) mres_pt = 0.014 + 0.01*(m.
pT()/GeV-50)/50;
440 if (m.
pT() > 100*GeV) mres_pt = 0.025;
441 const double ptres_pt =
SQRT2 * mres_pt;
442 const double resolution = (m.
abseta() < 1.5 ? 1.0 : 1.25) * ptres_pt;
450 if (m.
abspid() != PID::MUON)
return 0;
451 if (m.
abseta() > 2.4)
return 0;
452 if (m.
pT() < 10*GeV)
return 0;
453 return 0.95 * (m.
abseta() < 1.5 ? 1 : exp(0.5 - 5e-4*m.
pT()/GeV));
459 if (m.
abspid() != PID::MUON)
return 0;
470 double resolution = 0;
471 const double abseta = m.
abseta();
472 if (m.
pT() > 0.1*GeV && abseta < 2.5) {
474 resolution =
add_quad(0.01, 2.0e-4 * m.
pT()/GeV);
475 }
else if (abseta < 1.5) {
476 resolution =
add_quad(0.02, 3.0e-4 * m.
pT()/GeV);
478 resolution =
add_quad(0.05, 2.6e-4 * m.
pT()/GeV);
511 if (t.
abseta() > 2.5)
return 0;
514 Particles chargedhadrons;
518 if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1*GeV) chargedhadrons += p;
521 if (chargedhadrons.empty())
return 0;
522 if (pThadvis < 20*GeV)
return 0;
523 if (pThadvis < 40*GeV) {
524 if (chargedhadrons.size() == 1)
return (t.
abspid() == PID::TAU) ? 0.56 : 0;
525 if (chargedhadrons.size() == 3)
return (t.
abspid() == PID::TAU) ? 0.38 : 0;
527 if (chargedhadrons.size() == 1)
return (t.
abspid() == PID::TAU) ? 0.56 : 0;
528 if (chargedhadrons.size() == 3)
return (t.
abspid() == PID::TAU) ? 0.38 : 0;
541 if (j.
abseta() > 2.5)
return 0;
544 Particles chargedhadrons;
548 if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1*GeV) chargedhadrons += p;
551 if (chargedhadrons.empty())
return 0;
552 if (pThadvis < 20*GeV)
return 0;
553 const Particles ttags = j.
tauTags(Cuts::pT > 10*GeV);
555 if (pThadvis < 40*GeV)
556 return chargedhadrons.size() == 1 ? 1/20. : chargedhadrons.size() == 3 ? 1/100. : 0;
558 return chargedhadrons.size() == 1 ? 1/25. : chargedhadrons.size() == 3 ? 1/400. : 0;
560 const Particles prongs = ttags[0].stableDescendants(Cuts::charge3 > 0 && Cuts::pT > 1*GeV && Cuts::abseta < 2.5);
561 return prongs.size() == 1 ? 0.56 : 0.38;
571 if (t.
abspid() != PID::TAU)
return 0;
572 if (t.
abseta() > 2.5)
return 0;
575 Particles chargedhadrons;
579 if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1*GeV) chargedhadrons += p;
582 if (chargedhadrons.empty())
return 0;
583 if (pThadvis < 20*GeV)
return 0;
584 if (chargedhadrons.size() == 1)
return (t.
abspid() == PID::TAU) ? 0.55 : 0;
585 if (chargedhadrons.size() == 3)
return (t.
abspid() == PID::TAU) ? 0.40 : 0;
595 if (j.
abseta() > 2.5)
return 0;
598 Particles chargedhadrons;
602 if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1*GeV) chargedhadrons += p;
605 if (chargedhadrons.empty())
return 0;
606 if (pThadvis < 20*GeV)
return 0;
607 const Particles ttags = j.
tauTags(Cuts::pT > 10*GeV);
614 if (ttags.empty())
return chargedhadrons.size() == 1 ? 1/50. : chargedhadrons.size() == 3 ? 1/110. : 0;
615 const Particles prongs = ttags[0].stableDescendants(Cuts::charge3 > 0 && Cuts::pT > 1*GeV && Cuts::abseta < 2.5);
616 return prongs.size() == 1 ? 0.55 : 0.40;
637 static const vector<double> binedges_pt = {0., 50., 70., 100., 150., 200., 1000., 10000.};
638 static const vector<double> jer = {0.145, 0.115, 0.095, 0.075, 0.07, 0.05, 0.04, 0.04};
639 const int ipt =
binIndex(t.
pT()/GeV, binedges_pt,
true);
640 if (ipt < 0)
return t;
641 const double resolution = jer.at(ipt);
645 const double fsmear =
max(
randnorm(1., resolution), 0.);
646 const double mass = t.
mass2() > 0 ? t.
mass() : 0;
664 if (t.
abspid() != PID::TAU)
return 0;
665 return (t.
abspid() == PID::TAU) ? 0.6 : 0;
672 if (t.
abspid() != PID::TAU)
return 0;
673 return (t.
abspid() == PID::TAU) ? 0.6 : 0;
700 if (j.
abseta() > 2.5)
return 0;
701 const auto ftagsel = [&](
const Particle& p){
return p.pT() > 5*GeV &&
deltaR(p,j) < 0.3; };
702 if (j.
bTagged(ftagsel))
return 0.80*tanh(0.003*j.
pT()/GeV)*(30/(1+0.0860*j.
pT()/GeV));
703 if (j.
cTagged(ftagsel))
return 0.20*tanh(0.020*j.
pT()/GeV)*( 1/(1+0.0034*j.
pT()/GeV));
704 return 0.002 + 7.3e-6*j.
pT()/GeV;
709 if (j.
abseta() > 2.5)
return 0;
710 if (j.
bTagged(Cuts::pT > 5*GeV))
return 0.77;
711 if (j.
cTagged(Cuts::pT > 5*GeV))
return 1/4.5;
717 if (j.
abseta() > 2.5)
return 0;
718 if (j.
bTagged(Cuts::pT > 5*GeV))
return 0.77;
719 if (j.
cTagged(Cuts::pT > 5*GeV))
return 1/6.0;
731 static const vector<double> binedges_pt = {0., 50., 70., 100., 150., 200., 1000., 10000.};
732 static const vector<double> jer = {0.145, 0.115, 0.095, 0.075, 0.07, 0.05, 0.04, 0.04};
733 const int ipt =
binIndex(j.
pT()/GeV, binedges_pt,
true);
734 if (ipt < 0)
return j;
735 const double resolution = jer.at(ipt);
739 const double fsmear =
max(
randnorm(1., resolution), 0.);
740 const double mass = j.
mass2() > 0 ? j.
mass() : 0;
770 inline Vector3 MET_SMEAR_IDENTITY(
const Vector3& met,
double) {
return met; }
779 if (met.
mod() < 25*GeV) smeared_met *= 1.05;
780 else if (met.
mod() < 40*GeV) smeared_met *= (1.05 - (0.04/15)*(met.
mod()/GeV - 25));
781 else smeared_met *= 1.01;
784 const double resolution = 0.45 * sqrt(
set/GeV) * GeV;
786 const double metsmear = fabs(
randnorm(smeared_met.
mod(), resolution));
787 smeared_met = metsmear * smeared_met.
unit();
799 if (met.
mod() < 25*GeV) smeared_met *= 1.5;
800 else smeared_met *= (1 + exp(-(met.
mod() - 25*GeV)/(10*GeV)) - 0.02);
804 const double resolution1 = (
set < 180*GeV ?
set/180. : 1) * 0.45 * sqrt(
max(
set/GeV, 180)) * GeV;
808 const double resolution2 = 15*GeV + 0.5*sqrt(met.
mod()/GeV)*GeV;
812 const double resolution =
min(resolution1, resolution2);
814 const double metsmear = fabs(
randnorm(smeared_met.
mod(), resolution));
815 smeared_met = metsmear * smeared_met.
unit();
826 const double resolution_x = (1.1 + 0.6*sqrt(
set/GeV)) * GeV;
827 const double resolution_y = (1.4 + 0.6*sqrt(
set/GeV)) * GeV;
828 const double resolution = sqrt(
sqr(resolution_x) +
sqr(resolution_y));
832 const double metsmear = fabs(
randnorm(smeared_met.
mod(), resolution));
833 smeared_met = metsmear * smeared_met.
unit();
844 const double resolution_para = ( 2.0 + 0.64*sqrt(
set/GeV)) * GeV;
845 const double resolution_perp = (-1.5 + 0.68*sqrt(
set/GeV)) * GeV;
846 const double resolution = sqrt(
sqr(resolution_para) +
sqr(resolution_perp));
850 const double metsmear = fabs(
randnorm(smeared_met.
mod(), resolution));
851 smeared_met = metsmear * smeared_met.
unit();
864 if (p.
charge3() == 0)
return 0;
865 if (p.
abseta() > 2.5)
return 0;
866 if (p.
pT() < 0.1*GeV)
return 0;
868 if (p.
abspid() == PID::ELECTRON) {
870 if (p.
pT() < 1*GeV)
return 0.73;
871 if (p.
pT() < 100*GeV)
return 0.95;
874 if (p.
pT() < 1*GeV)
return 0.50;
875 if (p.
pT() < 100*GeV)
return 0.83;
878 }
else if (p.
abspid() == PID::MUON) {
880 return (p.
pT() < 1*GeV) ? 0.75 : 0.99;
882 return (p.
pT() < 1*GeV) ? 0.70 : 0.98;
886 return (p.
pT() < 1*GeV) ? 0.70 : 0.95;
888 return (p.
pT() < 1*GeV) ? 0.60 : 0.85;
902 if (p.
charge3() == 0)
return 0;
903 if (p.
abseta() > 2.5)
return 0;
904 if (p.
pT() < 0.1*GeV)
return 0;
906 if (p.
abspid() == PID::ELECTRON) {
908 if (p.
pT() < 1*GeV)
return 0.73;
909 if (p.
pT() < 100*GeV)
return 0.95;
912 if (p.
pT() < 1*GeV)
return 0.50;
913 if (p.
pT() < 100*GeV)
return 0.83;
916 }
else if (p.
abspid() == PID::MUON) {
918 return (p.
pT() < 1*GeV) ? 0.75 : 0.99;
920 return (p.
pT() < 1*GeV) ? 0.70 : 0.98;
924 return (p.
pT() < 1*GeV) ? 0.70 : 0.95;
926 return (p.
pT() < 1*GeV) ? 0.60 : 0.85;
Definition: MC_Cent_pPb.hh:10
Particle ELECTRON_SMEAR_ATLAS_RUN2(const Particle &e)
Definition: ExptSmearingFunctions.hh:222
Particle TAU_SMEAR_ATLAS_RUN2(const Particle &t)
Definition: ExptSmearingFunctions.hh:655
std::enable_if< std::is_arithmetic< NUM1 >::value &&std::is_arithmetic< NUM2 >::value, int >::type 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:416
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:698
double pz() const
z component of momentum.
Definition: ParticleBase.hh:124
bool bTagged(const Cut &c=Cuts::open()) const
Does this jet have at least one b-tag (that passes an optional Cut)?
Definition: Jet.hh:110
Particle MUON_SMEAR_CMS_RUN1(const Particle &m)
CMS Run 1 muon reco smearing.
Definition: ExptSmearingFunctions.hh:465
double abseta() const
Get the directly (alias).
Definition: ParticleBase.hh:91
std::enable_if< std::is_arithmetic< N1 >::value &&std::is_arithmetic< N2 >::value, typename std::common_type< N1, N2 >::type >::type min(N1 a, N2 b)
Get the minimum of two numbers.
Definition: MathUtils.hh:102
double PHOTON_EFF_ATLAS_RUN2(const Particle &y)
ATLAS Run 2 photon reco efficiency.
Definition: ExptSmearingFunctions.hh:321
double ELECTRON_EFF_ATLAS_RUN2_LOOSE(const Particle &e)
ATLAS Run 2 'loose' electron reco+identification efficiency.
Definition: ExptSmearingFunctions.hh:47
double TRK_EFF_ATLAS_RUN1(const Particle &p)
ATLAS Run 1 tracking efficiency.
Definition: ExptSmearingFunctions.hh:863
Particle MUON_SMEAR_CMS_RUN2(const Particle &m)
Definition: ExptSmearingFunctions.hh:492
Particles & particles()
Get the particles in this jet.
Definition: Jet.hh:47
Vector3 MET_SMEAR_ATLAS_RUN2(const Vector3 &met, double set)
Definition: ExptSmearingFunctions.hh:795
double ELECTRON_RECOEFF_ATLAS_RUN1(const Particle &e)
Definition: ExptSmearingFunctions.hh:20
std::enable_if< std::is_arithmetic< NUM >::value, NUM >::type add_quad(NUM a, NUM b)
Named number-type addition in quadrature operation.
Definition: MathUtils.hh:231
PdgId pid() const
This Particle's PDG ID code.
Definition: Particle.hh:162
double E2() const
Get the energy-squared.
Definition: ParticleBase.hh:56
double TAUJET_EFF_ATLAS_RUN2(const Jet &j)
ATLAS Run 2 13 TeV tau misID rate (medium working point)
Definition: ExptSmearingFunctions.hh:594
Particles children(const Cut &c=Cuts::OPEN) const
Get a list of the direct descendants from the current particle (with optional selection Cut) ...
Particle representation, either from a HepMC::GenEvent or reconstructed.
Definition: Particle.hh:18
double mass2() const
Get the mass**2 directly.
Definition: ParticleBase.hh:82
Particle TAU_SMEAR_ATLAS_RUN1(const Particle &t)
Definition: ExptSmearingFunctions.hh:622
double TAU_EFF_CMS_RUN2(const Particle &t)
Definition: ExptSmearingFunctions.hh:671
double PHOTON_EFF_CMS_RUN1(const Particle &y)
Definition: ExptSmearingFunctions.hh:350
double MUON_EFF_ATLAS_RUN1(const Particle &m)
ATLAS Run 1 muon reco efficiency.
Definition: ExptSmearingFunctions.hh:378
Particle PHOTON_SMEAR_ATLAS_RUN1(const Particle &y)
Definition: ExptSmearingFunctions.hh:365
double mass() const
Get the mass directly.
Definition: ParticleBase.hh:80
double ELECTRON_EFF_CMS_RUN2(const Particle &e)
Definition: ExptSmearingFunctions.hh:242
double ELECTRON_EFF_ATLAS_RUN1_MEDIUM(const Particle &e)
ATLAS Run 1 'medium' electron reco+identification efficiency.
Definition: ExptSmearingFunctions.hh:67
double E() const
Get the energy directly.
Definition: ParticleBase.hh:51
Vector3 MET_SMEAR_CMS_RUN1(const Vector3 &met, double set)
Definition: ExptSmearingFunctions.hh:822
double TRK_EFF_CMS_RUN1(const Particle &p)
CMS Run 1 tracking efficiency.
Definition: ExptSmearingFunctions.hh:901
double TAU_EFF_ATLAS_RUN1(const Particle &t)
ATLAS Run 1 8 TeV tau efficiencies (medium working point)
Definition: ExptSmearingFunctions.hh:510
Particle ELECTRON_SMEAR_CMS_RUN2(const Particle &e)
Definition: ExptSmearingFunctions.hh:277
Jet JET_SMEAR_CMS_RUN1(const Jet &j)
Definition: ExptSmearingFunctions.hh:754
Jet JET_SMEAR_ATLAS_RUN2(const Jet &j)
Definition: ExptSmearingFunctions.hh:748
std::enable_if< std::is_arithmetic< N1 >::value &&std::is_arithmetic< N2 >::value, typename std::common_type< N1, N2 >::type >::type max(N1 a, N2 b)
Get the maximum of two numbers.
Definition: MathUtils.hh:111
double ELECTRON_EFF_ATLAS_RUN2_TIGHT(const Particle &e)
ATLAS Run 2 'tight' electron reco+identification efficiency.
Definition: ExptSmearingFunctions.hh:172
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:708
double Et() const
Get the directly.
Definition: ParticleBase.hh:75
double ELECTRON_EFF_ATLAS_RUN2_MEDIUM(const Particle &e)
ATLAS Run 2 'medium' electron reco+identification efficiency.
Definition: ExptSmearingFunctions.hh:116
double MUON_EFF_CMS_RUN1(const Particle &m)
CMS Run 1 muon reco efficiency.
Definition: ExptSmearingFunctions.hh:449
Particles tauTags(const Cut &c=Cuts::open()) const
Tau particles which have been tag-matched to this jet (and pass an optional Cut)
FourMomentum P4_SMEAR_E_GAUSS(const FourMomentum &p, double resolution)
Definition: MomentumSmearingFunctions.hh:49
double TRK_EFF_ATLAS_RUN2(const Particle &p)
Definition: ExptSmearingFunctions.hh:895
double PHOTON_EFF_ATLAS_RUN1(const Particle &y)
ATLAS Run 2 photon reco efficiency.
Definition: ExptSmearingFunctions.hh:291
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:56
std::enable_if< std::is_arithmetic< N1 >::value &&std::is_arithmetic< N2 >::value &&std::is_arithmetic< N3 >::value, bool >::type 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:133
double pT() const
Get the directly (alias).
Definition: ParticleBase.hh:63
double MUON_RECOEFF_ATLAS_RUN2(const Particle &m)
Definition: ExptSmearingFunctions.hh:388
double TAU_EFF_CMS_RUN1(const Particle &t)
Definition: ExptSmearingFunctions.hh:663
double deltaR(double rap1, double phi1, double rap2, double phi2)
Definition: MathUtils.hh:659
int charge3() const
Three times the charge of this Particle (i.e. integer multiple of smallest quark charge).
Definition: Particle.hh:179
double TAU_EFF_ATLAS_RUN2(const Particle &t)
ATLAS Run 2 13 TeV tau efficiencies (medium working point)
Definition: ExptSmearingFunctions.hh:570
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:716
double ELECTRON_RECOEFF_ATLAS_RUN2(const Particle &e)
Definition: ExptSmearingFunctions.hh:30
double MUON_EFF_ATLAS_RUN2(const Particle &m)
ATLAS Run 2 muon reco+ID efficiency.
Definition: ExptSmearingFunctions.hh:400
Particle TAU_SMEAR_CMS_RUN2(const Particle &t)
Definition: ExptSmearingFunctions.hh:686
Vector3 unit() const
Synonym for unitVec.
Definition: Vector3.hh:105
double MUON_EFF_CMS_RUN2(const Particle &m)
Definition: ExptSmearingFunctions.hh:458
Particle ELECTRON_SMEAR_CMS_RUN1(const Particle &e)
CMS electron energy smearing, preserving direction.
Definition: ExptSmearingFunctions.hh:254
Jet JET_SMEAR_CMS_RUN2(const Jet &j)
Definition: ExptSmearingFunctions.hh:760
Particle TAU_SMEAR_CMS_RUN1(const Particle &t)
Definition: ExptSmearingFunctions.hh:679
double ELECTRON_EFF_CMS_RUN1(const Particle &e)
CMS Run 1 electron reconstruction efficiency.
Definition: ExptSmearingFunctions.hh:232
double TAUJET_EFF_ATLAS_RUN1(const Jet &j)
ATLAS Run 1 8 TeV tau misID rates (medium working point)
Definition: ExptSmearingFunctions.hh:540
double px() const
x component of momentum.
Definition: ParticleBase.hh:120
double TRK_EFF_CMS_RUN2(const Particle &p)
Definition: ExptSmearingFunctions.hh:933
Representation of a clustered jet of particles.
Definition: Jet.hh:18
Jet JET_SMEAR_ATLAS_RUN1(const Jet &j)
ATLAS Run 1 jet smearing.
Definition: ExptSmearingFunctions.hh:725
PdgId abspid() const
Absolute value of the PDG ID code.
Definition: Particle.hh:164
Three-dimensional specialisation of Vector.
Definition: Vector3.hh:26
Particle ELECTRON_SMEAR_ATLAS_RUN1(const Particle &e)
ATLAS Run 1 electron reco smearing.
Definition: ExptSmearingFunctions.hh:191
static const double SQRT2
A pre-defined value of .
Definition: MathConstants.hh:22
double PHOTON_EFF_CMS_RUN2(const Particle &y)
Definition: ExptSmearingFunctions.hh:358
Vector3 MET_SMEAR_CMS_RUN2(const Vector3 &met, double set)
Definition: ExptSmearingFunctions.hh:840
bool cTagged(const Cut &c=Cuts::open()) const
Does this jet have at least one c-tag (that passes an optional Cut)?
Definition: Jet.hh:123
static FourMomentum mkXYZM(double px, double py, double pz, double mass)
Make a vector from (px,py,pz) coordinates and the mass.
Definition: Vector4.hh:773
Particle MUON_SMEAR_ATLAS_RUN1(const Particle &m)
ATLAS Run 1 muon reco smearing.
Definition: ExptSmearingFunctions.hh:415
std::enable_if< std::is_arithmetic< NUM >::value, NUM >::type sqr(NUM a)
Named number-type squaring operation.
Definition: MathUtils.hh:219
double mod() const
Calculate the modulus of a vector. .
Definition: VectorN.hh:95
double py() const
y component of momentum.
Definition: ParticleBase.hh:122
Particle MUON_SMEAR_ATLAS_RUN2(const Particle &m)
Definition: ExptSmearingFunctions.hh:437
double ELECTRON_EFF_ATLAS_RUN1_TIGHT(const Particle &e)
ATLAS Run 1 'tight' electron reco+identification efficiency.
Definition: ExptSmearingFunctions.hh:123
Vector3 MET_SMEAR_ATLAS_RUN1(const Vector3 &met, double set)
ATLAS Run 1 ETmiss smearing.
Definition: ExptSmearingFunctions.hh:775
double randnorm(double loc, double scale)
Return a random number sampled from a Gaussian/normal distribution.