CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
PFJetIDSelectionFunctor Class Reference

PF Jet selector for pat::Jets. More...

#include "PhysicsTools/SelectorUtils/interface/PFJetIDSelectionFunctor.h"

Inheritance diagram for PFJetIDSelectionFunctor:
Selector< pat::Jet >

Public Types

enum  Quality_t { LOOSE, TIGHT, TIGHTLEPVETO, N_QUALITY }
 
enum  Version_t {
  FIRSTDATA, RUNIISTARTUP, WINTER16, WINTER17,
  WINTER17PUPPI, SUMMER18, SUMMER18PUPPI, RUN2UL16CHS,
  RUN2UL16PUPPI, RUN2ULCHS, RUN2ULPUPPI, N_VERSIONS
}
 
- Public Types inherited from Selector< pat::Jet >
typedef std::pair< index_type, size_t > cut_flow_item
 
typedef std::vector< cut_flow_itemcut_flow_map
 
typedef pat::Jet data_type
 
typedef std::map< index_type, double > double_map
 
typedef pat::strbitset::index_type index_type
 
typedef std::map< index_type, int > int_map
 

Public Member Functions

bool firstDataCuts (reco::Jet const &jet, pat::strbitset &ret, Version_t version_)
 
bool operator() (const pat::Jet &jet, pat::strbitset &ret) override
 This provides the interface for base classes to select objects. More...
 
bool operator() (const reco::PFJet &jet, pat::strbitset &ret)
 
bool operator() (const reco::PFJet &jet)
 
 PFJetIDSelectionFunctor ()
 
 PFJetIDSelectionFunctor (edm::ParameterSet const &params, edm::ConsumesCollector &iC)
 
 PFJetIDSelectionFunctor (edm::ParameterSet const &params)
 
 PFJetIDSelectionFunctor (Version_t version, Quality_t quality)
 
- Public Member Functions inherited from Selector< pat::Jet >
void clear (std::string const &s)
 Turn off a given selection cut. More...
 
void clear (index_type const &i)
 
bool considerCut (std::string const &s) const
 consider the cut at index "s" More...
 
bool considerCut (index_type const &i) const
 
int cut (index_type const &i, int val) const
 Access the int cut values at index "s". More...
 
double cut (index_type const &i, double val) const
 Access the double cut values at index "s". More...
 
int cut (std::string s, int val) const
 Access the int cut values at index "s". More...
 
double cut (std::string s, double val) const
 Access the double cut values at index "s". More...
 
pat::strbitset getBitTemplate () const
 Get an empty bitset with the proper names. More...
 
double getPasses (std::string const &s) const
 Return the number of passing cases. More...
 
double getPasses (index_type const &i) const
 
bool ignoreCut (std::string const &s) const
 ignore the cut at index "s" More...
 
bool ignoreCut (index_type const &i) const
 
virtual bool operator() (pat::Jet const &t)
 This provides an alternative signature without the second ret. More...
 
virtual bool operator() (pat::Jet const &t, edm::EventBase const &e, pat::strbitset &ret)
 This provides an alternative signature that includes extra information. More...
 
virtual bool operator() (pat::Jet const &t, edm::EventBase const &e)
 This provides an alternative signature that includes extra information. More...
 
bool operator[] (std::string const &s) const
 
bool operator[] (index_type const &i) const
 
void passCut (pat::strbitset &ret, std::string const &s)
 Passing cuts. More...
 
void passCut (pat::strbitset &ret, index_type const &i)
 
void print (std::ostream &out) const
 Print the cut flow. More...
 
void printActiveCuts (std::ostream &out) const
 Print the cuts being considered. More...
 
virtual void push_back (std::string const &s)
 This is the registration of an individual cut string. More...
 
virtual void push_back (std::string const &s, int cut)
 This is the registration of an individual cut string, with an int cut value. More...
 
virtual void push_back (std::string const &s, double cut)
 This is the registration of an individual cut string, with a double cut value. More...
 
 Selector ()
 Constructor clears the bits. More...
 
