CMS 3D CMS Logo

Public Member Functions | Private Attributes

TagInfoMVACategorySelector Class Reference

#include <TagInfoMVACategorySelector.h>

List of all members.

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(), 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.

{
}

Member Function Documentation

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; }

Member Data Documentation

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.