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
TagInfoMVACategorySelector Class Reference

#include <TagInfoMVACategorySelector.h>

Public Member Functions

int findCategory (const reco::TaggingVariableList &taggingVariables) const
 
const std::vector< std::string > & getCategoryLabels () const
 
 TagInfoMVACategorySelector (const edm::ParameterSet &params)
 
 ~TagInfoMVACategorySelector ()
 

Private Attributes

std::vector< std::string > categoryLabels
 
reco::TaggingVariableName categoryVariable
 

Detailed Description

Definition at line 11 of file TagInfoMVACategorySelector.h.

Constructor & Destructor Documentation

TagInfoMVACategorySelector::TagInfoMVACategorySelector ( const edm::ParameterSet params)

Definition at line 14 of file TagInfoMVACategorySelector.cc.

References Exception, edm::ParameterSet::getParameter(), reco::getTaggingVariableName(), reco::btau::lastTaggingVariable, and AlCaHLTBitMon_QueryRunRegistry::string.

16 {
17  std::string variableName =
18  params.getParameter<std::string>("categoryVariableName");
19 
21  if (categoryVariable >= btau::lastTaggingVariable)
22  throw cms::Exception("TagInfoMVACategorySelector")
23  << "No such tagging variable \""
24  << categoryVariable << "\"." << std::endl;
25 
26  categoryLabels = params.getParameter<std::vector<std::string> >(
27  "calibrationRecords");
28  for(std::vector<std::string>::iterator iter = categoryLabels.begin();
29  iter != categoryLabels.end(); iter++)
30  if (*iter == " " || *iter == "-" || *iter == "*")
31  *iter = "";
32 }
T getParameter(std::string const &) const
reco::TaggingVariableName categoryVariable
std::vector< std::string > categoryLabels
TaggingVariableName getTaggingVariableName(const std::string &name)
TagInfoMVACategorySelector::~TagInfoMVACategorySelector ( )

Definition at line 34 of file TagInfoMVACategorySelector.cc.

35 {
36 }

Member Function Documentation

int TagInfoMVACategorySelector::findCategory ( const reco::TaggingVariableList taggingVariables) const

Definition at line 38 of file TagInfoMVACategorySelector.cc.

References reco::TaggingVariableList::get(), and cmsHarvester::index.

40 {
41  int index = (int)taggingVariables.get(categoryVariable, -1);
42 
43  if (index < 0 || (unsigned int)index >= categoryLabels.size())
44  return -1;
45 
46  return index;
47 }
reco::TaggingVariableName categoryVariable
std::vector< std::string > categoryLabels
TaggingValue get(TaggingVariableName tag) const
const std::vector<std::string>& TagInfoMVACategorySelector::getCategoryLabels ( ) const
inline

Definition at line 16 of file TagInfoMVACategorySelector.h.

References categoryLabels.

17  { return categoryLabels; }
std::vector< std::string > categoryLabels

Member Data Documentation

std::vector<std::string> TagInfoMVACategorySelector::categoryLabels
private

Definition at line 24 of file TagInfoMVACategorySelector.h.

Referenced by getCategoryLabels().

reco::TaggingVariableName TagInfoMVACategorySelector::categoryVariable
private

Definition at line 23 of file TagInfoMVACategorySelector.h.