CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
JetIDSelectionFunctor Class Reference

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

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

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

Public Types

enum  Quality_t {
  MINIMAL, LOOSE_AOD, LOOSE, TIGHT,
  N_QUALITY
}
 
enum  Version_t { CRAFT08, PURE09, DQM09, N_VERSIONS }
 
- Public Types inherited from Selector< pat::Jet >
typedef std::binary_function
< pat::Jet, pat::strbitset,
bool > 
base_type
 
typedef std::pair< index_type,
size_t > 
cut_flow_item
 
typedef std::vector
< cut_flow_item
cut_flow_map
 
typedef pat::Jet data_type
 
typedef std::map< index_type,
double > 
double_map
 
typedef pat::strbitset::index_type index_type
 
typedef std::map< index_type, int > int_map
 

Public Member Functions

unsigned int count_hits (const std::vector< CaloTowerPtr > &towers)
 
bool craft08Cuts (reco::Candidate::LorentzVector const &correctedP4, double emEnergyFraction, reco::JetID const &jetID, pat::strbitset &ret)
 
bool fwd09Cuts (reco::Candidate::LorentzVector const &rawP4, double emEnergyFraction, double etaWidth, double phiWidth, unsigned int nHit, reco::JetID const &jetID, pat::strbitset &ret)
 
void initialize (Version_t version, Quality_t quality)
 
 JetIDSelectionFunctor ()
 
 JetIDSelectionFunctor (edm::ParameterSet const &parameters)
 
 JetIDSelectionFunctor (Version_t version, Quality_t quality)
 
bool operator() (const pat::Jet &jet, pat::strbitset &ret)
 This provides the interface for base classes to select objects. More...
 
bool operator() (reco::Candidate::LorentzVector const &correctedP4, double emEnergyFraction, reco::JetID const &jetID, pat::strbitset &ret)
 
virtual bool operator() (reco::Candidate::LorentzVector const &correctedP4, double emEnergyFraction, reco::JetID const &jetID)
 accessor like previous, without the ret More...
 
bool operator() (reco::CaloJet const &jet, reco::JetID const &jetID, pat::strbitset &ret)
 
virtual bool operator() (reco::CaloJet const &jet, reco::JetID const &jetID)
 accessor like previous, without the ret More...
 
- Public Member Functions inherited from Selector< pat::Jet >
void clear (std::string const &s)
 Turn off a given selection cut. More...
 
void clear (index_type const &i)
 
bool considerCut (std::string const &s) const
 consider the cut at index "s" More...
 
bool considerCut (index_type const &i) const
 
int cut (index_type const &i, int val) const
 Access the int cut values at index "s". More...
 
double cut (index_type const &i, double val) const
 Access the double cut values at index "s". More...
 
int cut (std::string s, int val) const
 Access the int cut values at index "s". More...
 
double cut (std::string s, double val) const
 Access the double cut values at index "s". More...
 
pat::strbitset getBitTemplate () const
 Get an empty bitset with the proper names. More...
 
double getPasses (std::string const &s) const
 Return the number of passing cases. More...
 
double getPasses (index_type const &i) const
 
bool ignoreCut (std::string const &s) const
 ignore the cut at index "s" More...
 
bool ignoreCut (index_type const &i) const
 
virtual bool operator() (pat::Jetconst &t)
 This provides an alternative signature without the second ret. More...
 
virtual bool operator() (pat::Jetconst &t, edm::EventBase const &e, pat::strbitset &ret)
 This provides an alternative signature that includes extra information. More...
 
virtual bool operator() (pat::Jetconst &t, edm::EventBase const &e)
 This provides an alternative signature that includes extra information. More...
 
bool operator[] (std::string const &s) const
 
bool operator[] (index_type const &i) const
 
void passCut (pat::strbitset &ret, std::string const &s)
 Passing cuts. More...
 
void passCut (pat::strbitset &ret, index_type const &i)
 