void set (std::string const &s, bool val=true)
 Set a given selection cut, on or off. More...
 
void set (index_type const &i, bool val=true)
 
void set (std::string const &s, int cut, bool val=true)
 Set a given selection cut, on or off, and reset int cut value. More...
 
void set (index_type const &i, int cut, bool val=true)
 
void set (std::string const &s, double cut, bool val=true)
 Set a given selection cut, on or off, and reset int cut value. More...
 
void set (index_type const &i, double cut, bool val=true)
 
void setIgnored (pat::strbitset &ret)
 set ignored bits More...
 
void setIgnoredCuts (std::vector< std::string > const &bitsToIgnore)
 set the bits to ignore from a vector More...
 
virtual ~Selector ()
 

Static Public Member Functions

static edm::ParameterSetDescription getDescription ()
 

Private Member Functions

void initCuts ()
 
void initIndex ()
 

Private Attributes

index_type indexCEF_
 
index_type indexCEF_TR_
 
index_type indexCHF_
 
index_type indexMUF_
 
index_type indexMUF_TR_
 
index_type indexNCH_
 
index_type indexNCH_TR_
 
index_type indexNConstituents_
 
index_type indexNEF_
 
index_type indexNEF_EC_
 
index_type indexNEF_EC_L_
 
index_type indexNEF_EC_U_
 
index_type indexNEF_FW_
 
index_type indexNEF_TR_
 
index_type indexNHF_
 
index_type indexNHF_EC_
 
index_type indexNHF_FW_
 
index_type indexNHF_TR_
 
index_type indexNNeutrals_EC_
 
index_type indexNNeutrals_FW_
 
index_type indexNNeutrals_FW_L_
 
index_type indexNNeutrals_FW_U_
 
Quality_t quality_
 
Version_t version_
 

Additional Inherited Members

- Protected Attributes inherited from Selector< pat::Jet >
pat::strbitset bits_
 the bitset indexed by strings More...
 
cut_flow_map cutFlow_
 map of cut flows in "human" order More...
 
double_map doubleCuts_
 the double-value cut map More...
 
int_map intCuts_
 the int-value cut map More...
 
pat::strbitset retInternal_
 internal ret if users don't care about return bits More...
 

Detailed Description

PF Jet selector for pat::Jets.

Selector functor for pat::Jets that implements quality cuts based on studies of noise patterns.

Please see https://twiki.cern.ch/twiki/bin/view/CMS/SWGuidePATSelectors for a general overview of the selectors.

Definition at line 28 of file PFJetIDSelectionFunctor.h.

Member Enumeration Documentation

◆ Quality_t

◆ Version_t

Constructor & Destructor Documentation

◆ PFJetIDSelectionFunctor() [1/4]

PFJetIDSelectionFunctor::PFJetIDSelectionFunctor ( )
inline

Definition at line 46 of file PFJetIDSelectionFunctor.h.

46 {}

◆ PFJetIDSelectionFunctor() [2/4]

PFJetIDSelectionFunctor::PFJetIDSelectionFunctor ( edm::ParameterSet const &  params,
edm::ConsumesCollector iC 
)
inline

◆ PFJetIDSelectionFunctor() [3/4]

PFJetIDSelectionFunctor::PFJetIDSelectionFunctor ( edm::ParameterSet const &  params)
inline

Definition at line 53 of file PFJetIDSelectionFunctor.h.

References Selector< pat::Jet >::bits_, FIRSTDATA, mps_fire::i, initCuts(), initIndex(), B2GTnPMonitor_cfi::item, LOOSE, submitPVValidationJobs::params, quality_, RUN2UL16CHS, RUN2UL16PUPPI, RUN2ULCHS, RUN2ULPUPPI, RUNIISTARTUP, Selector< pat::Jet >::setIgnoredCuts(), AlCaHLTBitMon_QueryRunRegistry::string, pat::strbitset::strings(), SUMMER18, SUMMER18PUPPI, TIGHT, TIGHTLEPVETO, version_, WINTER16, WINTER17, and WINTER17PUPPI.

