CMS 3D CMS Logo

List of all members | Public Types | 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, 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
 
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, pat::strbitset &ret)=0
 This provides the interface for base classes to select objects. More...
 
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 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 25 of file PFJetIDSelectionFunctor.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

PFJetIDSelectionFunctor::PFJetIDSelectionFunctor ( )
inline

Definition at line 30 of file PFJetIDSelectionFunctor.h.

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

Definition at line 33 of file PFJetIDSelectionFunctor.h.

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

Definition at line 37 of file PFJetIDSelectionFunctor.h.

References edm::ParameterSet::exists(), FIRSTDATA, edm::ParameterSet::getParameter(), initCuts(), initIndex(), LOOSE, quality_, RUNIISTARTUP, Selector< pat::Jet >::setIgnoredCuts(), AlCaHLTBitMon_QueryRunRegistry::string, SUMMER18, SUMMER18PUPPI, TIGHT, TIGHTLEPVETO, version_, WINTER16, WINTER17, and WINTER17PUPPI.

37  {
38  std::string versionStr = params.getParameter<std::string>("version");
39  std::string qualityStr = params.getParameter<std::string>("quality");
40 
41  if (versionStr == "FIRSTDATA")
43  else if (versionStr == "RUNIISTARTUP")
45  // WINTER16 implements most recent (as of Feb 2017) JetID criteria
46  // See: https://twiki.cern.ch/twiki/bin/view/CMS/JetID13TeVRun2016
47  else if (versionStr == "WINTER16")
49  else if (versionStr == "WINTER17")
51  else if (versionStr == "WINTER17PUPPI")
53  else if (versionStr == "SUMMER18")
55  else if (versionStr == "SUMMER18PUPPI")
57  else
58  version_ = WINTER17; //set WINTER17 as default
59 
60  if (qualityStr == "LOOSE")
61  quality_ = LOOSE;
62  else if (qualityStr == "TIGHT")
63  quality_ = TIGHT;
64  else if (qualityStr == "TIGHTLEPVETO")
66  else
67  quality_ = TIGHT;
68 
69  initCuts();
70 
71  // Now check the configuration to see if the user changed anything
72  if (params.exists("CHF"))
73  set("CHF", params.getParameter<double>("CHF"));
74  if (params.exists("NHF"))
75  set("NHF", params.getParameter<double>("NHF"));
77  quality_ != TIGHT) {
78  if (params.exists("CEF"))
79  set("CEF", params.getParameter<double>("CEF"));
80  }
81  if (params.exists("NEF"))
82  set("NEF", params.getParameter<double>("NEF"));
83  if (params.exists("NCH"))
84  set("NCH", params.getParameter<int>("NCH"));
85  if (params.exists("nConstituents"))
86  set("nConstituents", params.getParameter<int>("nConstituents"));
87  if (version_ == RUNIISTARTUP) {
88  if (params.exists("NEF_FW"))
89  set("NEF_FW", params.getParameter<double>("NEF_FW"));
90  if (params.exists("nNeutrals_FW"))
91  set("nNeutrals_FW", params.getParameter<int>("nNeutrals_FW"));
92  }
93  if (version_ == WINTER16) {
94  if (params.exists("NHF_EC"))
95  set("NHF_EC", params.getParameter<double>("NHF_EC"));
96  if (params.exists("NEF_EC"))
97  set("NEF_EC", params.getParameter<double>("NEF_EC"));
98  if (params.exists("nNeutrals_EC"))
99  set("nNeutrals_EC", params.getParameter<int>("nNeutrals_EC"));
100  if (params.exists("NEF_FW"))
101  set("NEF_FW", params.getParameter<double>("NEF_FW"));
102  if (params.exists("nNeutrals_FW"))
103  set("nNeutrals_FW", params.getParameter<int>("nNeutrals_FW"));
104  if (quality_ == TIGHTLEPVETO) {
105  if (params.exists("MUF"))
106  set("MUF", params.getParameter<double>("MUF"));
107  }
108  }
109  if (version_ == WINTER17) {
110  if (params.exists("NEF_EC_L"))
111  set("NEF_EC_L", params.getParameter<double>("NEF_EC_L"));
112  if (params.exists("NEF_EC_U"))
113  set("NEF_EC_U", params.getParameter<double>("NEF_EC_U"));
114  if (params.exists("nNeutrals_EC"))
115  set("nNeutrals_EC", params.getParameter<int>("nNeutrals_EC"));
116  if (params.exists("NHF_FW"))
117  set("NHF_FW", params.getParameter<double>("NHF_FW"));
118  if (params.exists("NEF_FW"))
119  set("NEF_FW", params.getParameter<double>("NEF_FW"));
120  if (params.exists("nNeutrals_FW"))
121  set("nNeutrals_FW", params.getParameter<int>("nNeutrals_FW"));
122  if (quality_ == TIGHTLEPVETO) {
123  if (params.exists("MUF"))
124  set("MUF", params.getParameter<double>("MUF"));
125  }
126  }
127  if (version_ == WINTER17PUPPI) {
128  if (params.exists("NHF_EC"))
129  set("NHF_EC", params.getParameter<double>("NHF_EC"));
130  if (params.exists("NHF_FW"))
131  set("NHF_FW", params.getParameter<double>("NHF_FW"));
132  if (params.exists("NEF_FW"))
133  set("NEF_FW", params.getParameter<double>("NEF_FW"));
134  if (params.exists("nNeutrals_FW_L"))
135  set("nNeutrals_FW_L", params.getParameter<int>("nNeutrals_FW_L"));
136  if (params.exists("nNeutrals_FW_U"))
137  set("nNeutrals_FW_U", params.getParameter<int>("nNeutrals_FW_U"));
138  if (quality_ == TIGHTLEPVETO) {
139  if (params.exists("MUF"))
140  set("MUF", params.getParameter<double>("MUF"));
141  }
142  }
143  if (version_ == SUMMER18) {
144  if (params.exists("NHF_TR"))
145  set("NHF_TR", params.getParameter<double>("NHF_TR"));
146  if (params.exists("NEF_TR"))
147  set("NEF_TR", params.getParameter<double>("NEF_TR"));
148  if (params.exists("NCH_TR"))
149  set("NCH_TR", params.getParameter<int>("NCH_TR"));
150  if (params.exists("NEF_EC_L"))
151  set("NEF_EC_L", params.getParameter<double>("NEF_EC_L"));
152  if (params.exists("NEF_EC_U"))
153  set("NEF_EC_U", params.getParameter<double>("NEF_EC_U"));
154  if (params.exists("nNeutrals_EC"))
155  set("nNeutrals_EC", params.getParameter<int>("nNeutrals_EC"));
156  if (params.exists("NHF_FW"))
157  set("NHF_FW", params.getParameter<double>("NHF_FW"));
158  if (params.exists("NEF_FW"))
159  set("NEF_FW", params.getParameter<double>("NEF_FW"));
160  if (params.exists("nNeutrals_FW"))
161  set("nNeutrals_FW", params.getParameter<int>("nNeutrals_FW"));
162  if (quality_ == TIGHTLEPVETO) {
163  if (params.exists("MUF"))
164  set("MUF", params.getParameter<double>("MUF"));
165  if (params.exists("MUF_TR"))
166  set("MUF_TR", params.getParameter<double>("MUF_TR"));
167  if (params.exists("CEF_TR"))
168  set("CEF_TR", params.getParameter<double>("CEF_TR"));
169  }
170  }
171  if (version_ == SUMMER18PUPPI) {
172  if (params.exists("NHF_TR"))
173  set("NHF_TR", params.getParameter<double>("NHF_TR"));
174  if (params.exists("NEF_TR"))
175  set("NEF_TR", params.getParameter<double>("NEF_TR"));
176  if (params.exists("NHF_EC"))
177  set("NHF_EC", params.getParameter<double>("NHF_EC"));
178  if (params.exists("NHF_FW"))
179  set("NHF_FW", params.getParameter<double>("NHF_FW"));
180  if (params.exists("NEF_FW"))
181  set("NEF_FW", params.getParameter<double>("NEF_FW"));
182  if (params.exists("nNeutrals_FW_L"))
183  set("nNeutrals_FW_L", params.getParameter<int>("nNeutrals_FW_L"));
184  if (params.exists("nNeutrals_FW_U"))
185  set("nNeutrals_FW_U", params.getParameter<int>("nNeutrals_FW_U"));
186  if (quality_ == TIGHTLEPVETO) {
187  if (params.exists("MUF"))
188  set("MUF", params.getParameter<double>("MUF"));
189  if (params.exists("MUF_TR"))
190  set("MUF_TR", params.getParameter<double>("MUF_TR"));
191  if (params.exists("CEF_TR"))
192  set("CEF_TR", params.getParameter<double>("CEF_TR"));
193  }
194  }
195 
196  if (params.exists("cutsToIgnore"))
197  setIgnoredCuts(params.getParameter<std::vector<std::string> >("cutsToIgnore"));
198 
199  initIndex();
200  }
void setIgnoredCuts(std::vector< std::string > const &bitsToIgnore)
set the bits to ignore from a vector
Definition: Selector.h:165
PFJetIDSelectionFunctor::PFJetIDSelectionFunctor ( Version_t  version,
Quality_t  quality 
)
inline

