gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-252-gf9a3f78
a Global And Modular Bsm Inference Tool
Gambit::ColliderBit::ATLAS Namespace Reference

ATLAS-specific efficiency and smearing functions for super fast detector simulation. More...

Functions

ATLAS detector efficiency functions
void applyElectronEff (std::vector< HEPUtils::Particle *> &electrons)
 Randomly filter the supplied particle list by parameterised electron efficiency. More...
 
void applyMuonEff (std::vector< HEPUtils::Particle *> &muons)
 Randomly filter the supplied particle list by parameterised muon efficiency. More...
 
void applyMuonEffR2 (std::vector< HEPUtils::Particle *> &muons)
 Randomly filter the supplied particle list by parameterised muon efficiency. More...
 
void applyTauEfficiencyR1 (std::vector< HEPUtils::Particle *> &taus)
 Randomly filter the supplied particle list by parameterised Run 1 tau efficiency. More...
 
void applyTauEfficiencyR2 (std::vector< HEPUtils::Particle *> &taus)
 Randomly filter the supplied particle list by parameterised Run 2 tau efficiency. More...
 
void applyPhotonEfficiencyR2 (std::vector< HEPUtils::Particle *> &photons)
 
void smearElectronEnergy (std::vector< HEPUtils::Particle *> &electrons)
 Randomly smear the supplied electrons' momenta by parameterised resolutions. More...
 
void smearMuonMomentum (std::vector< HEPUtils::Particle *> &muons)
 Randomly smear the supplied muons' momenta by parameterised resolutions. More...
 
void smearJets (std::vector< HEPUtils::Jet *> &jets)
 Randomly smear the supplied jets' momenta by parameterised resolutions. More...
 
void smearMET (HEPUtils::P4 &pmiss, double set)
 Randomly smear the MET vector by parameterised resolutions. More...
 
void smearTaus (std::vector< HEPUtils::Particle *> &taus)
 Randomly smear the supplied taus' momenta by parameterised resolutions. More...
 
void applyLooseIDElectronSelectionR2 (std::vector< const HEPUtils::Particle *> &electrons)
 Efficiency function for Loose ID electrons. More...
 
void applyLooseIDElectronSelectionR2 (std::vector< HEPUtils::Particle *> &electrons)
 Alias to allow non-const particle vectors. More...
 
void applyMediumIDElectronSelectionR2 (std::vector< const HEPUtils::Particle *> &electrons)
 Efficiency function for Loose ID electrons. More...
 
void applyMediumIDElectronSelectionR2 (std::vector< HEPUtils::Particle *> &electrons)
 Alias to allow non-const particle vectors. More...
 
void applyMediumIDElectronSelection (std::vector< const HEPUtils::Particle *> &electrons)
 Efficiency function for Medium ID electrons. More...
 
void applyMediumIDElectronSelection (std::vector< HEPUtils::Particle *> &electrons)
 Alias to allow non-const particle vectors. More...
 
void applyTightIDElectronSelection (std::vector< const HEPUtils::Particle *> &electrons)
 Efficiency function for Tight ID electrons. More...
 
void applyTightIDElectronSelection (std::vector< HEPUtils::Particle *> &electrons)
 Alias to allow non-const particle vectors. More...
 

Detailed Description

ATLAS-specific efficiency and smearing functions for super fast detector simulation.

Function Documentation

◆ applyElectronEff()

void Gambit::ColliderBit::ATLAS::applyElectronEff ( std::vector< HEPUtils::Particle *> &  electrons)
inline

Randomly filter the supplied particle list by parameterised electron efficiency.

Note
Should be applied after the electron energy smearing

Definition at line 60 of file ATLASEfficiencies.hpp.

References Gambit::ColliderBit::filtereff_etapt().

Referenced by Gambit::ColliderBit::_Phi_mpi_pi(), Gambit::ColliderBit::calcMT(), Gambit::ColliderBit::calcMT_1l(), Gambit::ColliderBit::Phi_mpi_pi(), Gambit::ColliderBit::sortByPT(), Gambit::ColliderBit::sortByPT_2lep(), Gambit::ColliderBit::sortByPT_l(), Gambit::ColliderBit::sortByPT_lep(), and Gambit::ColliderBit::SortJets().

60  {
61  static HEPUtils::BinnedFn2D<double> _elEff2d({{0,1.5,2.5,DBL_MAX}}, //< |eta|
62  {{0,10.,DBL_MAX}}, //< pT
63  {{0., 0.95,
64  0., 0.85,
65  0., 0.}});
66  filtereff_etapt(electrons, _elEff2d);
67  }
void filtereff_etapt(std::vector< HEPUtils::Particle *> &particles, const HEPUtils::BinnedFn2D< double > &eff_etapt, bool do_delete=false)
Utility function for filtering a supplied particle vector by sampling wrt a binned 2D efficiency map ...
Definition: Utils.cpp:56
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyLooseIDElectronSelectionR2() [1/2]

void Gambit::ColliderBit::ATLAS::applyLooseIDElectronSelectionR2 ( std::vector< const HEPUtils::Particle *> &  electrons)
inline

Efficiency function for Loose ID electrons.

Note
Numbers digitised from Fig 3 of 13 TeV note (ATL-PHYS-PUB-2015-041)

Definition at line 305 of file ATLASEfficiencies.hpp.

References Gambit::ColliderBit::random_bool().

Referenced by applyLooseIDElectronSelectionR2(), and Gambit::ColliderBit::sortByPT_l().

305  {
306  if (electrons.empty()) return;
307 
308  // Manually symmetrised eta eff histogram
309  const static std::vector<double> binedges_eta = { 0.0, 0.1, 0.8, 1.37, 1.52, 2.01, 2.37, 2.47, DBL_MAX };
310  const static std::vector<double> bineffs_eta = { 0.950, 0.965, 0.955, 0.885, 0.950, 0.935, 0.90, 0 };
311  const static HEPUtils::BinnedFn1D<double> _eff_eta(binedges_eta, bineffs_eta);
312  // Et eff histogram (10-20 GeV bin added by hand)
313  const static std::vector<double> binedges_et = { 10, 20, 25, 30, 35, 40, 45, 50, 60, 80, DBL_MAX };
314  const static std::vector<double> bineffs_et = { 0.90, 0.91, 0.92, 0.94, 0.95, 0.955, 0.965, 0.97, 0.98, 0.98 };
315  const static HEPUtils::BinnedFn1D<double> _eff_et(binedges_et, bineffs_et);
316 
317  auto keptElectronsEnd = std::remove_if(electrons.begin(), electrons.end(),
318  [](const HEPUtils::Particle* electron) {
319  const double e_pt = electron->pT();
320  const double e_aeta = electron->abseta();
321  if (e_aeta > 2.47 || e_pt < 10) return true;
322  const double eff1 = _eff_eta.get_at(e_aeta), eff2 = _eff_et.get_at(e_pt);
323  const double eff = std::min(eff1 * eff2 / 0.95, 1.0); //< norm factor as approximate double differential
324  return random_bool(1-eff);
325  } );
326  electrons.erase(keptElectronsEnd, electrons.end());
327  }
bool random_bool(double eff)
Return a random true/false at a success rate given by a number.
Definition: Utils.cpp:10
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyLooseIDElectronSelectionR2() [2/2]

