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, 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
 
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 41 of file PFJetIDSelectionFunctor.h.

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

Definition at line 44 of file PFJetIDSelectionFunctor.h.

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

Definition at line 48 of file PFJetIDSelectionFunctor.h.

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

48  {
49  std::string versionStr = params.getParameter<std::string>("version");
50  std::string qualityStr = params.getParameter<std::string>("quality");
51 
52  if (versionStr == "FIRSTDATA")
54  else if (versionStr == "RUNIISTARTUP")
56  else if (versionStr == "WINTER16")
58  else if (versionStr == "WINTER17")
60  else if (versionStr == "WINTER17PUPPI")
62  else if (versionStr == "SUMMER18")
64  else if (versionStr == "SUMMER18PUPPI")
66  else if (versionStr == "RUN2ULCHS")
68  else if (versionStr == "RUN2ULPUPPI")
70  else
71  version_ = WINTER17; //set WINTER17 as default
72 
73  if (qualityStr == "LOOSE")
74  quality_ = LOOSE;
75  else if (qualityStr == "TIGHT")
76  quality_ = TIGHT;
77  else if (qualityStr == "TIGHTLEPVETO")
79  else
80  quality_ = TIGHT;
81 
82  initCuts();
83 
84  // Now check the configuration to see if the user changed anything
85  if (params.exists("CHF"))
86  set("CHF", params.getParameter<double>("CHF"));
87  if (params.exists("NHF"))
88  set("NHF", params.getParameter<double>("NHF"));
91  quality_ != TIGHT) {
92  if (params.exists("CEF"))
93  set("CEF", params.getParameter<double>("CEF"));
94  }
95  if (params.exists("NEF"))
96  set("NEF", params.getParameter<double>("NEF"));
97  if (params.exists("NCH"))
98  set("NCH", params.getParameter<int>("NCH"));
99  if (params.exists("nConstituents"))
100  set("nConstituents", params.getParameter<int>("nConstituents"));
101  if (version_ == RUNIISTARTUP) {
102  if (params.exists("NEF_FW"))
103  set("NEF_FW", params.getParameter<double>("NEF_FW"));
104  if (params.exists("nNeutrals_FW"))
105  set("nNeutrals_FW", params.getParameter<int>("nNeutrals_FW"));
106  }
107  if (version_ == WINTER16) {
108  if (params.exists("NHF_EC"))
109  set("NHF_EC", params.getParameter<double>("NHF_EC"));
110  if (params.exists("NEF_EC"))
111  set("NEF_EC", params.getParameter<double>("NEF_EC"));
112  if (params.exists("nNeutrals_EC"))
113  set("nNeutrals_EC", params.getParameter<int>("nNeutrals_EC"));
114  if (params.exists("NEF_FW"))
115  set("NEF_FW", params.getParameter<double>("NEF_FW"));
116  if (params.exists("nNeutrals_FW"))
117  set("nNeutrals_FW", params.getParameter<int>("nNeutrals_FW"));
118  if (quality_ == TIGHTLEPVETO) {
119  if (params.exists("MUF"))
120  set("MUF", params.getParameter<double>("MUF"));
121  }
122  }
123  if (version_ == WINTER17) {
124  if (params.exists("NEF_EC_L"))
125  set("NEF_EC_L", params.getParameter<double>("NEF_EC_L"));
126  if (params.exists("NEF_EC_U"))
127  set("NEF_EC_U", params.getParameter<double>("NEF_EC_U"));
128  if (params.exists("nNeutrals_EC"))
129  set("nNeutrals_EC", params.getParameter<int>("nNeutrals_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"))
135  set("nNeutrals_FW", params.getParameter<int>("nNeutrals_FW"));
136  if (quality_ == TIGHTLEPVETO) {
137  if (params.exists("MUF"))
138  set("MUF", params.getParameter<double>("MUF"));
139  }
140  }
141  if (version_ == WINTER17PUPPI) {
142  if (params.exists("NHF_EC"))
143  set("NHF_EC", params.getParameter<double>("NHF_EC"));
144  if (params.exists("NHF_FW"))
145  set("NHF_FW", params.getParameter<double>("NHF_FW"));
146  if (params.exists("NEF_FW"))
147  set("NEF_FW", params.getParameter<double>("NEF_FW"));
148  if (params.exists("nNeutrals_FW_L"))
149  set("nNeutrals_FW_L", params.getParameter<int>("nNeutrals_FW_L"));
150  if (params.exists("nNeutrals_FW_U"))
151  set("nNeutrals_FW_U", params.getParameter<int>("nNeutrals_FW_U"));
152  if (quality_ == TIGHTLEPVETO) {
153  if (params.exists("MUF"))
154  set("MUF", params.getParameter<double>("MUF"));
155  }
156  }
157  if ((version_ == SUMMER18) || (version_ == RUN2ULCHS)) {
158  if (params.exists("NHF_TR"))
159  set("NHF_TR", params.getParameter<double>("NHF_TR"));
160  if (params.exists("NEF_TR"))
161  set("NEF_TR", params.getParameter<double>("NEF_TR"));
162  if (params.exists("NCH_TR"))
163  set("NCH_TR", params.getParameter<int>("NCH_TR"));
164  if (params.exists("NEF_EC_L"))
165  set("NEF_EC_L", params.getParameter<double>("NEF_EC_L"));
166  if (params.exists("NEF_EC_U"))
167  set("NEF_EC_U", params.getParameter<double>("NEF_EC_U"));
168  if (params.exists("nNeutrals_EC"))
169  set("nNeutrals_EC", params.getParameter<int>("nNeutrals_EC"));
170  if (params.exists("NHF_FW"))
171  set("NHF_FW", params.getParameter<double>("NHF_FW"));
172  if (params.exists("NEF_FW"))
173  set("NEF_FW", params.getParameter<double>("NEF_FW"));
174  if (params.exists("nNeutrals_FW"))
175  set("nNeutrals_FW", params.getParameter<int>("nNeutrals_FW"));
176  if (quality_ == TIGHTLEPVETO) {
177  if (params.exists("MUF"))
178  set("MUF", params.getParameter<double>("MUF"));
179  if (params.exists("MUF_TR"))
180  set("MUF_TR", params.getParameter<double>("MUF_TR"));
181  if (params.exists("CEF_TR"))
182  set("CEF_TR", params.getParameter<double>("CEF_TR"));
183  }
184  }
185  if ((version_ == SUMMER18PUPPI) || (version_ == RUN2ULPUPPI)) {
186  if (params.exists("NHF_TR"))
187  set("NHF_TR", params.getParameter<double>("NHF_TR"));
188  if (params.exists("NEF_TR"))
189  set("NEF_TR", params.getParameter<double>("NEF_TR"));
190  if (params.exists("NHF_EC"))
191  set("NHF_EC", params.getParameter<double>("NHF_EC"));
192  if (params.exists("NHF_FW"))
193  set("NHF_FW", params.getParameter<double>("NHF_FW"));
194  if (params.exists("NEF_FW"))
195  set("NEF_FW", params.getParameter<double>("NEF_FW"));
196  if (params.exists("nNeutrals_FW_L"))
197  set("nNeutrals_FW_L", params.getParameter<int>("nNeutrals_FW_L"));
198  if (params.exists("nNeutrals_FW_U"))
199  set("nNeutrals_FW_U", params.getParameter<int>("nNeutrals_FW_U"));
200  if (quality_ == TIGHTLEPVETO) {
201  if (params.exists("MUF"))
202  set("MUF", params.getParameter<double>("MUF"));
203  if (params.exists("MUF_TR"))
204  set("MUF_TR", params.getParameter<double>("MUF_TR"));
205  if (params.exists("CEF_TR"))
206  set("CEF_TR", params.getParameter<double>("CEF_TR"));
207  }
208  }
209 
210  if (params.exists("cutsToIgnore"))
211  setIgnoredCuts(params.getParameter<std::vector<std::string> >("cutsToIgnore"));
212 
213  initIndex();
214  }
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 262 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_, RUN2ULCHS, RUN2ULPUPPI, RUNIISTARTUP, pat::strbitset::set(), Selector< pat::Jet >::setIgnored(), SUMMER18, SUMMER18PUPPI, TIGHT, TIGHTLEPVETO, pat::PATObject< ObjectType >::userFloat(), WINTER16, WINTER17, and WINTER17PUPPI.