Member Function Documentation

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

Definition at line 246 of file PFJetIDSelectionFunctor.h.

References funct::abs(), 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(), reco::LeafCandidate::eta(), FIRSTDATA, pat::PATObject< ObjectType >::hasUserFloat(), 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(), reco::CompositePtrCandidate::numberOfDaughters(), pat::Jet::numberOfDaughters(), Selector< pat::Jet >::passCut(), reco::PFJet::photonEnergy(), quality_, RUNIISTARTUP, pat::strbitset::set(), Selector< pat::Jet >::setIgnored(), SUMMER18, SUMMER18PUPPI, TIGHT, TIGHTLEPVETO, pat::PATObject< ObjectType >::userFloat(), WINTER16, WINTER17, and WINTER17PUPPI.

Referenced by operator()().

246  {
247  ret.set(false);
248 
249  // cache some variables
250  double chf = 0.0;
251  double nhf = 0.0;
252  double cef = 0.0;
253  double nef = 0.0;
254  double muf = 0.0;
255 
256  int nch = 0;
257  int nconstituents = 0;
258  int nneutrals = 0;
259 
260  // Have to do this because pat::Jet inherits from reco::Jet but not reco::PFJet
261  reco::PFJet const *pfJet = dynamic_cast<reco::PFJet const *>(&jet);
262  pat::Jet const *patJet = dynamic_cast<pat::Jet const *>(&jet);
263  reco::BasicJet const *basicJet = dynamic_cast<reco::BasicJet const *>(&jet);
264 
265  if (patJet != nullptr) {
266  if (patJet->isPFJet()) {
267  chf = patJet->chargedHadronEnergyFraction();
268  nhf = patJet->neutralHadronEnergyFraction();
269  cef = patJet->chargedEmEnergyFraction();
270  nef = patJet->neutralEmEnergyFraction();
271  nch = patJet->chargedMultiplicity();
272  muf = patJet->muonEnergyFraction();
273  nconstituents = patJet->numberOfDaughters();
274  nneutrals = patJet->neutralMultiplicity();
275  // Handle the special case of PUPPI jets with weighted multiplicities
276  if (patJet->hasUserFloat("patPuppiJetSpecificProducer:puppiMultiplicity"))
277  nconstituents = patJet->userFloat("patPuppiJetSpecificProducer:puppiMultiplicity");
278  if (patJet->hasUserFloat("patPuppiJetSpecificProducer:neutralPuppiMultiplicity"))
279  nneutrals = patJet->userFloat("patPuppiJetSpecificProducer:neutralPuppiMultiplicity");
280  }
281  // Handle the special case where this is a composed jet for
282  // subjet analyses
283  else if (patJet->isBasicJet()) {
284  double e_chf = 0.0;
285  double e_nhf = 0.0;
286  double e_cef = 0.0;
287  double e_nef = 0.0;
288  double e_muf = 0.0;
289  nch = 0;
290  nconstituents = 0;
291  nneutrals = 0;
292 
293  for (reco::Jet::const_iterator ibegin = patJet->begin(), iend = patJet->end(), isub = ibegin; isub != iend;
294  ++isub) {
295  reco::PFJet const *pfsub = dynamic_cast<reco::PFJet const *>(&*isub);
296  pat::Jet const *patsub = dynamic_cast<pat::Jet const *>(&*isub);
297  if (patsub) {
298  e_chf += patsub->chargedHadronEnergy();
299  e_nhf += patsub->neutralHadronEnergy();
300  e_cef += patsub->chargedEmEnergy();
301  e_nef += patsub->neutralEmEnergy();
302  e_muf += patsub->muonEnergy();
303  nch += patsub->chargedMultiplicity();
304  nconstituents += patsub->numberOfDaughters();
305  nneutrals += patsub->neutralMultiplicity();
306  } else if (pfsub) {
307  e_chf += pfsub->chargedHadronEnergy();
308  e_nhf += pfsub->neutralHadronEnergy();
309  e_cef += pfsub->chargedEmEnergy();
310  e_nef += pfsub->neutralEmEnergy();
311  e_muf += pfsub->muonEnergy();
312  nch += pfsub->chargedMultiplicity();
313  nconstituents += pfsub->numberOfDaughters();
314  nneutrals += pfsub->neutralMultiplicity();
315  } else
316  assert(0);
317  }
318  double e = patJet->energy();
319  if (e > 0.000001) {
320  chf = e_chf / e;
321  nhf = e_nhf / e;
322  cef = e_cef / e;
323  nef = e_nef / e;
324  muf = e_muf / e;
325  } else {
326  chf = nhf = cef = nef = muf = 0.0;
327  }
328  }
329  } // end if pat jet
330  else if (pfJet != nullptr) {
331  // CV: need to compute energy fractions in a way that works for corrected as well as for uncorrected PFJets
332  double jetEnergyUncorrected = pfJet->chargedHadronEnergy() + pfJet->neutralHadronEnergy() +
333  pfJet->photonEnergy() + pfJet->electronEnergy() + pfJet->muonEnergy() +
334  pfJet->HFEMEnergy();
335  if (jetEnergyUncorrected > 0.) {
336  chf = pfJet->chargedHadronEnergy() / jetEnergyUncorrected;
337  nhf = pfJet->neutralHadronEnergy() / jetEnergyUncorrected;
338  cef = pfJet->chargedEmEnergy() / jetEnergyUncorrected;
339  nef = pfJet->neutralEmEnergy() / jetEnergyUncorrected;
340  muf = pfJet->muonEnergy() / jetEnergyUncorrected;
341  }
342  nch = pfJet->chargedMultiplicity();
343  nconstituents = pfJet->numberOfDaughters();
344  nneutrals = pfJet->neutralMultiplicity();
345  } // end if PF jet
346  // Handle the special case where this is a composed jet for
347  // subjet analyses
348  else if (basicJet != nullptr) {
349  double e_chf = 0.0;
350  double e_nhf = 0.0;
351  double e_cef = 0.0;
352  double e_nef = 0.0;
353  double e_muf = 0.0;
354  nch = 0;
355  nconstituents = 0;
356  for (reco::Jet::const_iterator ibegin = basicJet->begin(), iend = patJet->end(), isub = ibegin; isub != iend;
357  ++isub) {
358  reco::PFJet const *pfsub = dynamic_cast<reco::PFJet const *>(&*isub);
359  e_chf += pfsub->chargedHadronEnergy();
360  e_nhf += pfsub->neutralHadronEnergy();
361  e_cef += pfsub->chargedEmEnergy();
362  e_nef += pfsub->neutralEmEnergy();
363  e_muf += pfsub->muonEnergy();
364  nch += pfsub->chargedMultiplicity();
365  nconstituents += pfsub->numberOfDaughters();
366  nneutrals += pfsub->neutralMultiplicity();
367  }
368  double e = basicJet->energy();
369  if (e > 0.000001) {
370  chf = e_chf / e;
371  nhf = e_nhf / e;
372  cef = e_cef / e;
373  nef = e_nef / e;
374  muf = e_muf / e;
375  }
376  } // end if basic jet
377 
378  float etaB = 2.4;
379  // Cuts for |eta| < 2.6 for Summer18
381  etaB = 2.6;
383  quality_ != TIGHT) {
384  if (ignoreCut(indexCEF_) || (cef < cut(indexCEF_, double()) || std::abs(jet.eta()) > etaB))
385  passCut(ret, indexCEF_);
386  }
387  if (ignoreCut(indexCHF_) || (chf > cut(indexCHF_, double()) || std::abs(jet.eta()) > etaB))
388  passCut(ret, indexCHF_);
389  if (ignoreCut(indexNCH_) || (nch > cut(indexNCH_, int()) || std::abs(jet.eta()) > etaB))
390  passCut(ret, indexNCH_);
391  if (version_ == FIRSTDATA) { // Cuts for all eta for FIRSTDATA
392  if (ignoreCut(indexNConstituents_) || (nconstituents > cut(indexNConstituents_, int())))
394  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double())))
395  passCut(ret, indexNEF_);
396  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double())))
397  passCut(ret, indexNHF_);
398  } else if (version_ == RUNIISTARTUP) {
399  // Cuts for |eta| <= 3.0 for RUNIISTARTUP scenario
401  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 3.0))
403  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 3.0))
404  passCut(ret, indexNEF_);
405  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 3.0))
406  passCut(ret, indexNHF_);
407  // Cuts for |eta| > 3.0 for RUNIISTARTUP scenario
408  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
409  passCut(ret, indexNEF_FW_);
410  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
412  } else if (version_ == WINTER16) {
413  // Cuts for |eta| <= 2.7 for WINTER16 scenario
415  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.7))
417  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.7))
418  passCut(ret, indexNEF_);
419  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.7))
420  passCut(ret, indexNHF_);
421  if (quality_ == TIGHTLEPVETO) {
422  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.7))
423  passCut(ret, indexMUF_);
424  }
425 
426  // Cuts for 2.7 < |eta| <= 3.0 for WINTER16 scenario
427  if (ignoreCut(indexNHF_EC_) ||
428  (nhf < cut(indexNHF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
429  passCut(ret, indexNHF_EC_);
430  if (ignoreCut(indexNEF_EC_) ||
431  (nef > cut(indexNEF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
432  passCut(ret, indexNEF_EC_);
434  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
436 
437  // Cuts for |eta| > 3.0 for WINTER16 scenario
438  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
439  passCut(ret, indexNEF_FW_);
440  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
442  } else if (version_ == WINTER17) {
443  // Cuts for |eta| <= 2.7 for WINTER17 scenario
445  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.7))
447  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.7))
448  passCut(ret, indexNEF_);
449  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.7))
450  passCut(ret, indexNHF_);
451  if (quality_ == TIGHTLEPVETO) {
452  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.7))
453  passCut(ret, indexMUF_);
454  }
455 
456  // Cuts for 2.7 < |eta| <= 3.0 for WINTER17 scenario
457 
458  if (ignoreCut(indexNEF_EC_L_) ||
459  (nef > cut(indexNEF_EC_L_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
460  passCut(ret, indexNEF_EC_L_);
461  if (ignoreCut(indexNEF_EC_U_) ||
462  (nef < cut(indexNEF_EC_U_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
463  passCut(ret, indexNEF_EC_U_);
465  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
467 
468  // Cuts for |eta| > 3.0 for WINTER17 scenario
469  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
470  passCut(ret, indexNHF_FW_);
471  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
472  passCut(ret, indexNEF_FW_);
473  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
475 
476  } else if (version_ == WINTER17PUPPI) {
477  // Cuts for |eta| <= 2.7 for WINTER17 scenario
479  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.7))
481  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.7))
482  passCut(ret, indexNEF_);
483  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.7))
484  passCut(ret, indexNHF_);
485  if (quality_ == TIGHTLEPVETO) {
486  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.7))
487  passCut(ret, indexMUF_);
488  }
489 
490  // Cuts for 2.7 < |eta| <= 3.0 for WINTER17 scenario
491 
492  if (ignoreCut(indexNHF_EC_) ||
493  (nhf < cut(indexNHF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
494  passCut(ret, indexNHF_EC_);
495 
496  // Cuts for |eta| > 3.0 for WINTER17 scenario
497  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
498  passCut(ret, indexNHF_FW_);
499  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
500  passCut(ret, indexNEF_FW_);
502  (nneutrals > cut(indexNNeutrals_FW_L_, int()) || std::abs(jet.eta()) <= 3.0))
505  (nneutrals < cut(indexNNeutrals_FW_U_, int()) || std::abs(jet.eta()) <= 3.0))
507  } else if (version_ == SUMMER18) {
508  // Cuts for |eta| <= 2.6 for SUMMER18 scenario
510  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.6))
512  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.6))
513  passCut(ret, indexNEF_);
514  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.6))
515  passCut(ret, indexNHF_);
516  if (quality_ == TIGHTLEPVETO) {
517  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.6))
518  passCut(ret, indexMUF_);
519  }
520 
521  // Cuts for 2.6 <= |eta| <= 2.7 for SUMMER18 scenario
522  if (ignoreCut(indexNHF_TR_) ||
523  (nhf < cut(indexNHF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
524  passCut(ret, indexNHF_TR_);
525  if (ignoreCut(indexNEF_TR_) ||
526  (nef < cut(indexNEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
527  passCut(ret, indexNEF_TR_);
528  if (ignoreCut(indexNCH_TR_) ||
529  (nch > cut(indexNCH_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
530  passCut(ret, indexNCH_TR_);
531  if (quality_ == TIGHTLEPVETO) {
532  if (ignoreCut(indexMUF_TR_) ||
533  (muf < cut(indexMUF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
534  passCut(ret, indexMUF_TR_);
535  if (ignoreCut(indexCEF_TR_) ||
536  (cef < cut(indexCEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
537  passCut(ret, indexCEF_TR_);
538  }
539 
540  // Cuts for 2.7 < |eta| <= 3.0 for SUMMER18 scenario
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))
543  passCut(ret, indexNEF_EC_L_);
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))
546  passCut(ret, indexNEF_EC_U_);
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 SUMMER18 scenario
552  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
553  passCut(ret, indexNHF_FW_);
554  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
555  passCut(ret, indexNEF_FW_);
556  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
558  }
559 
560  else if (version_ == SUMMER18PUPPI) {
561  // Cuts for |eta| <= 2.6 for SUMMER18PUPPI scenario
563  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.6))
565  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.6))
566  passCut(ret, indexNEF_);
567  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.6))
568  passCut(ret, indexNHF_);
569  if (quality_ == TIGHTLEPVETO) {
570  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.6))
571  passCut(ret, indexMUF_);
572  }
573 
574  // Cuts for 2.6 <= |eta| <= 2.7 for SUMMER18PUPPI scenario
575  if (ignoreCut(indexNHF_TR_) ||
576  (nhf < cut(indexNHF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
577  passCut(ret, indexNHF_TR_);
578  if (ignoreCut(indexNEF_TR_) ||
579  (nef < cut(indexNEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
580  passCut(ret, indexNEF_TR_);
581  if (quality_ == TIGHTLEPVETO) {
582  if (ignoreCut(indexMUF_TR_) ||
583  (muf < cut(indexMUF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
584  passCut(ret, indexMUF_TR_);
585  if (ignoreCut(indexCEF_TR_) ||
586  (cef < cut(indexCEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
587  passCut(ret, indexCEF_TR_);
588  }
589 
590  // Cuts for 2.7 < |eta| <= 3.0 for SUMMER18PUPPI scenario
591  if (ignoreCut(indexNHF_EC_) ||
592  (nhf < cut(indexNHF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
593  passCut(ret, indexNHF_EC_);
594 
595  // Cuts for |eta| > 3.0 for SUMMER18PUPPI scenario
596  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
597  passCut(ret, indexNHF_FW_);
598  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
599  passCut(ret, indexNEF_FW_);
601  (nneutrals > cut(indexNNeutrals_FW_L_, int()) || std::abs(jet.eta()) <= 3.0))
604  (nneutrals < cut(indexNNeutrals_FW_U_, int()) || std::abs(jet.eta()) <= 3.0))
606  }
607 
608  //std::cout << "<PFJetIDSelectionFunctor::firstDataCuts>:" << std::endl;
609  //std::cout << " jet: Pt = " << jet.pt() << ", eta = " << jet.eta() << ", phi = " << jet.phi() << std::endl;
610  //ret.print(std::cout);
611  setIgnored(ret);
612  return (bool)ret;
613  }
float photonEnergy() const
photonEnergy
Definition: PFJet.h:106
float neutralHadronEnergyFraction() const
neutralHadronEnergyFraction (relative to uncorrected jet energy)
Definition: Jet.h:377
float muonEnergy() const
muonEnergy
Definition: Jet.h:393
float muonEnergy() const
muonEnergy
Definition: PFJet.h:114
float chargedHadronEnergy() const
chargedHadronEnergy
Definition: Jet.h:658
float chargedEmEnergy() const
chargedEmEnergy
Definition: PFJet.h:142
float neutralEmEnergy() const
neutralEmEnergy
Definition: Jet.h:679
float chargedHadronEnergyFraction() const
chargedHadronEnergyFraction (relative to uncorrected jet energy)
Definition: Jet.h:375
float neutralHadronEnergy() const
neutralHadronEnergy
Definition: Jet.h:665
float chargedEmEnergyFraction() const
chargedEmEnergyFraction (relative to uncorrected jet energy)
Definition: Jet.h:379
bool hasUserFloat(const std::string &key) const
Return true if there is a user-defined float with a given name.
Definition: PATObject.h:334
void setIgnored(pat::strbitset &ret)
set ignored bits
Definition: Selector.h:222
int neutralMultiplicity() const
neutralMultiplicity
Definition: Jet.h:425
Jets made from CaloTowers.
Definition: BasicJet.h:20
int chargedMultiplicity() const
chargedMultiplicity
Definition: PFJet.h:155
Jets made from PFObjects.
Definition: PFJet.h:21
float neutralEmEnergy() const
neutralEmEnergy
Definition: PFJet.h:150
float userFloat(const std::string &key) const
Definition: PATObject.h:791
float chargedEmEnergy() const
chargedEmEnergy
Definition: Jet.h:672
float electronEnergy() const
electronEnergy
Definition: PFJet.h:110
size_t numberOfDaughters() const override
number of daughters
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
Definition: Selector.h:174
float HFEMEnergy() const
HFEMEnergy.
Definition: PFJet.h:122
bool ignoreCut(std::string const &s) const
ignore the cut at index "s"
Definition: Selector.h:157
const_iterator end() const
last daughter const_iterator
Definition: Candidate.h:146
double energy() const final
energy
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool isPFJet() const
check to see if the jet is a reco::PFJet
Definition: Jet.h:258
int neutralMultiplicity() const
neutralMultiplicity
Definition: PFJet.h:157
strbitset & set(bool val=true)
set method of all bits
Definition: strbitset.h:144
Analysis-level calorimeter jet class.
Definition: Jet.h:80
size_t numberOfDaughters() const override
bool isBasicJet() const
check to see if the jet is no more than a reco::BasicJet
Definition: Jet.h:260
const_iterator begin() const
first daughter const_iterator
Definition: Candidate.h:144
float neutralHadronEnergy() const
neutralHadronEnergy
Definition: PFJet.h:102
float muonEnergyFraction() const
muonEnergyFraction (relative to corrected jet energy)
Definition: Jet.h:395
float neutralEmEnergyFraction() const
neutralEmEnergyFraction (relative to uncorrected jet energy)
Definition: Jet.h:381
int chargedMultiplicity() const
chargedMultiplicity
Definition: Jet.h:693
float chargedHadronEnergy() const
chargedHadronEnergy
Definition: PFJet.h:98
int cut(index_type const &i, int val) const
Access the int cut values at index "s".
Definition: Selector.h:192
void PFJetIDSelectionFunctor::initCuts ( )
inlineprivate

Definition at line 616 of file PFJetIDSelectionFunctor.h.

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

Referenced by PFJetIDSelectionFunctor().

616  {
617  push_back("CHF");
618  push_back("NHF");
620  quality_ != TIGHT)
621  push_back("CEF");
622  push_back("NEF");
623  push_back("NCH");
624  push_back("nConstituents");
625  if (version_ == RUNIISTARTUP) {
626  push_back("NEF_FW");
627  push_back("nNeutrals_FW");
628  }
629  if (version_ == WINTER16) {
630  push_back("NHF_EC");
631  push_back("NEF_EC");
632  push_back("nNeutrals_EC");
633  push_back("NEF_FW");
634  push_back("nNeutrals_FW");
635  if (quality_ == TIGHTLEPVETO)
636  push_back("MUF");
637  }
638  if (version_ == WINTER17) {
639  push_back("NEF_EC_L");
640  push_back("NEF_EC_U");
641  push_back("nNeutrals_EC");
642  push_back("NEF_FW");
643  push_back("NHF_FW");
644  push_back("nNeutrals_FW");
645  if (quality_ == TIGHTLEPVETO)
646  push_back("MUF");
647  }
648  if (version_ == WINTER17PUPPI) {
649  push_back("NHF_EC");
650  push_back("NEF_FW");
651  push_back("NHF_FW");
652  push_back("nNeutrals_FW_L");
653  push_back("nNeutrals_FW_U");
654  if (quality_ == TIGHTLEPVETO)
655  push_back("MUF");
656  }
657  if (version_ == SUMMER18) {
658  push_back("NHF_TR");
659  push_back("NEF_TR");
660  push_back("NCH_TR");
661  push_back("NEF_EC_L");
662  push_back("NEF_EC_U");
663  push_back("nNeutrals_EC");
664  push_back("NEF_FW");
665  push_back("NHF_FW");
666  push_back("nNeutrals_FW");
667 
668  if (quality_ == TIGHTLEPVETO) {
669  push_back("MUF");
670  push_back("MUF_TR");
671  push_back("CEF_TR");
672  }
673  }
674  if (version_ == SUMMER18PUPPI) {
675  push_back("NHF_TR");
676  push_back("NEF_TR");
677  push_back("NHF_EC");
678  push_back("NEF_FW");
679  push_back("NHF_FW");
680  push_back("nNeutrals_FW_L");
681  push_back("nNeutrals_FW_U");
682 
683  if (quality_ == TIGHTLEPVETO) {
684  push_back("MUF");
685  push_back("MUF_TR");
686  push_back("CEF_TR");
687  }
688  }
689 
691  quality_ == LOOSE) {
692  edm::LogWarning("BadJetIDVersion")
693  << "The LOOSE operating point is only supported for the WINTER16 JetID version -- defaulting to TIGHT";
694  quality_ = TIGHT;
695  }
696 
697  // Set some default cuts for LOOSE, TIGHT
698  if (quality_ == LOOSE) {
699  set("CHF", 0.0);
700  set("NHF", 0.99);
701  set("CEF", 0.99);
702  set("NEF", 0.99);
703  set("NCH", 0);
704  set("nConstituents", 1);
705  if (version_ == RUNIISTARTUP) {
706  set("NEF_FW", 0.90);
707  set("nNeutrals_FW", 10);
708  } else if (version_ == WINTER16) {
709  set("NHF_EC", 0.98);
710  set("NEF_EC", 0.01);
711  set("nNeutrals_EC", 2);
712  set("NEF_FW", 0.90);
713  set("nNeutrals_FW", 10);
714  }
715  } else if (quality_ == TIGHT) {
716  set("CHF", 0.0);
717  set("NHF", 0.9);
719  set("CEF", 0.99);
720  set("NEF", 0.9);
721  set("NCH", 0);
722  set("nConstituents", 1);
723  if (version_ == RUNIISTARTUP) {
724  set("NEF_FW", 0.90);
725  set("nNeutrals_FW", 10);
726  } else if (version_ == WINTER16) {
727  set("NHF_EC", 0.98);
728  set("NEF_EC", 0.01);
729  set("nNeutrals_EC", 2);
730  set("NEF_FW", 0.90);
731  set("nNeutrals_FW", 10);
732  } else if (version_ == WINTER17) {
733  set("NEF_EC_L", 0.02);
734  set("NEF_EC_U", 0.99);
735  set("nNeutrals_EC", 2);
736  set("NHF_FW", 0.02);
737  set("NEF_FW", 0.90);
738  set("nNeutrals_FW", 10);
739  } else if (version_ == WINTER17PUPPI) {
740  set("NHF_EC", 0.99);
741  set("NHF_FW", 0.02);
742  set("NEF_FW", 0.90);
743  set("nNeutrals_FW_L", 2);
744  set("nNeutrals_FW_U", 15);
745  } else if (version_ == SUMMER18) {
746  set("NHF_TR", 0.9);
747  set("NEF_TR", 0.99);
748  set("NCH_TR", 0);
749  set("NEF_EC_L", 0.02);
750  set("NEF_EC_U", 0.99);
751  set("nNeutrals_EC", 2);
752  set("NHF_FW", 0.2);
753  set("NEF_FW", 0.90);
754  set("nNeutrals_FW", 10);
755  } else if (version_ == SUMMER18PUPPI) {
756  set("NHF_TR", 0.9);
757  set("NEF_TR", 0.99);
758  set("NHF_EC", 0.99);
759  set("NHF_FW", 0.02);
760  set("NEF_FW", 0.90);
761  set("nNeutrals_FW_L", 2);
762  set("nNeutrals_FW_U", 15);
763  }
764  } else if (quality_ == TIGHTLEPVETO) {
765  set("CHF", 0.0);
766  set("NHF", 0.9);
767  set("NEF", 0.9);
768  set("NCH", 0);
769  set("nConstituents", 1);
770  if (version_ == WINTER17) {
771  set("CEF", 0.8);
772  set("NEF_EC_L", 0.02);
773  set("NEF_EC_U", 0.99);
774  set("nNeutrals_EC", 2);
775  set("NHF_FW", 0.02);
776  set("NEF_FW", 0.90);
777  set("nNeutrals_FW", 10);
778  set("MUF", 0.8);
779  } else if (version_ == WINTER17PUPPI) {
780  set("CEF", 0.8);
781  set("NHF_EC", 0.99);
782  set("NHF_FW", 0.02);
783  set("NEF_FW", 0.90);
784  set("nNeutrals_FW_L", 2);
785  set("nNeutrals_FW_U", 15);
786  set("MUF", 0.8);
787  } else if (version_ == WINTER16) {
788  set("CEF", 0.9);
789  set("NEF_EC", 0.01);
790  set("NHF_EC", 0.98);
791  set("nNeutrals_EC", 2);
792  set("nNeutrals_FW", 10);
793  set("NEF_FW", 0.90);
794  set("MUF", 0.8);
795  } else if (version_ == WINTER17PUPPI) {
796  set("CEF", 0.8);
797  set("NHF_EC", 0.99);
798  set("NHF_FW", 0.02);
799  set("NEF_FW", 0.90);
800  set("nNeutrals_FW_L", 2);
801  set("nNeutrals_FW_U", 15);
802  set("MUF", 0.8);
803  } else if (version_ == WINTER16) {
804  set("CEF", 0.9);
805  set("NEF_EC", 0.01);
806  set("NHF_EC", 0.98);
807  set("nNeutrals_EC", 2);
808  set("nNeutrals_FW", 10);
809  set("NEF_FW", 0.90);
810  set("MUF", 0.8);
811  } else if (version_ == SUMMER18) {
812  set("CEF", 0.8);
813  set("MUF", 0.8);
814  set("NHF_TR", 0.9);
815  set("NEF_TR", 0.99);
816  set("MUF_TR", 0.8);
817  set("NCH_TR", 0);
818  set("CEF_TR", 0.8);
819  set("NEF_EC_L", 0.02);
820  set("NEF_EC_U", 0.99);
821  set("nNeutrals_EC", 2);
822  set("NHF_FW", 0.2);
823  set("NEF_FW", 0.90);
824  set("nNeutrals_FW", 10);
825  } else if (version_ == SUMMER18PUPPI) {
826  set("CEF", 0.8);
827  set("MUF", 0.8);
828  set("NHF_TR", 0.9);
829  set("NEF_TR", 0.99);
830  set("MUF_TR", 0.8);
831  set("CEF_TR", 0.8);
832  set("NHF_EC", 0.99);
833  set("NHF_FW", 0.02);
834  set("NEF_FW", 0.90);
835  set("nNeutrals_FW_L", 2);
836  set("nNeutrals_FW_U", 15);
837  }
838  }
839  }
virtual void push_back(std::string const &s)
This is the registration of an individual cut string.
Definition: Selector.h:44
void PFJetIDSelectionFunctor::initIndex ( )
inlineprivate

Definition at line 841 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_, RUNIISTARTUP, SUMMER18, SUMMER18PUPPI, TIGHT, TIGHTLEPVETO, version_, WINTER16, WINTER17, and WINTER17PUPPI.

Referenced by PFJetIDSelectionFunctor().

841  {
842  indexNConstituents_ = index_type(&bits_, "nConstituents");
843  indexNEF_ = index_type(&bits_, "NEF");
844  indexNHF_ = index_type(&bits_, "NHF");
846  quality_ != TIGHT)
847  indexCEF_ = index_type(&bits_, "CEF");
848 
849  indexCHF_ = index_type(&bits_, "CHF");
850  indexNCH_ = index_type(&bits_, "NCH");
851  if (version_ == RUNIISTARTUP) {
852  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
853  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
854  }
855  if (version_ == WINTER16) {
856  indexNHF_EC_ = index_type(&bits_, "NHF_EC");
857  indexNEF_EC_ = index_type(&bits_, "NEF_EC");
858  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
859  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
860  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
861  if (quality_ == TIGHTLEPVETO) {
862  indexMUF_ = index_type(&bits_, "MUF");
863  }
864  }
865  if (version_ == WINTER17) {
866  indexNEF_EC_L_ = index_type(&bits_, "NEF_EC_L");
867  indexNEF_EC_U_ = index_type(&bits_, "NEF_EC_U");
868  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
869  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
870  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
871  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
872  if (quality_ == TIGHTLEPVETO) {
873  indexMUF_ = index_type(&bits_, "MUF");
874  }
875  }
876  if (version_ == WINTER17PUPPI) {
877  indexNHF_EC_ = index_type(&bits_, "NHF_EC");
878  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
879  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
880  indexNNeutrals_FW_L_ = index_type(&bits_, "nNeutrals_FW_L");
881  indexNNeutrals_FW_U_ = index_type(&bits_, "nNeutrals_FW_U");
882  if (quality_ == TIGHTLEPVETO) {
883  indexMUF_ = index_type(&bits_, "MUF");
884  }
885  }
886  if (version_ == SUMMER18) {
887  indexNHF_TR_ = index_type(&bits_, "NHF_TR");
888  indexNEF_TR_ = index_type(&bits_, "NEF_TR");
889  indexNCH_TR_ = index_type(&bits_, "NCH_TR");
890  indexNEF_EC_L_ = index_type(&bits_, "NEF_EC_L");
891  indexNEF_EC_U_ = index_type(&bits_, "NEF_EC_U");
892  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
893  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
894  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
895  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
896  if (quality_ == TIGHTLEPVETO) {
897  indexMUF_ = index_type(&bits_, "MUF");
898  indexMUF_TR_ = index_type(&bits_, "MUF_TR");
899  indexCEF_TR_ = index_type(&bits_, "CEF_TR");
900  }
901  }
902  if (version_ == SUMMER18PUPPI) {
903  indexNHF_TR_ = index_type(&bits_, "NHF_TR");
904  indexNEF_TR_ = index_type(&bits_, "NEF_TR");
905  indexNHF_EC_ = index_type(&bits_, "NHF_EC");
906  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
907  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
908  indexNNeutrals_FW_L_ = index_type(&bits_, "nNeutrals_FW_L");
909  indexNNeutrals_FW_U_ = index_type(&bits_, "nNeutrals_FW_U");
910  if (quality_ == TIGHTLEPVETO) {
911  indexMUF_ = index_type(&bits_, "MUF");
912  indexMUF_TR_ = index_type(&bits_, "MUF_TR");
913  indexCEF_TR_ = index_type(&bits_, "CEF_TR");
914  }
915  }
917  }
pat::strbitset::index_type index_type
Definition: Selector.h:27
pat::strbitset retInternal_
internal ret if users don&#39;t care about return bits
Definition: Selector.h:285
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:284
pat::strbitset getBitTemplate() const
Get an empty bitset with the proper names.
Definition: Selector.h:210
bool PFJetIDSelectionFunctor::operator() ( const pat::Jet jet,
pat::strbitset ret 
)
inlineoverride

Definition at line 210 of file PFJetIDSelectionFunctor.h.

References pat::Jet::correctedJet(), pat::Jet::currentJECLevel(), FIRSTDATA, firstDataCuts(), pat::Jet::jecSetsAvailable(), Utilities::operator, RUNIISTARTUP, SUMMER18, SUMMER18PUPPI, version_, WINTER16, WINTER17, and WINTER17PUPPI.

Referenced by operator()().

210  {
213  if (jet.currentJECLevel() == "Uncorrected" || !jet.jecSetsAvailable())
214  return firstDataCuts(jet, ret, version_);
215  else
216  return firstDataCuts(jet.correctedJet("Uncorrected"), ret, version_);
217  } else {
218  return false;
219  }
220  }
bool jecSetsAvailable() const
Definition: Jet.h:131
std::string currentJECLevel() const
return the name of the current step of jet energy corrections
Definition: Jet.h:141
Jet correctedJet(const std::string &level, const std::string &flavor="none", const std::string &set="") const
bool firstDataCuts(reco::Jet const &jet, pat::strbitset &ret, Version_t version_)
bool PFJetIDSelectionFunctor::operator() ( const reco::PFJet jet,
pat::strbitset ret 
)
inline
bool PFJetIDSelectionFunctor::operator() ( const reco::PFJet jet)
inline

Definition at line 236 of file PFJetIDSelectionFunctor.h.

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

236  {
237  retInternal_.set(false);
238  operator()(jet, retInternal_);
240  return (bool)retInternal_;
241  }
void setIgnored(pat::strbitset &ret)
set ignored bits
Definition: Selector.h:222
pat::strbitset retInternal_
internal ret if users don&#39;t care about return bits
Definition: Selector.h:285
bool operator()(const pat::Jet &jet, pat::strbitset &ret) override
strbitset & set(bool val=true)
set method of all bits
Definition: strbitset.h:144

Member Data Documentation

index_type PFJetIDSelectionFunctor::indexCEF_
private

Definition at line 926 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexCEF_TR_
private

Definition at line 934 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexCHF_
private

Definition at line 927 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexMUF_
private

Definition at line 924 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexMUF_TR_
private

Definition at line 933 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNCH_
private

Definition at line 928 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNCH_TR_
private

Definition at line 932 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNConstituents_
private

Definition at line 922 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNEF_
private

Definition at line 923 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNEF_EC_
private

Definition at line 943 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNEF_EC_L_
private

Definition at line 944 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNEF_EC_U_
private

Definition at line 945 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNEF_FW_
private

Definition at line 937 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNEF_TR_
private

Definition at line 931 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNHF_
private

Definition at line 925 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNHF_EC_
private

Definition at line 942 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNHF_FW_
private

Definition at line 936 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNHF_TR_
private

Definition at line 930 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNNeutrals_EC_
private

Definition at line 946 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNNeutrals_FW_
private

Definition at line 938 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNNeutrals_FW_L_
private

Definition at line 939 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNNeutrals_FW_U_
private

Definition at line 940 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

Quality_t PFJetIDSelectionFunctor::quality_
private
Version_t PFJetIDSelectionFunctor::version_
private