void Gambit::ColliderBit::ATLAS::applyLooseIDElectronSelectionR2 ( std::vector< HEPUtils::Particle *> &  electrons)
inline

Alias to allow non-const particle vectors.

Definition at line 330 of file ATLASEfficiencies.hpp.

References applyLooseIDElectronSelectionR2().

330  {
331  applyLooseIDElectronSelectionR2(reinterpret_cast<std::vector<const HEPUtils::Particle*>&>(electrons));
332  }
void applyLooseIDElectronSelectionR2(std::vector< HEPUtils::Particle *> &electrons)
Alias to allow non-const particle vectors.
Here is the call graph for this function:

◆ applyMediumIDElectronSelection() [1/2]

void Gambit::ColliderBit::ATLAS::applyMediumIDElectronSelection ( std::vector< const HEPUtils::Particle *> &  electrons)
inline

Efficiency function for Medium ID electrons.

Note
Numbers digitised from 8 TeV note (ATLAS-CONF-2014-032)
Note
No delete is necessary, because this should only ever be applied to a copy of the Event Particle* vectors

Definition at line 367 of file ATLASEfficiencies.hpp.

References Gambit::ColliderBit::makeBinValues(), and Gambit::ColliderBit::random_bool().

Referenced by applyMediumIDElectronSelection().

