![]() |
![]() |
#include <TagInfoMVACategorySelector.h>
Public Member Functions | |
int | findCategory (const reco::TaggingVariableList &taggingVariables) const |
const std::vector< std::string > & | getCategoryLabels () const |
TagInfoMVACategorySelector (const edm::ParameterSet ¶ms) | |
~TagInfoMVACategorySelector () | |
Private Attributes | |
std::vector< std::string > | categoryLabels |
reco::TaggingVariableName | categoryVariable |
Definition at line 11 of file TagInfoMVACategorySelector.h.
TagInfoMVACategorySelector::TagInfoMVACategorySelector | ( | const edm::ParameterSet & | params | ) |
Definition at line 14 of file TagInfoMVACategorySelector.cc.
References Exception, edm::ParameterSet::getParameter(), reco::getTaggingVariableName(), and reco::btau::lastTaggingVariable.
{ std::string variableName = params.getParameter<std::string>("categoryVariableName"); categoryVariable = getTaggingVariableName(variableName); if (categoryVariable >= btau::lastTaggingVariable) throw cms::Exception("TagInfoMVACategorySelector") << "No such tagging variable \"" << categoryVariable << "\"." << std::endl; categoryLabels = params.getParameter<std::vector<std::string> >( "calibrationRecords"); for(std::vector<std::string>::iterator iter = categoryLabels.begin(); iter != categoryLabels.end(); iter++) if (*iter == " " || *iter == "-" || *iter == "*") *iter = ""; }
TagInfoMVACategorySelector::~TagInfoMVACategorySelector | ( | ) |
Definition at line 34 of file TagInfoMVACategorySelector.cc.
{ }
int TagInfoMVACategorySelector::findCategory | ( | const reco::TaggingVariableList & | taggingVariables | ) | const |
Definition at line 38 of file TagInfoMVACategorySelector.cc.
References reco::TaggingVariableList::get(), and getHLTprescales::index.
{ int index = (int)taggingVariables.get(categoryVariable, -1); if (index < 0 || (unsigned int)index >= categoryLabels.size()) return -1; return index; }
const std::vector<std::string>& TagInfoMVACategorySelector::getCategoryLabels | ( | ) | const [inline] |
Definition at line 16 of file TagInfoMVACategorySelector.h.
References categoryLabels.
{ return categoryLabels; }
std::vector<std::string> TagInfoMVACategorySelector::categoryLabels [private] |
Definition at line 24 of file TagInfoMVACategorySelector.h.
Referenced by getCategoryLabels().
Definition at line 23 of file TagInfoMVACategorySelector.h.