CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 i.

8  :
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 
18  for (unsigned int i=0; i<BTagdiscriminator_.size(); i++){
20  discCut["Medium"][BTagdiscriminator_[i]] = discriminantCutsMedium_[i];
21  discCut["Tight"][BTagdiscriminator_[i]] = discriminantCutsTight_[i];
22  }
23 }
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
std::vector< std::string > BTagdiscriminator_
Definition: bJetSelector.h:35
std::vector< double > discriminantCutsLoose_
Definition: bJetSelector.h:32
std::vector< double > discriminantCutsMedium_
Definition: bJetSelector.h:33
std::string DefaultTg_
Definition: bJetSelector.h:37
std::map< std::string, std::map< std::string, double > > discCut
Definition: bJetSelector.h:31
std::vector< double > discriminantCutsTight_
Definition: bJetSelector.h:34
std::string DefaultOp_
Definition: bJetSelector.h:36

Member Function Documentation

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

Definition at line 26 of file bJetSelector.cc.

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

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

28  {
29 
30  std::map<std::string,std::map<std::string,double> >::const_iterator ioperpoint = discCut.find(operpoint);
31  if ( ioperpoint == discCut.end() ) throw cms::Exception("UnknownOperatingPoint") << "Unknown or undefined operative point" << std::endl;
32  std::map<std::string,double>::const_iterator itagger = ioperpoint->second.find(tagger);
33  if ( itagger == ioperpoint->second.end() ) throw cms::Exception("UnknownTagger") << "Unknown or undefined tagger" << std::endl;
34 
35  return JetCand.bDiscriminator(tagger) > itagger->second;
36 }
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:31
bool bJetSelector::IsbTag ( const pat::Jet JetCand,
const std::string &  operpoint 
) const

Definition at line 38 of file bJetSelector.cc.

References DefaultTg_, and IsbTag().

39  {
40 
41 
42  return IsbTag(JetCand,operpoint,DefaultTg_);
43 }
bool IsbTag(const pat::Jet &JetCand, const std::string &operpoint, const std::string &tagger) const
Definition: bJetSelector.cc:26
std::string DefaultTg_
Definition: bJetSelector.h:37
bool bJetSelector::IsbTag ( const pat::Jet JetCand) const

Definition at line 45 of file bJetSelector.cc.

References DefaultOp_, DefaultTg_, and IsbTag().

45  {
46  return IsbTag(JetCand,DefaultOp_,DefaultTg_);
47 }
bool IsbTag(const pat::Jet &JetCand, const std::string &operpoint, const std::string &tagger) const
Definition: bJetSelector.cc:26
std::string DefaultTg_
Definition: bJetSelector.h:37
std::string DefaultOp_
Definition: bJetSelector.h:36

Member Data Documentation

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

Definition at line 35 of file bJetSelector.h.

Referenced by bJetSelector().

std::string bJetSelector::DefaultOp_
private

Definition at line 36 of file bJetSelector.h.

Referenced by IsbTag().

std::string bJetSelector::DefaultTg_
private

Definition at line 37 of file bJetSelector.h.

Referenced by IsbTag().

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

Definition at line 31 of file bJetSelector.h.

Referenced by bJetSelector(), and IsbTag().

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

Definition at line 32 of file bJetSelector.h.

Referenced by bJetSelector().

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

Definition at line 33 of file bJetSelector.h.

Referenced by bJetSelector().

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

Definition at line 34 of file bJetSelector.h.

Referenced by bJetSelector().