367  {
368  if (electrons.empty()) return;
369 
370  const static std::vector<double> binedges_E10_15 = {0., 0.0494681, 0.453578, 1.10675, 1.46298, 1.78963, 2.2766, 2.5};
371  const static std::vector<double> binvalues_E10_15 = makeBinValues({0.730435, 0.730435, 0.782609, 0.776812, 0.765217, 0.773913, 0.77971, 0.776812});
372  const static HEPUtils::BinnedFn1D<double> _eff_E10_15(binedges_E10_15, binvalues_E10_15);
373 
374  const static std::vector<double> binedges_E15_20 = {0., 0.0533175, 0.456161, 1.1019, 1.46327, 1.78318, 2.26303, 2.5};
375  const static std::vector<double> binvalues_E15_20 = makeBinValues({0.77971, 0.77971, 0.82029, 0.817391, 0.701449, 0.797101, 0.828986, 0.828986});
376  const static HEPUtils::BinnedFn1D<double> _eff_E15_20(binedges_E15_20, binvalues_E15_20);
377 
378  const static std::vector<double> binedges_E20_25 = {-2.5, -2.45249, -2.21496, -1.94181, -1.6924, -1.46675, -1.26485, -0.991686, -0.682898, -0.350356, -0.0415677, 0.0653207, 0.362233, 0.718527, 0.97981, 1.2886, 1.45487, 1.68052, 1.94181, 2.23872, 2.45249, 2.5};
379  const static std::vector<double> binvalues_E20_25 = makeBinValues({0.827811, 0.82572, 0.790414, 0.798585, 0.779843, 0.727974, 0.802447, 0.798192, 0.812561, 0.812423, 0.808153, 0.779115, 0.822483, 0.816123, 0.795304, 0.793105, 0.772326, 0.778446, 0.794906, 0.78857, 0.821617, 0.821593});
380  const static HEPUtils::BinnedFn1D<double> _eff_E20_25(binedges_E20_25, binvalues_E20_25);
381 
382  const static std::vector<double> binedges_E25_30 = {-2.5, -2.45249, -2.22684, -1.92993, -1.6924, -1.46675, -1.26485, -0.97981, -0.694774, -0.33848, -0.0534442, 0.0771971, 0.33848, 0.74228, 1.00356, 1.26485, 1.46675, 1.6924, 1.94181, 2.22684, 2.45249, 2.5};
383  const static std::vector<double> binvalues_E25_30 = makeBinValues({0.84095, 0.838892, 0.8286, 0.830801, 0.818436, 0.76037, 0.841463, 0.83535, 0.850008, 0.852233, 0.837812, 0.82748, 0.854592, 0.854759, 0.838251, 0.844591, 0.76782, 0.815688, 0.836563, 0.824219, 0.838853, 0.838877});
384  const static HEPUtils::BinnedFn1D<double> _eff_E25_30(binedges_E25_30, binvalues_E25_30);
385 
386  const static std::vector<double> binedges_E30_35 = {-2.5, -2.44062, -2.21496, -1.92993, -1.68052, -1.46675, -1.27672, -0.991686, -0.706651, -0.350356, -0.0534442, 0.0771971, 0.350356, 0.706651, 0.97981, 1.2886, 1.47862, 1.68052, 1.94181, 2.23872, 2.44062, 2.5};
387  const static std::vector<double> binvalues_E30_35 = makeBinValues({0.849263, 0.849233, 0.840831, 0.853176, 0.844763, 0.771974, 0.873676, 0.865249, 0.877593, 0.883677, 0.869013, 0.856496, 0.879231, 0.883238, 0.870661, 0.870533, 0.779059, 0.839213, 0.84949, 0.834827, 0.834743, 0.834718});
388  const static HEPUtils::BinnedFn1D<double> _eff_E30_35(binedges_E30_35, binvalues_E30_35);
389 
390  const static std::vector<double> binedges_E35_40 = {-2.5, -2.44841, -2.23431, -1.94914, -1.69969, -1.46336, -1.28359, -0.998664, -0.713488, -0.357087, -0.0723338, 0.0580256, 0.343519, 0.699955, 1.0085, 1.26989, 1.45836, 1.685, 1.93451, 2.23118, 2.46818, 2.5};
391  const static std::vector<double> binvalues_E35_40 = makeBinValues({0.836795, 0.84095, 0.859644, 0.867953, 0.87003, 0.799407, 0.894955, 0.888724, 0.897033, 0.903264, 0.886647, 0.87003, 0.897033, 0.905341, 0.890801, 0.897033, 0.805638, 0.863798, 0.87003, 0.85549, 0.824332, 0.826409});
392  const static HEPUtils::BinnedFn1D<double> _eff_E35_40(binedges_E35_40, binvalues_E35_40);
393 
394  const static std::vector<double> binedges_E40_45 = {-2.5, -2.45261, -2.22749, -1.93128, -1.68246, -1.46919, -1.27962, -0.995261, -0.7109, -0.343602, -0.0592417, 0.0473934, 0.35545, 0.699052, 0.983412, 1.27962, 1.4455, 1.69431, 1.94313, 2.22749, 2.44076, 2.5};
395  const static std::vector<double> binvalues_E40_45 = makeBinValues({0.836795, 0.836795, 0.87003, 0.882493, 0.897033, 0.84095, 0.911573, 0.89911, 0.907418, 0.909496, 0.89911, 0.888724, 0.907418, 0.91365, 0.89911, 0.907418, 0.843027, 0.890801, 0.882493, 0.87003, 0.816024, 0.816024});
396  const static HEPUtils::BinnedFn1D<double> _eff_E40_45(binedges_E40_45, binvalues_E40_45);
397 
398  const static std::vector<double> binedges_E45_50 = {-2.5, -2.46086, -2.22192, -1.93675, -1.68709, -1.46211, -1.27124, -0.986416, -0.689328, -0.356822, -0.0482438, 0.0584337, 0.355838, 0.712203, 0.996992, 1.28217, 1.45947, 1.68576, 1.93499, 2.21988, 2.44378, 2.5};
399  const static std::vector<double> binvalues_E45_50 = makeBinValues({0.807101, 0.807101, 0.889941, 0.898225, 0.912722, 0.873373, 0.923077, 0.910651, 0.921006, 0.918935, 0.906509, 0.894083, 0.923077, 0.927219, 0.912722, 0.921006, 0.871302, 0.90858, 0.898225, 0.889941, 0.786391, 0.786391});
400  const static HEPUtils::BinnedFn1D<double> _eff_E45_50 = {binedges_E45_50, binvalues_E45_50};
401 
402  const static std::vector<double> binedges_E50_60 = {-2.5, -2.44076, -2.21564, -1.93128, -1.69431, -1.46919, -1.26777, -0.983412, -0.7109, -0.35545, -0.0592417, 0.0592417, 0.35545, 0.7109, 0.983412, 1.27962, 1.46919, 1.68246, 1.91943, 2.22749, 2.44076, 2.5};
403  const static std::vector<double> binvalues_E50_60 = makeBinValues({0.785417, 0.785417, 0.891667, 0.9, 0.916667, 0.877083, 0.927083, 0.91875, 0.91875, 0.922917, 0.90625, 0.9, 0.922917, 0.929167, 0.920833, 0.925, 0.885417, 0.9125, 0.904167, 0.885417, 0.7625, 0.7625});
404  const static HEPUtils::BinnedFn1D<double> _eff_E50_60 = {binedges_E50_60, binvalues_E50_60};
405 
406  const static std::vector<double> binedges_E60_80 = {-2.5, -2.44933, -2.22119, -1.9353, -1.68491, -1.47115, -1.2682, -0.982628, -0.696912, -0.351494, -0.0423579, 0.0526683, 0.350856, 0.719871, 1.00552, 1.29137, 1.46938, 1.69596, 1.94572, 2.24305, 2.45479, 2.5};
407  const static std::vector<double> binvalues_E60_80 = makeBinValues({0.779163, 0.779188, 0.893866, 0.904402, 0.927423, 0.896262, 0.92968, 0.921466, 0.921585, 0.932145, 0.909357, 0.896897, 0.930355, 0.928425, 0.924377, 0.93283, 0.899571, 0.922582, 0.908102, 0.89156, 0.741648, 0.741678});
408  const static HEPUtils::BinnedFn1D<double> _eff_E60_80 = {binedges_E60_80, binvalues_E60_80};
409 
410  const static std::vector<double> binedges_E80 = {-2.5, -2.45835, -2.22058, -1.94663, -1.68451, -1.44712, -1.27961, -0.970161, -0.708258, -0.351259, -0.0537477, 0.0532884, 0.351188, 0.72041, 0.994111, 1.29176, 1.4815, 1.70839, 1.93419, 2.21998, 2.45825, 2.5};
411  const static std::vector<double> binvalues_E80 = makeBinValues({0.951041, 0.948944, 0.930151, 0.938346, 0.9507, 0.909058, 0.95884, 0.954557, 0.954449, 0.945992, 0.939637, 0.933361, 0.949854, 0.960086, 0.953741, 0.955695, 0.911996, 0.953445, 0.930502, 0.934538, 0.944824, 0.9448});
412  const static HEPUtils::BinnedFn1D<double> _eff_E80 = {binedges_E80, binvalues_E80};
413 
414  // Now loop over the electrons and only keep those that pass the random efficiency cut
417  auto keptElectronsEnd = std::remove_if(electrons.begin(), electrons.end(),
418  [](const HEPUtils::Particle* electron) {
419  const double e_pt = electron->pT();
420  const double e_eta = electron->eta();
421  if (!(fabs(e_eta) < 2.5 && e_pt >= 10)) return true;
422  else if (HEPUtils::in_range(e_pt, 10, 15)) return !random_bool(_eff_E10_15, fabs(e_eta));
423  else if (HEPUtils::in_range(e_pt, 15, 20)) return !random_bool(_eff_E15_20, fabs(e_eta));
424  else if (HEPUtils::in_range(e_pt, 20, 25)) return !random_bool(_eff_E20_25, e_eta);
425  else if (HEPUtils::in_range(e_pt, 25, 30)) return !random_bool(_eff_E25_30, e_eta);
426  else if (HEPUtils::in_range(e_pt, 30, 35)) return !random_bool(_eff_E30_35, e_eta);
427  else if (HEPUtils::in_range(e_pt, 35, 40)) return !random_bool(_eff_E35_40, e_eta);
428  else if (HEPUtils::in_range(e_pt, 40, 45)) return !random_bool(_eff_E40_45, e_eta);
429  else if (HEPUtils::in_range(e_pt, 45, 50)) return !random_bool(_eff_E45_50, e_eta);
430  else if (HEPUtils::in_range(e_pt, 50, 60)) return !random_bool(_eff_E50_60, e_eta);
431  else if (HEPUtils::in_range(e_pt, 60, 80)) return !random_bool(_eff_E60_80, e_eta);
432  else return !random_bool(_eff_E80, e_eta);
433  } );
434  electrons.erase(keptElectronsEnd, electrons.end());
435  }
std::vector< double > makeBinValues(const std::vector< double > &binEdgeValues)
Alias.
Definition: Utils.hpp:198
bool random_bool(double eff)
Return a random true/false at a success rate given by a number.
Definition: Utils.cpp:10
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyMediumIDElectronSelection() [2/2]

void Gambit::ColliderBit::ATLAS::applyMediumIDElectronSelection ( std::vector< HEPUtils::Particle *> &  electrons)
inline

Alias to allow non-const particle vectors.

Definition at line 439 of file ATLASEfficiencies.hpp.

References applyMediumIDElectronSelection().