53  {
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  }
const std::vector< std::string > strings() const
give access to the ordered strings
Definition: strbitset.h:295
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:241
void setIgnoredCuts(std::vector< std::string > const &bitsToIgnore)
set the bits to ignore from a vector
Definition: Selector.h:131

◆ PFJetIDSelectionFunctor() [4/4]

PFJetIDSelectionFunctor::PFJetIDSelectionFunctor ( Version_t  version,
Quality_t  quality 
)
inline

Member Function Documentation

◆ firstDataCuts()

bool PFJetIDSelectionFunctor::firstDataCuts ( reco::Jet const &  jet,
pat::strbitset ret,
Version_t  version_ 
)
inline

Definition at line 233 of file PFJetIDSelectionFunctor.h.

References funct::abs(), cms::cuda::assert(), reco::Candidate::begin(), reco::PFJet::chargedEmEnergy(), pat::Jet::chargedEmEnergy(), pat::Jet::chargedEmEnergyFraction(), reco::PFJet::chargedHadronEnergy(), pat::Jet::chargedHadronEnergy(), pat::Jet::chargedHadronEnergyFraction(), reco::PFJet::chargedMultiplicity(), pat::Jet::chargedMultiplicity(), Selector< pat::Jet >::cut(), MillePedeFileConverter_cfg::e, reco::PFJet::electronEnergy(), reco::Candidate::end(), reco::LeafCandidate::energy(), FIRSTDATA, reco::PFJet::HFEMEnergy(), Selector< pat::Jet >::ignoreCut(), indexCEF_, indexCEF_TR_, indexCHF_, indexMUF_, indexMUF_TR_, indexNCH_, indexNCH_TR_, indexNConstituents_, indexNEF_, indexNEF_EC_, indexNEF_EC_L_, indexNEF_EC_U_, indexNEF_FW_, indexNEF_TR_, indexNHF_, indexNHF_EC_, indexNHF_FW_, indexNHF_TR_, indexNNeutrals_EC_, indexNNeutrals_FW_, indexNNeutrals_FW_L_, indexNNeutrals_FW_U_, pat::Jet::isBasicJet(), pat::Jet::isPFJet(), metsig::jet, reco::PFJet::muonEnergy(), pat::Jet::muonEnergy(), pat::Jet::muonEnergyFraction(), reco::PFJet::neutralEmEnergy(), pat::Jet::neutralEmEnergy(), pat::Jet::neutralEmEnergyFraction(), reco::PFJet::neutralHadronEnergy(), pat::Jet::neutralHadronEnergy(), pat::Jet::neutralHadronEnergyFraction(), reco::PFJet::neutralMultiplicity(), pat::Jet::neutralMultiplicity(), Selector< pat::Jet >::passCut(), reco::PFJet::photonEnergy(), quality_, runTheMatrix::ret, RUN2UL16CHS, RUN2UL16PUPPI, RUN2ULCHS, RUN2ULPUPPI, RUNIISTARTUP, Selector< pat::Jet >::setIgnored(), SUMMER18, SUMMER18PUPPI, TIGHT, TIGHTLEPVETO, version_, WINTER16, WINTER17, and WINTER17PUPPI.

Referenced by operator()().

233  {
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  }
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
bool isBasicJet() const
check to see if the jet is no more than a reco::BasicJet
Definition: Jet.h:277
int neutralMultiplicity() const
neutralMultiplicity
Definition: Jet.h:464
void setIgnored(pat::strbitset &ret)
set ignored bits
Definition: Selector.h:181
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
float chargedHadronEnergy() const
chargedHadronEnergy
Definition: Jet.h:694
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
float chargedEmEnergy() const
chargedEmEnergy
Definition: Jet.h:712
bool isPFJet() const
check to see if the jet is a reco::PFJet
Definition: Jet.h:275
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
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
const_iterator begin() const
first daughter const_iterator
Definition: Candidate.h:143
double energy() const final
energy

