43 typedef std::vector<ComputerAndCut>
CutList;
46 double discriminate(
const PFTauRef& thePFTau)
const override;
73 std::vector<edm::ParameterSet> decayModeMap = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"computers");
77 for(std::vector<edm::ParameterSet>::const_iterator iComputer = decayModeMap.begin();
78 iComputer != decayModeMap.end();
83 toInsert.
userCut = iComputer->getParameter<
double>(
"cut");
87 std::vector<int> associatedDecayModes = iComputer->getParameter<std::vector<int> >(
"decayModeIndices");
88 for(std::vector<int>::const_iterator iDecayMode = associatedDecayModes.begin();
89 iDecayMode != associatedDecayModes.end();
93 std::pair<DecayModeToCutMap::iterator, bool> insertResult =
computerMap_.insert(std::make_pair(*iDecayMode, computerJustAdded));
96 if(insertResult.second ==
false) {
97 throw cms::Exception(
"PFTauDecayModeCutMultiplexer::ctor") <<
"A tau decay mode: " << *iDecayMode <<
" has been mapped to two different MVA implementations, " 98 << insertResult.first->second->computerName <<
" and " << toInsert.
computerName 99 <<
". Please check the appropriate cfi file." << std::endl;
120 float valueToMultiplex = (*targetDiscriminant)[pfTau];
127 if (valueToMultiplex > iterToComputer->second->userCut)
147 vpsd_computers.add<
double>(
"cut");
148 vpsd_computers.add<std::vector<int> >(
"decayModeIndices");
152 desc.
addVPSet(
"computers", vpsd_computers);
156 descriptions.
add(
"pfTauDecayModeCutMultiplexer", desc);
T getParameter(std::string const &) const
double discriminate(const PFTauRef &thePFTau) const override
std::vector< ComputerAndCut > CutList
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::map< int, CutList::iterator > DecayModeToCutMap
DecayModeToCutMap computerMap_
#define DEFINE_FWK_MODULE(type)
static void fillProducerDescriptions(edm::ParameterSetDescription &desc)
~PFTauDecayModeCutMultiplexer() override
edm::InputTag pfTauDecayModeIndexSrc_
edm::InputTag discriminantToMultiplex_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< PFTauDiscriminator > discriminant_token
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< PFTauDiscriminator > pfTauDecayModeIndex_token
edm::Handle< PFTauDiscriminator > pfTauDecayModeIndices
PFTauDecayModeCutMultiplexer(const edm::ParameterSet &)
void beginEvent(const edm::Event &event, const edm::EventSetup &eventSetup) override
edm::Handle< PFTauDiscriminator > targetDiscriminant