439  {
440  applyMediumIDElectronSelection(reinterpret_cast<std::vector<const HEPUtils::Particle*>&>(electrons));
441  }
void applyMediumIDElectronSelection(std::vector< HEPUtils::Particle *> &electrons)
Alias to allow non-const particle vectors.
Here is the call graph for this function:

◆ applyMediumIDElectronSelectionR2() [1/2]

void Gambit::ColliderBit::ATLAS::applyMediumIDElectronSelectionR2 ( std::vector< const HEPUtils::Particle *> &  electrons)
inline

Efficiency function for Loose ID electrons.

Note
Numbers digitised from Fig 3 of 13 TeV note (ATL-PHYS-PUB-2015-041)

Definition at line 336 of file ATLASEfficiencies.hpp.

References Gambit::ColliderBit::random_bool().

Referenced by applyMediumIDElectronSelectionR2(), and Gambit::ColliderBit::sortByPT_l().

336  {
337  if (electrons.empty()) return;
338 
339  // Manually symmetrised eta eff histogram
340  const static std::vector<double> binedges_eta = { 0.0, 0.1, 0.8, 1.37, 1.52, 2.01, 2.37, 2.47, DBL_MAX };
341  const static std::vector<double> bineffs_eta = { 0.900, 0.930, 0.905, 0.830, 0.900, 0.880, 0.85, 0 };
342  const static HEPUtils::BinnedFn1D<double> _eff_eta(binedges_eta, bineffs_eta);
343  // Et eff histogram (10-20 GeV bin added by hand)
344  const static std::vector<double> binedges_et = { 10, 20, 25, 30, 35, 40, 45, 50, 60, 80, DBL_MAX };
345  const static std::vector<double> bineffs_et = { 0.83, 0.845, 0.87, 0.89, 0.90, 0.91, 0.92, 0.93, 0.95, 0.95 };
346  const static HEPUtils::BinnedFn1D<double> _eff_et(binedges_et, bineffs_et);
347 
348  auto keptElectronsEnd = std::remove_if(electrons.begin(), electrons.end(),
349  [](const HEPUtils::Particle* electron) {
350  const double e_pt = electron->pT();
351  const double e_aeta = electron->abseta();
352  if (e_aeta > 2.47 || e_pt < 10) return true;
353  const double eff1 = _eff_eta.get_at(e_aeta), eff2 = _eff_et.get_at(e_pt);
354  const double eff = std::min(eff1 * eff2 / 0.95, 1.0); //< norm factor as approximate double differential
355  return random_bool(1-eff);
356  } );
357  electrons.erase(keptElectronsEnd, electrons.end());
358  }
bool random_bool(double eff)
Return a random true/false at a success rate given by a number.
Definition: Utils.cpp:10
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyMediumIDElectronSelectionR2() [2/2]

void Gambit::ColliderBit::ATLAS::applyMediumIDElectronSelectionR2 ( std::vector< HEPUtils::Particle *> &  electrons)
inline

Alias to allow non-const particle vectors.

Definition at line 361 of file ATLASEfficiencies.hpp.

References applyMediumIDElectronSelectionR2().

361  {
362  applyMediumIDElectronSelectionR2(reinterpret_cast<std::vector<const HEPUtils::Particle*>&>(electrons));
363  }
void applyMediumIDElectronSelectionR2(std::vector< HEPUtils::Particle *> &electrons)
Alias to allow non-const particle vectors.
Here is the call graph for this function:

◆ applyMuonEff()

void Gambit::ColliderBit::ATLAS::applyMuonEff ( std::vector< HEPUtils::Particle *> &  muons)
inline

Randomly filter the supplied particle list by parameterised muon efficiency.

Definition at line 83 of file ATLASEfficiencies.hpp.

References Gambit::ColliderBit::filtereff_etapt().

Referenced by Gambit::ColliderBit::_Phi_mpi_pi(), Gambit::ColliderBit::calcMT(), Gambit::ColliderBit::calcMT_1l(), Gambit::ColliderBit::Phi_mpi_pi(), Gambit::ColliderBit::sortByPT(), Gambit::ColliderBit::sortByPT_2lep(), Gambit::ColliderBit::sortByPT_l(), Gambit::ColliderBit::sortByPT_lep(), and Gambit::ColliderBit::SortJets().

83  {
84  static HEPUtils::BinnedFn2D<double> _muEff2d({{0,1.5,2.7,DBL_MAX}}, //< |eta|
85  {{0,10.0,DBL_MAX}}, //< pT
86  {{0., 0.95,
87  0., 0.85,
88  0., 0.}});
89  filtereff_etapt(muons, _muEff2d);
90  }
void filtereff_etapt(std::vector< HEPUtils::Particle *> &particles, const HEPUtils::BinnedFn2D< double > &eff_etapt, bool do_delete=false)
Utility function for filtering a supplied particle vector by sampling wrt a binned 2D efficiency map ...
Definition: Utils.cpp:56
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyMuonEffR2()

void Gambit::ColliderBit::ATLAS::applyMuonEffR2 ( std::vector< HEPUtils::Particle *> &  muons)
inline

Randomly filter the supplied particle list by parameterised muon efficiency.

Definition at line 94 of file ATLASEfficiencies.hpp.

References Gambit::ColliderBit::filtereff_etapt().

94  {
95  static HEPUtils::BinnedFn2D<double> _muEff2d({0, 2.7, DBL_MAX}, //< |eta|
96  {0., 3.5, 4., 5., 6., 7., 8., 10., DBL_MAX}, //< pT
97  {0.00, 0.76, 0.94, 0.97, 0.98, 0.98, 0.98, 0.99,//
98  0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00});
99  filtereff_etapt(muons, _muEff2d);
100  }
void filtereff_etapt(std::vector< HEPUtils::Particle *> &particles, const HEPUtils::BinnedFn2D< double > &eff_etapt, bool do_delete=false)
Utility function for filtering a supplied particle vector by sampling wrt a binned 2D efficiency map ...
Definition: Utils.cpp:56
Here is the call graph for this function:

◆ applyPhotonEfficiencyR2()

void Gambit::ColliderBit::ATLAS::applyPhotonEfficiencyR2 ( std::vector< HEPUtils::Particle *> &  photons)
inline

Definition at line 150 of file ATLASEfficiencies.hpp.

References Gambit::ColliderBit::filtereff_etapt().

Referenced by Gambit::ColliderBit::sortByPT_lep().