◆ getDescription()

static edm::ParameterSetDescription PFJetIDSelectionFunctor::getDescription ( )
inlinestatic

Definition at line 119 of file PFJetIDSelectionFunctor.h.

References HLT_2022v15_cff::CEF, HLT_2022v15_cff::CHF, submitPVResolutionJobs::desc, HLT_2022v15_cff::NCH, custom_jme_cff::nConstituents, HLT_2022v15_cff::NEF, and HLT_2022v15_cff::NHF.

119  {
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  }

◆ initCuts()

void PFJetIDSelectionFunctor::initCuts ( )
inlineprivate

Definition at line 681 of file PFJetIDSelectionFunctor.h.

References LOOSE, Selector< pat::Jet >::push_back(), quality_, RUN2UL16CHS, RUN2UL16PUPPI, RUN2ULCHS, RUN2ULPUPPI, RUNIISTARTUP, SUMMER18, SUMMER18PUPPI, TIGHT, TIGHTLEPVETO, version_, WINTER16, WINTER17, and WINTER17PUPPI.

Referenced by PFJetIDSelectionFunctor().

681  {
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  }
virtual void push_back(std::string const &s)
This is the registration of an individual cut string.
Definition: Selector.h:42
Log< level::Warning, false > LogWarning

◆ initIndex()

void PFJetIDSelectionFunctor::initIndex ( )
inlineprivate

Definition at line 1018 of file PFJetIDSelectionFunctor.h.

References Selector< pat::Jet >::bits_, Selector< pat::Jet >::getBitTemplate(), indexCEF_, indexCEF_TR_, indexCHF_, indexMUF_, indexMUF_TR_, indexNCH_, indexNCH_TR_, indexNConstituents_, indexNEF_, indexNEF_EC_, indexNEF_EC_L_, indexNEF_EC_U_, indexNEF_FW_, indexNEF_TR_, indexNHF_, indexNHF_EC_, indexNHF_FW_, indexNHF_TR_, indexNNeutrals_EC_, indexNNeutrals_FW_, indexNNeutrals_FW_L_, indexNNeutrals_FW_U_, quality_, Selector< pat::Jet >::retInternal_, RUN2UL16CHS, RUN2UL16PUPPI, RUN2ULCHS, RUN2ULPUPPI, RUNIISTARTUP, SUMMER18, SUMMER18PUPPI, TIGHT, TIGHTLEPVETO, version_, WINTER16, WINTER17, and WINTER17PUPPI.

Referenced by PFJetIDSelectionFunctor().

1018  {
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  }
pat::strbitset::index_type index_type
Definition: Selector.h:25
pat::strbitset retInternal_
internal ret if users don&#39;t care about return bits
Definition: Selector.h:242
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:241
pat::strbitset getBitTemplate() const
Get an empty bitset with the proper names.
Definition: Selector.h:168

◆ operator()() [1/3]

bool PFJetIDSelectionFunctor::operator() ( const pat::Jet t,
pat::strbitset ret 
)
inlineoverridevirtual

This provides the interface for base classes to select objects.

Implements Selector< pat::Jet >.

Definition at line 195 of file PFJetIDSelectionFunctor.h.

References FIRSTDATA, firstDataCuts(), metsig::jet, runTheMatrix::ret, RUN2UL16CHS, RUN2UL16PUPPI, RUN2ULCHS, RUN2ULPUPPI, RUNIISTARTUP, SUMMER18, SUMMER18PUPPI, version_, WINTER16, WINTER17, and WINTER17PUPPI.

Referenced by operator()().

195  {
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  }
ret
prodAgent to be discontinued
bool firstDataCuts(reco::Jet const &jet, pat::strbitset &ret, Version_t version_)

◆ operator()() [2/3]

bool PFJetIDSelectionFunctor::operator() ( const reco::PFJet jet,
pat::strbitset ret 
)
inline

Definition at line 213 of file PFJetIDSelectionFunctor.h.