void print (std::ostream &out) const
 Print the cut flow. More...
 
void printActiveCuts (std::ostream &out) const
 Print the cuts being considered. More...
 
virtual void push_back (std::string const &s)
 This is the registration of an individual cut string. More...
 
virtual void push_back (std::string const &s, int cut)
 This is the registration of an individual cut string, with an int cut value. More...
 
virtual void push_back (std::string const &s, double cut)
 This is the registration of an individual cut string, with a double cut value. More...
 
 Selector ()
 Constructor clears the bits. More...
 
void set (std::string const &s, bool val=true)
 Set a given selection cut, on or off. More...
 
void set (index_type const &i, bool val=true)
 
void set (std::string const &s, int cut, bool val=true)
 Set a given selection cut, on or off, and reset int cut value. More...
 
void set (index_type const &i, int cut, bool val=true)
 
void set (std::string const &s, double cut, bool val=true)
 Set a given selection cut, on or off, and reset int cut value. More...
 
void set (index_type const &i, double cut, bool val=true)
 
void setIgnored (pat::strbitset &ret)
 set ignored bits More...
 
void setIgnoredCuts (std::vector< std::string > const &bitsToIgnore)
 set the bits to ignore from a vector More...
 
virtual ~Selector ()
 

Private Attributes

index_type index_EF_EMF_
 
index_type index_EF_N90Hits_
 
index_type index_LOOSE_als_
 
index_type index_LOOSE_AOD_EMF_
 
index_type index_LOOSE_AOD_fHPD_
 
index_type index_LOOSE_AOD_N90Hits_
 
index_type index_LOOSE_EMF_
 
index_type index_LOOSE_fHPD_
 
index_type index_LOOSE_fls_
 
index_type index_LOOSE_foot_
 
index_type index_LOOSE_N90Hits_
 
index_type index_LOOSE_nHit_
 
index_type index_MINIMAL_EMF_
 
index_type index_TIGHT_als_
 
index_type index_TIGHT_EMF_
 
index_type index_TIGHT_fHPD_
 
index_type index_TIGHT_fls_
 
index_type index_TIGHT_foot_
 
index_type index_TIGHT_nHit_
 
index_type index_widths_
 
Quality_t quality_
 
Version_t version_
 

Additional Inherited Members

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

Detailed Description

Jet selector for pat::Jets and for CaloJets.

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

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

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

Definition at line 29 of file JetIDSelectionFunctor.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

JetIDSelectionFunctor::JetIDSelectionFunctor ( )
inline

Definition at line 36 of file JetIDSelectionFunctor.h.

36 {}
JetIDSelectionFunctor::JetIDSelectionFunctor ( edm::ParameterSet const &  parameters)
inline

Definition at line 39 of file JetIDSelectionFunctor.h.

References CRAFT08, DQM09, edm::hlt::Exception, edm::ParameterSet::getParameter(), initialize(), LOOSE, LOOSE_AOD, MINIMAL, N_QUALITY, PURE09, AlCaHLTBitMon_QueryRunRegistry::string, and TIGHT.

39  {
40  std::string versionStr = parameters.getParameter<std::string>("version");
41  std::string qualityStr = parameters.getParameter<std::string>("quality");
42  Quality_t quality = N_QUALITY;
43 
44  if ( qualityStr == "MINIMAL" ) quality = MINIMAL;
45  else if ( qualityStr == "LOOSE_AOD" ) quality = LOOSE_AOD;
46  else if ( qualityStr == "LOOSE" ) quality = LOOSE;
47  else if ( qualityStr == "TIGHT" ) quality = TIGHT;
48  else
49  throw cms::Exception("InvalidInput") << "Expect quality to be one of MINIMAL, LOOSE_AOD, LOOSE,TIGHT" << std::endl;
50 
51 
52  if ( versionStr == "CRAFT08" ) {
53  initialize( CRAFT08, quality );
54  }
55  else if ( versionStr == "PURE09" ) {
56  initialize( PURE09, quality );
57  }
58  else if ( versionStr == "DQM09" ) {
59  initialize( DQM09, quality );
60  }
61  else {
62  throw cms::Exception("InvalidInput") << "Expect version to be one of CRAFT08, PURE09, DQM09" << std::endl;
63  }
64  }
dictionary parameters
Definition: Parameters.py:2
void initialize(Version_t version, Quality_t quality)
JetIDSelectionFunctor::JetIDSelectionFunctor ( Version_t  version,
Quality_t  quality 
)
inline