150  {
151 
152  const static std::vector<double> binedges_eta = { 0., 0.6, 1.37, 1.52, 1.81, 2.37, DBL_MAX };
153  const static std::vector<double> binedges_pt = { 0., 10., 15., 20., 25., 30., 35., 40., 45., 50., 60., 80., 100., 125., 150., 175., 250., DBL_MAX };
154  const static std::vector<double> bineffs_etapt = { 0.00, 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, //
155  0.00, 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, //
156  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, 0.00, //
157  0.00, 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, //
158  0.00, 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, //
159  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, 0.00 };
160  const static HEPUtils::BinnedFn2D<double> _eff_etapt(binedges_eta, binedges_pt, bineffs_etapt);
161  filtereff_etapt(photons, _eff_etapt);
162  }
void filtereff_etapt(std::vector< HEPUtils::Particle *> &particles, const HEPUtils::BinnedFn2D< double > &eff_etapt, bool do_delete=false)
Utility function for filtering a supplied particle vector by sampling wrt a binned 2D efficiency map ...
Definition: Utils.cpp:56
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyTauEfficiencyR1()

void Gambit::ColliderBit::ATLAS::applyTauEfficiencyR1 ( std::vector< HEPUtils::Particle *> &  taus)
inline

Randomly filter the supplied particle list by parameterised Run 1 tau efficiency.

Note
From Delphes 3.1.2

Definition at line 106 of file ATLASEfficiencies.hpp.

References Gambit::ColliderBit::filtereff().

Referenced by Gambit::ColliderBit::calcMT_1l(), Gambit::ColliderBit::Phi_mpi_pi(), Gambit::ColliderBit::sortByPT(), and Gambit::ColliderBit::sortByPT_2lep().

106  {
107  filtereff(taus, 0.40);
108  }
void filtereff(std::vector< HEPUtils::Particle *> &particles, double eff, bool do_delete=false)
Utility function for filtering a supplied particle vector by sampling wrt an efficiency scalar...
Definition: Utils.cpp:16
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyTauEfficiencyR2()

void Gambit::ColliderBit::ATLAS::applyTauEfficiencyR2 ( std::vector< HEPUtils::Particle *> &  taus)
inline

Randomly filter the supplied particle list by parameterised Run 2 tau efficiency.

Note
From Delphes 3.3.2 & ATL-PHYS-PUB-2015-045, 60% for 1-prong, 70% for multi-prong: this is wrong!!
No delete, because this should only ever be applied to copies of the Event Particle* vectors in Analysis routines

Definition at line 114 of file ATLASEfficiencies.hpp.

References Gambit::ColliderBit::filtereff_pt().

114  {
115 
116  // Delphes 3.3.2 config:
117  // set DeltaR 0.2
118  // set DeltaRTrack 0.2
119  // set TrackPTMin 1.0
120  // set TauPTMin 1.0
121  // set TauEtaMax 2.5
122  // # instructions: {n-prongs} {eff}
123  // # 1 - one prong efficiency
124  // # 2 - two or more efficiency
125  // # -1 - one prong mistag rate
126  // # -2 - two or more mistag rate
127  // set BitNumber 0
128  // # taken from ATL-PHYS-PUB-2015-045 (medium working point)
129  // add EfficiencyFormula {1} {0.70}
130  // add EfficiencyFormula {2} {0.60}
131  // add EfficiencyFormula {-1} {0.02}
132  // add EfficiencyFormula {-2} {0.01}
133  // filtereff(taus, 0.65);
134 
135  // Distributions from ATL-PHYS-PUB-2015-045, Fig 10
136  const static std::vector<double> binedges_pt = { 0., 20., 40., 60., 120., 160., 220., 280., 380., 500., DBL_MAX };
137  const static std::vector<double> bineffs_pt_1p = { 0., .54, .55, .56, .58, .57, .56, .54, .51, 0. };
138  const static std::vector<double> bineffs_pt_3p = { 0., .40, .41, .42, .46, .46, .43, .39, .33, 0. };
139  const static HEPUtils::BinnedFn1D<double> _eff_pt_1p(binedges_pt, bineffs_pt_1p);
140  const static HEPUtils::BinnedFn1D<double> _eff_pt_3p(binedges_pt, bineffs_pt_3p);
141  // 85% 1-prong, 15% >=3-prong
142  const static std::vector<double> bineffs_pt_avg = { 0., .52, .53, .54, .56, .55, .54, .52, .48, 0. };
143  const static HEPUtils::BinnedFn1D<double> _eff_pt_avg(binedges_pt, bineffs_pt_avg);
144  filtereff_pt(taus, _eff_pt_avg);
145 
146  }
void filtereff_pt(std::vector< HEPUtils::Particle *> &particles, const HEPUtils::BinnedFn1D< double > &eff_pt, bool do_delete=false)
Utility function for filtering a supplied particle vector by sampling wrt a binned 1D efficiency map ...
Definition: Utils.cpp:43
Here is the call graph for this function:

◆ applyTightIDElectronSelection() [1/2]

void Gambit::ColliderBit::ATLAS::applyTightIDElectronSelection ( std::vector< const HEPUtils::Particle *> &  electrons)
inline

Efficiency function for Tight ID electrons.

Note
Numbers digitised from 8 TeV note (ATLAS-CONF-2014-032)
Note
No delete is necessary, because this should only ever be applied to a copy of the Event Particle* vectors

Definition at line 446 of file ATLASEfficiencies.hpp.

References Gambit::ColliderBit::makeBinValues(), and Gambit::ColliderBit::random_bool().

Referenced by applyTightIDElectronSelection(), Gambit::ColliderBit::calcMT_1l(), Gambit::ColliderBit::Phi_mpi_pi(), Gambit::ColliderBit::sortByPT_2lep(), and Gambit::ColliderBit::sortByPT_lep().