References FIRSTDATA, firstDataCuts(), metsig::jet, runTheMatrix::ret, RUN2UL16CHS, RUN2UL16PUPPI, RUN2ULCHS, RUN2ULPUPPI, RUNIISTARTUP, SUMMER18, SUMMER18PUPPI, version_, WINTER16, WINTER17, and WINTER17PUPPI.

213  {
217  return firstDataCuts(jet, ret, version_);
218  } else {
219  return false;
220  }
221  }
ret
prodAgent to be discontinued
bool firstDataCuts(reco::Jet const &jet, pat::strbitset &ret, Version_t version_)

◆ operator()() [3/3]

bool PFJetIDSelectionFunctor::operator() ( const reco::PFJet jet)
inline

Definition at line 223 of file PFJetIDSelectionFunctor.h.

References metsig::jet, operator()(), Selector< pat::Jet >::retInternal_, pat::strbitset::set(), and Selector< pat::Jet >::setIgnored().

223  {
224  retInternal_.set(false);
227  return (bool)retInternal_;
228  }
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
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

Member Data Documentation

◆ indexCEF_

index_type PFJetIDSelectionFunctor::indexCEF_
private

Definition at line 1129 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexCEF_TR_

index_type PFJetIDSelectionFunctor::indexCEF_TR_
private

Definition at line 1137 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexCHF_

index_type PFJetIDSelectionFunctor::indexCHF_
private

Definition at line 1130 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexMUF_

index_type PFJetIDSelectionFunctor::indexMUF_
private

Definition at line 1127 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexMUF_TR_

index_type PFJetIDSelectionFunctor::indexMUF_TR_
private

Definition at line 1136 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexNCH_

index_type PFJetIDSelectionFunctor::indexNCH_
private

Definition at line 1131 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexNCH_TR_

index_type PFJetIDSelectionFunctor::indexNCH_TR_
private

Definition at line 1135 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexNConstituents_

index_type PFJetIDSelectionFunctor::indexNConstituents_
private

Definition at line 1125 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexNEF_

index_type PFJetIDSelectionFunctor::indexNEF_
private

Definition at line 1126 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexNEF_EC_

index_type PFJetIDSelectionFunctor::indexNEF_EC_
private

Definition at line 1146 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexNEF_EC_L_

index_type PFJetIDSelectionFunctor::indexNEF_EC_L_
private

Definition at line 1147 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexNEF_EC_U_

index_type PFJetIDSelectionFunctor::indexNEF_EC_U_
private

Definition at line 1148 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexNEF_FW_

index_type PFJetIDSelectionFunctor::indexNEF_FW_
private

Definition at line 1140 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexNEF_TR_

index_type PFJetIDSelectionFunctor::indexNEF_TR_
private

Definition at line 1134 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexNHF_

index_type PFJetIDSelectionFunctor::indexNHF_
private

Definition at line 1128 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexNHF_EC_

index_type PFJetIDSelectionFunctor::indexNHF_EC_
private

Definition at line 1145 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexNHF_FW_

index_type PFJetIDSelectionFunctor::indexNHF_FW_
private

Definition at line 1139 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexNHF_TR_

index_type PFJetIDSelectionFunctor::indexNHF_TR_
private

Definition at line 1133 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexNNeutrals_EC_

index_type PFJetIDSelectionFunctor::indexNNeutrals_EC_
private

Definition at line 1149 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexNNeutrals_FW_

index_type PFJetIDSelectionFunctor::indexNNeutrals_FW_
private

Definition at line 1141 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexNNeutrals_FW_L_

index_type PFJetIDSelectionFunctor::indexNNeutrals_FW_L_
private

Definition at line 1142 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ indexNNeutrals_FW_U_

index_type PFJetIDSelectionFunctor::indexNNeutrals_FW_U_
private

Definition at line 1143 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

◆ quality_

Quality_t PFJetIDSelectionFunctor::quality_
private

◆ version_

Version_t PFJetIDSelectionFunctor::version_
private