Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:24:37

0001 #include <vector>
0002 #include <string>
0003 
0004 #include "FWCore/Utilities/interface/typelookup.h"
0005 #include "FWCore/Utilities/interface/Exception.h"
0006 
0007 #include "DataFormats/BTauReco/interface/BaseTagInfo.h"
0008 
0009 #include "RecoBTau/JetTagComputer/interface/JetTagComputer.h"
0010 
0011 float JetTagComputer::operator()(const reco::BaseTagInfo &info) const {
0012   std::vector<const reco::BaseTagInfo *> helper;
0013   helper.push_back(&info);
0014   return discriminator(TagInfoHelper(helper));
0015 }
0016 
0017 void JetTagComputer::uses(unsigned int id, const std::string &label) {
0018   if (m_setupDone)
0019     throw cms::Exception("InvalidState") << "JetTagComputer::uses called outside of "
0020                                             "constructor"
0021                                          << std::endl;
0022 
0023   if (id >= m_inputLabels.size())
0024     m_inputLabels.resize(id + 1);
0025 
0026   if (!m_inputLabels[id].empty())
0027     throw cms::Exception("InvalidIndex") << "JetTagComputer::uses called with duplicate "
0028                                             "or invalid index"
0029                                          << std::endl;
0030 
0031   m_inputLabels[id] = label;
0032 }
0033 
0034 float JetTagComputer::discriminator(const reco::BaseTagInfo &info) const {
0035   throw cms::Exception("VirtualMethodMissing") << "No virtual method implementation for "
0036                                                << "JetTagComputer::discriminator() defined." << std::endl;
0037 }
0038 
0039 float JetTagComputer::discriminator(const JetTagComputer::TagInfoHelper &info) const {
0040   return discriminator(info.getBase(0));
0041 }
0042 
0043 TYPELOOKUP_DATA_REG(JetTagComputer);