CMS 3D CMS Logo

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

#include <bJetSelector.h>

Public Member Functions

 bJetSelector (const edm::ParameterSet &cfg)
 
bool IsbTag (const pat::Jet &JetCand, const std::string &operpoint, const std::string &tagger) const
 
bool IsbTag (const pat::Jet &JetCand, const std::string &operpoint) const
 
bool IsbTag (const pat::Jet &JetCand) const
 

Private Attributes

std::vector< std::string > BTagdiscriminator_
 
std::string DefaultOp_
 
std::string DefaultTg_
 
std::map< std::string,
std::map< std::string, double > > 
discCut
 
std::vector< double > discriminantCutsLoose_
 
std::vector< double > discriminantCutsMedium_
 
std::vector< double > discriminantCutsTight_
 

Detailed Description

Definition at line 19 of file bJetSelector.h.

Constructor & Destructor Documentation

bJetSelector::bJetSelector ( const edm::ParameterSet cfg)

Definition at line 8 of file bJetSelector.cc.

References BTagdiscriminator_, discCut, discriminantCutsLoose_, discriminantCutsMedium_, discriminantCutsTight_, and mps_fire::i.

9  : discriminantCutsLoose_(cfg.getParameter<std::vector<double> >("discCutLoose")),
10  discriminantCutsMedium_(cfg.getParameter<std::vector<double> >("discCutMedium")),
11  discriminantCutsTight_(cfg.getParameter<std::vector<double> >("discCutTight")),
12  BTagdiscriminator_(cfg.getParameter<std::vector<std::string> >("bdiscriminators")),
13  DefaultOp_(cfg.getParameter<std::string>("DefaultOp")),
14  DefaultTg_(cfg.getParameter<std::string>("DefaultBdisc"))
15 
16 {
17  for (unsigned int i = 0; i < BTagdiscriminator_.size(); i++) {
19  discCut["Medium"][BTagdiscriminator_[i]] = discriminantCutsMedium_[i];
20  discCut["Tight"][BTagdiscriminator_[i]] = discriminantCutsTight_[i];
21  }
22 }
std::vector< std::string > BTagdiscriminator_
Definition: bJetSelector.h:31
std::vector< double > discriminantCutsLoose_
Definition: bJetSelector.h:28
std::map< std::string, std::map< std::string, double > > discCut
Definition: bJetSelector.h:27
std::vector< double > discriminantCutsMedium_
Definition: bJetSelector.h:29
std::string DefaultTg_
Definition: bJetSelector.h:33
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< double > discriminantCutsTight_
Definition: bJetSelector.h:30
std::string DefaultOp_
Definition: bJetSelector.h:32

Member Function Documentation

bool bJetSelector::IsbTag ( const pat::Jet JetCand,
const std::string &  operpoint,
const std::string &  tagger 
) const

Definition at line 24 of file bJetSelector.cc.

References pat::Jet::bDiscriminator(), and discCut.

Referenced by PatBTagCommonHistos::Fill(), and IsbTag().

24  {
25  std::map<std::string, std::map<std::string, double> >::const_iterator ioperpoint = discCut.find(operpoint);
26  if (ioperpoint == discCut.end())
27  throw cms::Exception("UnknownOperatingPoint") << "Unknown or undefined operative point" << std::endl;
28  std::map<std::string, double>::const_iterator itagger = ioperpoint->second.find(tagger);
29  if (itagger == ioperpoint->second.end())
30  throw cms::Exception("UnknownTagger") << "Unknown or undefined tagger" << std::endl;
31 
32  return JetCand.bDiscriminator(tagger) > itagger->second;
33 }
float bDiscriminator(const std::string &theLabel) const
-— methods for accessing b-tagging info -—
std::map< std::string, std::map< std::string, double > > discCut
Definition: bJetSelector.h:27
bool bJetSelector::IsbTag ( const pat::Jet JetCand,
const std::string &  operpoint 
) const

Definition at line 34 of file bJetSelector.cc.

References DefaultTg_, and IsbTag().

34  {
35  return IsbTag(JetCand, operpoint, DefaultTg_);
36 }
bool IsbTag(const pat::Jet &JetCand, const std::string &operpoint, const std::string &tagger) const
Definition: bJetSelector.cc:24
std::string DefaultTg_
Definition: bJetSelector.h:33
bool bJetSelector::IsbTag ( const pat::Jet JetCand) const

Definition at line 37 of file bJetSelector.cc.

References DefaultOp_, DefaultTg_, and IsbTag().

37 { return IsbTag(JetCand, DefaultOp_, DefaultTg_); }
bool IsbTag(const pat::Jet &JetCand, const std::string &operpoint, const std::string &tagger) const
Definition: bJetSelector.cc:24
std::string DefaultTg_
Definition: bJetSelector.h:33
std::string DefaultOp_
Definition: bJetSelector.h:32

Member Data Documentation

std::vector<std::string> bJetSelector::BTagdiscriminator_
private

Definition at line 31 of file bJetSelector.h.

Referenced by bJetSelector().

std::string bJetSelector::DefaultOp_
private

Definition at line 32 of file bJetSelector.h.

Referenced by IsbTag().

std::string bJetSelector::DefaultTg_
private

Definition at line 33 of file bJetSelector.h.

Referenced by IsbTag().

std::map<std::string, std::map<std::string, double> > bJetSelector::discCut
private

Definition at line 27 of file bJetSelector.h.

Referenced by bJetSelector(), and IsbTag().

std::vector<double> bJetSelector::discriminantCutsLoose_
private

Definition at line 28 of file bJetSelector.h.

Referenced by bJetSelector().

std::vector<double> bJetSelector::discriminantCutsMedium_
private

Definition at line 29 of file bJetSelector.h.

Referenced by bJetSelector().

std::vector<double> bJetSelector::discriminantCutsTight_
private

Definition at line 30 of file bJetSelector.h.

Referenced by bJetSelector().