43 typedef std::vector<ComputerAndCut>
CutList;
46 double discriminate(
const PFTauRef& thePFTau)
const override;
76 std::vector<edm::ParameterSet> decayModeMap = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"computers");
80 for (std::vector<edm::ParameterSet>::const_iterator iComputer = decayModeMap.begin(); iComputer != decayModeMap.end();
84 toInsert.
userCut = iComputer->getParameter<
double>(
"cut");
85 CutList::iterator computerJustAdded =
89 std::vector<int> associatedDecayModes = iComputer->getParameter<std::vector<int> >(
"decayModeIndices");
90 for (std::vector<int>::const_iterator iDecayMode = associatedDecayModes.begin();
91 iDecayMode != associatedDecayModes.end();
94 std::pair<DecayModeToCutMap::iterator, bool> insertResult =
95 computerMap_.insert(std::make_pair(*iDecayMode, computerJustAdded));
98 if (insertResult.second ==
false) {
100 <<
"A tau decay mode: " << *iDecayMode <<
" has been mapped to two different MVA implementations, "
101 << insertResult.first->second->computerName <<
" and " << toInsert.
computerName
102 <<
". Please check the appropriate cfi file." << std::endl;
119 float valueToMultiplex = (*targetDiscriminant)[pfTau];
126 if (valueToMultiplex > iterToComputer->second->userCut)
145 vpsd_computers.add<
double>(
"cut");
146 vpsd_computers.add<std::vector<int> >(
"decayModeIndices");
150 desc.
addVPSet(
"computers", vpsd_computers);
154 descriptions.
add(
"pfTauDecayModeCutMultiplexer", desc);
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
#define DEFINE_FWK_MODULE(type)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::map< int, CutList::iterator > DecayModeToCutMap
double discriminate(const PFTauRef &thePFTau) const override
DecayModeToCutMap computerMap_
~PFTauDecayModeCutMultiplexer() override
edm::InputTag pfTauDecayModeIndexSrc_
static void fillProducerDescriptions(edm::ParameterSetDescription &desc)
edm::InputTag discriminantToMultiplex_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< PFTauDiscriminator > discriminant_token
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
T getParameter(std::string const &) const
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