Referenced by operator()().

262  {
263  ret.set(false);
264 
265  // cache some variables
266  double chf = 0.0;
267  double nhf = 0.0;
268  double cef = 0.0;
269  double nef = 0.0;
270  double muf = 0.0;
271 
272  int nch = 0;
273  int nconstituents = 0;
274  int nneutrals = 0;
275 
276  // Have to do this because pat::Jet inherits from reco::Jet but not reco::PFJet
277  reco::PFJet const *pfJet = dynamic_cast<reco::PFJet const *>(&jet);
278  pat::Jet const *patJet = dynamic_cast<pat::Jet const *>(&jet);
279  reco::BasicJet const *basicJet = dynamic_cast<reco::BasicJet const *>(&jet);
280 
281  if (patJet != nullptr) {
282  if (patJet->isPFJet()) {
283  chf = patJet->chargedHadronEnergyFraction();
284  nhf = patJet->neutralHadronEnergyFraction();
285  cef = patJet->chargedEmEnergyFraction();
286  nef = patJet->neutralEmEnergyFraction();
287  nch = patJet->chargedMultiplicity();
288  muf = patJet->muonEnergyFraction();
289  nconstituents = patJet->numberOfDaughters();
290  nneutrals = patJet->neutralMultiplicity();
291  // Handle the special case of PUPPI jets with weighted multiplicities
292  if (patJet->hasUserFloat("patPuppiJetSpecificProducer:puppiMultiplicity"))
293  nconstituents = patJet->userFloat("patPuppiJetSpecificProducer:puppiMultiplicity");
294  if (patJet->hasUserFloat("patPuppiJetSpecificProducer:neutralPuppiMultiplicity"))
295  nneutrals = patJet->userFloat("patPuppiJetSpecificProducer:neutralPuppiMultiplicity");
296  }
297  // Handle the special case where this is a composed jet for
298  // subjet analyses
299  else if (patJet->isBasicJet()) {
300  double e_chf = 0.0;
301  double e_nhf = 0.0;
302  double e_cef = 0.0;
303  double e_nef = 0.0;
304  double e_muf = 0.0;
305  nch = 0;
306  nconstituents = 0;
307  nneutrals = 0;
308 
309  for (reco::Jet::const_iterator ibegin = patJet->begin(), iend = patJet->end(), isub = ibegin; isub != iend;
310  ++isub) {
311  reco::PFJet const *pfsub = dynamic_cast<reco::PFJet const *>(&*isub);
312  pat::Jet const *patsub = dynamic_cast<pat::Jet const *>(&*isub);
313  if (patsub) {
314  e_chf += patsub->chargedHadronEnergy();
315  e_nhf += patsub->neutralHadronEnergy();
316  e_cef += patsub->chargedEmEnergy();
317  e_nef += patsub->neutralEmEnergy();
318  e_muf += patsub->muonEnergy();
319  nch += patsub->chargedMultiplicity();
320  nconstituents += patsub->numberOfDaughters();
321  nneutrals += patsub->neutralMultiplicity();
322  } else if (pfsub) {
323  e_chf += pfsub->chargedHadronEnergy();
324  e_nhf += pfsub->neutralHadronEnergy();
325  e_cef += pfsub->chargedEmEnergy();
326  e_nef += pfsub->neutralEmEnergy();
327  e_muf += pfsub->muonEnergy();
328  nch += pfsub->chargedMultiplicity();
329  nconstituents += pfsub->numberOfDaughters();
330  nneutrals += pfsub->neutralMultiplicity();
331  } else
332  assert(0);
333  }
334  double e = patJet->energy();
335  if (e > 0.000001) {
336  chf = e_chf / e;
337  nhf = e_nhf / e;
338  cef = e_cef / e;
339  nef = e_nef / e;
340  muf = e_muf / e;
341  } else {
342  chf = nhf = cef = nef = muf = 0.0;
343  }
344  }
345  } // end if pat jet
346  else if (pfJet != nullptr) {
347  // CV: need to compute energy fractions in a way that works for corrected as well as for uncorrected PFJets
348  double jetEnergyUncorrected = pfJet->chargedHadronEnergy() + pfJet->neutralHadronEnergy() +
349  pfJet->photonEnergy() + pfJet->electronEnergy() + pfJet->muonEnergy() +
350  pfJet->HFEMEnergy();
351  if (jetEnergyUncorrected > 0.) {
352  chf = pfJet->chargedHadronEnergy() / jetEnergyUncorrected;
353  nhf = pfJet->neutralHadronEnergy() / jetEnergyUncorrected;
354  cef = pfJet->chargedEmEnergy() / jetEnergyUncorrected;
355  nef = pfJet->neutralEmEnergy() / jetEnergyUncorrected;
356  muf = pfJet->muonEnergy() / jetEnergyUncorrected;
357  }
358  nch = pfJet->chargedMultiplicity();
359  nconstituents = pfJet->numberOfDaughters();
360  nneutrals = pfJet->neutralMultiplicity();
361  } // end if PF jet
362  // Handle the special case where this is a composed jet for
363  // subjet analyses
364  else if (basicJet != nullptr) {
365  double e_chf = 0.0;
366  double e_nhf = 0.0;
367  double e_cef = 0.0;
368  double e_nef = 0.0;
369  double e_muf = 0.0;
370  nch = 0;
371  nconstituents = 0;
372  for (reco::Jet::const_iterator ibegin = basicJet->begin(), iend = patJet->end(), isub = ibegin; isub != iend;
373  ++isub) {
374  reco::PFJet const *pfsub = dynamic_cast<reco::PFJet const *>(&*isub);
375  e_chf += pfsub->chargedHadronEnergy();
376  e_nhf += pfsub->neutralHadronEnergy();
377  e_cef += pfsub->chargedEmEnergy();
378  e_nef += pfsub->neutralEmEnergy();
379  e_muf += pfsub->muonEnergy();
380  nch += pfsub->chargedMultiplicity();
381  nconstituents += pfsub->numberOfDaughters();
382  nneutrals += pfsub->neutralMultiplicity();
383  }
384  double e = basicJet->energy();
385  if (e > 0.000001) {
386  chf = e_chf / e;
387  nhf = e_nhf / e;
388  cef = e_cef / e;
389  nef = e_nef / e;
390  muf = e_muf / e;
391  }
392  } // end if basic jet
393 
394  float etaB = 2.4;
395  // Cuts for |eta| < 2.6 for Summer18
397  etaB = 2.6;
400  quality_ != TIGHT) {
401  if (ignoreCut(indexCEF_) || (cef < cut(indexCEF_, double()) || std::abs(jet.eta()) > etaB))
402  passCut(ret, indexCEF_);
403  }
404  if (ignoreCut(indexCHF_) || (chf > cut(indexCHF_, double()) || std::abs(jet.eta()) > etaB))
405  passCut(ret, indexCHF_);
406  if (ignoreCut(indexNCH_) || (nch > cut(indexNCH_, int()) || std::abs(jet.eta()) > etaB))
407  passCut(ret, indexNCH_);
408  if (version_ == FIRSTDATA) { // Cuts for all eta for FIRSTDATA
409  if (ignoreCut(indexNConstituents_) || (nconstituents > cut(indexNConstituents_, int())))
411  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double())))
412  passCut(ret, indexNEF_);
413  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double())))
414  passCut(ret, indexNHF_);
415  } else if (version_ == RUNIISTARTUP) {
416  // Cuts for |eta| <= 3.0 for RUNIISTARTUP scenario
418  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 3.0))
420  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 3.0))
421  passCut(ret, indexNEF_);
422  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 3.0))
423  passCut(ret, indexNHF_);
424  // Cuts for |eta| > 3.0 for RUNIISTARTUP scenario
425  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
426  passCut(ret, indexNEF_FW_);
427  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
429  } else if (version_ == WINTER16) {
430  // Cuts for |eta| <= 2.7 for WINTER16 scenario
432  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.7))
434  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.7))
435  passCut(ret, indexNEF_);
436  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.7))
437  passCut(ret, indexNHF_);
438  if (quality_ == TIGHTLEPVETO) {
439  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.7))
440  passCut(ret, indexMUF_);
441  }
442 
443  // Cuts for 2.7 < |eta| <= 3.0 for WINTER16 scenario
444  if (ignoreCut(indexNHF_EC_) ||
445  (nhf < cut(indexNHF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
446  passCut(ret, indexNHF_EC_);
447  if (ignoreCut(indexNEF_EC_) ||
448  (nef > cut(indexNEF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
449  passCut(ret, indexNEF_EC_);
451  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
453 
454  // Cuts for |eta| > 3.0 for WINTER16 scenario
455  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
456  passCut(ret, indexNEF_FW_);
457  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
459  } else if (version_ == WINTER17) {
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))
465  passCut(ret, indexNEF_);
466  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.7))
467  passCut(ret, indexNHF_);
468  if (quality_ == TIGHTLEPVETO) {
469  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.7))
470  passCut(ret, indexMUF_);
471  }
472 
473  // Cuts for 2.7 < |eta| <= 3.0 for WINTER17 scenario
474 
475  if (ignoreCut(indexNEF_EC_L_) ||
476  (nef > cut(indexNEF_EC_L_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
477  passCut(ret, indexNEF_EC_L_);
478  if (ignoreCut(indexNEF_EC_U_) ||
479  (nef < cut(indexNEF_EC_U_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
480  passCut(ret, indexNEF_EC_U_);
482  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
484 
485  // Cuts for |eta| > 3.0 for WINTER17 scenario
486  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
487  passCut(ret, indexNHF_FW_);
488  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
489  passCut(ret, indexNEF_FW_);
490  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
492 
493  } else if (version_ == WINTER17PUPPI) {
494  // Cuts for |eta| <= 2.7 for WINTER17 scenario
496  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.7))
498  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.7))
499  passCut(ret, indexNEF_);
500  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.7))
501  passCut(ret, indexNHF_);
502  if (quality_ == TIGHTLEPVETO) {
503  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.7))
504  passCut(ret, indexMUF_);
505  }
506 
507  // Cuts for 2.7 < |eta| <= 3.0 for WINTER17 scenario
508 
509  if (ignoreCut(indexNHF_EC_) ||
510  (nhf < cut(indexNHF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
511  passCut(ret, indexNHF_EC_);
512 
513  // Cuts for |eta| > 3.0 for WINTER17 scenario
514  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
515  passCut(ret, indexNHF_FW_);
516  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
517  passCut(ret, indexNEF_FW_);
519  (nneutrals > cut(indexNNeutrals_FW_L_, int()) || std::abs(jet.eta()) <= 3.0))
522  (nneutrals < cut(indexNNeutrals_FW_U_, int()) || std::abs(jet.eta()) <= 3.0))
524  } else if ((version_ == SUMMER18) || (version_ == RUN2ULCHS)) {
525  // Cuts for |eta| <= 2.6 for SUMMER18 scenario
527  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.6))
529  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.6))
530  passCut(ret, indexNEF_);
531  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.6))
532  passCut(ret, indexNHF_);
533  if (quality_ == TIGHTLEPVETO) {
534  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.6))
535  passCut(ret, indexMUF_);
536  }
537 
538  // Cuts for 2.6 <= |eta| <= 2.7 for SUMMER18 scenario
539  if (ignoreCut(indexNHF_TR_) ||
540  (nhf < cut(indexNHF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
541  passCut(ret, indexNHF_TR_);
542  if (ignoreCut(indexNEF_TR_) ||
543  (nef < cut(indexNEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
544  passCut(ret, indexNEF_TR_);
545  if (ignoreCut(indexNCH_TR_) ||
546  (nch > cut(indexNCH_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
547  passCut(ret, indexNCH_TR_);
548  if (quality_ == TIGHTLEPVETO) {
549  if (ignoreCut(indexMUF_TR_) ||
550  (muf < cut(indexMUF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
551  passCut(ret, indexMUF_TR_);
552  if (ignoreCut(indexCEF_TR_) ||
553  (cef < cut(indexCEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
554  passCut(ret, indexCEF_TR_);
555  }
556 
557  // Cuts for 2.7 < |eta| <= 3.0 for SUMMER18 scenario
558  if (ignoreCut(indexNEF_EC_L_) ||
559  (nef > cut(indexNEF_EC_L_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
560  passCut(ret, indexNEF_EC_L_);
561  if (ignoreCut(indexNEF_EC_U_) ||
562  (nef < cut(indexNEF_EC_U_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
563  passCut(ret, indexNEF_EC_U_);
565  (nneutrals > cut(indexNNeutrals_EC_, int()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
567 
568  // Cuts for |eta| > 3.0 for SUMMER18 scenario
569  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
570  passCut(ret, indexNHF_FW_);
571  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
572  passCut(ret, indexNEF_FW_);
573  if (ignoreCut(indexNNeutrals_FW_) || (nneutrals > cut(indexNNeutrals_FW_, int()) || std::abs(jet.eta()) <= 3.0))
575  }
576 
577  else if ((version_ == SUMMER18PUPPI) || (version_ == RUN2ULPUPPI)) {
578  // Cuts for |eta| <= 2.6 for SUMMER18PUPPI scenario
580  (nconstituents > cut(indexNConstituents_, int()) || std::abs(jet.eta()) > 2.6))
582  if (ignoreCut(indexNEF_) || (nef < cut(indexNEF_, double()) || std::abs(jet.eta()) > 2.6))
583  passCut(ret, indexNEF_);
584  if (ignoreCut(indexNHF_) || (nhf < cut(indexNHF_, double()) || std::abs(jet.eta()) > 2.6))
585  passCut(ret, indexNHF_);
586  if (quality_ == TIGHTLEPVETO) {
587  if (ignoreCut(indexMUF_) || (muf < cut(indexMUF_, double()) || std::abs(jet.eta()) > 2.6))
588  passCut(ret, indexMUF_);
589  }
590 
591  // Cuts for 2.6 <= |eta| <= 2.7 for SUMMER18PUPPI scenario
592  if (ignoreCut(indexNHF_TR_) ||
593  (nhf < cut(indexNHF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
594  passCut(ret, indexNHF_TR_);
595  if (ignoreCut(indexNEF_TR_) ||
596  (nef < cut(indexNEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
597  passCut(ret, indexNEF_TR_);
598  if (quality_ == TIGHTLEPVETO) {
599  if (ignoreCut(indexMUF_TR_) ||
600  (muf < cut(indexMUF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
601  passCut(ret, indexMUF_TR_);
602  if (ignoreCut(indexCEF_TR_) ||
603  (cef < cut(indexCEF_TR_, double()) || std::abs(jet.eta()) <= 2.6 || std::abs(jet.eta()) > 2.7))
604  passCut(ret, indexCEF_TR_);
605  }
606 
607  // Cuts for 2.7 < |eta| <= 3.0 for SUMMER18PUPPI scenario
608  if (ignoreCut(indexNHF_EC_) ||
609  (nhf < cut(indexNHF_EC_, double()) || std::abs(jet.eta()) <= 2.7 || std::abs(jet.eta()) > 3.0))
610  passCut(ret, indexNHF_EC_);
611 
612  // Cuts for |eta| > 3.0 for SUMMER18PUPPI scenario
613  if (ignoreCut(indexNHF_FW_) || (nhf > cut(indexNHF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
614  passCut(ret, indexNHF_FW_);
615  if (ignoreCut(indexNEF_FW_) || (nef < cut(indexNEF_FW_, double()) || std::abs(jet.eta()) <= 3.0))
616  passCut(ret, indexNEF_FW_);
618  (nneutrals > cut(indexNNeutrals_FW_L_, int()) || std::abs(jet.eta()) <= 3.0))
621  (nneutrals < cut(indexNNeutrals_FW_U_, int()) || std::abs(jet.eta()) <= 3.0))
623  }
624 
625  //std::cout << "<PFJetIDSelectionFunctor::firstDataCuts>:" << std::endl;
626  //std::cout << " jet: Pt = " << jet.pt() << ", eta = " << jet.eta() << ", phi = " << jet.phi() << std::endl;
627  //ret.print(std::cout);
628  setIgnored(ret);
629  return (bool)ret;
630  }
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 633 of file PFJetIDSelectionFunctor.h.

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

Referenced by PFJetIDSelectionFunctor().

633  {
634  push_back("CHF");
635  push_back("NHF");
638  quality_ != TIGHT)
639  push_back("CEF");
640  push_back("NEF");
641  push_back("NCH");
642  push_back("nConstituents");
643  if (version_ == RUNIISTARTUP) {
644  push_back("NEF_FW");
645  push_back("nNeutrals_FW");
646  }
647  if (version_ == WINTER16) {
648  push_back("NHF_EC");
649  push_back("NEF_EC");
650  push_back("nNeutrals_EC");
651  push_back("NEF_FW");
652  push_back("nNeutrals_FW");
653  if (quality_ == TIGHTLEPVETO)
654  push_back("MUF");
655  }
656  if (version_ == WINTER17) {
657  push_back("NEF_EC_L");
658  push_back("NEF_EC_U");
659  push_back("nNeutrals_EC");
660  push_back("NEF_FW");
661  push_back("NHF_FW");
662  push_back("nNeutrals_FW");
663  if (quality_ == TIGHTLEPVETO)
664  push_back("MUF");
665  }
666  if (version_ == WINTER17PUPPI) {
667  push_back("NHF_EC");
668  push_back("NEF_FW");
669  push_back("NHF_FW");
670  push_back("nNeutrals_FW_L");
671  push_back("nNeutrals_FW_U");
672  if (quality_ == TIGHTLEPVETO)
673  push_back("MUF");
674  }
675  if ((version_ == SUMMER18) || (version_ == RUN2ULCHS)) {
676  push_back("NHF_TR");
677  push_back("NEF_TR");
678  push_back("NCH_TR");
679  push_back("NEF_EC_L");
680  push_back("NEF_EC_U");
681  push_back("nNeutrals_EC");
682  push_back("NEF_FW");
683  push_back("NHF_FW");
684  push_back("nNeutrals_FW");
685 
686  if (quality_ == TIGHTLEPVETO) {
687  push_back("MUF");
688  push_back("MUF_TR");
689  push_back("CEF_TR");
690  }
691  }
692  if ((version_ == SUMMER18PUPPI) || (version_ == RUN2ULPUPPI)) {
693  push_back("NHF_TR");
694  push_back("NEF_TR");
695  push_back("NHF_EC");
696  push_back("NEF_FW");
697  push_back("NHF_FW");
698  push_back("nNeutrals_FW_L");
699  push_back("nNeutrals_FW_U");
700 
701  if (quality_ == TIGHTLEPVETO) {
702  push_back("MUF");
703  push_back("MUF_TR");
704  push_back("CEF_TR");
705  }
706  }
707 
710  quality_ == LOOSE) {
711  edm::LogWarning("BadJetIDVersion")
712  << "The LOOSE operating point is only supported for the WINTER16 JetID version -- defaulting to TIGHT";
713  quality_ = TIGHT;
714  }
715 
716  // Set some default cuts for LOOSE, TIGHT
717  if (quality_ == LOOSE) {
718  set("CHF", 0.0);
719  set("NHF", 0.99);
720  set("CEF", 0.99);
721  set("NEF", 0.99);
722  set("NCH", 0);
723  set("nConstituents", 1);
724  if (version_ == RUNIISTARTUP) {
725  set("NEF_FW", 0.90);
726  set("nNeutrals_FW", 10);
727  } else if (version_ == WINTER16) {
728  set("NHF_EC", 0.98);
729  set("NEF_EC", 0.01);
730  set("nNeutrals_EC", 2);
731  set("NEF_FW", 0.90);
732  set("nNeutrals_FW", 10);
733  }
734  } else if (quality_ == TIGHT) {
735  set("CHF", 0.0);
736  set("NHF", 0.9);
739  set("CEF", 0.99);
740  set("NEF", 0.9);
741  set("NCH", 0);
742  set("nConstituents", 1);
743  if (version_ == RUNIISTARTUP) {
744  set("NEF_FW", 0.90);
745  set("nNeutrals_FW", 10);
746  } else if (version_ == WINTER16) {
747  set("NHF_EC", 0.98);
748  set("NEF_EC", 0.01);
749  set("nNeutrals_EC", 2);
750  set("NEF_FW", 0.90);
751  set("nNeutrals_FW", 10);
752  } else if (version_ == WINTER17) {
753  set("NEF_EC_L", 0.02);
754  set("NEF_EC_U", 0.99);
755  set("nNeutrals_EC", 2);
756  set("NHF_FW", 0.02);
757  set("NEF_FW", 0.90);
758  set("nNeutrals_FW", 10);
759  } else if (version_ == WINTER17PUPPI) {
760  set("NHF_EC", 0.99);
761  set("NHF_FW", 0.02);
762  set("NEF_FW", 0.90);
763  set("nNeutrals_FW_L", 2);
764  set("nNeutrals_FW_U", 15);
765  } else if (version_ == SUMMER18) {
766  set("NHF_TR", 0.9);
767  set("NEF_TR", 0.99);
768  set("NCH_TR", 0);
769  set("NEF_EC_L", 0.02);
770  set("NEF_EC_U", 0.99);
771  set("nNeutrals_EC", 2);
772  set("NHF_FW", 0.2);
773  set("NEF_FW", 0.90);
774  set("nNeutrals_FW", 10);
775  } else if (version_ == SUMMER18PUPPI) {
776  set("NHF_TR", 0.9);
777  set("NEF_TR", 0.99);
778  set("NHF_EC", 0.99);
779  set("NHF_FW", 0.02);
780  set("NEF_FW", 0.90);
781  set("nNeutrals_FW_L", 2);
782  set("nNeutrals_FW_U", 15);
783  } else if (version_ == RUN2ULCHS) {
784  set("NHF_TR", 0.9);
785  set("NEF_TR", 0.99);
786  set("NCH_TR", 0);
787  set("NEF_EC_L", 0.01);
788  set("NEF_EC_U", 0.99);
789  set("nNeutrals_EC", 2);
790  set("NHF_FW", 0.2);
791  set("NEF_FW", 0.90);
792  set("nNeutrals_FW", 10);
793  } else if (version_ == RUN2ULPUPPI) {
794  set("NHF_TR", 0.9);
795  set("NEF_TR", 0.99);
796  set("NHF_EC", 0.9999);
797  set("NHF_FW", -1.0);
798  set("NEF_FW", 0.90);
799  set("nNeutrals_FW_L", 2);
800  set("nNeutrals_FW_U", 999999);
801  }
802  } else if (quality_ == TIGHTLEPVETO) {
803  set("CHF", 0.0);
804  set("NHF", 0.9);
805  set("NEF", 0.9);
806  set("NCH", 0);
807  set("nConstituents", 1);
808  if (version_ == WINTER17) {
809  set("CEF", 0.8);
810  set("NEF_EC_L", 0.02);
811  set("NEF_EC_U", 0.99);
812  set("nNeutrals_EC", 2);
813  set("NHF_FW", 0.02);
814  set("NEF_FW", 0.90);
815  set("nNeutrals_FW", 10);
816  set("MUF", 0.8);
817  } else if (version_ == WINTER17PUPPI) {
818  set("CEF", 0.8);
819  set("NHF_EC", 0.99);
820  set("NHF_FW", 0.02);
821  set("NEF_FW", 0.90);
822  set("nNeutrals_FW_L", 2);
823  set("nNeutrals_FW_U", 15);
824  set("MUF", 0.8);
825  } else if (version_ == WINTER16) {
826  set("CEF", 0.9);
827  set("NEF_EC", 0.01);
828  set("NHF_EC", 0.98);
829  set("nNeutrals_EC", 2);
830  set("nNeutrals_FW", 10);
831  set("NEF_FW", 0.90);
832  set("MUF", 0.8);
833  } else if (version_ == WINTER17PUPPI) {
834  set("CEF", 0.8);
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  set("MUF", 0.8);
841  } else if (version_ == WINTER16) {
842  set("CEF", 0.9);
843  set("NEF_EC", 0.01);
844  set("NHF_EC", 0.98);
845  set("nNeutrals_EC", 2);
846  set("nNeutrals_FW", 10);
847  set("NEF_FW", 0.90);
848  set("MUF", 0.8);
849  } else if (version_ == SUMMER18) {
850  set("CEF", 0.8);
851  set("MUF", 0.8);
852  set("NHF_TR", 0.9);
853  set("NEF_TR", 0.99);
854  set("MUF_TR", 0.8);
855  set("NCH_TR", 0);
856  set("CEF_TR", 0.8);
857  set("NEF_EC_L", 0.02);
858  set("NEF_EC_U", 0.99);
859  set("nNeutrals_EC", 2);
860  set("NHF_FW", 0.2);
861  set("NEF_FW", 0.90);
862  set("nNeutrals_FW", 10);
863  } else if (version_ == SUMMER18PUPPI) {
864  set("CEF", 0.8);
865  set("MUF", 0.8);
866  set("NHF_TR", 0.9);
867  set("NEF_TR", 0.99);
868  set("MUF_TR", 0.8);
869  set("CEF_TR", 0.8);
870  set("NHF_EC", 0.99);
871  set("NHF_FW", 0.02);
872  set("NEF_FW", 0.90);
873  set("nNeutrals_FW_L", 2);
874  set("nNeutrals_FW_U", 15);
875  } else if (version_ == RUN2ULCHS) {
876  set("CEF", 0.8);
877  set("MUF", 0.8);
878  set("NHF_TR", 0.9);
879  set("NEF_TR", 0.99);
880  set("MUF_TR", 0.8);
881  set("NCH_TR", 0);
882  set("CEF_TR", 0.8);
883  set("NEF_EC_L", 0.01);
884  set("NEF_EC_U", 0.99);
885  set("nNeutrals_EC", 2);
886  set("NHF_FW", 0.2);
887  set("NEF_FW", 0.90);
888  set("nNeutrals_FW", 10);
889  } else if (version_ == RUN2ULPUPPI) {
890  set("CEF", 0.8);
891  set("MUF", 0.8);
892  set("NHF_TR", 0.9);
893  set("NEF_TR", 0.99);
894  set("MUF_TR", 0.8);
895  set("CEF_TR", 0.8);
896  set("NHF_EC", 0.9999);
897  set("NHF_FW", -1.0);
898  set("NEF_FW", 0.90);
899  set("nNeutrals_FW_L", 2);
900  set("nNeutrals_FW_U", 999999);
901  }
902  }
903  }
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 905 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_, RUN2ULCHS, RUN2ULPUPPI, RUNIISTARTUP, SUMMER18, SUMMER18PUPPI, TIGHT, TIGHTLEPVETO, version_, WINTER16, WINTER17, and WINTER17PUPPI.

Referenced by PFJetIDSelectionFunctor().

905  {
906  indexNConstituents_ = index_type(&bits_, "nConstituents");
907  indexNEF_ = index_type(&bits_, "NEF");
908  indexNHF_ = index_type(&bits_, "NHF");
911  quality_ != TIGHT)
912  indexCEF_ = index_type(&bits_, "CEF");
913 
914  indexCHF_ = index_type(&bits_, "CHF");
915  indexNCH_ = index_type(&bits_, "NCH");
916  if (version_ == RUNIISTARTUP) {
917  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
918  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
919  }
920  if (version_ == WINTER16) {
921  indexNHF_EC_ = index_type(&bits_, "NHF_EC");
922  indexNEF_EC_ = index_type(&bits_, "NEF_EC");
923  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
924  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
925  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
926  if (quality_ == TIGHTLEPVETO) {
927  indexMUF_ = index_type(&bits_, "MUF");
928  }
929  }
930  if (version_ == WINTER17) {
931  indexNEF_EC_L_ = index_type(&bits_, "NEF_EC_L");
932  indexNEF_EC_U_ = index_type(&bits_, "NEF_EC_U");
933  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
934  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
935  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
936  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
937  if (quality_ == TIGHTLEPVETO) {
938  indexMUF_ = index_type(&bits_, "MUF");
939  }
940  }
941  if (version_ == WINTER17PUPPI) {
942  indexNHF_EC_ = index_type(&bits_, "NHF_EC");
943  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
944  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
945  indexNNeutrals_FW_L_ = index_type(&bits_, "nNeutrals_FW_L");
946  indexNNeutrals_FW_U_ = index_type(&bits_, "nNeutrals_FW_U");
947  if (quality_ == TIGHTLEPVETO) {
948  indexMUF_ = index_type(&bits_, "MUF");
949  }
950  }
951  if ((version_ == SUMMER18) || (version_ == RUN2ULCHS)) {
952  indexNHF_TR_ = index_type(&bits_, "NHF_TR");
953  indexNEF_TR_ = index_type(&bits_, "NEF_TR");
954  indexNCH_TR_ = index_type(&bits_, "NCH_TR");
955  indexNEF_EC_L_ = index_type(&bits_, "NEF_EC_L");
956  indexNEF_EC_U_ = index_type(&bits_, "NEF_EC_U");
957  indexNNeutrals_EC_ = index_type(&bits_, "nNeutrals_EC");
958  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
959  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
960  indexNNeutrals_FW_ = index_type(&bits_, "nNeutrals_FW");
961  if (quality_ == TIGHTLEPVETO) {
962  indexMUF_ = index_type(&bits_, "MUF");
963  indexMUF_TR_ = index_type(&bits_, "MUF_TR");
964  indexCEF_TR_ = index_type(&bits_, "CEF_TR");
965  }
966  }
967  if ((version_ == SUMMER18PUPPI) || (version_ == RUN2ULPUPPI)) {
968  indexNHF_TR_ = index_type(&bits_, "NHF_TR");
969  indexNEF_TR_ = index_type(&bits_, "NEF_TR");
970  indexNHF_EC_ = index_type(&bits_, "NHF_EC");
971  indexNHF_FW_ = index_type(&bits_, "NHF_FW");
972  indexNEF_FW_ = index_type(&bits_, "NEF_FW");
973  indexNNeutrals_FW_L_ = index_type(&bits_, "nNeutrals_FW_L");
974  indexNNeutrals_FW_U_ = index_type(&bits_, "nNeutrals_FW_U");
975  if (quality_ == TIGHTLEPVETO) {
976  indexMUF_ = index_type(&bits_, "MUF");
977  indexMUF_TR_ = index_type(&bits_, "MUF_TR");
978  indexCEF_TR_ = index_type(&bits_, "CEF_TR");
979  }
980  }
982  }
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 224 of file PFJetIDSelectionFunctor.h.

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

Referenced by operator()().

224  {
227  version_ == RUN2ULPUPPI) {
228  if (jet.currentJECLevel() == "Uncorrected" || !jet.jecSetsAvailable())
229  return firstDataCuts(jet, ret, version_);
230  else
231  return firstDataCuts(jet.correctedJet("Uncorrected"), ret, version_);
232  } else {
233  return false;
234  }
235  }
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

Definition at line 242 of file PFJetIDSelectionFunctor.h.

References FIRSTDATA, firstDataCuts(), RUN2ULCHS, RUN2ULPUPPI, RUNIISTARTUP, SUMMER18, SUMMER18PUPPI, version_, WINTER16, WINTER17, and WINTER17PUPPI.

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

Definition at line 252 of file PFJetIDSelectionFunctor.h.

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

252  {
253  retInternal_.set(false);
254  operator()(jet, retInternal_);
256  return (bool)retInternal_;
257  }
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 991 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexCEF_TR_
private

Definition at line 999 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexCHF_
private

Definition at line 992 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexMUF_
private

Definition at line 989 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexMUF_TR_
private

Definition at line 998 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNCH_
private

Definition at line 993 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNCH_TR_
private

Definition at line 997 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNConstituents_
private

Definition at line 987 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNEF_
private

Definition at line 988 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNEF_EC_
private

Definition at line 1008 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNEF_EC_L_
private

Definition at line 1009 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNEF_EC_U_
private

Definition at line 1010 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNEF_FW_
private

Definition at line 1002 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNEF_TR_
private

Definition at line 996 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNHF_
private

Definition at line 990 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNHF_EC_
private

Definition at line 1007 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNHF_FW_
private

Definition at line 1001 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNHF_TR_
private

Definition at line 995 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNNeutrals_EC_
private

Definition at line 1011 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNNeutrals_FW_
private

Definition at line 1003 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNNeutrals_FW_L_
private

Definition at line 1004 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

index_type PFJetIDSelectionFunctor::indexNNeutrals_FW_U_
private

Definition at line 1005 of file PFJetIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initIndex().

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