Definition at line 66 of file JetIDSelectionFunctor.h.

References initialize().

66  {
67  initialize(version, quality);
68  }
void initialize(Version_t version, Quality_t quality)

Member Function Documentation

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

Definition at line 221 of file JetIDSelectionFunctor.h.

Referenced by operator()().

222  {
223  unsigned int nHit = 0;
224  for ( unsigned int iTower = 0; iTower < towers.size() ; ++iTower ) {
225  const std::vector<DetId>& cellIDs = towers[iTower]->constituents(); // cell == recHit
226  nHit += cellIDs.size();
227  }
228  return nHit;
229  }
bool JetIDSelectionFunctor::craft08Cuts ( reco::Candidate::LorentzVector const &  correctedP4,
double  emEnergyFraction,
reco::JetID const &  jetID,
pat::strbitset ret 
)
inline

Definition at line 315 of file JetIDSelectionFunctor.h.

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

Referenced by operator()().

319  {
320 
321  ret.set(false);
322 
323  // cache some variables
324  double abs_eta = TMath::Abs( correctedP4.eta() );
325  double corrPt = correctedP4.pt();
326  double emf = emEnergyFraction;
327 
328  if ( ignoreCut(index_MINIMAL_EMF_) || abs_eta > 2.6 || emf > 0.01 ) passCut( ret, index_MINIMAL_EMF_);
329 
330  if ( quality_ == LOOSE_AOD ) {
331  // loose fhpd cut from aod
332  if ( ignoreCut(index_LOOSE_AOD_fHPD_) || jetID.approximatefHPD < 0.98 ) passCut( ret, index_LOOSE_AOD_fHPD_);
333  // loose n90 hits cut
335 
336  // loose EMF Cut from aod
337  bool emf_loose = true;
338  if( abs_eta <= 2.6 ) { // HBHE
339  if( emEnergyFraction <= 0.01 ) emf_loose = false;
340  } else { // HF
341  if( emEnergyFraction <= -0.9 ) emf_loose = false;
342  if( corrPt > 80 && emEnergyFraction >= 1 ) emf_loose = false;
343  }
344  if ( ignoreCut(index_LOOSE_AOD_EMF_) || emf_loose ) passCut(ret, index_LOOSE_AOD_EMF_);
345 
346  }
347  else if ( quality_ == LOOSE || quality_ == TIGHT ) {
348  // loose fhpd cut
349  if ( ignoreCut(index_LOOSE_fHPD_) || jetID.fHPD < 0.98 ) passCut( ret, index_LOOSE_fHPD_);
350  // loose n90 hits cut
351  if ( ignoreCut(index_LOOSE_N90Hits_) || jetID.n90Hits > 1 ) passCut( ret, index_LOOSE_N90Hits_);
352 
353  // loose EMF Cut
354  bool emf_loose = true;
355  if( abs_eta <= 2.6 ) { // HBHE
356  if( emEnergyFraction <= 0.01 ) emf_loose = false;
357  } else { // HF
358  if( emEnergyFraction <= -0.9 ) emf_loose = false;
359  if( corrPt > 80 && emEnergyFraction >= 1 ) emf_loose = false;
360  }
361  if ( ignoreCut(index_LOOSE_EMF_) || emf_loose ) passCut(ret, index_LOOSE_EMF_);
362 
363  if ( quality_ == TIGHT ) {
364  // tight fhpd cut
365  bool tight_fhpd = true;
366  if ( corrPt >= 25 && jetID.fHPD >= 0.95 ) tight_fhpd = false; // this was supposed to use raw pT, see AN2009/087 :-(
367  if ( ignoreCut(index_TIGHT_fHPD_) || tight_fhpd ) passCut(ret, index_TIGHT_fHPD_);
368 
369  // tight emf cut
370  bool tight_emf = true;
371  if( abs_eta >= 1 && corrPt >= 80 && emEnergyFraction >= 1 ) tight_emf = false; // outside HB
372  if( abs_eta >= 2.6 ) { // outside HBHE
373  if( emEnergyFraction <= -0.3 ) tight_emf = false;
374  if( abs_eta < 3.25 ) { // HE-HF transition region
375  if( corrPt >= 50 && emEnergyFraction <= -0.2 ) tight_emf = false;
376  if( corrPt >= 80 && emEnergyFraction <= -0.1 ) tight_emf = false;
377  if( corrPt >= 340 && emEnergyFraction >= 0.95 ) tight_emf = false;
378  } else { // HF
379  if( emEnergyFraction >= 0.9 ) tight_emf = false;
380  if( corrPt >= 50 && emEnergyFraction <= -0.2 ) tight_emf = false;
381  if( corrPt >= 50 && emEnergyFraction >= 0.8 ) tight_emf = false;
382  if( corrPt >= 130 && emEnergyFraction <= -0.1 ) tight_emf = false;
383  if( corrPt >= 130 && emEnergyFraction >= 0.7 ) tight_emf = false;
384 
385  } // end if HF
386  }// end if outside HBHE
387  if ( ignoreCut(index_TIGHT_EMF_) || tight_emf ) passCut(ret, index_TIGHT_EMF_);
388  }// end if tight
389  }// end if loose or tight
390 
391  setIgnored( ret );
392 
393  return (bool)ret;
394  }
void setIgnored(pat::strbitset &ret)
set ignored bits
Definition: Selector.h:224
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
Definition: Selector.h:176
bool ignoreCut(std::string const &s) const
ignore the cut at index &quot;s&quot;
Definition: Selector.h:159
reco::Candidate::LorentzVector correctedP4(const T &rawMEt, const CorrMETData &correction)
strbitset & set(bool val=true)
set method of all bits
Definition: strbitset.h:144
bool JetIDSelectionFunctor::fwd09Cuts ( reco::Candidate::LorentzVector const &  rawP4,
double  emEnergyFraction,
double  etaWidth,
double  phiWidth,
unsigned int  nHit,
reco::JetID const &  jetID,
pat::strbitset ret 
)
inline

