Rivet  3.1.0
SmearingFunctions.hh
1 // -*- C++ -*-
2 #ifndef RIVET_SmearingFunctions_HH
3 #define RIVET_SmearingFunctions_HH
4 
5 #include "Rivet/Tools/MomentumSmearingFunctions.hh"
6 #include "Rivet/Tools/ParticleSmearingFunctions.hh"
7 #include "Rivet/Tools/JetSmearingFunctions.hh"
8 
9 namespace Rivet {
10 
11 
14 
17 
20  inline double ELECTRON_RECOEFF_ATLAS_RUN1(const Particle& e) {
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;
25  }
26 
30  inline double ELECTRON_RECOEFF_ATLAS_RUN2(const Particle& e) {
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;
39  return 0;
40  }
41 
42 
47  inline double ELECTRON_EFF_ATLAS_RUN2_LOOSE(const Particle& e) {
48  if (e.abspid() != PID::ELECTRON) return 0;
49 
50  // Manually symmetrised eta eff histogram
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 };
53  // Et eff histogram (10-20 is a guess)
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 };
56 
57  if (e.abseta() > 2.47) return 0.0; // no ID outside the tracker
58 
59  const int i_eta = binIndex(e.abseta(), edges_eta);
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; //< norm factor as approximate double differential
62  return min(eff, 1.0) * ELECTRON_RECOEFF_ATLAS_RUN2(e);
63  }
64 
65 
67  inline double ELECTRON_EFF_ATLAS_RUN1_MEDIUM(const Particle& e) {
68  if (e.abspid() != PID::ELECTRON) return 0;
69 
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};
72 
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};
75 
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};
78 
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};
81 
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};
84 
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};
87 
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};
90 
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};
93 
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};
96 
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};
99 
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};
102 
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 };
106 
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);
109  const int i_eta = binIndex(e.abseta(), et_eta_edges[i_et]);
110  return et_eta_vals[i_et][i_eta] * ELECTRON_RECOEFF_ATLAS_RUN1(e);
111  }
112 
116  inline double ELECTRON_EFF_ATLAS_RUN2_MEDIUM(const Particle& e) {
117  if (e.abspid() != PID::ELECTRON) return 0;
118  return 1.01 * ELECTRON_EFF_ATLAS_RUN1_MEDIUM(e);
119  }
120 
121 
123  inline double ELECTRON_EFF_ATLAS_RUN1_TIGHT(const Particle& e) {
124  if (e.abspid() != PID::ELECTRON) return 0;
125 
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};
128 
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};
131 
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};
134 
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};
137 
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};
140 
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};
143 
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};
146 
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};
149 
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};
152 
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};
155 
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};
158 
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 };
162 
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);
165  const int i_eta = binIndex(e.abseta(), et_eta_edges[i_et]);
166  return et_eta_vals[i_et][i_eta] * ELECTRON_RECOEFF_ATLAS_RUN1(e);
167  }
168 
172  inline double ELECTRON_EFF_ATLAS_RUN2_TIGHT(const Particle& e) {
173  if (e.abspid() != PID::ELECTRON) return 0;
174  const static vector<double> et_edges = { /* 10, 15, */ 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}; // from ET > 80 bin
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);
180  const int i_eta = binIndex(e.abseta(), eta_edges);
181  const double eff_et = et_effs[i_et]; //< integral eff
182  // Scale to |eta| shape, following the ~85% efficient high-ET bin from Run 1
183  const double eff = eff_et * (eta_refs[i_eta]/0.85) * ELECTRON_RECOEFF_ATLAS_RUN2(e);
184  //return ELECTRON_IDEFF_ATLAS_RUN1_TIGHT(e);
185  return eff;
186  }
187 
188 
189 
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,
195  0.005, 0.005, 0.005,
196  0.107, 0.107, 0.107};
197  static const vector<double> es = {0.00, 0.00, 0.05,
198  0.05, 0.05, 0.05,
199  2.08, 2.08, 2.08};
200  static const vector<double> cs = {0.00, 0.00, 0.25,
201  0.25, 0.25, 0.25,
202  0.00, 0.00, 0.00};
203 
204  const int i_eta = binIndex(e.abseta(), edges_eta, true);
205  const int i_pt = binIndex(e.pT()/GeV, edges_pt, true);
206  const int i = i_eta*edges_pt.size() + i_pt;
207 
208  // Calculate absolute resolution in GeV
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;
211 
212  // normal_distribution<> d(e.E(), resolution);
213  // const double mass = e.mass2() > 0 ? e.mass() : 0; //< numerical carefulness...
214  // const double smeared_E = max(d(gen), mass); //< can't let the energy go below the mass!
215  // return Particle(e.pid(), FourMomentum::mkEtaPhiME(e.eta(), e.phi(), mass, smeared_E));
216  return Particle(e.pid(), P4_SMEAR_E_GAUSS(e, resolution));
217  }
218 
219 
223  return ELECTRON_SMEAR_ATLAS_RUN1(e);
224  }
225 
226 
228 
229 
230 
232  inline double ELECTRON_EFF_CMS_RUN1(const Particle& e) {
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;
237  }
238 
239 
242  inline double ELECTRON_EFF_CMS_RUN2(const Particle& e) {
243  if (e.abspid() != PID::ELECTRON) return 0;
244  return ELECTRON_EFF_CMS_RUN1(e);
245  }
246 
247 
255  // Calculate absolute resolution in GeV from functional form
256  double resolution = 0;
257  const double abseta = e.abseta();
258  if (e.pT() > 0.1*GeV && abseta < 2.5) { //< should be a given from efficiencies
259  if (abseta < 0.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;
263  } else { // still |eta| < 2.5
264  resolution = add_quad(0.25, 3.1e-3 * e.pT()/GeV) * GeV;
265  }
266  }
267 
268  // normal_distribution<> d(e.E(), resolution);
269  // const double mass = e.mass2() > 0 ? e.mass() : 0; //< numerical carefulness...
270  // const double smeared_E = max(d(gen), mass); //< can't let the energy go below the mass!
271  // return Particle(e.pid(), FourMomentum::mkEtaPhiME(e.eta(), e.phi(), mass, smeared_E));
272  return Particle(e.pid(), P4_SMEAR_E_GAUSS(e, resolution));
273  }
274 
278  return ELECTRON_SMEAR_CMS_RUN1(e);
279  }
280 
282 
283 
284 
287 
291  inline double PHOTON_EFF_ATLAS_RUN1(const Particle& y) {
292  if (y.abspid() != PID::PHOTON) return 0;
293 
294  if (y.pT() < 10*GeV) return 0;
295  if (inRange(y.abseta(), 1.37, 1.52) || y.abseta() > 2.37) return 0;
296 
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};
310 
311  const int i_eta = binIndex(y.abseta(), edges_eta);
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];
315  return eff;
316  }
317 
321  inline double PHOTON_EFF_ATLAS_RUN2(const Particle& y) {
322  if (y.abspid() != PID::PHOTON) return 0;
323 
324  if (y.pT() < 10*GeV) return 0;
325  if (inRange(y.abseta(), 1.37, 1.52) || y.abseta() > 2.37) return 0;
326 
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};
340 
341  const int i_eta = binIndex(y.abseta(), edges_eta);
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];
345  return eff;
346  }
347 
350  inline double PHOTON_EFF_CMS_RUN1(const Particle& y) {
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;
354  }
355 
358  inline double PHOTON_EFF_CMS_RUN2(const Particle& y) {
359  if (y.abspid() != PID::PHOTON) return 0;
360  return PHOTON_EFF_CMS_RUN1(y);
361  }
362 
363 
365  inline Particle PHOTON_SMEAR_ATLAS_RUN1(const Particle& y) { return y; }
366  inline Particle PHOTON_SMEAR_ATLAS_RUN2(const Particle& y) { return y; }
367  inline Particle PHOTON_SMEAR_CMS_RUN1(const Particle& y) { return y; }
368  inline Particle PHOTON_SMEAR_CMS_RUN2(const Particle& y) { return y; }
369 
371 
372 
373 
376 
378  inline double MUON_EFF_ATLAS_RUN1(const Particle& m) {
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;
383  }
384 
388  inline double MUON_RECOEFF_ATLAS_RUN2(const Particle& m) {
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;
392  // if (m.pT() < 10*GeV) return 0;
393  return (m.abseta() < 1) ? 0.98 : 0.99;
394  }
395 
400  inline double MUON_EFF_ATLAS_RUN2(const Particle& m) {
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);
406  const double eff = effs[i_pt] * MUON_RECOEFF_ATLAS_RUN2(m);
407  return eff;
408  }
409 
411 
412 
413 
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};
420 
421  const int i_eta = binIndex(m.abseta(), edges_eta);
422  const int i_pt = binIndex(m.pT()/GeV, edges_pt, true);
423  const int i = i_eta*edges_pt.size() + i_pt;
424 
425  const double resolution = res[i];
426 
427  // Smear by a Gaussian centered on the current pT, with width given by the resolution
428  // normal_distribution<> d(m.pT(), resolution*m.pT());
429  // const double smeared_pt = max(d(gen), 0.);
430  // const double mass = m.mass2() > 0 ? m.mass() : 0; //< numerical carefulness...
431  // return Particle(m.pid(), FourMomentum::mkEtaPhiMPt(m.eta(), m.phi(), mass, smeared_pt));
432  return Particle(m.pid(), P4_SMEAR_PT_GAUSS(m, resolution*m.pT()));
433  }
434 
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; //< from Eq (10)
442  const double resolution = (m.abseta() < 1.5 ? 1.0 : 1.25) * ptres_pt;
443  return Particle(m.pid(), P4_SMEAR_PT_GAUSS(m, resolution*m.pT()));
444  }
445 
446 
447 
449  inline double MUON_EFF_CMS_RUN1(const Particle& m) {
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));
454  }
455 
458  inline double MUON_EFF_CMS_RUN2(const Particle& m) {
459  if (m.abspid() != PID::MUON) return 0;
460  return MUON_EFF_CMS_RUN1(m);
461  }
462 
463 
466  // Calculate fractional resolution
467  // for pT > 0.1 GeV, mom resolution = |eta| < 0.5 -> sqrt(0.01^2 + pt^2 * 2.0e-4^2)
468  // |eta| < 1.5 -> sqrt(0.02^2 + pt^2 * 3.0e-4^2)
469  // |eta| < 2.5 -> sqrt(0.05^2 + pt^2 * 2.6e-4^2)
470  double resolution = 0;
471  const double abseta = m.abseta();
472  if (m.pT() > 0.1*GeV && abseta < 2.5) {
473  if (abseta < 0.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);
477  } else { // still |eta| < 2.5... but isn't CMS' mu acceptance < 2.4?
478  resolution = add_quad(0.05, 2.6e-4 * m.pT()/GeV);
479  }
480  }
481 
482  // Smear by a Gaussian centered on the current pT, with width given by the resolution
483  // normal_distribution<> d(m.pT(), resolution*m.pT());
484  // const double smeared_pt = max(d(gen), 0.);
485  // const double mass = m.mass2() > 0 ? m.mass() : 0; //< numerical carefulness...
486  // return Particle(m.pid(), FourMomentum::mkEtaPhiMPt(m.eta(), m.phi(), mass, smeared_pt));
487  return Particle(m.pid(), P4_SMEAR_PT_GAUSS(m, resolution*m.pT()));
488  }
489 
493  return MUON_SMEAR_CMS_RUN1(m);
494  }
495 
497 
498 
499 
502 
510  inline double TAU_EFF_ATLAS_RUN1(const Particle& t) {
511  if (t.abseta() > 2.5) return 0; //< hmm... mostly
512  if (inRange(t.abseta(), 1.37, 1.52)) return 0; //< crack region
513  double pThadvis = 0;
514  Particles chargedhadrons;
515  for (const Particle& p : t.children()) {
516  if (p.isHadron()) {
517  pThadvis += p.pT(); //< right definition? Paper is unclear
518  if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1*GeV) chargedhadrons += p;
519  }
520  }
521  if (chargedhadrons.empty()) return 0; //< leptonic tau
522  if (pThadvis < 20*GeV) return 0; //< below threshold
523  if (pThadvis < 40*GeV) {
524  if (chargedhadrons.size() == 1) return (t.abspid() == PID::TAU) ? 0.56 : 0; //1/20.;
525  if (chargedhadrons.size() == 3) return (t.abspid() == PID::TAU) ? 0.38 : 0; //1/100.;
526  } else {
527  if (chargedhadrons.size() == 1) return (t.abspid() == PID::TAU) ? 0.56 : 0; //1/25.;
528  if (chargedhadrons.size() == 3) return (t.abspid() == PID::TAU) ? 0.38 : 0; //1/400.;
529  }
530  return 0;
531  }
532 
540  inline double TAUJET_EFF_ATLAS_RUN1(const Jet& j) {
541  if (j.abseta() > 2.5) return 0; //< hmm... mostly
542  if (inRange(j.abseta(), 1.37, 1.52)) return 0; //< crack region
543  double pThadvis = 0;
544  Particles chargedhadrons;
545  for (const Particle& p : j.particles()) {
546  if (p.isHadron()) {
547  pThadvis += p.pT(); //< right definition? Paper is unclear
548  if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1*GeV) chargedhadrons += p;
549  }
550  }
551  if (chargedhadrons.empty()) return 0;
552  if (pThadvis < 20*GeV) return 0; //< below threshold
553  const Particles ttags = j.tauTags(Cuts::pT > 10*GeV);
554  if (ttags.empty()) {
555  if (pThadvis < 40*GeV)
556  return chargedhadrons.size() == 1 ? 1/20. : chargedhadrons.size() == 3 ? 1/100. : 0; //< fake rates
557  else
558  return chargedhadrons.size() == 1 ? 1/25. : chargedhadrons.size() == 3 ? 1/400. : 0; //< fake rates
559  }
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;
562  }
563 
564 
570  inline double TAU_EFF_ATLAS_RUN2(const Particle& t) {
571  if (t.abspid() != PID::TAU) return 0;
572  if (t.abseta() > 2.5) return 0; //< hmm... mostly
573  if (inRange(t.abseta(), 1.37, 1.52)) return 0; //< crack region
574  double pThadvis = 0;
575  Particles chargedhadrons;
576  for (const Particle& p : t.children()) {
577  if (p.isHadron()) {
578  pThadvis += p.pT(); //< right definition? Paper is unclear
579  if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1*GeV) chargedhadrons += p;
580  }
581  }
582  if (chargedhadrons.empty()) return 0; //< leptonic tau
583  if (pThadvis < 20*GeV) return 0; //< below threshold
584  if (chargedhadrons.size() == 1) return (t.abspid() == PID::TAU) ? 0.55 : 0; //1/50.;
585  if (chargedhadrons.size() == 3) return (t.abspid() == PID::TAU) ? 0.40 : 0; //1/110.;
586  return 0;
587  }
588 
594  inline double TAUJET_EFF_ATLAS_RUN2(const Jet& j) {
595  if (j.abseta() > 2.5) return 0; //< hmm... mostly
596  if (inRange(j.abseta(), 1.37, 1.52)) return 0; //< crack region
597  double pThadvis = 0;
598  Particles chargedhadrons;
599  for (const Particle& p : j.particles()) {
600  if (p.isHadron()) {
601  pThadvis += p.pT(); //< right definition? Paper is unclear
602  if (p.charge3() != 0 && p.abseta() < 2.5 && p.pT() > 1*GeV) chargedhadrons += p;
603  }
604  }
605  if (chargedhadrons.empty()) return 0;
606  if (pThadvis < 20*GeV) return 0; //< below threshold
607  const Particles ttags = j.tauTags(Cuts::pT > 10*GeV);
608  // if (ttags.empty()) {
609  // if (pThadvis < 40*GeV)
610  // return chargedhadrons.size() == 1 ? 1/50. : 1/110.; //< fake rates
611  // else
612  // return chargedhadrons.size() == 1 ? 1/25. : 1/400.; //< fake rates
613  // }
614  if (ttags.empty()) return chargedhadrons.size() == 1 ? 1/50. : chargedhadrons.size() == 3 ? 1/110. : 0; //< fake rates
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;
617  }
618 
619 
623  // // Const fractional resolution for now
624  // static const double resolution = 0.03;
625 
626  // // Smear by a Gaussian centered on 1 with width given by the (fractional) resolution
627  // /// @todo Is this the best way to smear? Should we preserve the energy, or pT, or direction?
628  // const double fsmear = max(randnorm(1., resolution), 0.);
629  // const double mass = t.mass2() > 0 ? t.mass() : 0; //< numerical carefulness...
630  // return Particle(t.pid(), FourMomentum::mkXYZM(t.px()*fsmear, t.py()*fsmear, t.pz()*fsmear, mass));
631 
632  // Jet energy resolution lookup
633  // Implemented by Matthias Danninger for GAMBIT, based roughly on
634  // https://atlas.web.cern.ch/Atlas/GROUPS/PHYSICS/CONFNOTES/ATLAS-CONF-2015-017/
635  // Parameterisation can be still improved, but eta dependence is minimal
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}; //< note overflow value
639  const int ipt = binIndex(t.pT()/GeV, binedges_pt, true);
640  if (ipt < 0) return t;
641  const double resolution = jer.at(ipt);
642 
643  // Smear by a Gaussian centered on 1 with width given by the (fractional) resolution
645  const double fsmear = max(randnorm(1., resolution), 0.);
646  const double mass = t.mass2() > 0 ? t.mass() : 0; //< numerical carefulness...
647  Particle rtn(PID::TAU, FourMomentum::mkXYZM(t.px()*fsmear, t.py()*fsmear, t.pz()*fsmear, mass));
648  //if (deltaPhi(t, rtn) > 0.01) cout << "jdphi: " << deltaPhi(t, rtn) << endl;
649  return rtn;
650  }
651 
652 
656  return TAU_SMEAR_ATLAS_RUN1(t);
657  }
658 
659 
663  inline double TAU_EFF_CMS_RUN1(const Particle& t) {
664  if (t.abspid() != PID::TAU) return 0;
665  return (t.abspid() == PID::TAU) ? 0.6 : 0;
666  }
667 
671  inline double TAU_EFF_CMS_RUN2(const Particle& t) {
672  if (t.abspid() != PID::TAU) return 0;
673  return (t.abspid() == PID::TAU) ? 0.6 : 0;
674  }
675 
676 
680  return TAU_SMEAR_ATLAS_RUN1(t);
681  }
682 
683 
687  return TAU_SMEAR_CMS_RUN1(t);
688  }
689 
691 
692 
693 
696 
698  inline double JET_BTAG_ATLAS_RUN1(const Jet& j) {
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;
705  }
706 
708  inline double JET_BTAG_ATLAS_RUN2_MV2C20(const Jet& j) {
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;
712  return 1/140.;
713  }
714 
716  inline double JET_BTAG_ATLAS_RUN2_MV2C10(const Jet& j) {
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;
720  return 1/134.;
721  }
722 
723 
725  inline Jet JET_SMEAR_ATLAS_RUN1(const Jet& j) {
726  // Jet energy resolution lookup
727  // Implemented by Matthias Danninger for GAMBIT, based roughly on
728  // https://atlas.web.cern.ch/Atlas/GROUPS/PHYSICS/CONFNOTES/ATLAS-CONF-2015-017/
729  // Parameterisation can be still improved, but eta dependence is minimal
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}; //< note overflow value
733  const int ipt = binIndex(j.pT()/GeV, binedges_pt, true);
734  if (ipt < 0) return j;
735  const double resolution = jer.at(ipt);
736 
737  // Smear by a Gaussian centered on 1 with width given by the (fractional) resolution
739  const double fsmear = max(randnorm(1., resolution), 0.);
740  const double mass = j.mass2() > 0 ? j.mass() : 0; //< numerical carefulness...
741  Jet rtn(FourMomentum::mkXYZM(j.px()*fsmear, j.py()*fsmear, j.pz()*fsmear, mass));
742  //if (deltaPhi(j, rtn) > 0.01) cout << "jdphi: " << deltaPhi(j, rtn) << endl;
743  return rtn;
744  }
745 
748  inline Jet JET_SMEAR_ATLAS_RUN2(const Jet& j) {
749  return JET_SMEAR_ATLAS_RUN1(j);
750  }
751 
754  inline Jet JET_SMEAR_CMS_RUN1(const Jet& j) {
755  return JET_SMEAR_ATLAS_RUN1(j);
756  }
757 
760  inline Jet JET_SMEAR_CMS_RUN2(const Jet& j) {
761  return JET_SMEAR_CMS_RUN1(j);
762  }
763 
765 
766 
769 
770  inline Vector3 MET_SMEAR_IDENTITY(const Vector3& met, double) { return met; }
771 
775  inline Vector3 MET_SMEAR_ATLAS_RUN1(const Vector3& met, double set) {
776  Vector3 smeared_met = met;
777 
778  // Linearity offset (Fig 14)
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)); //< linear decrease
781  else smeared_met *= 1.01;
782 
783  // Smear by a Gaussian with width given by the resolution(sumEt) ~ 0.45 sqrt(sumEt) GeV
784  const double resolution = 0.45 * sqrt(set/GeV) * GeV;
785  const double metsmear = max(randnorm(smeared_met.mod(), resolution), 0.);
786  smeared_met = metsmear * smeared_met.unit();
787 
788  return smeared_met;
789  }
790 
793  inline Vector3 MET_SMEAR_ATLAS_RUN2(const Vector3& met, double set) {
794  return MET_SMEAR_ATLAS_RUN1(met, set);
795  }
796 
799  inline Vector3 MET_SMEAR_CMS_RUN1(const Vector3& met, double set) {
800  Vector3 smeared_met = met;
801 
802  // Calculate parallel and perpendicular resolutions and combine in quadrature (?)
803  const double resolution_x = (1.1 + 0.6*sqrt(set/GeV)) * GeV;
804  const double resolution_y = (1.4 + 0.6*sqrt(set/GeV)) * GeV;
805  const double resolution = sqrt(sqr(resolution_x) + sqr(resolution_y));
806 
807  // Smear by a Gaussian with width given by the resolution
808  const double metsmear = max(randnorm(smeared_met.mod(), resolution), 0.);
809  smeared_met = metsmear * smeared_met.unit();
810 
811  return smeared_met;
812  }
813 
816  inline Vector3 MET_SMEAR_CMS_RUN2(const Vector3& met, double set) {
817  Vector3 smeared_met = met;
818 
819  // Calculate parallel and perpendicular resolutions and combine in quadrature (?)
820  const double resolution_para = ( 2.0 + 0.64*sqrt(set/GeV)) * GeV;
821  const double resolution_perp = (-1.5 + 0.68*sqrt(set/GeV)) * GeV;
822  const double resolution = sqrt(sqr(resolution_para) + sqr(resolution_perp));
823 
824  // Smear by a Gaussian with width given by the resolution
825  const double metsmear = max(randnorm(smeared_met.mod(), resolution), 0.);
826  smeared_met = metsmear * smeared_met.unit();
827 
828  return smeared_met;
829  }
830 
832 
833 
836 
838  inline double TRK_EFF_ATLAS_RUN1(const Particle& p) {
839  if (p.charge3() == 0) return 0;
840  if (p.abseta() > 2.5) return 0;
841  if (p.pT() < 0.1*GeV) return 0;
842 
843  if (p.abspid() == PID::ELECTRON) {
844  if (p.abseta() < 1.5) {
845  if (p.pT() < 1*GeV) return 0.73;
846  if (p.pT() < 100*GeV) return 0.95;
847  return 0.99;
848  } else {
849  if (p.pT() < 1*GeV) return 0.50;
850  if (p.pT() < 100*GeV) return 0.83;
851  else return 0.90;
852  }
853  } else if (p.abspid() == PID::MUON) {
854  if (p.abseta() < 1.5) {
855  return (p.pT() < 1*GeV) ? 0.75 : 0.99;
856  } else {
857  return (p.pT() < 1*GeV) ? 0.70 : 0.98;
858  }
859  } else { // charged hadrons
860  if (p.abseta() < 1.5) {
861  return (p.pT() < 1*GeV) ? 0.70 : 0.95;
862  } else {
863  return (p.pT() < 1*GeV) ? 0.60 : 0.85;
864  }
865  }
866  }
867 
870  inline double TRK_EFF_ATLAS_RUN2(const Particle& p) {
871  return TRK_EFF_ATLAS_RUN1(p);
872  }
873 
874 
876  inline double TRK_EFF_CMS_RUN1(const Particle& p) {
877  if (p.charge3() == 0) return 0;
878  if (p.abseta() > 2.5) return 0;
879  if (p.pT() < 0.1*GeV) return 0;
880 
881  if (p.abspid() == PID::ELECTRON) {
882  if (p.abseta() < 1.5) {
883  if (p.pT() < 1*GeV) return 0.73;
884  if (p.pT() < 100*GeV) return 0.95;
885  return 0.99;
886  } else {
887  if (p.pT() < 1*GeV) return 0.50;
888  if (p.pT() < 100*GeV) return 0.83;
889  else return 0.90;
890  }
891  } else if (p.abspid() == PID::MUON) {
892  if (p.abseta() < 1.5) {
893  return (p.pT() < 1*GeV) ? 0.75 : 0.99;
894  } else {
895  return (p.pT() < 1*GeV) ? 0.70 : 0.98;
896  }
897  } else { // charged hadrons
898  if (p.abseta() < 1.5) {
899  return (p.pT() < 1*GeV) ? 0.70 : 0.95;
900  } else {
901  return (p.pT() < 1*GeV) ? 0.60 : 0.85;
902  }
903  }
904  }
905 
908  inline double TRK_EFF_CMS_RUN2(const Particle& p) {
909  return TRK_EFF_CMS_RUN1(p);
910  }
911 
913 
915 
916 
917 }
918 
919 #endif
Definition: MC_Cent_pPb.hh:10
Particle ELECTRON_SMEAR_ATLAS_RUN2(const Particle &e)
Definition: SmearingFunctions.hh:222
Particle TAU_SMEAR_ATLAS_RUN2(const Particle &t)
Definition: SmearingFunctions.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:365
double JET_BTAG_ATLAS_RUN1(const Jet &j)
Return the ATLAS Run 1 jet flavour tagging efficiency for the given Jet.
Definition: SmearingFunctions.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: SmearingFunctions.hh:465
double abseta() const
Get the directly (alias).
Definition: ParticleBase.hh:91
double PHOTON_EFF_ATLAS_RUN2(const Particle &y)
ATLAS Run 2 photon reco efficiency.
Definition: SmearingFunctions.hh:321
double ELECTRON_EFF_ATLAS_RUN2_LOOSE(const Particle &e)
ATLAS Run 2 &#39;loose&#39; electron reco+identification efficiency.
Definition: SmearingFunctions.hh:47
double TRK_EFF_ATLAS_RUN1(const Particle &p)
ATLAS Run 1 tracking efficiency.
Definition: SmearingFunctions.hh:838
Particle MUON_SMEAR_CMS_RUN2(const Particle &m)
Definition: SmearingFunctions.hh:492
Particles & particles()
Get the particles in this jet.
Definition: Jet.hh:47
double ELECTRON_RECOEFF_ATLAS_RUN1(const Particle &e)
Definition: SmearingFunctions.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:210
PdgId pid() const
This Particle&#39;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: SmearingFunctions.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: SmearingFunctions.hh:622
double TAU_EFF_CMS_RUN2(const Particle &t)
Definition: SmearingFunctions.hh:671
double PHOTON_EFF_CMS_RUN1(const Particle &y)
Definition: SmearingFunctions.hh:350
double MUON_EFF_ATLAS_RUN1(const Particle &m)
ATLAS Run 1 muon reco efficiency.
Definition: SmearingFunctions.hh:378
Particle PHOTON_SMEAR_ATLAS_RUN1(const Particle &y)
Definition: SmearingFunctions.hh:365
double mass() const
Get the mass directly.
Definition: ParticleBase.hh:80
double ELECTRON_EFF_CMS_RUN2(const Particle &e)
Definition: SmearingFunctions.hh:242
double ELECTRON_EFF_ATLAS_RUN1_MEDIUM(const Particle &e)
ATLAS Run 1 &#39;medium&#39; electron reco+identification efficiency.
Definition: SmearingFunctions.hh:67
double E() const
Get the energy directly.
Definition: ParticleBase.hh:51
double TRK_EFF_CMS_RUN1(const Particle &p)
CMS Run 1 tracking efficiency.
Definition: SmearingFunctions.hh:876
double TAU_EFF_ATLAS_RUN1(const Particle &t)
ATLAS Run 1 8 TeV tau efficiencies (medium working point)
Definition: SmearingFunctions.hh:510
Particle ELECTRON_SMEAR_CMS_RUN2(const Particle &e)
Definition: SmearingFunctions.hh:277
Jet JET_SMEAR_CMS_RUN1(const Jet &j)
Definition: SmearingFunctions.hh:754
Jet JET_SMEAR_ATLAS_RUN2(const Jet &j)
Definition: SmearingFunctions.hh:748
double ELECTRON_EFF_ATLAS_RUN2_TIGHT(const Particle &e)
ATLAS Run 2 &#39;tight&#39; electron reco+identification efficiency.
Definition: SmearingFunctions.hh:172
double JET_BTAG_ATLAS_RUN2_MV2C20(const Jet &j)
Return the ATLAS Run 2 MC2c20 jet flavour tagging efficiency for the given Jet.
Definition: SmearingFunctions.hh:708
double Et() const
Get the directly.
Definition: ParticleBase.hh:75
double ELECTRON_EFF_ATLAS_RUN2_MEDIUM(const Particle &e)
ATLAS Run 2 &#39;medium&#39; electron reco+identification efficiency.
Definition: SmearingFunctions.hh:116
double MUON_EFF_CMS_RUN1(const Particle &m)
CMS Run 1 muon reco efficiency.
Definition: SmearingFunctions.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: SmearingFunctions.hh:870
double PHOTON_EFF_ATLAS_RUN1(const Particle &y)
ATLAS Run 2 photon reco efficiency.
Definition: SmearingFunctions.hh:291
Vector3 MET_SMEAR_ATLAS_RUN1(const Vector3 &met, double set)
ATLAS Run 1 ETmiss smearing.
Definition: SmearingFunctions.hh:775
FourMomentum P4_SMEAR_PT_GAUSS(const FourMomentum &p, double resolution)
Smear a FourMomentum&#39;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:112
Vector3 MET_SMEAR_CMS_RUN1(const Vector3 &met, double set)
Definition: SmearingFunctions.hh:799
double pT() const
Get the directly (alias).
Definition: ParticleBase.hh:63
double MUON_RECOEFF_ATLAS_RUN2(const Particle &m)
Definition: SmearingFunctions.hh:388
double TAU_EFF_CMS_RUN1(const Particle &t)
Definition: SmearingFunctions.hh:663
double deltaR(double rap1, double phi1, double rap2, double phi2)
Definition: MathUtils.hh:608
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: SmearingFunctions.hh:570
double JET_BTAG_ATLAS_RUN2_MV2C10(const Jet &j)
Return the ATLAS Run 2 MC2c10 jet flavour tagging efficiency for the given Jet.
Definition: SmearingFunctions.hh:716
double ELECTRON_RECOEFF_ATLAS_RUN2(const Particle &e)
Definition: SmearingFunctions.hh:30
double max(const vector< double > &in, double errval=DBL_NAN)
Find the maximum value in the vector.
Definition: Utils.hh:612
Vector3 MET_SMEAR_CMS_RUN2(const Vector3 &met, double set)
Definition: SmearingFunctions.hh:816
double MUON_EFF_ATLAS_RUN2(const Particle &m)
ATLAS Run 2 muon reco+ID efficiency.
Definition: SmearingFunctions.hh:400
Particle TAU_SMEAR_CMS_RUN2(const Particle &t)
Definition: SmearingFunctions.hh:686
Vector3 unit() const
Synonym for unitVec.
Definition: Vector3.hh:105
double MUON_EFF_CMS_RUN2(const Particle &m)
Definition: SmearingFunctions.hh:458
Particle ELECTRON_SMEAR_CMS_RUN1(const Particle &e)
CMS electron energy smearing, preserving direction.
Definition: SmearingFunctions.hh:254
Jet JET_SMEAR_CMS_RUN2(const Jet &j)
Definition: SmearingFunctions.hh:760
Particle TAU_SMEAR_CMS_RUN1(const Particle &t)
Definition: SmearingFunctions.hh:679
double ELECTRON_EFF_CMS_RUN1(const Particle &e)
CMS Run 1 electron reconstruction efficiency.
Definition: SmearingFunctions.hh:232
double TAUJET_EFF_ATLAS_RUN1(const Jet &j)
ATLAS Run 1 8 TeV tau misID rates (medium working point)
Definition: SmearingFunctions.hh:540
double px() const
x component of momentum.
Definition: ParticleBase.hh:120
double TRK_EFF_CMS_RUN2(const Particle &p)
Definition: SmearingFunctions.hh:908
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: SmearingFunctions.hh:725
Vector3 MET_SMEAR_ATLAS_RUN2(const Vector3 &met, double set)
Definition: SmearingFunctions.hh:793
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: SmearingFunctions.hh:191
static const double SQRT2
A pre-defined value of .
Definition: MathConstants.hh:22
double PHOTON_EFF_CMS_RUN2(const Particle &y)
Definition: SmearingFunctions.hh:358
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: SmearingFunctions.hh:415
std::enable_if< std::is_arithmetic< NUM >::value, NUM >::type sqr(NUM a)
Named number-type squaring operation.
Definition: MathUtils.hh:198
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: SmearingFunctions.hh:437
double min(const vector< double > &in, double errval=DBL_NAN)
Find the minimum value in the vector.
Definition: Utils.hh:606
double ELECTRON_EFF_ATLAS_RUN1_TIGHT(const Particle &e)
ATLAS Run 1 &#39;tight&#39; electron reco+identification efficiency.
Definition: SmearingFunctions.hh:123
double randnorm(double loc, double scale)
Return a random number sampled from a Gaussian/normal distribution.