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 {
47  };
49 
51 
52 #ifndef __GCCXML__
55 #endif
56 
58  std::string versionStr = params.getParameter<std::string>("version");
59  std::string qualityStr = params.getParameter<std::string>("quality");
60 
61  if (versionStr == "FIRSTDATA")
63  else if (versionStr == "RUNIISTARTUP")
65  else if (versionStr == "WINTER16")
67  else if (versionStr == "WINTER17")
69  else if (versionStr == "WINTER17PUPPI")
71  else if (versionStr == "SUMMER18")
73  else if (versionStr == "SUMMER18PUPPI")
75  else if (versionStr == "RUN2UL16CHS")
77  else if (versionStr == "RUN2UL16PUPPI")
79  else if (versionStr == "RUN2ULCHS")
81  else if (versionStr == "RUN2ULPUPPI")
83  else if (versionStr == "RUN3CHSrunsBCDEprompt")
85  else if (versionStr == "RUN3PUPPIrunsBCDEprompt")
87  else if (versionStr == "RUN3CHSruns2022FGruns2023CD")
89  else if (versionStr == "RUN3PUPPIruns2022FGruns2023CD")
91  else
92  version_ =
93  RUN3PUPPIruns2022FGruns2023CD; //set RUN3PUPPIruns2022FGruns2023CD as default //this is extremely unsafe
94 
95  if (qualityStr == "LOOSE")
96  quality_ = LOOSE;
97  else if (qualityStr == "TIGHT")
98  quality_ = TIGHT;
99  else if (qualityStr == "TIGHTLEPVETO")
101  else
102  quality_ = TIGHT; //this is extremely unsafe
103 
104  initCuts();
105 
106  // loop over the std::string in bits_ and check for what was overwritten.
107  const auto strings_set = this->bits_.strings();
108  for (auto i = strings_set.begin(); i != strings_set.end(); ++i) {
109  const std::string &item = *i;
110  if (params.exists(item)) {
111  if (params.existsAs<int>(item))
112  set(item, params.getParameter<int>(item));
113  else
114  set(item, params.getParameter<double>(item));
115  }
116  }
117 
118  if (params.exists("cutsToIgnore"))
119  setIgnoredCuts(params.getParameter<std::vector<std::string>>("cutsToIgnore"));
120 
121  initIndex();
122  }
123 
125  initCuts();
126  initIndex();
127  }
128 
129  //
130  // give a configuration description for derived class
131  //
134 
135  desc.ifValue(
136  edm::ParameterDescription<std::string>("version", "RUN3PUPPIruns2022FGruns2023CD", true, edm::Comment("")),
137  edm::allowedValues<std::string>("FIRSTDATA",
138  "RUNIISTARTUP",
139  "WINTER16",
140  "WINTER17",
141  "WINTER17PUPPI",
142  "SUMMER18",
143  "SUMMER18PUPPI",
144  "RUN2UL16CHS",
145  "RUN2UL16PUPPI",
146  "RUN2ULCHS",
147  "RUN2ULPUPPI",
148  "RUN3CHSrunsBCDEprompt",
149  "RUN3PUPPIrunsBCDEprompt",
150  "RUN3CHSruns2022FGruns2023CD",
151  "RUN3PUPPIruns2022FGruns2023CD"));
152  desc.ifValue(edm::ParameterDescription<std::string>("quality", "TIGHT", true, edm::Comment("")),
153  edm::allowedValues<std::string>("LOOSE", "TIGHT", "TIGHTLEPVETO"));
154  desc.addOptional<std::vector<std::string>>("cutsToIgnore")->setComment("");
155 
158  edm::ParameterDescription<double> NHF_FW("NHF_FW", true, edm::Comment(""));
159  edm::ParameterDescription<double> NHF_EC("NHF_EC", true, edm::Comment(""));
160  edm::ParameterDescription<double> NHF_TR("NHF_TR", true, edm::Comment(""));
161 
163  edm::ParameterDescription<double> CEF_TR("CEF_TR", true, edm::Comment(""));
164 
166  edm::ParameterDescription<double> NEF_FW("NEF_FW", true, edm::Comment(""));
167  edm::ParameterDescription<double> NEF_EC_L("NEF_EC_L", true, edm::Comment(""));
168  edm::ParameterDescription<double> NEF_EC_U("NEF_EC_U", true, edm::Comment(""));
169  edm::ParameterDescription<double> NEF_TR("NEF_TR", true, edm::Comment(""));
170 
172 
173  edm::ParameterDescription<double> MUF("MUF", true, edm::Comment(""));
174  edm::ParameterDescription<double> MUF_TR("MUF_TR", true, edm::Comment(""));
175 
176  edm::ParameterDescription<int> nConstituents("nConstituents", true, edm::Comment(""));
177  edm::ParameterDescription<int> nNeutrals_FW("nNeutrals_FW", true, edm::Comment(""));
178  edm::ParameterDescription<int> nNeutrals_FW_L("nNeutrals_FW_L", true, edm::Comment(""));
179  edm::ParameterDescription<int> nNeutrals_FW_U("nNeutrals_FW_U", true, edm::Comment(""));
180  edm::ParameterDescription<int> nnNeutrals_EC("nNeutrals_EC", true, edm::Comment(""));
181 
182  desc.addOptionalNode(CHF, false);
183  desc.addOptionalNode(NHF, false);
184  desc.addOptionalNode(NHF_FW, false);
185  desc.addOptionalNode(NHF_EC, false);
186  desc.addOptionalNode(NHF_TR, false);
187 
188  desc.addOptionalNode(CEF, false);
189  desc.addOptionalNode(CEF_TR, false);
190 
191  desc.addOptionalNode(NEF, false);
192  desc.addOptionalNode(NEF_FW, false);
193  desc.addOptionalNode(NEF_EC_L, false);
194  desc.addOptionalNode(NEF_EC_U, false);
195  desc.addOptionalNode(NEF_TR, false);
196 
197  desc.addOptionalNode(NCH, false);
198 
199  desc.addOptionalNode(MUF, false);
200  desc.addOptionalNode(MUF_TR, false);
201 
202  desc.addOptionalNode(nConstituents, false);
203  desc.addOptionalNode(nNeutrals_FW, false);
204  desc.addOptionalNode(nNeutrals_FW_L, false);
205  desc.addOptionalNode(nNeutrals_FW_U, false);
206  desc.addOptionalNode(nnNeutrals_EC, false);
207 
208  return desc;
209  }
210  //
211  // Accessor from PAT jets
212  //
213  bool operator()(const pat::Jet &jet, pat::strbitset &ret) override {
218  version_ == RUN2ULPUPPI) {
219  if (jet.currentJECLevel() == "Uncorrected" || !jet.jecSetsAvailable())
220  return firstDataCuts(jet, ret, version_);
221  else
222  return firstDataCuts(jet.correctedJet("Uncorrected"), ret, version_);
223  } else {
224  return false;
225  }
226  }
228 
229  //
230  // Accessor from *CORRECTED* 4-vector, EMF, and Jet ID.
231  // This can be used with reco quantities.
232  //
238  version_ == RUN2ULPUPPI) {
239  return firstDataCuts(jet, ret, version_);
240  } else {
241  return false;
242  }
243  }
244 
245  bool operator()(const reco::PFJet &jet) {
246  retInternal_.set(false);
249  return (bool)retInternal_;
250  }
251 
252  //
253  // cuts based on craft 08 analysis.
254  //
256  ret.set(false);
257 
258  // cache some variables
259  double chf = 0.0;
260  double nhf = 0.0;
261  double cef = 0.0;
262  double nef = 0.0;
263  double muf = 0.0;
264 
265  int nch = 0;
266  int nconstituents = 0;
267  int nneutrals = 0;
268 
269  // Have to do this because pat::Jet inherits from reco::Jet but not reco::PFJet
270  reco::PFJet const *pfJet = dynamic_cast<reco::PFJet const *>(&jet);
271  pat::Jet const *patJet = dynamic_cast<pat::Jet const *>(&jet);
272  reco::BasicJet const *basicJet = dynamic_cast<reco::BasicJet const *>(&jet);
273 
274  if (patJet != nullptr) {
275  if (patJet->isPFJet()) {
276  chf = patJet->chargedHadronEnergyFraction();
277  nhf = patJet->neutralHadronEnergyFraction();
278  cef = patJet->chargedEmEnergyFraction();
279  nef = patJet->neutralEmEnergyFraction();
280  nch = patJet->chargedMultiplicity();
281  muf = patJet->muonEnergyFraction();
282  nconstituents = patJet->neutralMultiplicity() + patJet->chargedMultiplicity();
283  nneutrals = patJet->neutralMultiplicity();
284  }
285  // Handle the special case where this is a composed jet for
286  // subjet analyses
287  else if (patJet->isBasicJet()) {
288  double e_chf = 0.0;
289  double e_nhf = 0.0;
290  double e_cef = 0.0;
291  double e_nef = 0.0;
292  double e_muf = 0.0;
293  nch = 0;
294  nconstituents = 0;
295  nneutrals = 0;
296 
297  for (reco::Jet::const_iterator ibegin = patJet->begin(), iend = patJet->end(), isub = ibegin; isub != iend;
298  ++isub) {
299  reco::PFJet const *pfsub = dynamic_cast<reco::PFJet const *>(&*isub);
300  pat::Jet const *patsub = dynamic_cast<pat::Jet const *>(&*isub);
301  if (patsub) {
302  e_chf += patsub->chargedHadronEnergy();
303  e_nhf += patsub->neutralHadronEnergy();
304  e_cef += patsub->chargedEmEnergy();
305  e_nef += patsub->neutralEmEnergy();
306  e_muf += patsub->muonEnergy();
307  nch += patsub->chargedMultiplicity();
308  nconstituents += patsub->neutralMultiplicity() + patsub->chargedMultiplicity();
309  nneutrals += patsub->neutralMultiplicity();
310  } else if (pfsub) {
311  e_chf += pfsub->chargedHadronEnergy();
312  e_nhf += pfsub->neutralHadronEnergy();
313  e_cef += pfsub->chargedEmEnergy();
314  e_nef += pfsub->neutralEmEnergy();
315  e_muf += pfsub->muonEnergy();
316  nch += pfsub->chargedMultiplicity();
317  nconstituents += pfsub->neutralMultiplicity() + pfsub->chargedMultiplicity();
318  nneutrals += pfsub->neutralMultiplicity();
319  } else
320  assert(0);
321  }
322  double e = patJet->energy();
323  if (e > 0.000001) {
324  chf = e_chf / e;
325  nhf = e_nhf / e;
326  cef = e_cef / e;
327  nef = e_nef / e;
328  muf = e_muf / e;
329  } else {
330  chf = nhf = cef = nef = muf = 0.0;
331  }
332  }
333  } // end if pat jet
334  else if (pfJet != nullptr) {
335  // CV: need to compute energy fractions in a way that works for corrected as well as for uncorrected PFJets
336  double jetEnergyUncorrected = pfJet->chargedHadronEnergy() + pfJet->neutralHadronEnergy() +
337  pfJet->photonEnergy() + pfJet->electronEnergy() + pfJet->muonEnergy() +
338  pfJet->HFEMEnergy();
339  if (jetEnergyUncorrected > 0.) {
340  chf = pfJet->chargedHadronEnergy() / jetEnergyUncorrected;
341  nhf = pfJet->neutralHadronEnergy() / jetEnergyUncorrected;
342  cef = pfJet->chargedEmEnergy() / jetEnergyUncorrected;
343  nef = pfJet->neutralEmEnergy() / jetEnergyUncorrected;
344  muf = pfJet->muonEnergy() / jetEnergyUncorrected;
345  }
346  nch = pfJet->chargedMultiplicity();
347  nconstituents = pfJet->neutralMultiplicity() + pfJet->chargedMultiplicity();
348  nneutrals = pfJet->neutralMultiplicity();
349  } // end if PF jet
350  // Handle the special case where this is a composed jet for
351  // subjet analyses
352  else if (basicJet != nullptr) {
353  double e_chf = 0.0;
354  double e_nhf = 0.0;
355  double e_cef = 0.0;
356  double e_nef = 0.0;
357  double e_muf = 0.0;
358  nch = 0;
359  nconstituents = 0;
360  for (reco::Jet::const_iterator ibegin = basicJet->begin(), iend = basicJet->end(), isub = ibegin; isub != iend;
361  ++isub) {
362  reco::PFJet const *pfsub = dynamic_cast<reco::PFJet const *>(&*isub);
363  e_chf += pfsub->chargedHadronEnergy();
364  e_nhf += pfsub->neutralHadronEnergy();
365  e_cef += pfsub->chargedEmEnergy();
366  e_nef += pfsub->neutralEmEnergy();
367  e_muf += pfsub->muonEnergy();
368  nch += pfsub->chargedMultiplicity();
369  nconstituents += pfsub->neutralMultiplicity() + pfsub->chargedMultiplicity();
370  nneutrals += pfsub->neutralMultiplicity();
371  }
372  double e = basicJet->energy();
373  if (e > 0.000001) {
374  chf = e_chf / e;
375  nhf = e_nhf / e;
376  cef = e_cef / e;
377  nef = e_nef / e;
378  muf = e_muf / e;
379  }
380  } // end if basic jet
381 
382  float etaB = 2.4;
383  // Cuts for |eta| < 2.6 for Summer18
387  etaB = 2.6;
392  quality_ != TIGHT) {
393  if (ignoreCut(indexCEF_) || (cef < cut(indexCEF_, double()) || std::abs(jet.eta()) > etaB))
395  }
396  if (ignoreCut(indexCHF_) || (chf > cut(indexCHF_, double()) || std::abs(jet.eta()) > etaB))
398  if (ignoreCut(indexNCH_) || (nch > cut(indexNCH_, int()) || std::abs(jet.eta()) > etaB))
400  if (version_ == FIRSTDATA) { // Cuts for all eta for FIRSTDATA
401  if (ignoreCut(indexNConstituents_) || (nconstituents > cut(indexNConstituents_, int())))
403  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double())))
405  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double())))
407  } else if (version_ == RUNIISTARTUP) {
408  // Cuts for |eta| <= 3.0 for RUNIISTARTUP scenario
410  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 3.0))
412  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 3.0))
414  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 3.0))
416  // Cuts for |eta| > 3.0 for RUNIISTARTUP scenario
417  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
419  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
421  } else if (version_ == WINTER16) {
422  // Cuts for |eta| <= 2.7 for WINTER16 scenario
424  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.7))
426  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.7))
428  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.7))
430  if (quality_ == TIGHTLEPVETO) {
431  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.7))
433  }
434 
435  // Cuts for 2.7 < |eta| <= 3.0 for WINTER16 scenario
436  if (ignoreCut(indexNHF_EC_) ||
437  (nhf < cut(indexNHF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
439  if (ignoreCut(indexNEF_EC_) ||
440  (nef > cut(indexNEF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
443  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
445 
446  // Cuts for |eta| > 3.0 for WINTER16 scenario
447  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
449  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
451  } else if (version_ == WINTER17) {
452  // Cuts for |eta| <= 2.7 for WINTER17 scenario
454  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.7))
456  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.7))
458  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.7))
460  if (quality_ == TIGHTLEPVETO) {
461  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.7))
463  }
464 
465  // Cuts for 2.7 < |eta| <= 3.0 for WINTER17 scenario
466 
467  if (ignoreCut(indexNEF_EC_L_) ||
468  (nef > cut(indexNEF_EC_L_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
470  if (ignoreCut(indexNEF_EC_U_) ||
471  (nef < cut(indexNEF_EC_U_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
474  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
476 
477  // Cuts for |eta| > 3.0 for WINTER17 scenario
478  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
480  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
482  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
484 
485  } else if (version_ == WINTER17PUPPI) {
486  // Cuts for |eta| <= 2.7 for WINTER17 scenario
488  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.7))
490  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.7))
492  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.7))
494  if (quality_ == TIGHTLEPVETO) {
495  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.7))
497  }
498 
499  // Cuts for 2.7 < |eta| <= 3.0 for WINTER17 scenario
500 
501  if (ignoreCut(indexNHF_EC_) ||
502  (nhf < cut(indexNHF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
504 
505  // Cuts for |eta| > 3.0 for WINTER17 scenario
506  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
508  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
511  (nneutrals > cut(indexNNeutrals_FW_L_, int()) || std::abs(jet.eta()) <= 3.0))
514  (nneutrals < cut(indexNNeutrals_FW_U_, int()) || std::abs(jet.eta()) <= 3.0))
516 
517  } else if (version_ == RUN2UL16CHS) {
518  // Cuts for |eta| <= 2.4 for RUN2UL16CHS scenario
520  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.4))
522  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.4))
524  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.4))
526  if (quality_ == TIGHTLEPVETO) {
527  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.4))
529  }
530 
531  // Cuts for 2.4 <= |eta| <= 2.7 for RUN2UL16CHS scenario
532  if (ignoreCut(indexNHF_TR_) ||
533  (nhf < cut(indexNHF_TR_, double()) || std::abs(jet.eta()) <= 2.4 || std::abs(jet.eta()) > 2.7))
535  if (ignoreCut(indexNEF_TR_) ||
536  (nef < cut(indexNEF_TR_, double()) || std::abs(jet.eta()) <= 2.4 || std::abs(jet.eta()) > 2.7))
538 
539  // Cuts for 2.7 < |eta| <= 3.0 for RUN2UL16CHS scenario
540  if (ignoreCut(indexNHF_EC_) ||
541  (nhf < cut(indexNHF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
543  if (ignoreCut(indexNEF_EC_L_) ||
544  (nef > cut(indexNEF_EC_L_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
546  if (ignoreCut(indexNEF_EC_U_) ||
547  (nef < cut(indexNEF_EC_U_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
550  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
552 
553  // Cuts for |eta| > 3.0 for RUN2UL16CHS scenario
554  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
556  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
558  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
560 
561  } else if (version_ == RUN2UL16PUPPI) {
562  // Cuts for |eta| <= 2.4 for RUN2UL16PUPPI scenario
564  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.4))
566  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.4))
568  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.4))
570  if (quality_ == TIGHTLEPVETO) {
571  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.4))
573  }
574 
575  // Cuts for 2.4 <= |eta| <= 2.7 for RUN2UL16PUPPI scenario
576  if (ignoreCut(indexNHF_TR_) ||
577  (nhf < cut(indexNHF_TR_, double()) || std::abs(jet.eta()) <= 2.4 || std::abs(jet.eta()) > 2.7))
579  if (ignoreCut(indexNEF_TR_) ||
580  (nef < cut(indexNEF_TR_, double()) || std::abs(jet.eta()) <= 2.4 || std::abs(jet.eta()) > 2.7))
582 
583  // Cuts for 2.7 < |eta| <= 3.0 for RUN2UL16PUPPI scenario
585  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
587 
588  // Cuts for |eta| > 3.0 for RUN2UL16PUPPI scenario
589  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
592  (nneutrals > cut(indexNNeutrals_FW_L_, int()) || std::abs(jet.eta()) <= 3.0))
595  (nneutrals < cut(indexNNeutrals_FW_U_, int()) || std::abs(jet.eta()) <= 3.0))
597 
598  } else if ((version_ == SUMMER18) || (version_ == RUN2ULCHS) || (version_ == RUN3CHSrunsBCDEprompt) ||
600  // Cuts for |eta| <= 2.6 for SUMMER18 scenario
602  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.6))
604  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.6))
606  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.6))
608  if (quality_ == TIGHTLEPVETO) {
609  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.6))
611  if (ignoreCut(indexCEF_) || (cef < cut(indexCEF_, double()) || std::abs(jet.eta()) > 2.6)) //edw
613  }
614 
615  // Cuts for 2.6 <= |eta| <= 2.7 for SUMMER18 scenario
616  if (ignoreCut(indexNHF_TR_) ||
617  (nhf < cut(indexNHF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
619  if (ignoreCut(indexNEF_TR_) ||
620  (nef < cut(indexNEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
622  if (ignoreCut(indexNCH_TR_) ||
623  (nch > cut(indexNCH_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
625  if (quality_ == TIGHTLEPVETO) {
626  if (ignoreCut(indexMUF_TR_) ||
627  (muf < cut(indexMUF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
629  if (ignoreCut(indexCEF_TR_) ||
630  (cef < cut(indexCEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
632  }
633 
634  // Cuts for 2.7 < |eta| <= 3.0 for SUMMER18 scenario
635  if (ignoreCut(indexNEF_EC_L_) ||
636  (nef > cut(indexNEF_EC_L_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
638  if (ignoreCut(indexNEF_EC_U_) ||
639  (nef < cut(indexNEF_EC_U_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
642  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
644 
645  // Cuts for |eta| > 3.0 for SUMMER18 scenario
646  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
648  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
650  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
652  }
653 
656  // Cuts for |eta| <= 2.6 for SUMMER18PUPPI scenario
658  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.6))
660  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.6))
662  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.6))
664  if (quality_ == TIGHTLEPVETO) {
665  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.6))
667  if (ignoreCut(indexCEF_) || (cef < cut(indexCEF_, double()) || std::abs(jet.eta()) > 2.6)) //edw
669  }
670 
671  // Cuts for 2.6 <= |eta| <= 2.7 for SUMMER18PUPPI scenario
672  if (ignoreCut(indexNHF_TR_) ||
673  (nhf < cut(indexNHF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
675  if (ignoreCut(indexNEF_TR_) ||
676  (nef < cut(indexNEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
678  if (quality_ == TIGHTLEPVETO) {
679  if (ignoreCut(indexMUF_TR_) ||
680  (muf < cut(indexMUF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
682  if (ignoreCut(indexCEF_TR_) ||
683  (cef < cut(indexCEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
685  }
686 
687  // Cuts for 2.7 < |eta| <= 3.0 for SUMMER18PUPPI scenario
688  if (ignoreCut(indexNHF_EC_) ||
689  (nhf < cut(indexNHF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
691 
692  // Cuts for |eta| > 3.0 for SUMMER18PUPPI scenario
693  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
695  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
698  (nneutrals > cut(indexNNeutrals_FW_L_, int()) || std::abs(jet.eta()) <= 3.0))
701  (nneutrals < cut(indexNNeutrals_FW_U_, int()) || std::abs(jet.eta()) <= 3.0))
703  }
704 
705  //std::cout << "<PFJetIDSelectionFunctor::firstDataCuts>:" << std::endl;
706  //std::cout << " jet: Pt = " << jet.pt() << ", eta = " << jet.eta() << ", phi = " << jet.phi() << std::endl;
707  //ret.print(std::cout);
708  setIgnored(ret);
709  return (bool)ret;
710  }
711 
712 private: // member variables
713  void initCuts() {
714  push_back("CHF");
715  push_back("NHF");
720  quality_ != TIGHT)
721  push_back("CEF");
722  push_back("NEF");
723  push_back("NCH");
724  push_back("nConstituents");
725  if (version_ == RUNIISTARTUP) {
726  push_back("NEF_FW");
727  push_back("nNeutrals_FW");
728  }
729  if (version_ == WINTER16) {
730  push_back("NHF_EC");
731  push_back("NEF_EC");
732  push_back("nNeutrals_EC");
733  push_back("NEF_FW");
734  push_back("nNeutrals_FW");
735  if (quality_ == TIGHTLEPVETO)
736  push_back("MUF");
737  }
738  if (version_ == WINTER17) {
739  push_back("NEF_EC_L");
740  push_back("NEF_EC_U");
741  push_back("nNeutrals_EC");
742  push_back("NEF_FW");
743  push_back("NHF_FW");
744  push_back("nNeutrals_FW");
745  if (quality_ == TIGHTLEPVETO)
746  push_back("MUF");
747  }
748  if (version_ == WINTER17PUPPI) {
749  push_back("NHF_EC");
750  push_back("NEF_FW");
751  push_back("NHF_FW");
752  push_back("nNeutrals_FW_L");
753  push_back("nNeutrals_FW_U");
754  if (quality_ == TIGHTLEPVETO)
755  push_back("MUF");
756  }
757  if (version_ == RUN2UL16CHS) {
758  push_back("NHF_TR");
759  push_back("NEF_TR");
760  push_back("NHF_EC");
761  push_back("NEF_EC_L");
762  push_back("NEF_EC_U");
763  push_back("nNeutrals_EC");
764  push_back("NEF_FW");
765  push_back("NHF_FW");
766  push_back("nNeutrals_FW");
767 
768  if (quality_ == TIGHTLEPVETO) {
769  push_back("MUF");
770  }
771  }
772  if (version_ == RUN2UL16PUPPI) {
773  push_back("NHF_TR");
774  push_back("NEF_TR");
775  push_back("nNeutrals_EC");
776  push_back("NEF_FW");
777  push_back("nNeutrals_FW_L");
778  push_back("nNeutrals_FW_U");
779 
780  if (quality_ == TIGHTLEPVETO) {
781  push_back("MUF");
782  }
783  }
784  if ((version_ == SUMMER18) || (version_ == RUN2ULCHS)) {
785  push_back("NHF_TR");
786  push_back("NEF_TR");
787  push_back("NCH_TR");
788  push_back("NEF_EC_L");
789  push_back("NEF_EC_U");
790  push_back("nNeutrals_EC");
791  push_back("NEF_FW");
792  push_back("NHF_FW");
793  push_back("nNeutrals_FW");
794 
795  if (quality_ == TIGHTLEPVETO) {
796  push_back("MUF");
797  push_back("MUF_TR");
798  push_back("CEF_TR");
799  }
800  }
802  push_back("NHF_TR");
803  push_back("NEF_TR");
804  push_back("NCH_TR");
805  push_back("NEF_EC_U");
806  push_back("nNeutrals_EC");
807  push_back("NEF_FW");
808  push_back("NHF_FW");
809  push_back("nNeutrals_FW");
810 
811  if (quality_ == TIGHTLEPVETO) {
812  push_back("CEF");
813  push_back("MUF");
814  push_back("MUF_TR");
815  push_back("CEF_TR");
816  }
817  }
819  push_back("NHF_TR");
820  push_back("NEF_TR");
821  push_back("NCH_TR");
822  push_back("NHF_EC");
823  push_back("NEF_EC_U");
824  push_back("nNeutrals_EC");
825  push_back("NEF_FW");
826  push_back("nNeutrals_FW");
827 
828  if (quality_ == TIGHTLEPVETO) {
829  push_back("CEF");
830  push_back("MUF");
831  push_back("MUF_TR");
832  push_back("CEF_TR");
833  }
834  }
835  if ((version_ == SUMMER18PUPPI) || (version_ == RUN2ULPUPPI)) {
836  push_back("NHF_TR");
837  push_back("NEF_TR");
838  push_back("NHF_EC");
839  push_back("NEF_FW");
840  push_back("NHF_FW");
841  push_back("nNeutrals_FW_L");
842  push_back("nNeutrals_FW_U");
843 
844  if (quality_ == TIGHTLEPVETO) {
845  push_back("MUF");
846  push_back("MUF_TR");
847  push_back("CEF_TR");
848  }
849  }
851  push_back("NHF_TR");
852  push_back("NEF_TR");
853  push_back("NHF_EC");
854  push_back("NEF_FW");
855  push_back("nNeutrals_FW_L");
856 
857  if (quality_ == TIGHTLEPVETO) {
858  push_back("CEF");
859  push_back("MUF");
860  push_back("MUF_TR");
861  push_back("CEF_TR");
862  }
863  }
868  quality_ == LOOSE) {
869  edm::LogWarning("BadJetIDVersion")
870  << "The LOOSE operating point is only supported for the WINTER16 JetID version -- defaulting to TIGHT";
871  quality_ = TIGHT;
872  }
873 
874  // Set some default cuts for LOOSE, TIGHT
875  if (quality_ == LOOSE) {
876  set("CHF", 0.0);
877  set("NHF", 0.99);
878  set("CEF", 0.99);
879  set("NEF", 0.99);
880  set("NCH", 0);
881  set("nConstituents", 1);
882  if (version_ == RUNIISTARTUP) {
883  set("NEF_FW", 0.90);
884  set("nNeutrals_FW", 10);
885  } else if (version_ == WINTER16) {
886  set("NHF_EC", 0.98);
887  set("NEF_EC", 0.01);
888  set("nNeutrals_EC", 2);
889  set("NEF_FW", 0.90);
890  set("nNeutrals_FW", 10);
891  }
892  } else if (quality_ == TIGHT) {
893  set("CHF", 0.0);
894  set("NHF", 0.9);
899  set("CEF", 0.99);
902  set("CHF", 0.01);
904  set("NHF", 0.99);
905  set("NEF", 0.9);
906  set("NCH", 0);
907  set("nConstituents", 1);
908  if (version_ == RUNIISTARTUP) {
909  set("NEF_FW", 0.90);
910  set("nNeutrals_FW", 10);
911  } else if (version_ == WINTER16) {
912  set("NHF_EC", 0.98);
913  set("NEF_EC", 0.01);
914  set("nNeutrals_EC", 2);
915  set("NEF_FW", 0.90);
916  set("nNeutrals_FW", 10);
917  } else if (version_ == WINTER17) {
918  set("NEF_EC_L", 0.02);
919  set("NEF_EC_U", 0.99);
920  set("nNeutrals_EC", 2);
921  set("NHF_FW", 0.02);
922  set("NEF_FW", 0.90);
923  set("nNeutrals_FW", 10);
924  } else if (version_ == WINTER17PUPPI) {
925  set("NHF_EC", 0.99);
926  set("NHF_FW", 0.02);
927  set("NEF_FW", 0.90);
928  set("nNeutrals_FW_L", 2);
929  set("nNeutrals_FW_U", 15);
930  } else if (version_ == SUMMER18) {
931  set("NHF_TR", 0.9);
932  set("NEF_TR", 0.99);
933  set("NCH_TR", 0);
934  set("NEF_EC_L", 0.02);
935  set("NEF_EC_U", 0.99);
936  set("nNeutrals_EC", 2);
937  set("NHF_FW", 0.2);
938  set("NEF_FW", 0.90);
939  set("nNeutrals_FW", 10);
940  } else if (version_ == SUMMER18PUPPI) {
941  set("NHF_TR", 0.9);
942  set("NEF_TR", 0.99);
943  set("NHF_EC", 0.99);
944  set("NHF_FW", 0.02);
945  set("NEF_FW", 0.90);
946  set("nNeutrals_FW_L", 2);
947  set("nNeutrals_FW_U", 15);
948  } else if (version_ == RUN2UL16CHS) {
949  set("NHF_TR", 0.9);
950  set("NEF_TR", 0.99);
951  set("NHF_EC", 0.9);
952  set("NEF_EC_L", 0.);
953  set("NEF_EC_U", 0.99);
954  set("nNeutrals_EC", 1);
955  set("NHF_FW", 0.2);
956  set("NEF_FW", 0.90);
957  set("nNeutrals_FW", 10);
958  } else if (version_ == RUN2UL16PUPPI) {
959  set("NHF_TR", 0.98);
960  set("NEF_TR", 0.99);
961  set("nNeutrals_EC", 1);
962  set("NEF_FW", 0.90);
963  set("nNeutrals_FW_L", 2);
964  set("nNeutrals_FW_U", 999999);
965  } else if (version_ == RUN2ULCHS) {
966  set("NHF_TR", 0.9);
967  set("NEF_TR", 0.99);
968  set("NCH_TR", 0);
969  set("NEF_EC_L", 0.01);
970  set("NEF_EC_U", 0.99);
971  set("nNeutrals_EC", 1);
972  set("NHF_FW", 0.2);
973  set("NEF_FW", 0.90);
974  set("nNeutrals_FW", 10);
975  } else if (version_ == RUN3CHSrunsBCDEprompt) {
976  set("NHF_TR", 0.9);
977  set("NEF_TR", 0.99);
978  set("NCH_TR", 0);
979  set("NEF_EC_U", 0.99);
980  set("nNeutrals_EC", 1);
981  set("NHF_FW", 0.2);
982  set("NEF_FW", 0.90);
983  set("nNeutrals_FW", 10);
984  } else if (version_ == RUN3CHSruns2022FGruns2023CD) {
985  set("NHF_TR", 0.9);
986  set("NEF_TR", 0.99);
987  set("NCH_TR", 0);
988  set("NEF_EC_U", 0.99);
989  set("NHF_EC", 0.99);
990  set("nNeutrals_EC", 1);
991  set("NEF_FW", 0.4);
992  set("nNeutrals_FW", 10);
993  } else if (version_ == RUN2ULPUPPI) {
994  set("NHF_TR", 0.9);
995  set("NEF_TR", 0.99);
996  set("NHF_EC", 0.99);
997  set("NHF_FW", -1.0);
998  set("NEF_FW", 0.4);
999  set("nNeutrals_FW_L", 2);
1000  set("nNeutrals_FW_U", 999999);
1001  } else if (version_ == RUN3PUPPIrunsBCDEprompt) {
1002  set("NHF_TR", 0.9);
1003  set("NEF_TR", 0.99);
1004  set("NHF_EC", 0.9999);
1005  set("NEF_FW", 0.90);
1006  set("nNeutrals_FW_L", 2);
1007  } else if (version_ == RUN3PUPPIruns2022FGruns2023CD) {
1008  set("NHF_TR", 0.9);
1009  set("NEF_TR", 0.99);
1010  set("NHF_EC", 0.99);
1011  set("NEF_FW", 0.4);
1012  set("nNeutrals_FW_L", 1);
1013  }
1014  } else if (quality_ == TIGHTLEPVETO) {
1015  set("CHF", 0.0);
1016  set("NHF", 0.9);
1017  set("CEF", 0.8);
1018  set("NEF", 0.9);
1019  set("NCH", 0);
1020  set("nConstituents", 1);
1021  set("MUF", 0.8);
1022  if (version_ == WINTER17) {
1023  set("NEF_EC_L", 0.02);
1024  set("NEF_EC_U", 0.99);
1025  set("nNeutrals_EC", 2);
1026  set("NHF_FW", 0.02);
1027  set("NEF_FW", 0.90);
1028  set("nNeutrals_FW", 10);
1029  }
1032  set("CHF", 0.01);
1034  set("NHF", 0.99);
1035  } else if (version_ == WINTER17PUPPI) {
1036  set("NHF_EC", 0.99);
1037  set("NHF_FW", 0.02);
1038  set("NEF_FW", 0.90);
1039  set("nNeutrals_FW_L", 2);
1040  set("nNeutrals_FW_U", 15);
1041  } else if (version_ == WINTER16) {
1042  set("CEF", 0.9);
1043  set("NEF_EC", 0.01);
1044  set("NHF_EC", 0.98);
1045  set("nNeutrals_EC", 2);
1046  set("nNeutrals_FW", 10);
1047  set("NEF_FW", 0.90);
1048  } else if (version_ == WINTER17PUPPI) {
1049  set("NHF_EC", 0.99);
1050  set("NHF_FW", 0.02);
1051  set("NEF_FW", 0.90);
1052  set("nNeutrals_FW_L", 2);
1053  set("nNeutrals_FW_U", 15);
1054  } else if (version_ == WINTER16) {
1055  set("CEF", 0.9);
1056  set("NEF_EC", 0.01);
1057  set("NHF_EC", 0.98);
1058  set("nNeutrals_EC", 2);
1059  set("nNeutrals_FW", 10);
1060  set("NEF_FW", 0.90);
1061  } else if (version_ == SUMMER18) {
1062  set("NHF_TR", 0.9);
1063  set("NEF_TR", 0.99);
1064  set("MUF_TR", 0.8);
1065  set("NCH_TR", 0);
1066  set("CEF_TR", 0.8);
1067  set("NEF_EC_L", 0.02);
1068  set("NEF_EC_U", 0.99);
1069  set("nNeutrals_EC", 2);
1070  set("NHF_FW", 0.2);
1071  set("NEF_FW", 0.90);
1072  set("nNeutrals_FW", 10);
1073  } else if (version_ == SUMMER18PUPPI) {
1074  set("NHF_TR", 0.9);
1075  set("NEF_TR", 0.99);
1076  set("MUF_TR", 0.8);
1077  set("CEF_TR", 0.8);
1078  set("NHF_EC", 0.99);
1079  set("NHF_FW", 0.02);
1080  set("NEF_FW", 0.90);
1081  set("nNeutrals_FW_L", 2);
1082  set("nNeutrals_FW_U", 15);
1083  } else if (version_ == RUN2UL16CHS) {
1084  set("NHF_TR", 0.9);
1085  set("NEF_TR", 0.99);
1086  set("NHF_EC", 0.9);
1087  set("NEF_EC_L", 0.);
1088  set("NEF_EC_U", 0.99);
1089  set("nNeutrals_EC", 1);
1090  set("NHF_FW", 0.2);
1091  set("NEF_FW", 0.90);
1092  set("nNeutrals_FW", 10);
1093  } else if (version_ == RUN2UL16PUPPI) {
1094  set("NHF_TR", 0.98);
1095  set("NEF_TR", 0.99);
1096  set("nNeutrals_EC", 1);
1097  set("NEF_FW", 0.90);
1098  set("nNeutrals_FW_L", 2);
1099  set("nNeutrals_FW_U", 999999);
1100  } else if (version_ == RUN2ULCHS) {
1101  set("NHF_TR", 0.9);
1102  set("NEF_TR", 0.99);
1103  set("MUF_TR", 0.8);
1104  set("NCH_TR", 0);
1105  set("CEF_TR", 0.8);
1106  set("NEF_EC_L", 0.01);
1107  set("NEF_EC_U", 0.99);
1108  set("nNeutrals_EC", 1);
1109  set("NHF_FW", 0.2);
1110  set("NEF_FW", 0.90);
1111  set("nNeutrals_FW", 10);
1112  } else if (version_ == RUN3CHSrunsBCDEprompt) {
1113  set("MUF_TR", 0.8);
1114  set("CEF_TR", 0.8);
1115  set("NHF_TR", 0.9);
1116  set("NEF_TR", 0.99);
1117  set("NCH_TR", 0);
1118  set("NEF_EC_U", 0.99);
1119  set("nNeutrals_EC", 1);
1120  set("NHF_FW", 0.2);
1121  set("NEF_FW", 0.90);
1122  set("nNeutrals_FW", 10);
1123  } else if (version_ == RUN3CHSruns2022FGruns2023CD) {
1124  set("MUF_TR", 0.8);
1125  set("CEF_TR", 0.8);
1126  set("NHF_TR", 0.9);
1127  set("NEF_TR", 0.99);
1128  set("NCH_TR", 0);
1129  set("NEF_EC_U", 0.99);
1130  set("NHF_EC", 0.99);
1131  set("nNeutrals_EC", 1);
1132  set("NEF_FW", 0.4);
1133  set("nNeutrals_FW", 10);
1134  } else if (version_ == RUN2ULPUPPI) {
1135  set("NHF_TR", 0.9);
1136  set("NEF_TR", 0.99);
1137  set("MUF_TR", 0.8);
1138  set("CEF_TR", 0.8);
1139  set("NHF_EC", 0.9999);
1140  set("NHF_FW", -1.0);
1141  set("NEF_FW", 0.90);
1142  set("nNeutrals_FW_L", 2);
1143  set("nNeutrals_FW_U", 999999);
1144  } else if (version_ == RUN3PUPPIrunsBCDEprompt) {
1145  set("MUF_TR", 0.8);
1146  set("CEF_TR", 0.8);
1147  set("NHF_TR", 0.9);
1148  set("NEF_TR", 0.99);
1149  set("NHF_EC", 0.9999);
1150  set("NEF_FW", 0.90);
1151  set("nNeutrals_FW_L", 2);
1152  } else if (version_ == RUN3PUPPIruns2022FGruns2023CD) {
1153  set("MUF_TR", 0.8);
1154  set("CEF_TR", 0.8);
1155  set("NHF_TR", 0.9);
1156  set("NEF_TR", 0.99);
1157  set("NHF_EC", 0.99);
1158  set("NEF_FW", 0.4);
1159  set("nNeutrals_FW_L", 1);
1160  }
1161  }
1162  }
1163 
1164  void initIndex() {
1165  indexNConstituents_ = index_type(&bits_, "nConstituents");
1166  indexNEF_ = index_type(&bits_, "NEF");
1167  indexNHF_ = index_type(&bits_, "NHF");
1172  quality_ != TIGHT)
1173  indexCEF_ = index_type(&bits_, "CEF");
1174 
1175  indexCHF_ = index_type(&bits_, "CHF");
1176  indexNCH_ = index_type(&bits_, "NCH");
1177  if (version_ == RUNIISTARTUP) {
1178  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1179  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
1180  }
1181  if (version_ == WINTER16) {
1182  indexNHF_EC_ = index_type(&bits_, "NHF_EC");
1183  indexNEF_EC_ = index_type(&bits_, "NEF_EC");
1184  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
1185  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1186  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
1187  if (quality_ == TIGHTLEPVETO) {
1188  indexMUF_ = index_type(&bits_, "MUF");
1189  }
1190  }
1191  if (version_ == WINTER17) {
1192  indexNEF_EC_L_ = index_type(&bits_, "NEF_EC_L");
1193  indexNEF_EC_U_ = index_type(&bits_, "NEF_EC_U");
1194  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
1195  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
1196  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1197  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
1198  if (quality_ == TIGHTLEPVETO) {
1199  indexMUF_ = index_type(&bits_, "MUF");
1200  }
1201  }
1202  if (version_ == WINTER17PUPPI) {
1203  indexNHF_EC_ = index_type(&bits_, "NHF_EC");
1204  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
1205  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1206  indexNNeutrals_FW_L_ = index_type(&bits_, "nNeutrals_FW_L");
1207  indexNNeutrals_FW_U_ = index_type(&bits_, "nNeutrals_FW_U");
1208  if (quality_ == TIGHTLEPVETO) {
1209  indexMUF_ = index_type(&bits_, "MUF");
1210  }
1211  }
1214  indexNHF_TR_ = index_type(&bits_, "NHF_TR");
1215  indexNEF_TR_ = index_type(&bits_, "NEF_TR");
1216  indexNCH_TR_ = index_type(&bits_, "NCH_TR");
1217  indexNEF_EC_L_ = index_type(&bits_, "NEF_EC_L");
1218  indexNEF_EC_U_ = index_type(&bits_, "NEF_EC_U");
1219  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
1220  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
1221  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1222  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
1223  if (quality_ == TIGHTLEPVETO) {
1224  indexMUF_ = index_type(&bits_, "MUF");
1225  indexMUF_TR_ = index_type(&bits_, "MUF_TR");
1226  indexCEF_TR_ = index_type(&bits_, "CEF_TR");
1227  }
1228  }
1231  indexNHF_TR_ = index_type(&bits_, "NHF_TR");
1232  indexNEF_TR_ = index_type(&bits_, "NEF_TR");
1233  indexNHF_EC_ = index_type(&bits_, "NHF_EC");
1234  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
1235  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1236  indexNNeutrals_FW_L_ = index_type(&bits_, "nNeutrals_FW_L");
1237  indexNNeutrals_FW_U_ = index_type(&bits_, "nNeutrals_FW_U");
1238  if (quality_ == TIGHTLEPVETO) {
1239  indexMUF_ = index_type(&bits_, "MUF");
1240  indexMUF_TR_ = index_type(&bits_, "MUF_TR");
1241  indexCEF_TR_ = index_type(&bits_, "CEF_TR");
1242  }
1243  }
1244  if (version_ == RUN2UL16CHS) {
1245  indexNHF_TR_ = index_type(&bits_, "NHF_TR");
1246  indexNEF_TR_ = index_type(&bits_, "NEF_TR");
1247  indexNHF_EC_ = index_type(&bits_, "NHF_EC");
1248  indexNEF_EC_L_ = index_type(&bits_, "NEF_EC_L");
1249  indexNEF_EC_U_ = index_type(&bits_, "NEF_EC_U");
1250  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
1251  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
1252  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1253  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
1254  if (quality_ == TIGHTLEPVETO) {
1255  indexMUF_ = index_type(&bits_, "MUF");
1256  }
1257  }
1258  if (version_ == RUN2UL16PUPPI) {
1259  indexNHF_TR_ = index_type(&bits_, "NHF_TR");
1260  indexNEF_TR_ = index_type(&bits_, "NEF_TR");
1261  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
1262  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1263  indexNNeutrals_FW_L_ = index_type(&bits_, "nNeutrals_FW_L");
1264  indexNNeutrals_FW_U_ = index_type(&bits_, "nNeutrals_FW_U");
1265  if (quality_ == TIGHTLEPVETO) {
1266  indexMUF_ = index_type(&bits_, "MUF");
1267  }
1268  }
1270  }
1271 
1274 
1282 
1288 
1294 
1300 };
1301 
1302 #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)
string quality
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
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