40 typedef std::vector<ComputerAndCut>
CutList;
43 double discriminate(
const PFTauRef& thePFTau)
const override;
69 std::vector<edm::ParameterSet> decayModeMap = iConfig.
getParameter<std::vector<edm::ParameterSet> >(
"computers");
73 for(std::vector<edm::ParameterSet>::const_iterator iComputer = decayModeMap.begin();
74 iComputer != decayModeMap.end();
79 toInsert.
userCut = iComputer->getParameter<
double>(
"cut");
83 std::vector<int> associatedDecayModes = iComputer->getParameter<std::vector<int> >(
"decayModeIndices");
84 for(std::vector<int>::const_iterator iDecayMode = associatedDecayModes.begin();
85 iDecayMode != associatedDecayModes.end();
89 std::pair<DecayModeToCutMap::iterator, bool> insertResult =
computerMap_.insert(std::make_pair(*iDecayMode, computerJustAdded));
92 if(insertResult.second ==
false) {
93 throw cms::Exception(
"PFTauDecayModeCutMultiplexer::ctor") <<
"A tau decay mode: " << *iDecayMode <<
" has been mapped to two different MVA implementations, " 94 << insertResult.first->second->computerName <<
" and " << toInsert.
computerName 95 <<
". Please check the appropriate cfi file." << std::endl;
116 float valueToMultiplex = (*targetDiscriminant)[pfTau];
123 if (valueToMultiplex > iterToComputer->second->userCut)
T getParameter(std::string const &) const
double discriminate(const PFTauRef &thePFTau) const override
std::vector< ComputerAndCut > CutList
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
std::map< int, CutList::iterator > DecayModeToCutMap
DecayModeToCutMap computerMap_
edm::InputTag pfTauDecayModeIndexSrc_
edm::InputTag discriminantToMultiplex_
~PFTauDecayModeCutMultiplexer()
edm::EDGetTokenT< PFTauDiscriminator > discriminant_token
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