CMS 3D CMS Logo

PFJetIDSelectionFunctor.h
Go to the documentation of this file.
1 #ifndef PhysicsTools_SelectorUtils_interface_PFJetIDSelectionFunctor_h
2 #define PhysicsTools_SelectorUtils_interface_PFJetIDSelectionFunctor_h
3 
15 #ifndef __GCCXML__
17 #endif
20 
23 
25 
26 #include <TMath.h>
27 
28 class PFJetIDSelectionFunctor : public Selector<pat::Jet> {
29 public: // interface
30  enum Version_t {
43  };
45 
47 
48 #ifndef __GCCXML__
51 #endif
52 
54  std::string versionStr = params.getParameter<std::string>("version");
55  std::string qualityStr = params.getParameter<std::string>("quality");
56 
57  if (versionStr == "FIRSTDATA")
59  else if (versionStr == "RUNIISTARTUP")
61  else if (versionStr == "WINTER16")
63  else if (versionStr == "WINTER17")
65  else if (versionStr == "WINTER17PUPPI")
67  else if (versionStr == "SUMMER18")
69  else if (versionStr == "SUMMER18PUPPI")
71  else if (versionStr == "RUN2UL16CHS")
73  else if (versionStr == "RUN2UL16PUPPI")
75  else if (versionStr == "RUN2ULCHS")
77  else if (versionStr == "RUN2ULPUPPI")
79  else
80  version_ = RUN2ULCHS; //set RUN2ULCHS as default //this is extremely unsafe
81 
82  if (qualityStr == "LOOSE")
83  quality_ = LOOSE;
84  else if (qualityStr == "TIGHT")
85  quality_ = TIGHT;
86  else if (qualityStr == "TIGHTLEPVETO")
88  else
89  quality_ = TIGHT; //this is extremely unsafe
90 
91  initCuts();
92 
93  // loop over the std::string in bits_ and check for what was overwritten.
94  const auto strings_set = this->bits_.strings();
95  for (auto i = strings_set.begin(); i != strings_set.end(); ++i) {
96  const std::string &item = *i;
97  if (params.exists(item)) {
98  if (params.existsAs<int>(item))
99  set(item, params.getParameter<int>(item));
100  else
101  set(item, params.getParameter<double>(item));
102  }
103  }
104 
105  if (params.exists("cutsToIgnore"))
106  setIgnoredCuts(params.getParameter<std::vector<std::string>>("cutsToIgnore"));
107 
108  initIndex();
109  }
110 
112  initCuts();
113  initIndex();
114  }
115 
116  //
117  // give a configuration description for derived class
118  //
121 
122  desc.ifValue(edm::ParameterDescription<std::string>("version", "RUN2ULCHS", true, edm::Comment("")),
123  edm::allowedValues<std::string>("FIRSTDATA",
124  "RUNIISTARTUP",
125  "WINTER16",
126  "WINTER17",
127  "WINTER17PUPPI",
128  "SUMMER18",
129  "SUMMER18PUPPI",
130  "RUN2UL16CHS",
131  "RUN2UL16PUPPI",
132  "RUN2ULCHS",
133  "RUN2ULPUPPI"));
134  desc.ifValue(edm::ParameterDescription<std::string>("quality", "TIGHT", true, edm::Comment("")),
135  edm::allowedValues<std::string>("LOOSE", "TIGHT", "TIGHTLEPVETO"));
136  desc.addOptional<std::vector<std::string>>("cutsToIgnore")->setComment("");
137 
140  edm::ParameterDescription<double> NHF_FW("NHF_FW", true, edm::Comment(""));
141  edm::ParameterDescription<double> NHF_EC("NHF_EC", true, edm::Comment(""));
142  edm::ParameterDescription<double> NHF_TR("NHF_TR", true, edm::Comment(""));
143 
145  edm::ParameterDescription<double> CEF_TR("CEF_TR", true, edm::Comment(""));
146 
148  edm::ParameterDescription<double> NEF_FW("NEF_FW", true, edm::Comment(""));
149  edm::ParameterDescription<double> NEF_EC_L("NEF_EC_L", true, edm::Comment(""));
150  edm::ParameterDescription<double> NEF_EC_U("NEF_EC_U", true, edm::Comment(""));
151  edm::ParameterDescription<double> NEF_TR("NEF_TR", true, edm::Comment(""));
152 
154 
155  edm::ParameterDescription<double> MUF("MUF", true, edm::Comment(""));
156  edm::ParameterDescription<double> MUF_TR("MUF_TR", true, edm::Comment(""));
157 
158  edm::ParameterDescription<int> nConstituents("nConstituents", true, edm::Comment(""));
159  edm::ParameterDescription<int> nNeutrals_FW("nNeutrals_FW", true, edm::Comment(""));
160  edm::ParameterDescription<int> nNeutrals_FW_L("nNeutrals_FW_L", true, edm::Comment(""));
161  edm::ParameterDescription<int> nNeutrals_FW_U("nNeutrals_FW_U", true, edm::Comment(""));
162  edm::ParameterDescription<int> nnNeutrals_EC("nNeutrals_EC", true, edm::Comment(""));
163 
164  desc.addOptionalNode(CHF, false);
165  desc.addOptionalNode(NHF, false);
166  desc.addOptionalNode(NHF_FW, false);
167  desc.addOptionalNode(NHF_EC, false);
168  desc.addOptionalNode(NHF_TR, false);
169 
170  desc.addOptionalNode(CEF, false);
171  desc.addOptionalNode(CEF_TR, false);
172 
173  desc.addOptionalNode(NEF, false);
174  desc.addOptionalNode(NEF_FW, false);
175  desc.addOptionalNode(NEF_EC_L, false);
176  desc.addOptionalNode(NEF_EC_U, false);
177  desc.addOptionalNode(NEF_TR, false);
178 
179  desc.addOptionalNode(NCH, false);
180 
181  desc.addOptionalNode(MUF, false);
182  desc.addOptionalNode(MUF_TR, false);
183 
184  desc.addOptionalNode(nConstituents, false);
185  desc.addOptionalNode(nNeutrals_FW, false);
186  desc.addOptionalNode(nNeutrals_FW_L, false);
187  desc.addOptionalNode(nNeutrals_FW_U, false);
188  desc.addOptionalNode(nnNeutrals_EC, false);
189 
190  return desc;
191  }
192  //
193  // Accessor from PAT jets
194  //
195  bool operator()(const pat::Jet &jet, pat::strbitset &ret) override {
199  if (jet.currentJECLevel() == "Uncorrected" || !jet.jecSetsAvailable())
200  return firstDataCuts(jet, ret, version_);
201  else
202  return firstDataCuts(jet.correctedJet("Uncorrected"), ret, version_);
203  } else {
204  return false;
205  }
206  }
208 
209  //
210  // Accessor from *CORRECTED* 4-vector, EMF, and Jet ID.
211  // This can be used with reco quantities.
212  //
217  return firstDataCuts(jet, ret, version_);
218  } else {
219  return false;
220  }
221  }
222 
223  bool operator()(const reco::PFJet &jet) {
224  retInternal_.set(false);
227  return (bool)retInternal_;
228  }
229 
230  //
231  // cuts based on craft 08 analysis.
232  //
234  ret.set(false);
235 
236  // cache some variables
237  double chf = 0.0;
238  double nhf = 0.0;
239  double cef = 0.0;
240  double nef = 0.0;
241  double muf = 0.0;
242 
243  int nch = 0;
244  int nconstituents = 0;
245  int nneutrals = 0;
246 
247  // Have to do this because pat::Jet inherits from reco::Jet but not reco::PFJet
248  reco::PFJet const *pfJet = dynamic_cast<reco::PFJet const *>(&jet);
249  pat::Jet const *patJet = dynamic_cast<pat::Jet const *>(&jet);
250  reco::BasicJet const *basicJet = dynamic_cast<reco::BasicJet const *>(&jet);
251 
252  if (patJet != nullptr) {
253  if (patJet->isPFJet()) {
254  chf = patJet->chargedHadronEnergyFraction();
255  nhf = patJet->neutralHadronEnergyFraction();
256  cef = patJet->chargedEmEnergyFraction();
257  nef = patJet->neutralEmEnergyFraction();
258  nch = patJet->chargedMultiplicity();
259  muf = patJet->muonEnergyFraction();
260  nconstituents = patJet->neutralMultiplicity() + patJet->chargedMultiplicity();
261  nneutrals = patJet->neutralMultiplicity();
262  }
263  // Handle the special case where this is a composed jet for
264  // subjet analyses
265  else if (patJet->isBasicJet()) {
266  double e_chf = 0.0;
267  double e_nhf = 0.0;
268  double e_cef = 0.0;
269  double e_nef = 0.0;
270  double e_muf = 0.0;
271  nch = 0;
272  nconstituents = 0;
273  nneutrals = 0;
274 
275  for (reco::Jet::const_iterator ibegin = patJet->begin(), iend = patJet->end(), isub = ibegin; isub != iend;
276  ++isub) {
277  reco::PFJet const *pfsub = dynamic_cast<reco::PFJet const *>(&*isub);
278  pat::Jet const *patsub = dynamic_cast<pat::Jet const *>(&*isub);
279  if (patsub) {
280  e_chf += patsub->chargedHadronEnergy();
281  e_nhf += patsub->neutralHadronEnergy();
282  e_cef += patsub->chargedEmEnergy();
283  e_nef += patsub->neutralEmEnergy();
284  e_muf += patsub->muonEnergy();
285  nch += patsub->chargedMultiplicity();
286  nconstituents += patsub->neutralMultiplicity() + patsub->chargedMultiplicity();
287  nneutrals += patsub->neutralMultiplicity();
288  } else if (pfsub) {
289  e_chf += pfsub->chargedHadronEnergy();
290  e_nhf += pfsub->neutralHadronEnergy();
291  e_cef += pfsub->chargedEmEnergy();
292  e_nef += pfsub->neutralEmEnergy();
293  e_muf += pfsub->muonEnergy();
294  nch += pfsub->chargedMultiplicity();
295  nconstituents += pfsub->neutralMultiplicity() + pfsub->chargedMultiplicity();
296  nneutrals += pfsub->neutralMultiplicity();
297  } else
298  assert(0);
299  }
300  double e = patJet->energy();
301  if (e > 0.000001) {
302  chf = e_chf / e;
303  nhf = e_nhf / e;
304  cef = e_cef / e;
305  nef = e_nef / e;
306  muf = e_muf / e;
307  } else {
308  chf = nhf = cef = nef = muf = 0.0;
309  }
310  }
311  } // end if pat jet
312  else if (pfJet != nullptr) {
313  // CV: need to compute energy fractions in a way that works for corrected as well as for uncorrected PFJets
314  double jetEnergyUncorrected = pfJet->chargedHadronEnergy() + pfJet->neutralHadronEnergy() +
315  pfJet->photonEnergy() + pfJet->electronEnergy() + pfJet->muonEnergy() +
316  pfJet->HFEMEnergy();
317  if (jetEnergyUncorrected > 0.) {
318  chf = pfJet->chargedHadronEnergy() / jetEnergyUncorrected;
319  nhf = pfJet->neutralHadronEnergy() / jetEnergyUncorrected;
320  cef = pfJet->chargedEmEnergy() / jetEnergyUncorrected;
321  nef = pfJet->neutralEmEnergy() / jetEnergyUncorrected;
322  muf = pfJet->muonEnergy() / jetEnergyUncorrected;
323  }
324  nch = pfJet->chargedMultiplicity();
325  nconstituents = pfJet->neutralMultiplicity() + pfJet->chargedMultiplicity();
326  nneutrals = pfJet->neutralMultiplicity();
327  } // end if PF jet
328  // Handle the special case where this is a composed jet for
329  // subjet analyses
330  else if (basicJet != nullptr) {
331  double e_chf = 0.0;
332  double e_nhf = 0.0;
333  double e_cef = 0.0;
334  double e_nef = 0.0;
335  double e_muf = 0.0;
336  nch = 0;
337  nconstituents = 0;
338  for (reco::Jet::const_iterator ibegin = basicJet->begin(), iend = basicJet->end(), isub = ibegin; isub != iend;
339  ++isub) {
340  reco::PFJet const *pfsub = dynamic_cast<reco::PFJet const *>(&*isub);
341  e_chf += pfsub->chargedHadronEnergy();
342  e_nhf += pfsub->neutralHadronEnergy();
343  e_cef += pfsub->chargedEmEnergy();
344  e_nef += pfsub->neutralEmEnergy();
345  e_muf += pfsub->muonEnergy();
346  nch += pfsub->chargedMultiplicity();
347  nconstituents += pfsub->neutralMultiplicity() + pfsub->chargedMultiplicity();
348  nneutrals += pfsub->neutralMultiplicity();
349  }
350  double e = basicJet->energy();
351  if (e > 0.000001) {
352  chf = e_chf / e;
353  nhf = e_nhf / e;
354  cef = e_cef / e;
355  nef = e_nef / e;
356  muf = e_muf / e;
357  }
358  } // end if basic jet
359 
360  float etaB = 2.4;
361  // Cuts for |eta| < 2.6 for Summer18
363  etaB = 2.6;
366  quality_ != TIGHT) {
367  if (ignoreCut(indexCEF_) || (cef < cut(indexCEF_, double()) || std::abs(jet.eta()) > etaB))
369  }
370  if (ignoreCut(indexCHF_) || (chf > cut(indexCHF_, double()) || std::abs(jet.eta()) > etaB))
372  if (ignoreCut(indexNCH_) || (nch > cut(indexNCH_, int()) || std::abs(jet.eta()) > etaB))
374  if (version_ == FIRSTDATA) { // Cuts for all eta for FIRSTDATA
375  if (ignoreCut(indexNConstituents_) || (nconstituents > cut(indexNConstituents_, int())))
377  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double())))
379  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double())))
381  } else if (version_ == RUNIISTARTUP) {
382  // Cuts for |eta| <= 3.0 for RUNIISTARTUP scenario
384  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 3.0))
386  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 3.0))
388  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 3.0))
390  // Cuts for |eta| > 3.0 for RUNIISTARTUP scenario
391  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
393  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
395  } else if (version_ == WINTER16) {
396  // Cuts for |eta| <= 2.7 for WINTER16 scenario
398  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.7))
400  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.7))
402  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.7))
404  if (quality_ == TIGHTLEPVETO) {
405  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.7))
407  }
408 
409  // Cuts for 2.7 < |eta| <= 3.0 for WINTER16 scenario
410  if (ignoreCut(indexNHF_EC_) ||
411  (nhf < cut(indexNHF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
413  if (ignoreCut(indexNEF_EC_) ||
414  (nef > cut(indexNEF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
417  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
419 
420  // Cuts for |eta| > 3.0 for WINTER16 scenario
421  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
423  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
425  } else if (version_ == WINTER17) {
426  // Cuts for |eta| <= 2.7 for WINTER17 scenario
428  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.7))
430  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.7))
432  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.7))
434  if (quality_ == TIGHTLEPVETO) {
435  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.7))
437  }
438 
439  // Cuts for 2.7 < |eta| <= 3.0 for WINTER17 scenario
440 
441  if (ignoreCut(indexNEF_EC_L_) ||
442  (nef > cut(indexNEF_EC_L_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
444  if (ignoreCut(indexNEF_EC_U_) ||
445  (nef < cut(indexNEF_EC_U_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
448  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
450 
451  // Cuts for |eta| > 3.0 for WINTER17 scenario
452  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
454  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
456  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
458 
459  } else if (version_ == WINTER17PUPPI) {
460  // Cuts for |eta| <= 2.7 for WINTER17 scenario
462  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.7))
464  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.7))
466  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.7))
468  if (quality_ == TIGHTLEPVETO) {
469  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.7))
471  }
472 
473  // Cuts for 2.7 < |eta| <= 3.0 for WINTER17 scenario
474 
475  if (ignoreCut(indexNHF_EC_) ||
476  (nhf < cut(indexNHF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
478 
479  // Cuts for |eta| > 3.0 for WINTER17 scenario
480  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
482  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
485  (nneutrals > cut(indexNNeutrals_FW_L_, int()) || std::abs(jet.eta()) <= 3.0))
488  (nneutrals < cut(indexNNeutrals_FW_U_, int()) || std::abs(jet.eta()) <= 3.0))
490 
491  } else if (version_ == RUN2UL16CHS) {
492  // Cuts for |eta| <= 2.4 for RUN2UL16CHS scenario
494  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.4))
496  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.4))
498  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.4))
500  if (quality_ == TIGHTLEPVETO) {
501  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.4))
503  }
504 
505  // Cuts for 2.4 <= |eta| <= 2.7 for RUN2UL16CHS scenario
506  if (ignoreCut(indexNHF_TR_) ||
507  (nhf < cut(indexNHF_TR_, double()) || std::abs(jet.eta()) <= 2.4 || std::abs(jet.eta()) > 2.7))
509  if (ignoreCut(indexNEF_TR_) ||
510  (nef < cut(indexNEF_TR_, double()) || std::abs(jet.eta()) <= 2.4 || std::abs(jet.eta()) > 2.7))
512 
513  // Cuts for 2.7 < |eta| <= 3.0 for RUN2UL16CHS scenario
514  if (ignoreCut(indexNHF_EC_) ||
515  (nhf < cut(indexNHF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
517  if (ignoreCut(indexNEF_EC_L_) ||
518  (nef > cut(indexNEF_EC_L_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
520  if (ignoreCut(indexNEF_EC_U_) ||
521  (nef < cut(indexNEF_EC_U_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
524  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
526 
527  // Cuts for |eta| > 3.0 for RUN2UL16CHS scenario
528  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
530  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
532  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
534 
535  } else if (version_ == RUN2UL16PUPPI) {
536  // Cuts for |eta| <= 2.4 for RUN2UL16PUPPI scenario
538  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.4))
540  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.4))
542  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.4))
544  if (quality_ == TIGHTLEPVETO) {
545  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.4))
547  }
548 
549  // Cuts for 2.4 <= |eta| <= 2.7 for RUN2UL16PUPPI scenario
550  if (ignoreCut(indexNHF_TR_) ||
551  (nhf < cut(indexNHF_TR_, double()) || std::abs(jet.eta()) <= 2.4 || std::abs(jet.eta()) > 2.7))
553  if (ignoreCut(indexNEF_TR_) ||
554  (nef < cut(indexNEF_TR_, double()) || std::abs(jet.eta()) <= 2.4 || std::abs(jet.eta()) > 2.7))
556 
557  // Cuts for 2.7 < |eta| <= 3.0 for RUN2UL16PUPPI scenario
559  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
561 
562  // Cuts for |eta| > 3.0 for RUN2UL16PUPPI scenario
563  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
566  (nneutrals > cut(indexNNeutrals_FW_L_, int()) || std::abs(jet.eta()) <= 3.0))
569  (nneutrals < cut(indexNNeutrals_FW_U_, int()) || std::abs(jet.eta()) <= 3.0))
571 
572  } else if ((version_ == SUMMER18) || (version_ == RUN2ULCHS)) {
573  // Cuts for |eta| <= 2.6 for SUMMER18 scenario
575  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.6))
577  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.6))
579  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.6))
581  if (quality_ == TIGHTLEPVETO) {
582  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.6))
584  }
585 
586  // Cuts for 2.6 <= |eta| <= 2.7 for SUMMER18 scenario
587  if (ignoreCut(indexNHF_TR_) ||
588  (nhf < cut(indexNHF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
590  if (ignoreCut(indexNEF_TR_) ||
591  (nef < cut(indexNEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
593  if (ignoreCut(indexNCH_TR_) ||
594  (nch > cut(indexNCH_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
596  if (quality_ == TIGHTLEPVETO) {
597  if (ignoreCut(indexMUF_TR_) ||
598  (muf < cut(indexMUF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
600  if (ignoreCut(indexCEF_TR_) ||
601  (cef < cut(indexCEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
603  }
604 
605  // Cuts for 2.7 < |eta| <= 3.0 for SUMMER18 scenario
606  if (ignoreCut(indexNEF_EC_L_) ||
607  (nef > cut(indexNEF_EC_L_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
609  if (ignoreCut(indexNEF_EC_U_) ||
610  (nef < cut(indexNEF_EC_U_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
613  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
615 
616  // Cuts for |eta| > 3.0 for SUMMER18 scenario
617  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
619  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
621  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
623  }
624 
625  else if ((version_ == SUMMER18PUPPI) || (version_ == RUN2ULPUPPI)) {
626  // Cuts for |eta| <= 2.6 for SUMMER18PUPPI scenario
628  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.6))
630  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.6))
632  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.6))
634  if (quality_ == TIGHTLEPVETO) {
635  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.6))
637  }
638 
639  // Cuts for 2.6 <= |eta| <= 2.7 for SUMMER18PUPPI scenario
640  if (ignoreCut(indexNHF_TR_) ||
641  (nhf < cut(indexNHF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
643  if (ignoreCut(indexNEF_TR_) ||
644  (nef < cut(indexNEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
646  if (quality_ == TIGHTLEPVETO) {
647  if (ignoreCut(indexMUF_TR_) ||
648  (muf < cut(indexMUF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
650  if (ignoreCut(indexCEF_TR_) ||
651  (cef < cut(indexCEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
653  }
654 
655  // Cuts for 2.7 < |eta| <= 3.0 for SUMMER18PUPPI scenario
656  if (ignoreCut(indexNHF_EC_) ||
657  (nhf < cut(indexNHF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
659 
660  // Cuts for |eta| > 3.0 for SUMMER18PUPPI scenario
661  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
663  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
666  (nneutrals > cut(indexNNeutrals_FW_L_, int()) || std::abs(jet.eta()) <= 3.0))
669  (nneutrals < cut(indexNNeutrals_FW_U_, int()) || std::abs(jet.eta()) <= 3.0))
671  }
672 
673  //std::cout << "<PFJetIDSelectionFunctor::firstDataCuts>:" << std::endl;
674  //std::cout << " jet: Pt = " << jet.pt() << ", eta = " << jet.eta() << ", phi = " << jet.phi() << std::endl;
675  //ret.print(std::cout);
676  setIgnored(ret);
677  return (bool)ret;
678  }
679 
680 private: // member variables
681  void initCuts() {
682  push_back("CHF");
683  push_back("NHF");
686  quality_ != TIGHT)
687  push_back("CEF");
688  push_back("NEF");
689  push_back("NCH");
690  push_back("nConstituents");
691  if (version_ == RUNIISTARTUP) {
692  push_back("NEF_FW");
693  push_back("nNeutrals_FW");
694  }
695  if (version_ == WINTER16) {
696  push_back("NHF_EC");
697  push_back("NEF_EC");
698  push_back("nNeutrals_EC");
699  push_back("NEF_FW");
700  push_back("nNeutrals_FW");
701  if (quality_ == TIGHTLEPVETO)
702  push_back("MUF");
703  }
704  if (version_ == WINTER17) {
705  push_back("NEF_EC_L");
706  push_back("NEF_EC_U");
707  push_back("nNeutrals_EC");
708  push_back("NEF_FW");
709  push_back("NHF_FW");
710  push_back("nNeutrals_FW");
711  if (quality_ == TIGHTLEPVETO)
712  push_back("MUF");
713  }
714  if (version_ == WINTER17PUPPI) {
715  push_back("NHF_EC");
716  push_back("NEF_FW");
717  push_back("NHF_FW");
718  push_back("nNeutrals_FW_L");
719  push_back("nNeutrals_FW_U");
720  if (quality_ == TIGHTLEPVETO)
721  push_back("MUF");
722  }
723  if (version_ == RUN2UL16CHS) {
724  push_back("NHF_TR");
725  push_back("NEF_TR");
726  push_back("NHF_EC");
727  push_back("NEF_EC_L");
728  push_back("NEF_EC_U");
729  push_back("nNeutrals_EC");
730  push_back("NEF_FW");
731  push_back("NHF_FW");
732  push_back("nNeutrals_FW");
733 
734  if (quality_ == TIGHTLEPVETO) {
735  push_back("MUF");
736  }
737  }
738  if (version_ == RUN2UL16PUPPI) {
739  push_back("NHF_TR");
740  push_back("NEF_TR");
741  push_back("nNeutrals_EC");
742  push_back("NEF_FW");
743  push_back("nNeutrals_FW_L");
744  push_back("nNeutrals_FW_U");
745 
746  if (quality_ == TIGHTLEPVETO) {
747  push_back("MUF");
748  }
749  }
750  if ((version_ == SUMMER18) || (version_ == RUN2ULCHS)) {
751  push_back("NHF_TR");
752  push_back("NEF_TR");
753  push_back("NCH_TR");
754  push_back("NEF_EC_L");
755  push_back("NEF_EC_U");
756  push_back("nNeutrals_EC");
757  push_back("NEF_FW");
758  push_back("NHF_FW");
759  push_back("nNeutrals_FW");
760 
761  if (quality_ == TIGHTLEPVETO) {
762  push_back("MUF");
763  push_back("MUF_TR");
764  push_back("CEF_TR");
765  }
766  }
767  if ((version_ == SUMMER18PUPPI) || (version_ == RUN2ULPUPPI)) {
768  push_back("NHF_TR");
769  push_back("NEF_TR");
770  push_back("NHF_EC");
771  push_back("NEF_FW");
772  push_back("NHF_FW");
773  push_back("nNeutrals_FW_L");
774  push_back("nNeutrals_FW_U");
775 
776  if (quality_ == TIGHTLEPVETO) {
777  push_back("MUF");
778  push_back("MUF_TR");
779  push_back("CEF_TR");
780  }
781  }
782 
785  quality_ == LOOSE) {
786  edm::LogWarning("BadJetIDVersion")
787  << "The LOOSE operating point is only supported for the WINTER16 JetID version -- defaulting to TIGHT";
788  quality_ = TIGHT;
789  }
790 
791  // Set some default cuts for LOOSE, TIGHT
792  if (quality_ == LOOSE) {
793  set("CHF", 0.0);
794  set("NHF", 0.99);
795  set("CEF", 0.99);
796  set("NEF", 0.99);
797  set("NCH", 0);
798  set("nConstituents", 1);
799  if (version_ == RUNIISTARTUP) {
800  set("NEF_FW", 0.90);
801  set("nNeutrals_FW", 10);
802  } else if (version_ == WINTER16) {
803  set("NHF_EC", 0.98);
804  set("NEF_EC", 0.01);
805  set("nNeutrals_EC", 2);
806  set("NEF_FW", 0.90);
807  set("nNeutrals_FW", 10);
808  }
809  } else if (quality_ == TIGHT) {
810  set("CHF", 0.0);
811  set("NHF", 0.9);
814  set("CEF", 0.99);
815  set("NEF", 0.9);
816  set("NCH", 0);
817  set("nConstituents", 1);
818  if (version_ == RUNIISTARTUP) {
819  set("NEF_FW", 0.90);
820  set("nNeutrals_FW", 10);
821  } else if (version_ == WINTER16) {
822  set("NHF_EC", 0.98);
823  set("NEF_EC", 0.01);
824  set("nNeutrals_EC", 2);
825  set("NEF_FW", 0.90);
826  set("nNeutrals_FW", 10);
827  } else if (version_ == WINTER17) {
828  set("NEF_EC_L", 0.02);
829  set("NEF_EC_U", 0.99);
830  set("nNeutrals_EC", 2);
831  set("NHF_FW", 0.02);
832  set("NEF_FW", 0.90);
833  set("nNeutrals_FW", 10);
834  } else if (version_ == WINTER17PUPPI) {
835  set("NHF_EC", 0.99);
836  set("NHF_FW", 0.02);
837  set("NEF_FW", 0.90);
838  set("nNeutrals_FW_L", 2);
839  set("nNeutrals_FW_U", 15);
840  } else if (version_ == SUMMER18) {
841  set("NHF_TR", 0.9);
842  set("NEF_TR", 0.99);
843  set("NCH_TR", 0);
844  set("NEF_EC_L", 0.02);
845  set("NEF_EC_U", 0.99);
846  set("nNeutrals_EC", 2);
847  set("NHF_FW", 0.2);
848  set("NEF_FW", 0.90);
849  set("nNeutrals_FW", 10);
850  } else if (version_ == SUMMER18PUPPI) {
851  set("NHF_TR", 0.9);
852  set("NEF_TR", 0.99);
853  set("NHF_EC", 0.99);
854  set("NHF_FW", 0.02);
855  set("NEF_FW", 0.90);
856  set("nNeutrals_FW_L", 2);
857  set("nNeutrals_FW_U", 15);
858  } else if (version_ == RUN2UL16CHS) {
859  set("NHF_TR", 0.9);
860  set("NEF_TR", 0.99);
861  set("NHF_EC", 0.9);
862  set("NEF_EC_L", 0.);
863  set("NEF_EC_U", 0.99);
864  set("nNeutrals_EC", 1);
865  set("NHF_FW", 0.2);
866  set("NEF_FW", 0.90);
867  set("nNeutrals_FW", 10);
868  } else if (version_ == RUN2UL16PUPPI) {
869  set("NHF_TR", 0.98);
870  set("NEF_TR", 0.99);
871  set("nNeutrals_EC", 1);
872  set("NEF_FW", 0.90);
873  set("nNeutrals_FW_L", 2);
874  set("nNeutrals_FW_U", 999999);
875  } else if (version_ == RUN2ULCHS) {
876  set("NHF_TR", 0.9);
877  set("NEF_TR", 0.99);
878  set("NCH_TR", 0);
879  set("NEF_EC_L", 0.01);
880  set("NEF_EC_U", 0.99);
881  set("nNeutrals_EC", 2);
882  set("NHF_FW", 0.2);
883  set("NEF_FW", 0.90);
884  set("nNeutrals_FW", 10);
885  } else if (version_ == RUN2ULPUPPI) {
886  set("NHF_TR", 0.9);
887  set("NEF_TR", 0.99);
888  set("NHF_EC", 0.9999);
889  set("NHF_FW", -1.0);
890  set("NEF_FW", 0.90);
891  set("nNeutrals_FW_L", 2);
892  set("nNeutrals_FW_U", 999999);
893  }
894  } else if (quality_ == TIGHTLEPVETO) {
895  set("CHF", 0.0);
896  set("NHF", 0.9);
897  set("NEF", 0.9);
898  set("NCH", 0);
899  set("nConstituents", 1);
900  if (version_ == WINTER17) {
901  set("CEF", 0.8);
902  set("NEF_EC_L", 0.02);
903  set("NEF_EC_U", 0.99);
904  set("nNeutrals_EC", 2);
905  set("NHF_FW", 0.02);
906  set("NEF_FW", 0.90);
907  set("nNeutrals_FW", 10);
908  set("MUF", 0.8);
909  } else if (version_ == WINTER17PUPPI) {
910  set("CEF", 0.8);
911  set("NHF_EC", 0.99);
912  set("NHF_FW", 0.02);
913  set("NEF_FW", 0.90);
914  set("nNeutrals_FW_L", 2);
915  set("nNeutrals_FW_U", 15);
916  set("MUF", 0.8);
917  } else if (version_ == WINTER16) {
918  set("CEF", 0.9);
919  set("NEF_EC", 0.01);
920  set("NHF_EC", 0.98);
921  set("nNeutrals_EC", 2);
922  set("nNeutrals_FW", 10);
923  set("NEF_FW", 0.90);
924  set("MUF", 0.8);
925  } else if (version_ == WINTER17PUPPI) {
926  set("CEF", 0.8);
927  set("NHF_EC", 0.99);
928  set("NHF_FW", 0.02);
929  set("NEF_FW", 0.90);
930  set("nNeutrals_FW_L", 2);
931  set("nNeutrals_FW_U", 15);
932  set("MUF", 0.8);
933  } else if (version_ == WINTER16) {
934  set("CEF", 0.9);
935  set("NEF_EC", 0.01);
936  set("NHF_EC", 0.98);
937  set("nNeutrals_EC", 2);
938  set("nNeutrals_FW", 10);
939  set("NEF_FW", 0.90);
940  set("MUF", 0.8);
941  } else if (version_ == SUMMER18) {
942  set("CEF", 0.8);
943  set("MUF", 0.8);
944  set("NHF_TR", 0.9);
945  set("NEF_TR", 0.99);
946  set("MUF_TR", 0.8);
947  set("NCH_TR", 0);
948  set("CEF_TR", 0.8);
949  set("NEF_EC_L", 0.02);
950  set("NEF_EC_U", 0.99);
951  set("nNeutrals_EC", 2);
952  set("NHF_FW", 0.2);
953  set("NEF_FW", 0.90);
954  set("nNeutrals_FW", 10);
955  } else if (version_ == SUMMER18PUPPI) {
956  set("CEF", 0.8);
957  set("MUF", 0.8);
958  set("NHF_TR", 0.9);
959  set("NEF_TR", 0.99);
960  set("MUF_TR", 0.8);
961  set("CEF_TR", 0.8);
962  set("NHF_EC", 0.99);
963  set("NHF_FW", 0.02);
964  set("NEF_FW", 0.90);
965  set("nNeutrals_FW_L", 2);
966  set("nNeutrals_FW_U", 15);
967  } else if (version_ == RUN2UL16CHS) {
968  set("MUF", 0.8);
969  set("CEF", 0.8);
970  set("NHF_TR", 0.9);
971  set("NEF_TR", 0.99);
972  set("NHF_EC", 0.9);
973  set("NEF_EC_L", 0.);
974  set("NEF_EC_U", 0.99);
975  set("nNeutrals_EC", 1);
976  set("NHF_FW", 0.2);
977  set("NEF_FW", 0.90);
978  set("nNeutrals_FW", 10);
979  } else if (version_ == RUN2UL16PUPPI) {
980  set("MUF", 0.8);
981  set("CEF", 0.8);
982  set("NHF_TR", 0.98);
983  set("NEF_TR", 0.99);
984  set("nNeutrals_EC", 1);
985  set("NEF_FW", 0.90);
986  set("nNeutrals_FW_L", 2);
987  set("nNeutrals_FW_U", 999999);
988  } else if (version_ == RUN2ULCHS) {
989  set("CEF", 0.8);
990  set("MUF", 0.8);
991  set("NHF_TR", 0.9);
992  set("NEF_TR", 0.99);
993  set("MUF_TR", 0.8);
994  set("NCH_TR", 0);
995  set("CEF_TR", 0.8);
996  set("NEF_EC_L", 0.01);
997  set("NEF_EC_U", 0.99);
998  set("nNeutrals_EC", 2);
999  set("NHF_FW", 0.2);
1000  set("NEF_FW", 0.90);
1001  set("nNeutrals_FW", 10);
1002  } else if (version_ == RUN2ULPUPPI) {
1003  set("CEF", 0.8);
1004  set("MUF", 0.8);
1005  set("NHF_TR", 0.9);
1006  set("NEF_TR", 0.99);
1007  set("MUF_TR", 0.8);
1008  set("CEF_TR", 0.8);
1009  set("NHF_EC", 0.9999);
1010  set("NHF_FW", -1.0);
1011  set("NEF_FW", 0.90);
1012  set("nNeutrals_FW_L", 2);
1013  set("nNeutrals_FW_U", 999999);
1014  }
1015  }
1016  }
1017 
1018  void initIndex() {
1019  indexNConstituents_ = index_type(&bits_, "nConstituents");
1020  indexNEF_ = index_type(&bits_, "NEF");
1021  indexNHF_ = index_type(&bits_, "NHF");
1024  quality_ != TIGHT)
1025  indexCEF_ = index_type(&bits_, "CEF");
1026 
1027  indexCHF_ = index_type(&bits_, "CHF");
1028  indexNCH_ = index_type(&bits_, "NCH");
1029  if (version_ == RUNIISTARTUP) {
1030  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1031  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
1032  }
1033  if (version_ == WINTER16) {
1034  indexNHF_EC_ = index_type(&bits_, "NHF_EC");
1035  indexNEF_EC_ = index_type(&bits_, "NEF_EC");
1036  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
1037  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1038  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
1039  if (quality_ == TIGHTLEPVETO) {
1040  indexMUF_ = index_type(&bits_, "MUF");
1041  }
1042  }
1043  if (version_ == WINTER17) {
1044  indexNEF_EC_L_ = index_type(&bits_, "NEF_EC_L");
1045  indexNEF_EC_U_ = index_type(&bits_, "NEF_EC_U");
1046  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
1047  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
1048  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1049  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
1050  if (quality_ == TIGHTLEPVETO) {
1051  indexMUF_ = index_type(&bits_, "MUF");
1052  }
1053  }
1054  if (version_ == WINTER17PUPPI) {
1055  indexNHF_EC_ = index_type(&bits_, "NHF_EC");
1056  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
1057  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1058  indexNNeutrals_FW_L_ = index_type(&bits_, "nNeutrals_FW_L");
1059  indexNNeutrals_FW_U_ = index_type(&bits_, "nNeutrals_FW_U");
1060  if (quality_ == TIGHTLEPVETO) {
1061  indexMUF_ = index_type(&bits_, "MUF");
1062  }
1063  }
1064  if ((version_ == SUMMER18) || (version_ == RUN2ULCHS)) {
1065  indexNHF_TR_ = index_type(&bits_, "NHF_TR");
1066  indexNEF_TR_ = index_type(&bits_, "NEF_TR");
1067  indexNCH_TR_ = index_type(&bits_, "NCH_TR");
1068  indexNEF_EC_L_ = index_type(&bits_, "NEF_EC_L");
1069  indexNEF_EC_U_ = index_type(&bits_, "NEF_EC_U");
1070  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
1071  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
1072  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1073  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
1074  if (quality_ == TIGHTLEPVETO) {
1075  indexMUF_ = index_type(&bits_, "MUF");
1076  indexMUF_TR_ = index_type(&bits_, "MUF_TR");
1077  indexCEF_TR_ = index_type(&bits_, "CEF_TR");
1078  }
1079  }
1080  if ((version_ == SUMMER18PUPPI) || (version_ == RUN2ULPUPPI)) {
1081  indexNHF_TR_ = index_type(&bits_, "NHF_TR");
1082  indexNEF_TR_ = index_type(&bits_, "NEF_TR");
1083  indexNHF_EC_ = index_type(&bits_, "NHF_EC");
1084  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
1085  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1086  indexNNeutrals_FW_L_ = index_type(&bits_, "nNeutrals_FW_L");
1087  indexNNeutrals_FW_U_ = index_type(&bits_, "nNeutrals_FW_U");
1088  if (quality_ == TIGHTLEPVETO) {
1089  indexMUF_ = index_type(&bits_, "MUF");
1090  indexMUF_TR_ = index_type(&bits_, "MUF_TR");
1091  indexCEF_TR_ = index_type(&bits_, "CEF_TR");
1092  }
1093  }
1094  if (version_ == RUN2UL16CHS) {
1095  indexNHF_TR_ = index_type(&bits_, "NHF_TR");
1096  indexNEF_TR_ = index_type(&bits_, "NEF_TR");
1097  indexNHF_EC_ = index_type(&bits_, "NHF_EC");
1098  indexNEF_EC_L_ = index_type(&bits_, "NEF_EC_L");
1099  indexNEF_EC_U_ = index_type(&bits_, "NEF_EC_U");
1100  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
1101  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
1102  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1103  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
1104  if (quality_ == TIGHTLEPVETO) {
1105  indexMUF_ = index_type(&bits_, "MUF");
1106  }
1107  }
1108  if (version_ == RUN2UL16PUPPI) {
1109  indexNHF_TR_ = index_type(&bits_, "NHF_TR");
1110  indexNEF_TR_ = index_type(&bits_, "NEF_TR");
1111  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
1112  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1113  indexNNeutrals_FW_L_ = index_type(&bits_, "nNeutrals_FW_L");
1114  indexNNeutrals_FW_U_ = index_type(&bits_, "nNeutrals_FW_U");
1115  if (quality_ == TIGHTLEPVETO) {
1116  indexMUF_ = index_type(&bits_, "MUF");
1117  }
1118  }
1120  }
1121 
1124 
1132 
1138 
1144 
1150 };
1151 
1152 #endif
bool ignoreCut(std::string const &s) const
ignore the cut at index "s"
Definition: Selector.h:127
float muonEnergy() const
muonEnergy
Definition: Jet.h:428
float neutralHadronEnergy() const
neutralHadronEnergy
Definition: PFJet.h:99
int chargedMultiplicity() const
chargedMultiplicity
Definition: PFJet.h:152
int chargedMultiplicity() const
chargedMultiplicity
Definition: Jet.h:740
float chargedEmEnergy() const
chargedEmEnergy
Definition: PFJet.h:139
float neutralEmEnergy() const
neutralEmEnergy
Definition: PFJet.h:147
ret
prodAgent to be discontinued
PFJetIDSelectionFunctor(edm::ParameterSet const &params, edm::ConsumesCollector &iC)
Base class for all types of Jets.
Definition: Jet.h:20
bool isBasicJet() const
check to see if the jet is no more than a reco::BasicJet
Definition: Jet.h:277
pat::strbitset::index_type index_type
Definition: Selector.h:25
int neutralMultiplicity() const
neutralMultiplicity
Definition: Jet.h:464
void setIgnored(pat::strbitset &ret)
set ignored bits
Definition: Selector.h:181
pat::strbitset retInternal_
internal ret if users don&#39;t care about return bits
Definition: Selector.h:242
const std::vector< std::string > strings() const
give access to the ordered strings
Definition: strbitset.h:295
int neutralMultiplicity() const
neutralMultiplicity
Definition: PFJet.h:154
Jets made from CaloTowers.
Definition: BasicJet.h:19
float neutralHadronEnergyFraction() const
neutralHadronEnergyFraction (relative to uncorrected jet energy)
Definition: Jet.h:402
assert(be >=bs)
Jets made from PFObjects.
Definition: PFJet.h:20
PFJetIDSelectionFunctor(Version_t version, Quality_t quality)
bool operator()(const reco::PFJet &jet, pat::strbitset &ret)
PFJetIDSelectionFunctor(edm::ParameterSet const &params)
float chargedHadronEnergy() const
chargedHadronEnergy
Definition: Jet.h:694
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:241
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
Definition: Selector.h:142
float electronEnergy() const
electronEnergy
Definition: PFJet.h:107
const_iterator end() const
last daughter const_iterator
Definition: Candidate.h:145
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
virtual void push_back(std::string const &s)
This is the registration of an individual cut string.
Definition: Selector.h:42
bool operator()(const reco::PFJet &jet)
float chargedEmEnergy() const
chargedEmEnergy
Definition: Jet.h:712
Functor that operates on <T>
Definition: Selector.h:22
bool isPFJet() const
check to see if the jet is a reco::PFJet
Definition: Jet.h:275
PF Jet selector for pat::Jets.
float neutralHadronEnergy() const
neutralHadronEnergy
Definition: Jet.h:704
float chargedHadronEnergyFraction() const
chargedHadronEnergyFraction (relative to uncorrected jet energy)
Definition: Jet.h:398
float HFEMEnergy() const
HFEMEnergy.
Definition: PFJet.h:119
static edm::ParameterSetDescription getDescription()
pat::strbitset getBitTemplate() const
Get an empty bitset with the proper names.
Definition: Selector.h:168
bool operator()(const pat::Jet &jet, pat::strbitset &ret) override
This provides the interface for base classes to select objects.
strbitset & set(bool val=true)
set method of all bits
Definition: strbitset.h:126
int cut(index_type const &i, int val) const
Access the int cut values at index "s".
Definition: Selector.h:158
Analysis-level calorimeter jet class.
Definition: Jet.h:77
float muonEnergy() const
muonEnergy
Definition: PFJet.h:111
float chargedEmEnergyFraction() const
chargedEmEnergyFraction (relative to uncorrected jet energy)
Definition: Jet.h:406
float muonEnergyFraction() const
muonEnergyFraction (relative to corrected jet energy)
Definition: Jet.h:430
float neutralEmEnergy() const
neutralEmEnergy
Definition: Jet.h:722
float neutralEmEnergyFraction() const
neutralEmEnergyFraction (relative to uncorrected jet energy)
Definition: Jet.h:410
float chargedHadronEnergy() const
chargedHadronEnergy
Definition: PFJet.h:95
float photonEnergy() const
photonEnergy
Definition: PFJet.h:103
void setIgnoredCuts(std::vector< std::string > const &bitsToIgnore)
set the bits to ignore from a vector
Definition: Selector.h:131
Log< level::Warning, false > LogWarning
string quality
bool firstDataCuts(reco::Jet const &jet, pat::strbitset &ret, Version_t version_)
const_iterator begin() const
first daughter const_iterator
Definition: Candidate.h:143
double energy() const final
energy