446  {
447 
448  const static std::vector<double> binedges_E10_15 = {0., 0.0485903, 0.458914, 1.10009, 1.46117, 1.78881, 2.27013, 2.5};
449  const static std::vector<double> binvalues_E10_15 = makeBinValues({0.57971, 0.582609, 0.681159, 0.655072, 0.46087, 0.634783, 0.689855, 0.689855});
450  const static HEPUtils::BinnedFn1D<double> _eff_E10_15(binedges_E10_15, binvalues_E10_15);
451 
452  const static std::vector<double> binedges_E15_20 = {0., 0.0533175, 0.450237, 1.09597, 1.46327, 1.78318, 2.26896, 2.5};
453  const static std::vector<double> binvalues_E15_20 = makeBinValues({0.631884, 0.628986, 0.727536, 0.701449, 0.565217, 0.666667, 0.733333, 0.733333});
454  const static HEPUtils::BinnedFn1D<double> _eff_E15_20(binedges_E15_20, binvalues_E15_20);
455 
456  const static std::vector<double> binedges_E20_25 = {-2.5, -2.44062, -2.22684, -1.92993, -1.66865, -1.45487, -1.26485, -0.967933, -0.706651, -0.350356, -0.0415677, 0.0653207, 0.362233, 0.718527, 0.991686, 1.27672, 1.47862, 1.6924, 1.92993, 2.22684, 2.46437, 2.5};
457  const static std::vector<double> binvalues_E20_25 = makeBinValues({0.678698, 0.678674, 0.70965, 0.65361, 0.655573, 0.599567, 0.6844, 0.694632, 0.729731, 0.731654, 0.665254, 0.640358, 0.743785, 0.733282, 0.697962, 0.672992, 0.585926, 0.660394, 0.652011, 0.703663, 0.670429, 0.668338});
458  const static HEPUtils::BinnedFn1D<double> _eff_E20_25(binedges_E20_25, binvalues_E20_25);
459 
460  const static std::vector<double> binedges_E25_30 = {-2.5, -2.44062, -2.22684, -1.91805, -1.68052, -1.45487, -1.27672, -0.97981, -0.706651, -0.350356, -0.0415677, 0.0771971, 0.362233, 0.718527, 0.991686, 1.30048, 1.47862, 1.6924, 1.94181, 2.22684, 2.46437, 2.5};
461  const static std::vector<double> binvalues_E25_30 = makeBinValues({0.678932, 0.681034, 0.737205, 0.683328, 0.695889, 0.633669, 0.720983, 0.733569, 0.758609, 0.769142, 0.69657, 0.688311, 0.771515, 0.771663, 0.734388, 0.717899, 0.636964, 0.699368, 0.689086, 0.730747, 0.67684, 0.67686});
462  const static HEPUtils::BinnedFn1D<double> _eff_E25_30(binedges_E25_30, binvalues_E25_30);
463 
464  const static std::vector<double> binedges_E30_35 = {-2.5, -2.45249, -2.21496, -1.94181, -1.68052, -1.47862, -1.27672, -0.97981, -0.706651, -0.33848, -0.0415677, 0.0534442, 0.362233, 0.718527, 1.00356, 1.27672, 1.46675, 1.68052, 1.95368, 2.23872, 2.45249, 2.5};
465  const static std::vector<double> binvalues_E30_35 = makeBinValues({0.691395, 0.691375, 0.749436, 0.716089, 0.726366, 0.653582, 0.749047, 0.771772, 0.800739, 0.802663, 0.731916, 0.71526, 0.802372, 0.810532, 0.773025, 0.75214, 0.656512, 0.722892, 0.712393, 0.745509, 0.670643, 0.6727});
466  const static HEPUtils::BinnedFn1D<double> _eff_E30_35(binedges_E30_35, binvalues_E30_35);
467 
468  const static std::vector<double> binedges_E35_40 = {-2.5, -2.46296, -2.22413, -1.93966, -1.7017, -1.47721, -1.28567, -0.988409, -0.714721, -0.334744, -0.0510125, 0.0437527, 0.342215, 0.710598, 0.971211, 1.27968, 1.45638, 1.68306, 1.94399, 2.21764, 2.44185, 2.5};
469  const static std::vector<double> binvalues_E35_40 = makeBinValues({0.683086, 0.683086, 0.759941, 0.726706, 0.751632, 0.683086, 0.772404, 0.793175, 0.824332, 0.820178, 0.743323, 0.728783, 0.820178, 0.832641, 0.793175, 0.774481, 0.689318, 0.749555, 0.728783, 0.757864, 0.6727, 0.6727});
470  const static HEPUtils::BinnedFn1D<double> _eff_E35_40(binedges_E35_40, binvalues_E35_40);
471 
472  const static std::vector<double> binedges_E40_45 = {-2.5, -2.45261, -2.21564, -1.94313, -1.69431, -1.45735, -1.27962, -0.983412, -0.7109, -0.35545, -0.0592417, 0.0473934, 0.35545, 0.699052, 0.983412, 1.26777, 1.45735, 1.67062, 1.93128, 2.20379, 2.45261, 2.5};
473  const static std::vector<double> binvalues_E40_45 = makeBinValues({0.693472, 0.693472, 0.782789, 0.757864, 0.784866, 0.726706, 0.797329, 0.803561, 0.836795, 0.805638, 0.747478, 0.735015, 0.805638, 0.843027, 0.807715, 0.797329, 0.732938, 0.780712, 0.762018, 0.782789, 0.674777, 0.674777});
474  const static HEPUtils::BinnedFn1D<double> _eff_E40_45(binedges_E40_45, binvalues_E40_45);
475 
476  const static std::vector<double> binedges_E45_50 = {-2.5, -2.46311, -2.22329, -1.93875, -1.70073, -1.47585, -1.273, -0.976015, -0.714205, -0.358403, -0.0625448, 0.0560444, 0.354151, 0.711078, 0.98364, 1.28045, 1.45768, 1.68407, 1.94493, 2.20653, 2.4415, 2.5};
477  const static std::vector<double> binvalues_E45_50 = makeBinValues({0.674556, 0.674556, 0.809172, 0.780178, 0.809172, 0.763609, 0.819527, 0.823669, 0.854734, 0.82574, 0.763609, 0.753254, 0.823669, 0.860947, 0.82574, 0.819527, 0.76568, 0.809172, 0.78432, 0.802959, 0.651775, 0.651775});
478  const static HEPUtils::BinnedFn1D<double> _eff_E45_50 = {binedges_E45_50, binvalues_E45_50};
479 
480  const static std::vector<double> binedges_E50_60 = {-2.5, -2.45261, -2.21564, -1.93128, -1.68246, -1.45735, -1.27962, -0.995261, -0.699052, -0.343602, -0.0592417, 0.0592417, 0.35545, 0.699052, 0.983412, 1.26777, 1.4455, 1.68246, 1.94313, 2.21564, 2.45261, 2.5};
481  const static std::vector<double> binvalues_E50_60 = makeBinValues({0.6625, 0.6625, 0.810417, 0.795833, 0.81875, 0.779167, 0.839583, 0.84375, 0.860417, 0.841667, 0.777083, 0.764583, 0.841667, 0.877083, 0.85, 0.839583, 0.785417, 0.816667, 0.8, 0.804167, 0.64375, 0.64375});
482  const static HEPUtils::BinnedFn1D<double> _eff_E50_60 = {binedges_E50_60, binvalues_E50_60};
483 
484  const static std::vector<double> binedges_E60_80 = {-2.5, -2.46326, -2.22265, -1.93711, -1.69844, -1.47299, -1.28152, -0.995631, -0.709702, -0.364674, -0.0564949, 0.0504716, 0.349652, 0.707116, 0.980538, 1.27812, 1.46757, 1.69447, 1.94394, 2.24157, 2.45288, 2.5};
485  const static std::vector<double> binvalues_E60_80 = makeBinValues({0.660412, 0.660432, 0.808449, 0.798151, 0.831584, 0.787928, 0.846341, 0.856877, 0.869496, 0.85714, 0.778101, 0.767729, 0.859521, 0.87842, 0.855617, 0.853658, 0.79332, 0.835081, 0.803935, 0.804059, 0.629147, 0.629172});
486  const static HEPUtils::BinnedFn1D<double> _eff_E60_80 = {binedges_E60_80, binvalues_E60_80};
487 
488  const static std::vector<double> binedges_E80 = {-2.5, -2.45987, -2.22149, -1.94797, -1.69748, -1.47206, -1.29251, -0.994818, -0.709105, -0.352212, -0.0558319, 0.0513809, 0.374044, 0.719562, 0.981359, 1.27873, 1.46843, 1.70723, 1.9449, 2.20712, 2.45676, 2.5};
489  const static std::vector<double> binvalues_E80 = makeBinValues({0.859652, 0.859627, 0.876145, 0.859415, 0.888391, 0.8426, 0.900685, 0.904716, 0.904597, 0.889909, 0.817086, 0.821195, 0.893762, 0.910235, 0.903895, 0.889231, 0.843455, 0.884899, 0.859875, 0.87846, 0.857585, 0.85756});
490  const static HEPUtils::BinnedFn1D<double> _eff_E80 = {binedges_E80, binvalues_E80};
491 
492  // Now loop over the electrons and only keep those that pass the random efficiency cut
495  auto keptElectronsEnd = std::remove_if(electrons.begin(), electrons.end(),
496  [](const HEPUtils::Particle* electron) {
497  const double e_pt = electron->pT();
498  const double e_eta = electron->eta();
499  if (!(fabs(e_eta) < 2.5 && e_pt >= 10)) return true;
500  else if (HEPUtils::in_range(e_pt, 10, 15)) return !random_bool(_eff_E10_15, fabs(e_eta));
501  else if (HEPUtils::in_range(e_pt, 15, 20)) return !random_bool(_eff_E15_20, fabs(e_eta));
502  else if (HEPUtils::in_range(e_pt, 20, 25)) return !random_bool(_eff_E20_25, e_eta);
503  else if (HEPUtils::in_range(e_pt, 25, 30)) return !random_bool(_eff_E25_30, e_eta);
504  else if (HEPUtils::in_range(e_pt, 30, 35)) return !random_bool(_eff_E30_35, e_eta);
505  else if (HEPUtils::in_range(e_pt, 35, 40)) return !random_bool(_eff_E35_40, e_eta);
506  else if (HEPUtils::in_range(e_pt, 40, 45)) return !random_bool(_eff_E40_45, e_eta);
507  else if (HEPUtils::in_range(e_pt, 45, 50)) return !random_bool(_eff_E45_50, e_eta);
508  else if (HEPUtils::in_range(e_pt, 50, 60)) return !random_bool(_eff_E50_60, e_eta);
509  else if (HEPUtils::in_range(e_pt, 60, 80)) return !random_bool(_eff_E60_80, e_eta);
510  else return !random_bool(_eff_E80, e_eta);
511  } );
512  electrons.erase(keptElectronsEnd, electrons.end());
513  }
std::vector< double > makeBinValues(const std::vector< double > &binEdgeValues)
Alias.
Definition: Utils.hpp:198
bool random_bool(double eff)
Return a random true/false at a success rate given by a number.
Definition: Utils.cpp:10
Here is the call graph for this function:
Here is the caller graph for this function:

