CMS 3D CMS Logo

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

Jet selector for pat::Jets and for CaloJets. More...

#include "PhysicsTools/Utilities/interface/JetIDSelectionFunctor.h"

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

Public Types

enum  Quality_t {
  MINIMAL, LOOSE_AOD, LOOSE, TIGHT,
  N_QUALITY
}
 
enum  Version_t { CRAFT08, PURE09, DQM09, 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

unsigned int count_hits (const std::vector< CaloTowerPtr > &towers)
 
bool craft08Cuts (reco::Candidate::LorentzVector const &correctedP4, double emEnergyFraction, reco::JetID const &jetID, pat::strbitset &ret)
 
bool fwd09Cuts (reco::Candidate::LorentzVector const &rawP4, double emEnergyFraction, double etaWidth, double phiWidth, unsigned int nHit, reco::JetID const &jetID, pat::strbitset &ret)
 
void initialize (Version_t version, Quality_t quality)
 
 JetIDSelectionFunctor ()
 
 JetIDSelectionFunctor (edm::ParameterSet const &parameters, edm::ConsumesCollector &iC)
 
 JetIDSelectionFunctor (edm::ParameterSet const &parameters)
 
 JetIDSelectionFunctor (Version_t version, Quality_t quality)
 
bool operator() (const pat::Jet &jet, pat::strbitset &ret) override
 This provides the interface for base classes to select objects. More...
 
bool operator() (reco::Candidate::LorentzVector const &correctedP4, double emEnergyFraction, reco::JetID const &jetID, pat::strbitset &ret)
 
virtual bool operator() (reco::Candidate::LorentzVector const &correctedP4, double emEnergyFraction, reco::JetID const &jetID)
 accessor like previous, without the ret More...
 
bool operator() (reco::CaloJet const &jet, reco::JetID const &jetID, pat::strbitset &ret)
 
virtual bool operator() (reco::CaloJet const &jet, reco::JetID const &jetID)
 accessor like previous, without the ret More...
 
- 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 ()
 

Private Attributes

index_type index_EF_EMF_
 
index_type index_EF_N90Hits_
 
index_type index_LOOSE_als_
 
index_type index_LOOSE_AOD_EMF_
 
index_type index_LOOSE_AOD_fHPD_
 
index_type index_LOOSE_AOD_N90Hits_
 
index_type index_LOOSE_EMF_
 
index_type index_LOOSE_fHPD_
 
index_type index_LOOSE_fls_
 
index_type index_LOOSE_foot_
 
index_type index_LOOSE_N90Hits_
 
index_type index_LOOSE_nHit_
 
index_type index_MINIMAL_EMF_
 
index_type index_TIGHT_als_
 
index_type index_TIGHT_EMF_
 
index_type index_TIGHT_fHPD_
 
index_type index_TIGHT_fls_
 
index_type index_TIGHT_foot_
 
index_type index_TIGHT_nHit_
 
index_type index_widths_
 
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

Jet selector for pat::Jets and for CaloJets.

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.

Author
Salvatore Rappoccio (Update: Amnon Harel)
Version
Id
JetIDSelectionFunctor.h,v 1.15 2010/08/31 20:31:50 srappocc Exp

Definition at line 28 of file JetIDSelectionFunctor.h.

Member Enumeration Documentation

◆ Quality_t

◆ Version_t

Constructor & Destructor Documentation

◆ JetIDSelectionFunctor() [1/4]

JetIDSelectionFunctor::JetIDSelectionFunctor ( )
inline

Definition at line 33 of file JetIDSelectionFunctor.h.

33 {}

◆ JetIDSelectionFunctor() [2/4]

JetIDSelectionFunctor::JetIDSelectionFunctor ( edm::ParameterSet const &  parameters,
edm::ConsumesCollector iC 
)
inline

◆ JetIDSelectionFunctor() [3/4]

JetIDSelectionFunctor::JetIDSelectionFunctor ( edm::ParameterSet const &  parameters)
inline

Definition at line 40 of file JetIDSelectionFunctor.h.

References CRAFT08, DQM09, Exception, initialize(), LOOSE, LOOSE_AOD, MINIMAL, N_QUALITY, PURE09, quality, AlCaHLTBitMon_QueryRunRegistry::string, and TIGHT.

40  {
41  std::string versionStr = parameters.getParameter<std::string>("version");
42  std::string qualityStr = parameters.getParameter<std::string>("quality");
44 
45  if (qualityStr == "MINIMAL")
46  quality = MINIMAL;
47  else if (qualityStr == "LOOSE_AOD")
49  else if (qualityStr == "LOOSE")
50  quality = LOOSE;
51  else if (qualityStr == "TIGHT")
52  quality = TIGHT;
53  else
54  throw cms::Exception("InvalidInput")
55  << "Expect quality to be one of MINIMAL, LOOSE_AOD, LOOSE,TIGHT" << std::endl;
56 
57  if (versionStr == "CRAFT08") {
59  } else if (versionStr == "PURE09") {
61  } else if (versionStr == "DQM09") {
63  } else {
64  throw cms::Exception("InvalidInput") << "Expect version to be one of CRAFT08, PURE09, DQM09" << std::endl;
65  }
66  }
void initialize(Version_t version, Quality_t quality)
string quality

◆ JetIDSelectionFunctor() [4/4]

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

Definition at line 68 of file JetIDSelectionFunctor.h.

References initialize(), quality, and BeamSplash_cfg::version.

void initialize(Version_t version, Quality_t quality)
string quality

Member Function Documentation

◆ count_hits()

unsigned int JetIDSelectionFunctor::count_hits ( const std::vector< CaloTowerPtr > &  towers)
inline

Definition at line 218 of file JetIDSelectionFunctor.h.

References HLT_2024v11_cff::towers.

Referenced by operator()().

218  {
219  unsigned int nHit = 0;
220  for (unsigned int iTower = 0; iTower < towers.size(); ++iTower) {
221  const std::vector<DetId>& cellIDs = towers[iTower]->constituents(); // cell == recHit
222  nHit += cellIDs.size();
223  }
224  return nHit;
225  }

◆ craft08Cuts()

bool JetIDSelectionFunctor::craft08Cuts ( reco::Candidate::LorentzVector const &  correctedP4,
double  emEnergyFraction,
reco::JetID const &  jetID,
pat::strbitset ret 
)
inline

Definition at line 309 of file JetIDSelectionFunctor.h.

References reco::JetID::approximatefHPD, custom_jme_cff::emf, reco::JetID::fHPD, reco::JetID::hitsInN90, Selector< pat::Jet >::ignoreCut(), index_LOOSE_AOD_EMF_, index_LOOSE_AOD_fHPD_, index_LOOSE_AOD_N90Hits_, index_LOOSE_EMF_, index_LOOSE_fHPD_, index_LOOSE_N90Hits_, index_MINIMAL_EMF_, index_TIGHT_EMF_, index_TIGHT_fHPD_, LOOSE, LOOSE_AOD, reco::JetID::n90Hits, Selector< pat::Jet >::passCut(), quality_, runTheMatrix::ret, Selector< pat::Jet >::setIgnored(), and TIGHT.

Referenced by operator()().

312  {
313  ret.set(false);
314 
315  // cache some variables
316  double abs_eta = TMath::Abs(correctedP4.eta());
317  double corrPt = correctedP4.pt();
318  double emf = emEnergyFraction;
319 
320  if (ignoreCut(index_MINIMAL_EMF_) || abs_eta > 2.6 || emf > 0.01)
322 
323  if (quality_ == LOOSE_AOD) {
324  // loose fhpd cut from aod
325  if (ignoreCut(index_LOOSE_AOD_fHPD_) || jetID.approximatefHPD < 0.98)
327  // loose n90 hits cut
328  if (ignoreCut(index_LOOSE_AOD_N90Hits_) || jetID.hitsInN90 > 1)
330 
331  // loose EMF Cut from aod
332  bool emf_loose = true;
333  if (abs_eta <= 2.6) { // HBHE
334  if (emEnergyFraction <= 0.01)
335  emf_loose = false;
336  } else { // HF
337  if (emEnergyFraction <= -0.9)
338  emf_loose = false;
339  if (corrPt > 80 && emEnergyFraction >= 1)
340  emf_loose = false;
341  }
342  if (ignoreCut(index_LOOSE_AOD_EMF_) || emf_loose)
344 
345  } else if (quality_ == LOOSE || quality_ == TIGHT) {
346  // loose fhpd cut
347  if (ignoreCut(index_LOOSE_fHPD_) || jetID.fHPD < 0.98)
349  // loose n90 hits cut
350  if (ignoreCut(index_LOOSE_N90Hits_) || jetID.n90Hits > 1)
352 
353  // loose EMF Cut
354  bool emf_loose = true;
355  if (abs_eta <= 2.6) { // HBHE
356  if (emEnergyFraction <= 0.01)
357  emf_loose = false;
358  } else { // HF
359  if (emEnergyFraction <= -0.9)
360  emf_loose = false;
361  if (corrPt > 80 && emEnergyFraction >= 1)
362  emf_loose = false;
363  }
364  if (ignoreCut(index_LOOSE_EMF_) || emf_loose)
366 
367  if (quality_ == TIGHT) {
368  // tight fhpd cut
369  bool tight_fhpd = true;
370  if (corrPt >= 25 && jetID.fHPD >= 0.95)
371  tight_fhpd = false; // this was supposed to use raw pT, see AN2009/087 :-(
372  if (ignoreCut(index_TIGHT_fHPD_) || tight_fhpd)
374 
375  // tight emf cut
376  bool tight_emf = true;
377  if (abs_eta >= 1 && corrPt >= 80 && emEnergyFraction >= 1)
378  tight_emf = false; // outside HB
379  if (abs_eta >= 2.6) { // outside HBHE
380  if (emEnergyFraction <= -0.3)
381  tight_emf = false;
382  if (abs_eta < 3.25) { // HE-HF transition region
383  if (corrPt >= 50 && emEnergyFraction <= -0.2)
384  tight_emf = false;
385  if (corrPt >= 80 && emEnergyFraction <= -0.1)
386  tight_emf = false;
387  if (corrPt >= 340 && emEnergyFraction >= 0.95)
388  tight_emf = false;
389  } else { // HF
390  if (emEnergyFraction >= 0.9)
391  tight_emf = false;
392  if (corrPt >= 50 && emEnergyFraction <= -0.2)
393  tight_emf = false;
394  if (corrPt >= 50 && emEnergyFraction >= 0.8)
395  tight_emf = false;
396  if (corrPt >= 130 && emEnergyFraction <= -0.1)
397  tight_emf = false;
398  if (corrPt >= 130 && emEnergyFraction >= 0.7)
399  tight_emf = false;
400 
401  } // end if HF
402  } // end if outside HBHE
403  if (ignoreCut(index_TIGHT_EMF_) || tight_emf)
405  } // end if tight
406  } // end if loose or tight
407 
408  setIgnored(ret);
409 
410  return (bool)ret;
411  }
bool ignoreCut(std::string const &s) const
ignore the cut at index "s"
Definition: Selector.h:127
ret
prodAgent to be discontinued
void setIgnored(pat::strbitset &ret)
set ignored bits
Definition: Selector.h:181
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
Definition: Selector.h:142

◆ fwd09Cuts()

bool JetIDSelectionFunctor::fwd09Cuts ( reco::Candidate::LorentzVector const &  rawP4,
double  emEnergyFraction,
double  etaWidth,
double  phiWidth,
unsigned int  nHit,
reco::JetID const &  jetID,
pat::strbitset ret 
)
inline

Definition at line 416 of file JetIDSelectionFunctor.h.

References reco::JetID::approximatefHPD, custom_jme_cff::emf, electrons_cff::etaWidth, reco::JetID::fHFOOT, reco::JetID::fHPD, reco::JetID::fLong, reco::JetID::fLS, reco::JetID::fShort, HB, tpScales_cff::HBHE, tpScales_cff::HF, reco::JetID::hitsInN90, Selector< pat::Jet >::ignoreCut(), index_EF_EMF_, index_EF_N90Hits_, index_LOOSE_als_, index_LOOSE_AOD_fHPD_, index_LOOSE_AOD_N90Hits_, index_LOOSE_fHPD_, index_LOOSE_fls_, index_LOOSE_foot_, index_LOOSE_N90Hits_, index_LOOSE_nHit_, index_MINIMAL_EMF_, index_TIGHT_als_, index_TIGHT_EMF_, index_TIGHT_fHPD_, index_TIGHT_fls_, index_TIGHT_foot_, index_TIGHT_nHit_, index_widths_, METSkim_cff::Max, METSkim_cff::Min, reco::JetID::n90Hits, Selector< pat::Jet >::passCut(), electrons_cff::phiWidth, jetsAK4_CHS_cff::rawPt, runTheMatrix::ret, and Selector< pat::Jet >::setIgnored().

Referenced by operator()().

422  {
423  ret.set(false);
424 
425  // cache some variables
426  double abs_eta = TMath::Abs(rawP4.eta());
427  double rawPt = rawP4.pt();
428  double emf = emEnergyFraction;
429  double fhf = jetID.fLong + jetID.fShort;
430  double lnpt = (rawPt > 0) ? TMath::Log(rawPt) : -10;
431  double lnE = (rawP4.energy() > 0) ? TMath::Log(rawP4.energy()) : -10;
432 
433  bool HB = abs_eta < 1.0;
434  bool EF = 2.6 <= abs_eta && abs_eta < 3.4 && 0.1 <= fhf && fhf < 0.9;
435  bool HBHE = abs_eta < 2.6 || (abs_eta < 3.4 && fhf < 0.1);
436  bool HF = 3.4 <= abs_eta || (2.6 <= abs_eta && 0.9 <= fhf);
437  bool HFa = HF && abs_eta < 3.8;
438  bool HFb = HF && !HFa;
439 
440  // HBHE cuts as in CRAFT08
441  // - but using raw pTs
442  // ========================
443 
444  if ((!HBHE) || ignoreCut(index_MINIMAL_EMF_) || emf > 0.01)
446 
447  // loose fhpd cut from AOD
448  if ((!HBHE) || ignoreCut(index_LOOSE_AOD_fHPD_) || jetID.approximatefHPD < 0.98)
450  // loose n90 hits cut from AOD
451  if ((!HBHE) || ignoreCut(index_LOOSE_AOD_N90Hits_) || jetID.hitsInN90 > 1)
453 
454  // loose fhpd cut
455  if ((!HBHE) || ignoreCut(index_LOOSE_fHPD_) || jetID.fHPD < 0.98)
457  // loose n90 hits cut
458  if ((!HBHE) || ignoreCut(index_LOOSE_N90Hits_) || jetID.n90Hits > 1)
460 
461  // tight fhpd cut
462  if ((!HBHE) || ignoreCut(index_TIGHT_fHPD_) || rawPt < 25 || jetID.fHPD < 0.95)
464 
465  // tight emf cut
466  if ((!HBHE) || ignoreCut(index_TIGHT_EMF_) || HB || rawPt < 55 || emf < 1)
468 
469  // EF - these cuts are only used in "tight", but there's no need for this test here.
470 
471  if ((!EF) || ignoreCut(index_EF_N90Hits_) || jetID.n90Hits > 1 + 1.5 * TMath::Max(0., lnpt - 1.5))
473 
474  if ((!EF) || ignoreCut(index_EF_EMF_) ||
475  emf > TMath::Max(-0.9, -0.1 - 0.05 * TMath::Power(TMath::Max(0., 5 - lnpt), 2.)))
477 
478  // both EF and HF
479 
480  if ((!(EF || HF)) || ignoreCut(index_TIGHT_fls_) ||
481  (EF && jetID.fLS < TMath::Min(0.8, 0.1 + 0.016 * TMath::Power(TMath::Max(0., 6 - lnpt), 2.5))) ||
482  (HFa && jetID.fLS < TMath::Min(0.6, 0.05 + 0.045 * TMath::Power(TMath::Max(0., 7.5 - lnE), 2.2))) ||
483  (HFb && jetID.fLS < TMath::Min(0.1, 0.05 + 0.07 * TMath::Power(TMath::Max(0., 7.8 - lnE), 2.))))
485 
486  if ((!(EF || HF)) || ignoreCut(index_widths_) ||
487  (1E-10 < etaWidth && etaWidth < 0.12 && 1E-10 < phiWidth && phiWidth < 0.12))
489 
490  // HF cuts
491 
492  if ((!HF) || ignoreCut(index_LOOSE_nHit_) || (HFa && nHit > 1 + 2.4 * (lnpt - 1.)) ||
493  (HFb && nHit > 1 + 3. * (lnpt - 1.)))
495 
496  if ((!HF) || ignoreCut(index_LOOSE_als_) ||
497  (emf < 0.6 + 0.05 * TMath::Power(TMath::Max(0., 9 - lnE), 1.5) &&
498  emf > -0.2 - 0.041 * TMath::Power(TMath::Max(0., 7.5 - lnE), 2.2)))
500 
501  if ((!HF) || ignoreCut(index_LOOSE_fls_) ||
502  (HFa && jetID.fLS < TMath::Min(0.9, 0.1 + 0.05 * TMath::Power(TMath::Max(0., 7.5 - lnE), 2.2))) ||
503  (HFb && jetID.fLS < TMath::Min(0.6, 0.1 + 0.065 * TMath::Power(TMath::Max(0., 7.5 - lnE), 2.2))))
505 
506  if ((!HF) || ignoreCut(index_LOOSE_foot_) || jetID.fHFOOT < 0.9)
508 
509  if ((!HF) || ignoreCut(index_TIGHT_nHit_) || (HFa && nHit > 1 + 2.7 * (lnpt - 0.8)) ||
510  (HFb && nHit > 1 + 3.5 * (lnpt - 0.8)))
512 
513  if ((!HF) || ignoreCut(index_TIGHT_als_) ||
514  (emf < 0.5 + 0.057 * TMath::Power(TMath::Max(0., 9 - lnE), 1.5) &&
515  emf > TMath::Max(-0.6, -0.1 - 0.026 * TMath::Power(TMath::Max(0., 8 - lnE), 2.2))))
517 
518  if ((!HF) || ignoreCut(index_TIGHT_foot_) || jetID.fLS < 0.5)
520 
521  setIgnored(ret);
522 
523  return (bool)ret;
524  }
bool ignoreCut(std::string const &s) const
ignore the cut at index "s"
Definition: Selector.h:127
ret
prodAgent to be discontinued
void setIgnored(pat::strbitset &ret)
set ignored bits
Definition: Selector.h:181
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
Definition: Selector.h:142

◆ initialize()

void JetIDSelectionFunctor::initialize ( Version_t  version,
Quality_t  quality 
)
inline

Definition at line 70 of file JetIDSelectionFunctor.h.

References Selector< pat::Jet >::bits_, CRAFT08, DQM09, Selector< pat::Jet >::getBitTemplate(), index_EF_EMF_, index_EF_N90Hits_, index_LOOSE_als_, index_LOOSE_AOD_EMF_, index_LOOSE_AOD_fHPD_, index_LOOSE_AOD_N90Hits_, index_LOOSE_EMF_, index_LOOSE_fHPD_, index_LOOSE_fls_, index_LOOSE_foot_, index_LOOSE_N90Hits_, index_LOOSE_nHit_, index_MINIMAL_EMF_, index_TIGHT_als_, index_TIGHT_EMF_, index_TIGHT_fHPD_, index_TIGHT_fls_, index_TIGHT_foot_, index_TIGHT_nHit_, index_widths_, LOOSE, LOOSE_AOD, Selector< pat::Jet >::push_back(), quality, quality_, Selector< pat::Jet >::retInternal_, TIGHT, BeamSplash_cfg::version, and version_.

Referenced by JetIDSelectionFunctor().

70  {
71  version_ = version;
72  quality_ = quality;
73 
74  push_back("MINIMAL_EMF");
75 
76  push_back("LOOSE_AOD_fHPD");
77  push_back("LOOSE_AOD_N90Hits");
78  push_back("LOOSE_AOD_EMF");
79 
80  push_back("LOOSE_fHPD");
81  push_back("LOOSE_N90Hits");
82  push_back("LOOSE_EMF");
83 
84  push_back("TIGHT_fHPD");
85  push_back("TIGHT_EMF");
86 
87  push_back("LOOSE_nHit");
88  push_back("LOOSE_als");
89  push_back("LOOSE_fls");
90  push_back("LOOSE_foot");
91 
92  push_back("TIGHT_nHit");
93  push_back("TIGHT_als");
94  push_back("TIGHT_fls");
95  push_back("TIGHT_foot");
96  push_back("widths");
97  push_back("EF_N90Hits");
98  push_back("EF_EMF");
99 
100  bool use_09_fwd_id = version_ != CRAFT08; // CRAFT08 predates the 09 forward ID cuts
101  bool use_dqm_09 = version_ == DQM09 && quality_ != LOOSE_AOD;
102 
103  // all appropriate for version and format (AOD complications) are on by default
104  set("MINIMAL_EMF");
105  set("LOOSE_AOD_fHPD");
106  set("LOOSE_AOD_N90Hits");
107  set("LOOSE_AOD_EMF", !use_09_fwd_id); // except in CRAFT08, this devolves into MINIMAL_EMF
108  set("LOOSE_fHPD");
109  set("LOOSE_N90Hits");
110  set("LOOSE_EMF", !use_09_fwd_id); // except in CRAFT08, this devolves into MINIMAL_EMF
111  set("TIGHT_fHPD");
112  set("TIGHT_EMF");
113 
114  set("LOOSE_nHit", use_09_fwd_id);
115  set("LOOSE_als", use_09_fwd_id);
116  set("TIGHT_nHit", use_09_fwd_id);
117  set("TIGHT_als", use_09_fwd_id);
118  set("widths", use_09_fwd_id);
119  set("EF_N90Hits", use_09_fwd_id);
120  set("EF_EMF", use_09_fwd_id);
121 
122  set("LOOSE_fls", use_dqm_09);
123  set("LOOSE_foot", use_dqm_09);
124  set("TIGHT_fls", use_dqm_09);
125  set("TIGHT_foot", use_dqm_09);
126 
127  index_MINIMAL_EMF_ = index_type(&bits_, "MINIMAL_EMF");
128 
129  index_LOOSE_AOD_fHPD_ = index_type(&bits_, "LOOSE_AOD_fHPD");
130  index_LOOSE_AOD_N90Hits_ = index_type(&bits_, "LOOSE_AOD_N90Hits");
131  index_LOOSE_AOD_EMF_ = index_type(&bits_, "LOOSE_AOD_EMF");
132 
133  index_LOOSE_fHPD_ = index_type(&bits_, "LOOSE_fHPD");
134  index_LOOSE_N90Hits_ = index_type(&bits_, "LOOSE_N90Hits");
135  index_LOOSE_EMF_ = index_type(&bits_, "LOOSE_EMF");
136 
137  index_TIGHT_fHPD_ = index_type(&bits_, "TIGHT_fHPD");
138  index_TIGHT_EMF_ = index_type(&bits_, "TIGHT_EMF");
139 
140  index_LOOSE_nHit_ = index_type(&bits_, "LOOSE_nHit");
141  index_LOOSE_als_ = index_type(&bits_, "LOOSE_als");
142  index_LOOSE_fls_ = index_type(&bits_, "LOOSE_fls");
143  index_LOOSE_foot_ = index_type(&bits_, "LOOSE_foot");
144 
145  index_TIGHT_nHit_ = index_type(&bits_, "TIGHT_nHit");
146  index_TIGHT_als_ = index_type(&bits_, "TIGHT_als");
147  index_TIGHT_fls_ = index_type(&bits_, "TIGHT_fls");
148  index_TIGHT_foot_ = index_type(&bits_, "TIGHT_foot");
149  index_widths_ = index_type(&bits_, "widths");
150  index_EF_N90Hits_ = index_type(&bits_, "EF_N90Hits");
151  index_EF_EMF_ = index_type(&bits_, "EF_EMF");
152 
153  // now set the return values for the ignored parts
154  bool use_loose_aod = false;
155  bool use_loose = false;
156  bool use_tight = false;
157  bool use_tight_09_fwd_id = false;
158  bool use_loose_09_fwd_id = false;
159  // if ( quality_ == MINIMAL ) nothing to do...
160  if (quality_ == LOOSE) {
161  use_loose = true;
162  if (use_09_fwd_id)
163  use_loose_09_fwd_id = true;
164  }
165  if (quality_ == LOOSE_AOD) {
166  use_loose_aod = true;
167  if (use_09_fwd_id)
168  use_loose_09_fwd_id = true;
169  }
170  if (quality_ == TIGHT) {
171  use_tight = true;
172  if (use_09_fwd_id)
173  use_tight_09_fwd_id = true;
174  }
175 
176  if (!use_loose_aod) {
177  set("LOOSE_AOD_fHPD", false);
178  set("LOOSE_AOD_N90Hits", false);
179  set("LOOSE_AOD_EMF", false);
180  }
181 
182  if (!(use_loose || use_tight)) { // the CRAFT08 cuts are cumulative
183  set("LOOSE_N90Hits", false);
184  set("LOOSE_fHPD", false);
185  set("LOOSE_EMF", false);
186  }
187 
188  if (!use_tight) {
189  set("TIGHT_fHPD", false);
190  set("TIGHT_EMF", false);
191  }
192 
193  if (!use_loose_09_fwd_id) { // the FWD09 cuts are not
194  set("LOOSE_nHit", false);
195  set("LOOSE_als", false);
196  if (use_dqm_09) {
197  set("LOOSE_fls", false);
198  set("LOOSE_foot", false);
199  }
200  } // not using loose 09 fwd ID
201 
202  if (!use_tight_09_fwd_id) {
203  set("TIGHT_nHit", false);
204  set("TIGHT_als", false);
205  set("widths", false);
206  set("EF_N90Hits", false);
207  set("EF_EMF", false);
208  if (use_dqm_09) {
209  set("TIGHT_fls", false);
210  set("TIGHT_foot", false);
211  }
212  } // not using tight 09 fwd ID
213 
215  }
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
string quality
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:241
virtual void push_back(std::string const &s)
This is the registration of an individual cut string.
Definition: Selector.h:42
pat::strbitset getBitTemplate() const
Get an empty bitset with the proper names.
Definition: Selector.h:168

◆ operator()() [1/5]

bool JetIDSelectionFunctor::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 230 of file JetIDSelectionFunctor.h.

References count_hits(), CRAFT08, craft08Cuts(), DQM09, fwd09Cuts(), metsig::jet, PURE09, runTheMatrix::ret, and version_.

Referenced by operator()().

230  {
231  if (!jet.isCaloJet() && !jet.isJPTJet()) {
232  edm::LogWarning("NYI") << "Criteria for pat::Jet-s other than CaloJets and JPTJets are not yet implemented";
233  return false;
234  }
235  if (version_ == CRAFT08)
236  return craft08Cuts(jet.p4(), jet.emEnergyFraction(), jet.jetID(), ret);
237  if (version_ == PURE09 || version_ == DQM09) {
238  unsigned int nHit = count_hits(jet.getCaloConstituents());
239  if (jet.currentJECLevel() == "Uncorrected") {
240  return fwd09Cuts(
241  jet.p4(), jet.emEnergyFraction(), jet.etaetaMoment(), jet.phiphiMoment(), nHit, jet.jetID(), ret);
242  } else {
243  return fwd09Cuts(jet.correctedP4("Uncorrected"),
244  jet.emEnergyFraction(),
245  jet.etaetaMoment(),
246  jet.phiphiMoment(),
247  nHit,
248  jet.jetID(),
249  ret);
250  }
251  }
252  edm::LogWarning("BadInput | NYI") << "Requested version (" << version_ << ") is unknown";
253  return false;
254  }
unsigned int count_hits(const std::vector< CaloTowerPtr > &towers)
ret
prodAgent to be discontinued
bool craft08Cuts(reco::Candidate::LorentzVector const &correctedP4, double emEnergyFraction, reco::JetID const &jetID, pat::strbitset &ret)
bool fwd09Cuts(reco::Candidate::LorentzVector const &rawP4, double emEnergyFraction, double etaWidth, double phiWidth, unsigned int nHit, reco::JetID const &jetID, pat::strbitset &ret)
Log< level::Warning, false > LogWarning

◆ operator()() [2/5]

bool JetIDSelectionFunctor::operator() ( reco::Candidate::LorentzVector const &  correctedP4,
double  emEnergyFraction,
reco::JetID const &  jetID,
pat::strbitset ret 
)
inline

Definition at line 263 of file JetIDSelectionFunctor.h.

References CRAFT08, craft08Cuts(), runTheMatrix::ret, and version_.

266  {
267  if (version_ == CRAFT08)
268  return craft08Cuts(correctedP4, emEnergyFraction, jetID, ret);
269  edm::LogWarning("BadInput | NYI") << "Requested version (" << version_
270  << ") is unknown or doesn't match the depreceated interface used";
271  return false;
272  }
ret
prodAgent to be discontinued
bool craft08Cuts(reco::Candidate::LorentzVector const &correctedP4, double emEnergyFraction, reco::JetID const &jetID, pat::strbitset &ret)
Log< level::Warning, false > LogWarning

◆ operator()() [3/5]

virtual bool JetIDSelectionFunctor::operator() ( reco::Candidate::LorentzVector const &  correctedP4,
double  emEnergyFraction,
reco::JetID const &  jetID 
)
inlinevirtual

accessor like previous, without the ret

Definition at line 274 of file JetIDSelectionFunctor.h.

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

276  {
277  retInternal_.set(false);
278  operator()(correctedP4, emEnergyFraction, jetID, retInternal_);
280  return (bool)retInternal_;
281  }
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

◆ operator()() [4/5]

bool JetIDSelectionFunctor::operator() ( reco::CaloJet const &  jet,
reco::JetID const &  jetID,
pat::strbitset ret 
)
inline

Definition at line 287 of file JetIDSelectionFunctor.h.

References count_hits(), CRAFT08, craft08Cuts(), DQM09, fwd09Cuts(), metsig::jet, PURE09, runTheMatrix::ret, and version_.

287  {
288  if (version_ == CRAFT08)
289  return craft08Cuts(jet.p4(), jet.emEnergyFraction(), jetID, ret);
290  if (version_ == PURE09 || version_ == DQM09) {
291  unsigned int nHit = count_hits(jet.getCaloConstituents());
292  return fwd09Cuts(jet.p4(), jet.emEnergyFraction(), jet.etaetaMoment(), jet.phiphiMoment(), nHit, jetID, ret);
293  }
294  edm::LogWarning("BadInput | NYI") << "Requested version (" << version_ << ") is unknown";
295  return false;
296  }
unsigned int count_hits(const std::vector< CaloTowerPtr > &towers)
ret
prodAgent to be discontinued
bool craft08Cuts(reco::Candidate::LorentzVector const &correctedP4, double emEnergyFraction, reco::JetID const &jetID, pat::strbitset &ret)
bool fwd09Cuts(reco::Candidate::LorentzVector const &rawP4, double emEnergyFraction, double etaWidth, double phiWidth, unsigned int nHit, reco::JetID const &jetID, pat::strbitset &ret)
Log< level::Warning, false > LogWarning

◆ operator()() [5/5]

virtual bool JetIDSelectionFunctor::operator() ( reco::CaloJet const &  jet,
reco::JetID const &  jetID 
)
inlinevirtual

accessor like previous, without the ret

Definition at line 299 of file JetIDSelectionFunctor.h.

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

299  {
300  retInternal_.set(false);
301  operator()(jet, jetID, retInternal_);
303  return (bool)retInternal_;
304  }
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

◆ index_EF_EMF_

index_type JetIDSelectionFunctor::index_EF_EMF_
private

Definition at line 554 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

◆ index_EF_N90Hits_

index_type JetIDSelectionFunctor::index_EF_N90Hits_
private

Definition at line 553 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

◆ index_LOOSE_als_

index_type JetIDSelectionFunctor::index_LOOSE_als_
private

Definition at line 544 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

◆ index_LOOSE_AOD_EMF_

index_type JetIDSelectionFunctor::index_LOOSE_AOD_EMF_
private

Definition at line 534 of file JetIDSelectionFunctor.h.

Referenced by craft08Cuts(), and initialize().

◆ index_LOOSE_AOD_fHPD_

index_type JetIDSelectionFunctor::index_LOOSE_AOD_fHPD_
private

Definition at line 532 of file JetIDSelectionFunctor.h.

Referenced by craft08Cuts(), fwd09Cuts(), and initialize().

◆ index_LOOSE_AOD_N90Hits_

index_type JetIDSelectionFunctor::index_LOOSE_AOD_N90Hits_
private

Definition at line 533 of file JetIDSelectionFunctor.h.

Referenced by craft08Cuts(), fwd09Cuts(), and initialize().

◆ index_LOOSE_EMF_

index_type JetIDSelectionFunctor::index_LOOSE_EMF_
private

Definition at line 538 of file JetIDSelectionFunctor.h.

Referenced by craft08Cuts(), and initialize().

◆ index_LOOSE_fHPD_

index_type JetIDSelectionFunctor::index_LOOSE_fHPD_
private

Definition at line 536 of file JetIDSelectionFunctor.h.

Referenced by craft08Cuts(), fwd09Cuts(), and initialize().

◆ index_LOOSE_fls_

index_type JetIDSelectionFunctor::index_LOOSE_fls_
private

Definition at line 545 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

◆ index_LOOSE_foot_

index_type JetIDSelectionFunctor::index_LOOSE_foot_
private

Definition at line 546 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

◆ index_LOOSE_N90Hits_

index_type JetIDSelectionFunctor::index_LOOSE_N90Hits_
private

Definition at line 537 of file JetIDSelectionFunctor.h.

Referenced by craft08Cuts(), fwd09Cuts(), and initialize().

◆ index_LOOSE_nHit_

index_type JetIDSelectionFunctor::index_LOOSE_nHit_
private

Definition at line 543 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

◆ index_MINIMAL_EMF_

index_type JetIDSelectionFunctor::index_MINIMAL_EMF_
private

Definition at line 530 of file JetIDSelectionFunctor.h.

Referenced by craft08Cuts(), fwd09Cuts(), and initialize().

◆ index_TIGHT_als_

index_type JetIDSelectionFunctor::index_TIGHT_als_
private

Definition at line 549 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

◆ index_TIGHT_EMF_

index_type JetIDSelectionFunctor::index_TIGHT_EMF_
private

Definition at line 541 of file JetIDSelectionFunctor.h.

Referenced by craft08Cuts(), fwd09Cuts(), and initialize().

◆ index_TIGHT_fHPD_

index_type JetIDSelectionFunctor::index_TIGHT_fHPD_
private

Definition at line 540 of file JetIDSelectionFunctor.h.

Referenced by craft08Cuts(), fwd09Cuts(), and initialize().

◆ index_TIGHT_fls_

index_type JetIDSelectionFunctor::index_TIGHT_fls_
private

Definition at line 550 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

◆ index_TIGHT_foot_

index_type JetIDSelectionFunctor::index_TIGHT_foot_
private

Definition at line 551 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

◆ index_TIGHT_nHit_

index_type JetIDSelectionFunctor::index_TIGHT_nHit_
private

Definition at line 548 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

◆ index_widths_

index_type JetIDSelectionFunctor::index_widths_
private

Definition at line 552 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

◆ quality_

Quality_t JetIDSelectionFunctor::quality_
private

Definition at line 528 of file JetIDSelectionFunctor.h.

Referenced by craft08Cuts(), and initialize().

◆ version_

Version_t JetIDSelectionFunctor::version_
private

Definition at line 527 of file JetIDSelectionFunctor.h.

Referenced by initialize(), and operator()().