Definition at line 399 of file JetIDSelectionFunctor.h.

References reco::JetID::approximatefHPD, reco::JetID::fHFOOT, reco::JetID::fHPD, reco::JetID::fLong, reco::JetID::fLS, reco::JetID::fShort, reco::JetID::hitsInN90, Selector< pat::Jet >::ignoreCut(), index_EF_EMF_, index_EF_N90Hits_, index_LOOSE_als_, index_LOOSE_AOD_fHPD_, index_LOOSE_AOD_N90Hits_, index_LOOSE_fHPD_, index_LOOSE_fls_, index_LOOSE_foot_, index_LOOSE_N90Hits_, index_LOOSE_nHit_, index_MINIMAL_EMF_, index_TIGHT_als_, index_TIGHT_EMF_, index_TIGHT_fHPD_, index_TIGHT_fls_, index_TIGHT_foot_, index_TIGHT_nHit_, index_widths_, siStripFEDMonitor_P5_cff::Max, siStripFEDMonitor_P5_cff::Min, reco::JetID::n90Hits, Selector< pat::Jet >::passCut(), run_regression::ret, pat::strbitset::set(), and Selector< pat::Jet >::setIgnored().

Referenced by operator()().

403  {
404  ret.set(false);
405 
406  // cache some variables
407  double abs_eta = TMath::Abs( rawP4.eta() );
408  double rawPt = rawP4.pt();
409  double emf = emEnergyFraction;
410  double fhf = jetID.fLong + jetID.fShort;
411  double lnpt = ( rawPt > 0 ) ? TMath::Log( rawPt ) : -10;
412  double lnE = ( rawP4.energy() > 0 ) ? TMath::Log( rawP4.energy() ) : -10;
413 
414  bool HB = abs_eta < 1.0;
415  bool EF = 2.6 <= abs_eta && abs_eta < 3.4 && 0.1 <= fhf && fhf < 0.9;
416  bool HBHE = abs_eta < 2.6 || ( abs_eta < 3.4 && fhf < 0.1 );
417  bool HF = 3.4 <= abs_eta || ( 2.6 <= abs_eta && 0.9 <= fhf );
418  bool HFa = HF && abs_eta < 3.8;
419  bool HFb = HF && ! HFa;
420 
421  // HBHE cuts as in CRAFT08
422  // - but using raw pTs
423  // ========================
424 
425  if ( (!HBHE) || ignoreCut(index_MINIMAL_EMF_) || emf > 0.01 ) passCut( ret, index_MINIMAL_EMF_);
426 
427  // loose fhpd cut from AOD
428  if ( (!HBHE) || ignoreCut(index_LOOSE_AOD_fHPD_) || jetID.approximatefHPD < 0.98 ) passCut( ret, index_LOOSE_AOD_fHPD_);
429  // loose n90 hits cut from AOD
430  if ( (!HBHE) || ignoreCut(index_LOOSE_AOD_N90Hits_) || jetID.hitsInN90 > 1 ) passCut( ret, index_LOOSE_AOD_N90Hits_);
431 
432  // loose fhpd cut
433  if ( (!HBHE) || ignoreCut(index_LOOSE_fHPD_) || jetID.fHPD < 0.98 ) passCut( ret, index_LOOSE_fHPD_);
434  // loose n90 hits cut
435  if ( (!HBHE) || ignoreCut(index_LOOSE_N90Hits_) || jetID.n90Hits > 1 ) passCut( ret, index_LOOSE_N90Hits_);
436 
437  // tight fhpd cut
438  if ( (!HBHE) || ignoreCut(index_TIGHT_fHPD_) || rawPt < 25 || jetID.fHPD < 0.95 ) passCut(ret, index_TIGHT_fHPD_);
439 
440  // tight emf cut
441  if ( (!HBHE) || ignoreCut(index_TIGHT_EMF_) || HB || rawPt < 55 || emf < 1 ) passCut(ret, index_TIGHT_EMF_);
442 
443 
444  // EF - these cuts are only used in "tight", but there's no need for this test here.
445 
446  if( (!EF) || ignoreCut( index_EF_N90Hits_ )
447  || jetID.n90Hits > 1 + 1.5 * TMath::Max( 0., lnpt - 1.5 ) )
448  passCut( ret, index_EF_N90Hits_ );
449 
450  if( (!EF) || ignoreCut( index_EF_EMF_ )
451  || emf > TMath::Max( -0.9, -0.1 - 0.05 * TMath::Power( TMath::Max( 0., 5 - lnpt ), 2. ) ) )
452  passCut( ret, index_EF_EMF_ );
453 
454  // both EF and HF
455 
456  if( ( !( EF || HF ) ) || ignoreCut( index_TIGHT_fls_ )
457  || ( EF && jetID.fLS < TMath::Min( 0.8, 0.1 + 0.016 * TMath::Power( TMath::Max( 0., 6 - lnpt ), 2.5 ) ) )
458  || ( HFa && jetID.fLS < TMath::Min( 0.6, 0.05 + 0.045 * TMath::Power( TMath::Max( 0., 7.5 - lnE ), 2.2 ) ) )
459  || ( HFb && jetID.fLS < TMath::Min( 0.1, 0.05 + 0.07 * TMath::Power( TMath::Max( 0., 7.8 - lnE ), 2. ) ) ) )
460  passCut( ret, index_TIGHT_fls_ );
461 
462  if( ( !( EF || HF ) ) || ignoreCut( index_widths_ )
463  || ( 1E-10 < etaWidth && etaWidth < 0.12 &&
464  1E-10 < phiWidth && phiWidth < 0.12 ) )
465  passCut( ret, index_widths_ );
466 
467  // HF cuts
468 
469  if( (!HF) || ignoreCut( index_LOOSE_nHit_ )
470  || ( HFa && nHit > 1 + 2.4*( lnpt - 1. ) )
471  || ( HFb && nHit > 1 + 3.*( lnpt - 1. ) ) )
472  passCut( ret, index_LOOSE_nHit_ );
473 
474  if( (!HF) || ignoreCut( index_LOOSE_als_ )
475  || ( emf < 0.6 + 0.05 * TMath::Power( TMath::Max( 0., 9 - lnE ), 1.5 ) &&
476  emf > -0.2 - 0.041 * TMath::Power( TMath::Max( 0., 7.5 - lnE ), 2.2 ) ) )
477  passCut( ret, index_LOOSE_als_ );
478 
479  if( (!HF) || ignoreCut( index_LOOSE_fls_ )
480  || ( HFa && jetID.fLS < TMath::Min( 0.9, 0.1 + 0.05 * TMath::Power( TMath::Max( 0., 7.5 - lnE ), 2.2 ) ) )
481  || ( HFb && jetID.fLS < TMath::Min( 0.6, 0.1 + 0.065 * TMath::Power( TMath::Max( 0., 7.5 - lnE ), 2.2 ) ) ) )
482  passCut( ret, index_LOOSE_fls_ );
483 
484  if( (!HF) || ignoreCut( index_LOOSE_foot_ )
485  || jetID.fHFOOT < 0.9 )
486  passCut( ret, index_LOOSE_foot_ );
487 
488  if( (!HF) || ignoreCut( index_TIGHT_nHit_ )
489  || ( HFa && nHit > 1 + 2.7*( lnpt - 0.8 ) )
490  || ( HFb && nHit > 1 + 3.5*( lnpt - 0.8 ) ) )
491  passCut( ret, index_TIGHT_nHit_ );
492 
493  if( (!HF) || ignoreCut( index_TIGHT_als_ )
494  || ( emf < 0.5 + 0.057 * TMath::Power( TMath::Max( 0., 9 - lnE ), 1.5 ) &&
495  emf > TMath::Max( -0.6, -0.1 - 0.026 * TMath::Power( TMath::Max( 0., 8 - lnE ), 2.2 ) ) ) )
496  passCut( ret, index_TIGHT_als_ );
497 
498  if( (!HF) || ignoreCut( index_TIGHT_foot_ )
499  || jetID.fLS < 0.5 )
500  passCut( ret, index_TIGHT_foot_ );
501 
502  setIgnored( ret );
503 
504  return (bool)ret;
505  }
void setIgnored(pat::strbitset &ret)
set ignored bits
Definition: Selector.h:224
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
Definition: Selector.h:176
bool ignoreCut(std::string const &s) const
ignore the cut at index &quot;s&quot;
Definition: Selector.h:159
strbitset & set(bool val=true)
set method of all bits
Definition: strbitset.h:144
void JetIDSelectionFunctor::initialize ( Version_t  version,
Quality_t  quality 
)
inline

Definition at line 70 of file JetIDSelectionFunctor.h.

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

Referenced by JetIDSelectionFunctor().

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

This provides the interface for base classes to select objects.

Implements Selector< pat::Jet >.

Definition at line 234 of file JetIDSelectionFunctor.h.

References pat::Jet::correctedP4(), count_hits(), CRAFT08, craft08Cuts(), pat::Jet::currentJECLevel(), DQM09, pat::Jet::emEnergyFraction(), reco::Jet::etaetaMoment(), fwd09Cuts(), pat::Jet::getCaloConstituents(), pat::Jet::isCaloJet(), pat::Jet::isJPTJet(), pat::Jet::jetID(), reco::LeafCandidate::p4(), reco::Jet::phiphiMoment(), PURE09, run_regression::ret, and version_.

Referenced by operator()().

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

Definition at line 263 of file JetIDSelectionFunctor.h.

References CRAFT08, craft08Cuts(), and version_.

267  {
268  if ( version_ == CRAFT08 ) return craft08Cuts( correctedP4, emEnergyFraction, jetID, ret );
269  edm::LogWarning( "BadInput | NYI" )<<"Requested version ("<<version_
270  <<") is unknown or doesn't match the depreceated interface used";
271  return false;
272  }
bool craft08Cuts(reco::Candidate::LorentzVector const &correctedP4, double emEnergyFraction, reco::JetID const &jetID, pat::strbitset &ret)
reco::Candidate::LorentzVector correctedP4(const T &rawMEt, const CorrMETData &correction)
virtual bool JetIDSelectionFunctor::operator() ( reco::Candidate::LorentzVector const &  correctedP4,
double  emEnergyFraction,
reco::JetID const &  jetID 
)
inlinevirtual

accessor like previous, without the ret

Definition at line 274 of file JetIDSelectionFunctor.h.

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

277  {
278  retInternal_.set(false);
279  operator()(correctedP4,emEnergyFraction, jetID, retInternal_);
281  return (bool)retInternal_;
282  }
bool operator()(const pat::Jet &jet, pat::strbitset &ret)
This provides the interface for base classes to select objects.
void setIgnored(pat::strbitset &ret)
set ignored bits
Definition: Selector.h:224
pat::strbitset retInternal_
internal ret if users don&#39;t care about return bits
Definition: Selector.h:287
reco::Candidate::LorentzVector correctedP4(const T &rawMEt, const CorrMETData &correction)
strbitset & set(bool val=true)
set method of all bits
Definition: strbitset.h:144
bool JetIDSelectionFunctor::operator() ( reco::CaloJet const &  jet,
reco::JetID const &  jetID,
pat::strbitset ret 
)
inline

Definition at line 288 of file JetIDSelectionFunctor.h.

References count_hits(), CRAFT08, craft08Cuts(), DQM09, reco::CaloJet::emEnergyFraction(), reco::Jet::etaetaMoment(), fwd09Cuts(), reco::CaloJet::getCaloConstituents(), bTagSequences_cff::jetID, reco::LeafCandidate::p4(), reco::Jet::phiphiMoment(), PURE09, run_regression::ret, and version_.

291  {
292  if ( version_ == CRAFT08 ) return craft08Cuts( jet.p4(), jet.emEnergyFraction(), jetID, ret );
293  if ( version_ == PURE09 || version_ == DQM09 ) {
294  unsigned int nHit = count_hits( jet.getCaloConstituents() );
295  return fwd09Cuts( jet.p4(), jet.emEnergyFraction(), jet.etaetaMoment(), jet.phiphiMoment(), nHit,
296  jetID, ret );
297  }
298  edm::LogWarning( "BadInput | NYI" )<<"Requested version ("<<version_<<") is unknown";
299  return false;
300  }
unsigned int count_hits(const std::vector< CaloTowerPtr > &towers)
bool craft08Cuts(reco::Candidate::LorentzVector const &correctedP4, double emEnergyFraction, reco::JetID const &jetID, pat::strbitset &ret)
bool fwd09Cuts(reco::Candidate::LorentzVector const &rawP4, double emEnergyFraction, double etaWidth, double phiWidth, unsigned int nHit, reco::JetID const &jetID, pat::strbitset &ret)
virtual bool JetIDSelectionFunctor::operator() ( reco::CaloJet const &  jet,
reco::JetID const &  jetID 
)
inlinevirtual

accessor like previous, without the ret

Definition at line 303 of file JetIDSelectionFunctor.h.

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

305  {
306  retInternal_.set(false);
309  return (bool)retInternal_;
310  }
bool operator()(const pat::Jet &jet, pat::strbitset &ret)
This provides the interface for base classes to select objects.
void setIgnored(pat::strbitset &ret)
set ignored bits
Definition: Selector.h:224
pat::strbitset retInternal_
internal ret if users don&#39;t care about return bits
Definition: Selector.h:287
strbitset & set(bool val=true)
set method of all bits
Definition: strbitset.h:144

Member Data Documentation

index_type JetIDSelectionFunctor::index_EF_EMF_
private

Definition at line 536 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

index_type JetIDSelectionFunctor::index_EF_N90Hits_
private

Definition at line 535 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

index_type JetIDSelectionFunctor::index_LOOSE_als_
private

Definition at line 526 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

index_type JetIDSelectionFunctor::index_LOOSE_AOD_EMF_
private

Definition at line 516 of file JetIDSelectionFunctor.h.

Referenced by craft08Cuts(), and initialize().

index_type JetIDSelectionFunctor::index_LOOSE_AOD_fHPD_
private

Definition at line 514 of file JetIDSelectionFunctor.h.

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

index_type JetIDSelectionFunctor::index_LOOSE_AOD_N90Hits_
private

Definition at line 515 of file JetIDSelectionFunctor.h.

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

index_type JetIDSelectionFunctor::index_LOOSE_EMF_
private

Definition at line 520 of file JetIDSelectionFunctor.h.

Referenced by craft08Cuts(), and initialize().

index_type JetIDSelectionFunctor::index_LOOSE_fHPD_
private

Definition at line 518 of file JetIDSelectionFunctor.h.

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

index_type JetIDSelectionFunctor::index_LOOSE_fls_
private

Definition at line 527 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

index_type JetIDSelectionFunctor::index_LOOSE_foot_
private

Definition at line 528 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

index_type JetIDSelectionFunctor::index_LOOSE_N90Hits_
private

Definition at line 519 of file JetIDSelectionFunctor.h.

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

index_type JetIDSelectionFunctor::index_LOOSE_nHit_
private

Definition at line 525 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

index_type JetIDSelectionFunctor::index_MINIMAL_EMF_
private

Definition at line 512 of file JetIDSelectionFunctor.h.

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

index_type JetIDSelectionFunctor::index_TIGHT_als_
private

Definition at line 531 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

index_type JetIDSelectionFunctor::index_TIGHT_EMF_
private

Definition at line 523 of file JetIDSelectionFunctor.h.

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

index_type JetIDSelectionFunctor::index_TIGHT_fHPD_
private

Definition at line 522 of file JetIDSelectionFunctor.h.

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

index_type JetIDSelectionFunctor::index_TIGHT_fls_
private

Definition at line 532 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

index_type JetIDSelectionFunctor::index_TIGHT_foot_
private

Definition at line 533 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

index_type JetIDSelectionFunctor::index_TIGHT_nHit_
private

Definition at line 530 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

index_type JetIDSelectionFunctor::index_widths_
private

Definition at line 534 of file JetIDSelectionFunctor.h.

Referenced by fwd09Cuts(), and initialize().

Quality_t JetIDSelectionFunctor::quality_
private

Definition at line 510 of file JetIDSelectionFunctor.h.

Referenced by craft08Cuts(), and initialize().

Version_t JetIDSelectionFunctor::version_
private

Definition at line 509 of file JetIDSelectionFunctor.h.

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