◆ applyTightIDElectronSelection() [2/2]

void Gambit::ColliderBit::ATLAS::applyTightIDElectronSelection ( std::vector< HEPUtils::Particle *> &  electrons)
inline

Alias to allow non-const particle vectors.

Definition at line 517 of file ATLASEfficiencies.hpp.

References applyTightIDElectronSelection().

517  {
518  applyTightIDElectronSelection(reinterpret_cast<std::vector<const HEPUtils::Particle*>&>(electrons));
519  }
void applyTightIDElectronSelection(std::vector< HEPUtils::Particle *> &electrons)
Alias to allow non-const particle vectors.
Here is the call graph for this function:

◆ smearElectronEnergy()

void Gambit::ColliderBit::ATLAS::smearElectronEnergy ( std::vector< HEPUtils::Particle *> &  electrons)
inline

Randomly smear the supplied electrons' momenta by parameterised resolutions.

Definition at line 166 of file ATLASEfficiencies.hpp.

References Gambit::Random::rng(), and Gambit::Utils::sqr().

Referenced by Gambit::ColliderBit::getBuckFast(), and Gambit::ColliderBit::BuckFast< EventT >::processEvent().

166  {
167  // Function that mimics the DELPHES electron energy resolution
168  // We need to smear E, then recalculate pT, then reset 4 vector
169 
170  static HEPUtils::BinnedFn2D<double> coeffE2({{0, 2.5, 3., 5.}}, //< |eta|
171  {{0, 0.1, 25., DBL_MAX}}, //< pT
172  {{0., 0.015*0.015, 0.005*0.005,
173  0.005*0.005, 0.005*0.005, 0.005*0.005,
174  0.107*0.107, 0.107*0.107, 0.107*0.107}});
175 
176  static HEPUtils::BinnedFn2D<double> coeffE({{0, 2.5, 3., 5.}}, //< |eta|
177  {{0, 0.1, 25., DBL_MAX}}, //< pT
178  {{0., 0., 0.05*0.05,
179  0.05*0.05, 0.05*0.05, 0.05*0.05,
180  2.08*2.08, 2.08*2.08, 2.08*2.08}});
181 
182  static HEPUtils::BinnedFn2D<double> coeffC({{0, 2.5, 3., 5.}}, //< |eta|
183  {{0, 0.1, 25., DBL_MAX}}, //< pT
184  {{0., 0., 0.25*0.25,
185  0.25*0.25,0.25*0.25,0.25*0.25,
186  0., 0., 0.}});
187 
188  // Now loop over the electrons and smear the 4-vectors
189  for (HEPUtils::Particle* e : electrons) {
190  if (e->abseta() > 5) continue;
191 
192  // Look up / calculate resolution
193  const double c1 = coeffE2.get_at(e->abseta(), e->pT());
194  const double c2 = coeffE.get_at(e->abseta(), e->pT());
195  const double c3 = coeffC.get_at(e->abseta(), e->pT());
196  const double resolution = sqrt(c1*HEPUtils::sqr(e->E()) + c2*e->E() + c3);
197 
198  // Smear by a Gaussian centered on the current energy, with width given by the resolution
199  std::normal_distribution<> d(e->E(), resolution);
200  double smeared_E = d(Random::rng());
201  if (smeared_E < 0) smeared_E = 0;
202  // double smeared_pt = smeared_E/cosh(e->eta()); ///< @todo Should be cosh(|eta|)?
203  // std::cout << "BEFORE eta " << electron->eta() << std::endl;
204  e->set_mom(HEPUtils::P4::mkEtaPhiME(e->eta(), e->phi(), e->mass(), smeared_E));
205  // std::cout << "AFTER eta " << electron->eta() << std::endl;
206  }
207  }
EXPORT_SYMBOLS double sqr(double a)
returns square of double - saves tedious repetition
Here is the call graph for this function:
Here is the caller graph for this function:

