CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
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 }
24 
25 bool
27  const std::string& operpoint,
28  const std::string& tagger) const {
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 }
37 bool
39  const std::string& operpoint) const {
40 
41 
42  return IsbTag(JetCand,operpoint,DefaultTg_);
43 }
44 bool
45 bJetSelector::IsbTag(const pat::Jet& JetCand) const{
46  return IsbTag(JetCand,DefaultOp_,DefaultTg_);
47 }
48 
49 
int i
Definition: DBlmapReader.cc:9
bool IsbTag(const pat::Jet &JetCand, const std::string &operpoint, const std::string &tagger) const
Definition: bJetSelector.cc:26
std::vector< std::string > BTagdiscriminator_
Definition: bJetSelector.h:35
std::vector< double > discriminantCutsLoose_
Definition: bJetSelector.h:32
bJetSelector(const edm::ParameterSet &cfg)
Definition: bJetSelector.cc:8
float bDiscriminator(const std::string &theLabel) const
-— methods for accessing b-tagging info -—
Definition: Jet.cc:339
std::vector< double > discriminantCutsMedium_
Definition: bJetSelector.h:33
std::string DefaultTg_
Definition: bJetSelector.h:37
Analysis-level calorimeter jet class.
Definition: Jet.h:73
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