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 == "RUN3WINTER22CHSrunsBCDEprompt")
85  else if (versionStr == "RUN3WINTER22PUPPIrunsBCDEprompt")
87  else if (versionStr == "RUN3WINTER22CHS")
89  else if (versionStr == "RUN3WINTER22PUPPI")
91  else
92  version_ = RUN3WINTER22PUPPI; //set RUN3WINTER22PUPPI as default //this is extremely unsafe
93 
94  if (qualityStr == "LOOSE")
95  quality_ = LOOSE;
96  else if (qualityStr == "TIGHT")
97  quality_ = TIGHT;
98  else if (qualityStr == "TIGHTLEPVETO")
100  else
101  quality_ = TIGHT; //this is extremely unsafe
102 
103  initCuts();
104 
105  // loop over the std::string in bits_ and check for what was overwritten.
106  const auto strings_set = this->bits_.strings();
107  for (auto i = strings_set.begin(); i != strings_set.end(); ++i) {
108  const std::string &item = *i;
109  if (params.exists(item)) {
110  if (params.existsAs<int>(item))
111  set(item, params.getParameter<int>(item));
112  else
113  set(item, params.getParameter<double>(item));
114  }
115  }
116 
117  if (params.exists("cutsToIgnore"))
118  setIgnoredCuts(params.getParameter<std::vector<std::string>>("cutsToIgnore"));
119 
120  initIndex();
121  }
122 
124  initCuts();
125  initIndex();
126  }
127 
128  //
129  // give a configuration description for derived class
130  //
133 
134  desc.ifValue(edm::ParameterDescription<std::string>("version", "RUN3WINTER22PUPPI", true, edm::Comment("")),
135  edm::allowedValues<std::string>("FIRSTDATA",
136  "RUNIISTARTUP",
137  "WINTER16",
138  "WINTER17",
139  "WINTER17PUPPI",
140  "SUMMER18",
141  "SUMMER18PUPPI",
142  "RUN2UL16CHS",
143  "RUN2UL16PUPPI",
144  "RUN2ULCHS",
145  "RUN2ULPUPPI",
146  "RUN3WINTER22CHSrunsBCDEprompt",
147  "RUN3WINTER22PUPPIrunsBCDEprompt",
148  "RUN3WINTER22CHS",
149  "RUN3WINTER22PUPPI"));
150  desc.ifValue(edm::ParameterDescription<std::string>("quality", "TIGHT", true, edm::Comment("")),
151  edm::allowedValues<std::string>("LOOSE", "TIGHT", "TIGHTLEPVETO"));
152  desc.addOptional<std::vector<std::string>>("cutsToIgnore")->setComment("");
153 
156  edm::ParameterDescription<double> NHF_FW("NHF_FW", true, edm::Comment(""));
157  edm::ParameterDescription<double> NHF_EC("NHF_EC", true, edm::Comment(""));
158  edm::ParameterDescription<double> NHF_TR("NHF_TR", true, edm::Comment(""));
159 
161  edm::ParameterDescription<double> CEF_TR("CEF_TR", true, edm::Comment(""));
162 
164  edm::ParameterDescription<double> NEF_FW("NEF_FW", true, edm::Comment(""));
165  edm::ParameterDescription<double> NEF_EC_L("NEF_EC_L", true, edm::Comment(""));
166  edm::ParameterDescription<double> NEF_EC_U("NEF_EC_U", true, edm::Comment(""));
167  edm::ParameterDescription<double> NEF_TR("NEF_TR", true, edm::Comment(""));
168 
170 
171  edm::ParameterDescription<double> MUF("MUF", true, edm::Comment(""));
172  edm::ParameterDescription<double> MUF_TR("MUF_TR", true, edm::Comment(""));
173 
174  edm::ParameterDescription<int> nConstituents("nConstituents", true, edm::Comment(""));
175  edm::ParameterDescription<int> nNeutrals_FW("nNeutrals_FW", true, edm::Comment(""));
176  edm::ParameterDescription<int> nNeutrals_FW_L("nNeutrals_FW_L", true, edm::Comment(""));
177  edm::ParameterDescription<int> nNeutrals_FW_U("nNeutrals_FW_U", true, edm::Comment(""));
178  edm::ParameterDescription<int> nnNeutrals_EC("nNeutrals_EC", true, edm::Comment(""));
179 
180  desc.addOptionalNode(CHF, false);
181  desc.addOptionalNode(NHF, false);
182  desc.addOptionalNode(NHF_FW, false);
183  desc.addOptionalNode(NHF_EC, false);
184  desc.addOptionalNode(NHF_TR, false);
185 
186  desc.addOptionalNode(CEF, false);
187  desc.addOptionalNode(CEF_TR, false);
188 
189  desc.addOptionalNode(NEF, false);
190  desc.addOptionalNode(NEF_FW, false);
191  desc.addOptionalNode(NEF_EC_L, false);
192  desc.addOptionalNode(NEF_EC_U, false);
193  desc.addOptionalNode(NEF_TR, false);
194 
195  desc.addOptionalNode(NCH, false);
196 
197  desc.addOptionalNode(MUF, false);
198  desc.addOptionalNode(MUF_TR, false);
199 
200  desc.addOptionalNode(nConstituents, false);
201  desc.addOptionalNode(nNeutrals_FW, false);
202  desc.addOptionalNode(nNeutrals_FW_L, false);
203  desc.addOptionalNode(nNeutrals_FW_U, false);
204  desc.addOptionalNode(nnNeutrals_EC, false);
205 
206  return desc;
207  }
208  //
209  // Accessor from PAT jets
210  //
211  bool operator()(const pat::Jet &jet, pat::strbitset &ret) override {
217  if (jet.currentJECLevel() == "Uncorrected" || !jet.jecSetsAvailable())
218  return firstDataCuts(jet, ret, version_);
219  else
220  return firstDataCuts(jet.correctedJet("Uncorrected"), ret, version_);
221  } else {
222  return false;
223  }
224  }
226 
227  //
228  // Accessor from *CORRECTED* 4-vector, EMF, and Jet ID.
229  // This can be used with reco quantities.
230  //
237  return firstDataCuts(jet, ret, version_);
238  } else {
239  return false;
240  }
241  }
242 
243  bool operator()(const reco::PFJet &jet) {
244  retInternal_.set(false);
247  return (bool)retInternal_;
248  }
249 
250  //
251  // cuts based on craft 08 analysis.
252  //
254  ret.set(false);
255 
256  // cache some variables
257  double chf = 0.0;
258  double nhf = 0.0;
259  double cef = 0.0;
260  double nef = 0.0;
261  double muf = 0.0;
262 
263  int nch = 0;
264  int nconstituents = 0;
265  int nneutrals = 0;
266 
267  // Have to do this because pat::Jet inherits from reco::Jet but not reco::PFJet
268  reco::PFJet const *pfJet = dynamic_cast<reco::PFJet const *>(&jet);
269  pat::Jet const *patJet = dynamic_cast<pat::Jet const *>(&jet);
270  reco::BasicJet const *basicJet = dynamic_cast<reco::BasicJet const *>(&jet);
271 
272  if (patJet != nullptr) {
273  if (patJet->isPFJet()) {
274  chf = patJet->chargedHadronEnergyFraction();
275  nhf = patJet->neutralHadronEnergyFraction();
276  cef = patJet->chargedEmEnergyFraction();
277  nef = patJet->neutralEmEnergyFraction();
278  nch = patJet->chargedMultiplicity();
279  muf = patJet->muonEnergyFraction();
280  nconstituents = patJet->neutralMultiplicity() + patJet->chargedMultiplicity();
281  nneutrals = patJet->neutralMultiplicity();
282  }
283  // Handle the special case where this is a composed jet for
284  // subjet analyses
285  else if (patJet->isBasicJet()) {
286  double e_chf = 0.0;
287  double e_nhf = 0.0;
288  double e_cef = 0.0;
289  double e_nef = 0.0;
290  double e_muf = 0.0;
291  nch = 0;
292  nconstituents = 0;
293  nneutrals = 0;
294 
295  for (reco::Jet::const_iterator ibegin = patJet->begin(), iend = patJet->end(), isub = ibegin; isub != iend;
296  ++isub) {
297  reco::PFJet const *pfsub = dynamic_cast<reco::PFJet const *>(&*isub);
298  pat::Jet const *patsub = dynamic_cast<pat::Jet const *>(&*isub);
299  if (patsub) {
300  e_chf += patsub->chargedHadronEnergy();
301  e_nhf += patsub->neutralHadronEnergy();
302  e_cef += patsub->chargedEmEnergy();
303  e_nef += patsub->neutralEmEnergy();
304  e_muf += patsub->muonEnergy();
305  nch += patsub->chargedMultiplicity();
306  nconstituents += patsub->neutralMultiplicity() + patsub->chargedMultiplicity();
307  nneutrals += patsub->neutralMultiplicity();
308  } else if (pfsub) {
309  e_chf += pfsub->chargedHadronEnergy();
310  e_nhf += pfsub->neutralHadronEnergy();
311  e_cef += pfsub->chargedEmEnergy();
312  e_nef += pfsub->neutralEmEnergy();
313  e_muf += pfsub->muonEnergy();
314  nch += pfsub->chargedMultiplicity();
315  nconstituents += pfsub->neutralMultiplicity() + pfsub->chargedMultiplicity();
316  nneutrals += pfsub->neutralMultiplicity();
317  } else
318  assert(0);
319  }
320  double e = patJet->energy();
321  if (e > 0.000001) {
322  chf = e_chf / e;
323  nhf = e_nhf / e;
324  cef = e_cef / e;
325  nef = e_nef / e;
326  muf = e_muf / e;
327  } else {
328  chf = nhf = cef = nef = muf = 0.0;
329  }
330  }
331  } // end if pat jet
332  else if (pfJet != nullptr) {
333  // CV: need to compute energy fractions in a way that works for corrected as well as for uncorrected PFJets
334  double jetEnergyUncorrected = pfJet->chargedHadronEnergy() + pfJet->neutralHadronEnergy() +
335  pfJet->photonEnergy() + pfJet->electronEnergy() + pfJet->muonEnergy() +
336  pfJet->HFEMEnergy();
337  if (jetEnergyUncorrected > 0.) {
338  chf = pfJet->chargedHadronEnergy() / jetEnergyUncorrected;
339  nhf = pfJet->neutralHadronEnergy() / jetEnergyUncorrected;
340  cef = pfJet->chargedEmEnergy() / jetEnergyUncorrected;
341  nef = pfJet->neutralEmEnergy() / jetEnergyUncorrected;
342  muf = pfJet->muonEnergy() / jetEnergyUncorrected;
343  }
344  nch = pfJet->chargedMultiplicity();
345  nconstituents = pfJet->neutralMultiplicity() + pfJet->chargedMultiplicity();
346  nneutrals = pfJet->neutralMultiplicity();
347  } // end if PF jet
348  // Handle the special case where this is a composed jet for
349  // subjet analyses
350  else if (basicJet != nullptr) {
351  double e_chf = 0.0;
352  double e_nhf = 0.0;
353  double e_cef = 0.0;
354  double e_nef = 0.0;
355  double e_muf = 0.0;
356  nch = 0;
357  nconstituents = 0;
358  for (reco::Jet::const_iterator ibegin = basicJet->begin(), iend = basicJet->end(), isub = ibegin; isub != iend;
359  ++isub) {
360  reco::PFJet const *pfsub = dynamic_cast<reco::PFJet const *>(&*isub);
361  e_chf += pfsub->chargedHadronEnergy();
362  e_nhf += pfsub->neutralHadronEnergy();
363  e_cef += pfsub->chargedEmEnergy();
364  e_nef += pfsub->neutralEmEnergy();
365  e_muf += pfsub->muonEnergy();
366  nch += pfsub->chargedMultiplicity();
367  nconstituents += pfsub->neutralMultiplicity() + pfsub->chargedMultiplicity();
368  nneutrals += pfsub->neutralMultiplicity();
369  }
370  double e = basicJet->energy();
371  if (e > 0.000001) {
372  chf = e_chf / e;
373  nhf = e_nhf / e;
374  cef = e_cef / e;
375  nef = e_nef / e;
376  muf = e_muf / e;
377  }
378  } // end if basic jet
379 
380  float etaB = 2.4;
381  // Cuts for |eta| < 2.6 for Summer18
385  etaB = 2.6;
390  quality_ != TIGHT) {
391  if (ignoreCut(indexCEF_) || (cef < cut(indexCEF_, double()) || std::abs(jet.eta()) > etaB))
393  }
394  if (ignoreCut(indexCHF_) || (chf > cut(indexCHF_, double()) || std::abs(jet.eta()) > etaB))
396  if (ignoreCut(indexNCH_) || (nch > cut(indexNCH_, int()) || std::abs(jet.eta()) > etaB))
398  if (version_ == FIRSTDATA) { // Cuts for all eta for FIRSTDATA
399  if (ignoreCut(indexNConstituents_) || (nconstituents > cut(indexNConstituents_, int())))
401  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double())))
403  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double())))
405  } else if (version_ == RUNIISTARTUP) {
406  // Cuts for |eta| <= 3.0 for RUNIISTARTUP scenario
408  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 3.0))
410  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 3.0))
412  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 3.0))
414  // Cuts for |eta| > 3.0 for RUNIISTARTUP scenario
415  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
417  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
419  } else if (version_ == WINTER16) {
420  // Cuts for |eta| <= 2.7 for WINTER16 scenario
422  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.7))
424  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.7))
426  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.7))
428  if (quality_ == TIGHTLEPVETO) {
429  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.7))
431  }
432 
433  // Cuts for 2.7 < |eta| <= 3.0 for WINTER16 scenario
434  if (ignoreCut(indexNHF_EC_) ||
435  (nhf < cut(indexNHF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
437  if (ignoreCut(indexNEF_EC_) ||
438  (nef > cut(indexNEF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
441  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
443 
444  // Cuts for |eta| > 3.0 for WINTER16 scenario
445  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
447  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
449  } else if (version_ == WINTER17) {
450  // Cuts for |eta| <= 2.7 for WINTER17 scenario
452  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.7))
454  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.7))
456  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.7))
458  if (quality_ == TIGHTLEPVETO) {
459  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.7))
461  }
462 
463  // Cuts for 2.7 < |eta| <= 3.0 for WINTER17 scenario
464 
465  if (ignoreCut(indexNEF_EC_L_) ||
466  (nef > cut(indexNEF_EC_L_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
468  if (ignoreCut(indexNEF_EC_U_) ||
469  (nef < cut(indexNEF_EC_U_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
472  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
474 
475  // Cuts for |eta| > 3.0 for WINTER17 scenario
476  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
478  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
480  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
482 
483  } else if (version_ == WINTER17PUPPI) {
484  // Cuts for |eta| <= 2.7 for WINTER17 scenario
486  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.7))
488  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.7))
490  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.7))
492  if (quality_ == TIGHTLEPVETO) {
493  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.7))
495  }
496 
497  // Cuts for 2.7 < |eta| <= 3.0 for WINTER17 scenario
498 
499  if (ignoreCut(indexNHF_EC_) ||
500  (nhf < cut(indexNHF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
502 
503  // Cuts for |eta| > 3.0 for WINTER17 scenario
504  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
506  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
509  (nneutrals > cut(indexNNeutrals_FW_L_, int()) || std::abs(jet.eta()) <= 3.0))
512  (nneutrals < cut(indexNNeutrals_FW_U_, int()) || std::abs(jet.eta()) <= 3.0))
514 
515  } else if (version_ == RUN2UL16CHS) {
516  // Cuts for |eta| <= 2.4 for RUN2UL16CHS scenario
518  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.4))
520  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.4))
522  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.4))
524  if (quality_ == TIGHTLEPVETO) {
525  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.4))
527  }
528 
529  // Cuts for 2.4 <= |eta| <= 2.7 for RUN2UL16CHS scenario
530  if (ignoreCut(indexNHF_TR_) ||
531  (nhf < cut(indexNHF_TR_, double()) || std::abs(jet.eta()) <= 2.4 || std::abs(jet.eta()) > 2.7))
533  if (ignoreCut(indexNEF_TR_) ||
534  (nef < cut(indexNEF_TR_, double()) || std::abs(jet.eta()) <= 2.4 || std::abs(jet.eta()) > 2.7))
536 
537  // Cuts for 2.7 < |eta| <= 3.0 for RUN2UL16CHS scenario
538  if (ignoreCut(indexNHF_EC_) ||
539  (nhf < cut(indexNHF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
541  if (ignoreCut(indexNEF_EC_L_) ||
542  (nef > cut(indexNEF_EC_L_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
544  if (ignoreCut(indexNEF_EC_U_) ||
545  (nef < cut(indexNEF_EC_U_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
548  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
550 
551  // Cuts for |eta| > 3.0 for RUN2UL16CHS scenario
552  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
554  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
556  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
558 
559  } else if (version_ == RUN2UL16PUPPI) {
560  // Cuts for |eta| <= 2.4 for RUN2UL16PUPPI scenario
562  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.4))
564  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.4))
566  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.4))
568  if (quality_ == TIGHTLEPVETO) {
569  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.4))
571  }
572 
573  // Cuts for 2.4 <= |eta| <= 2.7 for RUN2UL16PUPPI scenario
574  if (ignoreCut(indexNHF_TR_) ||
575  (nhf < cut(indexNHF_TR_, double()) || std::abs(jet.eta()) <= 2.4 || std::abs(jet.eta()) > 2.7))
577  if (ignoreCut(indexNEF_TR_) ||
578  (nef < cut(indexNEF_TR_, double()) || std::abs(jet.eta()) <= 2.4 || std::abs(jet.eta()) > 2.7))
580 
581  // Cuts for 2.7 < |eta| <= 3.0 for RUN2UL16PUPPI scenario
583  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
585 
586  // Cuts for |eta| > 3.0 for RUN2UL16PUPPI scenario
587  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
590  (nneutrals > cut(indexNNeutrals_FW_L_, int()) || std::abs(jet.eta()) <= 3.0))
593  (nneutrals < cut(indexNNeutrals_FW_U_, int()) || std::abs(jet.eta()) <= 3.0))
595 
596  } else if ((version_ == SUMMER18) || (version_ == RUN2ULCHS) || (version_ == RUN3WINTER22CHSrunsBCDEprompt) ||
597  (version_ == RUN3WINTER22CHS)) {
598  // Cuts for |eta| <= 2.6 for SUMMER18 scenario
600  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.6))
602  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.6))
604  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.6))
606  if (quality_ == TIGHTLEPVETO) {
607  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.6))
609  }
610 
611  // Cuts for 2.6 <= |eta| <= 2.7 for SUMMER18 scenario
612  if (ignoreCut(indexNHF_TR_) ||
613  (nhf < cut(indexNHF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
615  if (ignoreCut(indexNEF_TR_) ||
616  (nef < cut(indexNEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
618  if (ignoreCut(indexNCH_TR_) ||
619  (nch > cut(indexNCH_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
621  if (quality_ == TIGHTLEPVETO) {
622  if (ignoreCut(indexMUF_TR_) ||
623  (muf < cut(indexMUF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
625  if (ignoreCut(indexCEF_TR_) ||
626  (cef < cut(indexCEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
628  }
629 
630  // Cuts for 2.7 < |eta| <= 3.0 for SUMMER18 scenario
631  if (ignoreCut(indexNEF_EC_L_) ||
632  (nef > cut(indexNEF_EC_L_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
634  if (ignoreCut(indexNEF_EC_U_) ||
635  (nef < cut(indexNEF_EC_U_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
638  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
640 
641  // Cuts for |eta| > 3.0 for SUMMER18 scenario
642  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
644  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
646  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
648  }
649 
650  else if ((version_ == SUMMER18PUPPI) || (version_ == RUN2ULPUPPI) ||
652  // Cuts for |eta| <= 2.6 for SUMMER18PUPPI scenario
654  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.6))
656  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.6))
658  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.6))
660  if (quality_ == TIGHTLEPVETO) {
661  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.6))
663  }
664 
665  // Cuts for 2.6 <= |eta| <= 2.7 for SUMMER18PUPPI scenario
666  if (ignoreCut(indexNHF_TR_) ||
667  (nhf < cut(indexNHF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
669  if (ignoreCut(indexNEF_TR_) ||
670  (nef < cut(indexNEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
672  if (quality_ == TIGHTLEPVETO) {
673  if (ignoreCut(indexMUF_TR_) ||
674  (muf < cut(indexMUF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
676  if (ignoreCut(indexCEF_TR_) ||
677  (cef < cut(indexCEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
679  }
680 
681  // Cuts for 2.7 < |eta| <= 3.0 for SUMMER18PUPPI scenario
682  if (ignoreCut(indexNHF_EC_) ||
683  (nhf < cut(indexNHF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
685 
686  // Cuts for |eta| > 3.0 for SUMMER18PUPPI scenario
687  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
689  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
692  (nneutrals > cut(indexNNeutrals_FW_L_, int()) || std::abs(jet.eta()) <= 3.0))
695  (nneutrals < cut(indexNNeutrals_FW_U_, int()) || std::abs(jet.eta()) <= 3.0))
697  }
698 
699  //std::cout << "<PFJetIDSelectionFunctor::firstDataCuts>:" << std::endl;
700  //std::cout << " jet: Pt = " << jet.pt() << ", eta = " << jet.eta() << ", phi = " << jet.phi() << std::endl;
701  //ret.print(std::cout);
702  setIgnored(ret);
703  return (bool)ret;
704  }
705 
706 private: // member variables
707  void initCuts() {
708  push_back("CHF");
709  push_back("NHF");
714  quality_ != TIGHT)
715  push_back("CEF");
716  push_back("NEF");
717  push_back("NCH");
718  push_back("nConstituents");
719  if (version_ == RUNIISTARTUP) {
720  push_back("NEF_FW");
721  push_back("nNeutrals_FW");
722  }
723  if (version_ == WINTER16) {
724  push_back("NHF_EC");
725  push_back("NEF_EC");
726  push_back("nNeutrals_EC");
727  push_back("NEF_FW");
728  push_back("nNeutrals_FW");
729  if (quality_ == TIGHTLEPVETO)
730  push_back("MUF");
731  }
732  if (version_ == WINTER17) {
733  push_back("NEF_EC_L");
734  push_back("NEF_EC_U");
735  push_back("nNeutrals_EC");
736  push_back("NEF_FW");
737  push_back("NHF_FW");
738  push_back("nNeutrals_FW");
739  if (quality_ == TIGHTLEPVETO)
740  push_back("MUF");
741  }
742  if (version_ == WINTER17PUPPI) {
743  push_back("NHF_EC");
744  push_back("NEF_FW");
745  push_back("NHF_FW");
746  push_back("nNeutrals_FW_L");
747  push_back("nNeutrals_FW_U");
748  if (quality_ == TIGHTLEPVETO)
749  push_back("MUF");
750  }
751  if (version_ == RUN2UL16CHS) {
752  push_back("NHF_TR");
753  push_back("NEF_TR");
754  push_back("NHF_EC");
755  push_back("NEF_EC_L");
756  push_back("NEF_EC_U");
757  push_back("nNeutrals_EC");
758  push_back("NEF_FW");
759  push_back("NHF_FW");
760  push_back("nNeutrals_FW");
761 
762  if (quality_ == TIGHTLEPVETO) {
763  push_back("MUF");
764  }
765  }
766  if (version_ == RUN2UL16PUPPI) {
767  push_back("NHF_TR");
768  push_back("NEF_TR");
769  push_back("nNeutrals_EC");
770  push_back("NEF_FW");
771  push_back("nNeutrals_FW_L");
772  push_back("nNeutrals_FW_U");
773 
774  if (quality_ == TIGHTLEPVETO) {
775  push_back("MUF");
776  }
777  }
779  (version_ == RUN3WINTER22CHS)) {
780  push_back("NHF_TR");
781  push_back("NEF_TR");
782  push_back("NCH_TR");
783  push_back("NEF_EC_L");
784  push_back("NEF_EC_U");
785  push_back("nNeutrals_EC");
786  push_back("NEF_FW");
787  push_back("NHF_FW");
788  push_back("nNeutrals_FW");
789 
790  if (quality_ == TIGHTLEPVETO) {
791  push_back("MUF");
792  push_back("MUF_TR");
793  push_back("CEF_TR");
794  }
795  }
798  push_back("NHF_TR");
799  push_back("NEF_TR");
800  push_back("NHF_EC");
801  push_back("NEF_FW");
802  push_back("NHF_FW");
803  push_back("nNeutrals_FW_L");
804  push_back("nNeutrals_FW_U");
805 
806  if (quality_ == TIGHTLEPVETO) {
807  push_back("MUF");
808  push_back("MUF_TR");
809  push_back("CEF_TR");
810  }
811  }
812 
817  quality_ == LOOSE) {
818  edm::LogWarning("BadJetIDVersion")
819  << "The LOOSE operating point is only supported for the WINTER16 JetID version -- defaulting to TIGHT";
820  quality_ = TIGHT;
821  }
822 
823  // Set some default cuts for LOOSE, TIGHT
824  if (quality_ == LOOSE) {
825  set("CHF", 0.0);
826  set("NHF", 0.99);
827  set("CEF", 0.99);
828  set("NEF", 0.99);
829  set("NCH", 0);
830  set("nConstituents", 1);
831  if (version_ == RUNIISTARTUP) {
832  set("NEF_FW", 0.90);
833  set("nNeutrals_FW", 10);
834  } else if (version_ == WINTER16) {
835  set("NHF_EC", 0.98);
836  set("NEF_EC", 0.01);
837  set("nNeutrals_EC", 2);
838  set("NEF_FW", 0.90);
839  set("nNeutrals_FW", 10);
840  }
841  } else if (quality_ == TIGHT) {
842  set("CHF", 0.0);
843  set("NHF", 0.9);
848  set("CEF", 0.99);
851  set("CHF", 0.01);
853  set("NHF", 0.99);
854  set("NEF", 0.9);
855  set("NCH", 0);
856  set("nConstituents", 1);
857  if (version_ == RUNIISTARTUP) {
858  set("NEF_FW", 0.90);
859  set("nNeutrals_FW", 10);
860  } else if (version_ == WINTER16) {
861  set("NHF_EC", 0.98);
862  set("NEF_EC", 0.01);
863  set("nNeutrals_EC", 2);
864  set("NEF_FW", 0.90);
865  set("nNeutrals_FW", 10);
866  } else if (version_ == WINTER17) {
867  set("NEF_EC_L", 0.02);
868  set("NEF_EC_U", 0.99);
869  set("nNeutrals_EC", 2);
870  set("NHF_FW", 0.02);
871  set("NEF_FW", 0.90);
872  set("nNeutrals_FW", 10);
873  } else if (version_ == WINTER17PUPPI) {
874  set("NHF_EC", 0.99);
875  set("NHF_FW", 0.02);
876  set("NEF_FW", 0.90);
877  set("nNeutrals_FW_L", 2);
878  set("nNeutrals_FW_U", 15);
879  } else if (version_ == SUMMER18) {
880  set("NHF_TR", 0.9);
881  set("NEF_TR", 0.99);
882  set("NCH_TR", 0);
883  set("NEF_EC_L", 0.02);
884  set("NEF_EC_U", 0.99);
885  set("nNeutrals_EC", 2);
886  set("NHF_FW", 0.2);
887  set("NEF_FW", 0.90);
888  set("nNeutrals_FW", 10);
889  } else if (version_ == SUMMER18PUPPI) {
890  set("NHF_TR", 0.9);
891  set("NEF_TR", 0.99);
892  set("NHF_EC", 0.99);
893  set("NHF_FW", 0.02);
894  set("NEF_FW", 0.90);
895  set("nNeutrals_FW_L", 2);
896  set("nNeutrals_FW_U", 15);
897  } else if (version_ == RUN2UL16CHS) {
898  set("NHF_TR", 0.9);
899  set("NEF_TR", 0.99);
900  set("NHF_EC", 0.9);
901  set("NEF_EC_L", 0.);
902  set("NEF_EC_U", 0.99);
903  set("nNeutrals_EC", 1);
904  set("NHF_FW", 0.2);
905  set("NEF_FW", 0.90);
906  set("nNeutrals_FW", 10);
907  } else if (version_ == RUN2UL16PUPPI) {
908  set("NHF_TR", 0.98);
909  set("NEF_TR", 0.99);
910  set("nNeutrals_EC", 1);
911  set("NEF_FW", 0.90);
912  set("nNeutrals_FW_L", 2);
913  set("nNeutrals_FW_U", 999999);
915  set("NHF_TR", 0.9);
916  set("NEF_TR", 0.99);
917  set("NCH_TR", 0);
918  set("NEF_EC_L", 0.01);
919  set("NEF_EC_U", 0.99);
920  set("nNeutrals_EC", 2);
921  set("NHF_FW", 0.2);
922  set("NEF_FW", 0.90);
923  set("nNeutrals_FW", 10);
925  set("NHF_TR", 0.9);
926  set("NEF_TR", 0.99);
927  set("NHF_EC", 0.9999);
928  set("NHF_FW", -1.0);
929  set("NEF_FW", 0.90);
930  set("nNeutrals_FW_L", 2);
931  set("nNeutrals_FW_U", 999999);
932  } else if (version_ == RUN3WINTER22PUPPI) {
933  set("NHF_TR", 0.9);
934  set("NEF_TR", 0.99);
935  set("NHF_EC", 0.9999);
936  set("NHF_FW", -1.0);
937  set("NEF_FW", 0.90);
938  set("nNeutrals_FW_L", 1);
939  set("nNeutrals_FW_U", 999999);
940  }
941  } else if (quality_ == TIGHTLEPVETO) {
942  set("CHF", 0.0);
943  set("NHF", 0.9);
944  set("CEF", 0.8);
945  set("NEF", 0.9);
946  set("NCH", 0);
947  set("nConstituents", 1);
948  set("MUF", 0.8);
949  if (version_ == WINTER17) {
950  set("NEF_EC_L", 0.02);
951  set("NEF_EC_U", 0.99);
952  set("nNeutrals_EC", 2);
953  set("NHF_FW", 0.02);
954  set("NEF_FW", 0.90);
955  set("nNeutrals_FW", 10);
956  }
959  set("CHF", 0.01);
960  } else if (version_ == RUN3WINTER22CHS || version_ == RUN3WINTER22PUPPI) {
961  set("NHF", 0.99);
962  } else if (version_ == WINTER17PUPPI) {
963  set("NHF_EC", 0.99);
964  set("NHF_FW", 0.02);
965  set("NEF_FW", 0.90);
966  set("nNeutrals_FW_L", 2);
967  set("nNeutrals_FW_U", 15);
968  } else if (version_ == WINTER16) {
969  set("CEF", 0.9);
970  set("NEF_EC", 0.01);
971  set("NHF_EC", 0.98);
972  set("nNeutrals_EC", 2);
973  set("nNeutrals_FW", 10);
974  set("NEF_FW", 0.90);
975  } else if (version_ == WINTER17PUPPI) {
976  set("NHF_EC", 0.99);
977  set("NHF_FW", 0.02);
978  set("NEF_FW", 0.90);
979  set("nNeutrals_FW_L", 2);
980  set("nNeutrals_FW_U", 15);
981  } else if (version_ == WINTER16) {
982  set("CEF", 0.9);
983  set("NEF_EC", 0.01);
984  set("NHF_EC", 0.98);
985  set("nNeutrals_EC", 2);
986  set("nNeutrals_FW", 10);
987  set("NEF_FW", 0.90);
988  } else if (version_ == SUMMER18) {
989  set("NHF_TR", 0.9);
990  set("NEF_TR", 0.99);
991  set("MUF_TR", 0.8);
992  set("NCH_TR", 0);
993  set("CEF_TR", 0.8);
994  set("NEF_EC_L", 0.02);
995  set("NEF_EC_U", 0.99);
996  set("nNeutrals_EC", 2);
997  set("NHF_FW", 0.2);
998  set("NEF_FW", 0.90);
999  set("nNeutrals_FW", 10);
1000  } else if (version_ == SUMMER18PUPPI) {
1001  set("NHF_TR", 0.9);
1002  set("NEF_TR", 0.99);
1003  set("MUF_TR", 0.8);
1004  set("CEF_TR", 0.8);
1005  set("NHF_EC", 0.99);
1006  set("NHF_FW", 0.02);
1007  set("NEF_FW", 0.90);
1008  set("nNeutrals_FW_L", 2);
1009  set("nNeutrals_FW_U", 15);
1010  } else if (version_ == RUN2UL16CHS) {
1011  set("NHF_TR", 0.9);
1012  set("NEF_TR", 0.99);
1013  set("NHF_EC", 0.9);
1014  set("NEF_EC_L", 0.);
1015  set("NEF_EC_U", 0.99);
1016  set("nNeutrals_EC", 1);
1017  set("NHF_FW", 0.2);
1018  set("NEF_FW", 0.90);
1019  set("nNeutrals_FW", 10);
1020  } else if (version_ == RUN2UL16PUPPI) {
1021  set("NHF_TR", 0.98);
1022  set("NEF_TR", 0.99);
1023  set("nNeutrals_EC", 1);
1024  set("NEF_FW", 0.90);
1025  set("nNeutrals_FW_L", 2);
1026  set("nNeutrals_FW_U", 999999);
1028  set("NHF_TR", 0.9);
1029  set("NEF_TR", 0.99);
1030  set("MUF_TR", 0.8);
1031  set("NCH_TR", 0);
1032  set("CEF_TR", 0.8);
1033  set("NEF_EC_L", 0.01);
1034  set("NEF_EC_U", 0.99);
1035  set("nNeutrals_EC", 2);
1036  set("NHF_FW", 0.2);
1037  set("NEF_FW", 0.90);
1038  set("nNeutrals_FW", 10);
1040  set("NHF_TR", 0.9);
1041  set("NEF_TR", 0.99);
1042  set("MUF_TR", 0.8);
1043  set("CEF_TR", 0.8);
1044  set("NHF_EC", 0.9999);
1045  set("NHF_FW", -1.0);
1046  set("NEF_FW", 0.90);
1047  set("nNeutrals_FW_L", 2);
1048  set("nNeutrals_FW_U", 999999);
1049  } else if (version_ == RUN3WINTER22PUPPI) {
1050  set("NHF_TR", 0.9);
1051  set("NEF_TR", 0.99);
1052  set("MUF_TR", 0.8);
1053  set("CEF_TR", 0.8);
1054  set("NHF_EC", 0.9999);
1055  set("NHF_FW", -1.0);
1056  set("NEF_FW", 0.90);
1057  set("nNeutrals_FW_L", 1);
1058  set("nNeutrals_FW_U", 999999);
1059  }
1060  }
1061  }
1062 
1063  void initIndex() {
1064  indexNConstituents_ = index_type(&bits_, "nConstituents");
1065  indexNEF_ = index_type(&bits_, "NEF");
1066  indexNHF_ = index_type(&bits_, "NHF");
1071  quality_ != TIGHT)
1072  indexCEF_ = index_type(&bits_, "CEF");
1073 
1074  indexCHF_ = index_type(&bits_, "CHF");
1075  indexNCH_ = index_type(&bits_, "NCH");
1076  if (version_ == RUNIISTARTUP) {
1077  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1078  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
1079  }
1080  if (version_ == WINTER16) {
1081  indexNHF_EC_ = index_type(&bits_, "NHF_EC");
1082  indexNEF_EC_ = index_type(&bits_, "NEF_EC");
1083  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
1084  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1085  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
1086  if (quality_ == TIGHTLEPVETO) {
1087  indexMUF_ = index_type(&bits_, "MUF");
1088  }
1089  }
1090  if (version_ == WINTER17) {
1091  indexNEF_EC_L_ = index_type(&bits_, "NEF_EC_L");
1092  indexNEF_EC_U_ = index_type(&bits_, "NEF_EC_U");
1093  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
1094  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
1095  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1096  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
1097  if (quality_ == TIGHTLEPVETO) {
1098  indexMUF_ = index_type(&bits_, "MUF");
1099  }
1100  }
1101  if (version_ == WINTER17PUPPI) {
1102  indexNHF_EC_ = index_type(&bits_, "NHF_EC");
1103  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
1104  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1105  indexNNeutrals_FW_L_ = index_type(&bits_, "nNeutrals_FW_L");
1106  indexNNeutrals_FW_U_ = index_type(&bits_, "nNeutrals_FW_U");
1107  if (quality_ == TIGHTLEPVETO) {
1108  indexMUF_ = index_type(&bits_, "MUF");
1109  }
1110  }
1112  (version_ == RUN3WINTER22CHS)) {
1113  indexNHF_TR_ = index_type(&bits_, "NHF_TR");
1114  indexNEF_TR_ = index_type(&bits_, "NEF_TR");
1115  indexNCH_TR_ = index_type(&bits_, "NCH_TR");
1116  indexNEF_EC_L_ = index_type(&bits_, "NEF_EC_L");
1117  indexNEF_EC_U_ = index_type(&bits_, "NEF_EC_U");
1118  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
1119  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
1120  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1121  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
1122  if (quality_ == TIGHTLEPVETO) {
1123  indexMUF_ = index_type(&bits_, "MUF");
1124  indexMUF_TR_ = index_type(&bits_, "MUF_TR");
1125  indexCEF_TR_ = index_type(&bits_, "CEF_TR");
1126  }
1127  }
1129  (version_ == RUN3WINTER22PUPPI)) {
1130  indexNHF_TR_ = index_type(&bits_, "NHF_TR");
1131  indexNEF_TR_ = index_type(&bits_, "NEF_TR");
1132  indexNHF_EC_ = index_type(&bits_, "NHF_EC");
1133  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
1134  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1135  indexNNeutrals_FW_L_ = index_type(&bits_, "nNeutrals_FW_L");
1136  indexNNeutrals_FW_U_ = index_type(&bits_, "nNeutrals_FW_U");
1137  if (quality_ == TIGHTLEPVETO) {
1138  indexMUF_ = index_type(&bits_, "MUF");
1139  indexMUF_TR_ = index_type(&bits_, "MUF_TR");
1140  indexCEF_TR_ = index_type(&bits_, "CEF_TR");
1141  }
1142  }
1143  if (version_ == RUN2UL16CHS) {
1144  indexNHF_TR_ = index_type(&bits_, "NHF_TR");
1145  indexNEF_TR_ = index_type(&bits_, "NEF_TR");
1146  indexNHF_EC_ = index_type(&bits_, "NHF_EC");
1147  indexNEF_EC_L_ = index_type(&bits_, "NEF_EC_L");
1148  indexNEF_EC_U_ = index_type(&bits_, "NEF_EC_U");
1149  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
1150  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
1151  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1152  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
1153  if (quality_ == TIGHTLEPVETO) {
1154  indexMUF_ = index_type(&bits_, "MUF");
1155  }
1156  }
1157  if (version_ == RUN2UL16PUPPI) {
1158  indexNHF_TR_ = index_type(&bits_, "NHF_TR");
1159  indexNEF_TR_ = index_type(&bits_, "NEF_TR");
1160  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
1161  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
1162  indexNNeutrals_FW_L_ = index_type(&bits_, "nNeutrals_FW_L");
1163  indexNNeutrals_FW_U_ = index_type(&bits_, "nNeutrals_FW_U");
1164  if (quality_ == TIGHTLEPVETO) {
1165  indexMUF_ = index_type(&bits_, "MUF");
1166  }
1167  }
1169  }
1170 
1173 
1181 
1187 
1193 
1199 };
1200 
1201 #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