◆ smearJets()

void Gambit::ColliderBit::ATLAS::smearJets ( std::vector< HEPUtils::Jet *> &  jets)
inline

Randomly smear the supplied jets' momenta by parameterised resolutions.

Definition at line 239 of file ATLASEfficiencies.hpp.

References Gambit::Random::rng().

Referenced by Gambit::ColliderBit::getBuckFast(), and Gambit::ColliderBit::BuckFast< EventT >::processEvent().

239  {
240  // Function that mimics the DELPHES jet momentum resolution.
241  // We need to smear pT, then recalculate E, then reset the 4-vector.
242  // Const resolution for now
243  //const double resolution = 0.03;
244 
245  // Matthias jet smearing implemented roughly from
246  // https://atlas.web.cern.ch/Atlas/GROUPS/PHYSICS/CONFNOTES/ATLAS-CONF-2015-017/
247  // Parameterisation can be still improved, but eta dependence is minimal
248  const std::vector<double> binedges_eta = {0,10.};
249  const std::vector<double> binedges_pt = {0,50.,70.,100.,150.,200.,1000.,10000.};
250  const std::vector<double> JetsJER = {0.145,0.115,0.095,0.075,0.07,0.05,0.04};
251  static HEPUtils::BinnedFn2D<double> _resJets2D(binedges_eta,binedges_pt,JetsJER);
252 
253  // Now loop over the jets and smear the 4-vectors
254  for (HEPUtils::Jet* jet : jets) {
255  const double resolution = _resJets2D.get_at(jet->abseta(), jet->pT());
256  std::normal_distribution<> d(1., resolution);
257  // Smear by a Gaussian centered on 1 with width given by the (fractional) resolution
258  double smear_factor = d(Random::rng());
260  jet->set_mom(HEPUtils::P4::mkXYZM(jet->mom().px()*smear_factor, jet->mom().py()*smear_factor, jet->mom().pz()*smear_factor, jet->mass()));
261  }
262  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ smearMET()

void Gambit::ColliderBit::ATLAS::smearMET ( HEPUtils::P4 &  pmiss,
double  set 
)
inline

Randomly smear the MET vector by parameterised resolutions.

Definition at line 266 of file ATLASEfficiencies.hpp.

References Gambit::Random::rng().

Referenced by Gambit::ColliderBit::sortByPT_lep().

266  {
267  // Smearing function from ATLAS Run 1 performance paper, converted from Rivet
268  // cf. https://arxiv.org/pdf/1108.5602v2.pdf, Figs 14 and 15
269 
270  // Linearity offset (Fig 14)
271  if (pmiss.pT() < 25) pmiss *= 1.05;
272  else if (pmiss.pT() < 40) pmiss *= (1.05 - (0.04/15)*(pmiss.pT() - 25)); //< linear decrease
273  else pmiss *= 1.01;
274 
275  // Smear by a Gaussian with width given by the resolution(sumEt) ~ 0.45 sqrt(sumEt) GeV
276  const double resolution = 0.45 * sqrt(set);
277  std::normal_distribution<> d(pmiss.pT(), resolution);
278  const double smearedmet = std::max(d(Random::rng()), 0.);
279 
280  pmiss *= smearedmet / pmiss.pT();
281  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ smearMuonMomentum()

void Gambit::ColliderBit::ATLAS::smearMuonMomentum ( std::vector< HEPUtils::Particle *> &  muons)
inline

Randomly smear the supplied muons' momenta by parameterised resolutions.

Definition at line 211 of file ATLASEfficiencies.hpp.

References Gambit::DecayBit::SM_Z::mu, and Gambit::Random::rng().

Referenced by Gambit::ColliderBit::getBuckFast(), and Gambit::ColliderBit::BuckFast< EventT >::processEvent().

211  {
212  // Function that mimics the DELPHES muon momentum resolution
213  // We need to smear pT, then recalculate E, then reset 4 vector
214 
215  static HEPUtils::BinnedFn2D<double> _muEff({{0,1.5,2.5}},
216  {{0,0.1,1.,10.,200.,DBL_MAX}},
217  {{0.,0.03,0.02,0.03,0.05,
218  0.,0.04,0.03,0.04,0.05}});
219 
220  // Now loop over the muons and smear the 4-vectors
221  for (HEPUtils::Particle* mu : muons) {
222  if (mu->abseta() > 2.5) continue;
223 
224  // Look up resolution
225  const double resolution = _muEff.get_at(mu->abseta(), mu->pT());
226 
227  // Smear by a Gaussian centered on the current energy, with width given by the resolution
228  std::normal_distribution<> d(mu->pT(), resolution*mu->pT());
229  double smeared_pt = d(Random::rng());
230  if (smeared_pt < 0) smeared_pt = 0;
231  // const double smeared_E = smeared_pt*cosh(mu->eta()); ///< @todo Should be cosh(|eta|)?
232  // std::cout << "Muon pt " << mu_pt << " smeared " << smeared_pt << endl;
233  mu->set_mom(HEPUtils::P4::mkEtaPhiMPt(mu->eta(), mu->phi(), mu->mass(), smeared_pt));
234  }
235  }
const double mu
Definition: SM_Z.hpp:42
Here is the call graph for this function:
Here is the caller graph for this function:

◆ smearTaus()

void Gambit::ColliderBit::ATLAS::smearTaus ( std::vector< HEPUtils::Particle *> &  taus)
inline

Randomly smear the supplied taus' momenta by parameterised resolutions.

Definition at line 285 of file ATLASEfficiencies.hpp.

References Gambit::Random::rng().

Referenced by Gambit::ColliderBit::getBuckFast(), and Gambit::ColliderBit::BuckFast< EventT >::processEvent().

285  {
286  // We need to smear pT, then recalculate E, then reset the 4-vector.
287  // Same as for jets, but on a vector of particles. (?)
288  // Const resolution for now
289  const double resolution = 0.03;
290 
291  // Now loop over the jets and smear the 4-vectors
292  std::normal_distribution<> d(1., resolution);
293  for (HEPUtils::Particle* p : taus) {
294  // Smear by a Gaussian centered on 1 with width given by the (fractional) resolution
295  double smear_factor = d(Random::rng());
297  p->set_mom(HEPUtils::P4::mkXYZM(p->mom().px()*smear_factor, p->mom().py()*smear_factor, p->mom().pz()*smear_factor, p->mass()));
298  }
299  }
Here is the call graph for this function:
Here is the caller graph for this function: