CMS 3D CMS Logo

bJetSelector.cc
Go to the documentation of this file.
1 //
2 // Implementacion of b Jet Selector for PAT
3 // By J.E. Ramirez Jun 18,2008
4 //
7 
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++) {
21  }
22 }
23 
24 bool bJetSelector::IsbTag(const pat::Jet& JetCand, const std::string& operpoint, const std::string& tagger) const {
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 }
34 bool bJetSelector::IsbTag(const pat::Jet& JetCand, const std::string& operpoint) const {
35  return IsbTag(JetCand, operpoint, DefaultTg_);
36 }
37 bool bJetSelector::IsbTag(const pat::Jet& JetCand) const { return IsbTag(JetCand, DefaultOp_, DefaultTg_); }
float bDiscriminator(const std::string &theLabel) const
-— methods for accessing b-tagging info -—
std::vector< std::string > BTagdiscriminator_
Definition: bJetSelector.h:31
std::vector< double > discriminantCutsLoose_
Definition: bJetSelector.h:28
bJetSelector(const edm::ParameterSet &cfg)
Definition: bJetSelector.cc:8
std::map< std::string, std::map< std::string, double > > discCut
Definition: bJetSelector.h:27
bool IsbTag(const pat::Jet &JetCand, const std::string &operpoint, const std::string &tagger) const
Definition: bJetSelector.cc:24
std::vector< double > discriminantCutsMedium_
Definition: bJetSelector.h:29
std::string DefaultTg_
Definition: bJetSelector.h:33
Analysis-level calorimeter jet class.
Definition: Jet.h:77
std::vector< double > discriminantCutsTight_
Definition: bJetSelector.h:30
std::string DefaultOp_
Definition: bJetSelector.h:32