33 std::shared_ptr<reco::tau::RecoTauDiscriminantPlugin>
plugin;
46 typedef std::vector<edm::ParameterSet>
VPSet;
50 for(VPSet::const_iterator iDisc = discriminants.begin();
51 iDisc != discriminants.end(); ++iDisc) {
54 double defaultValue = (iDisc->exists(
"default")) ?
55 iDisc->getParameter<
double>(
"default") : 0.;
57 bool requestMultiple = iDisc->exists(
"indices");
60 std::vector<uint32_t> indices =
61 iDisc->getParameter<std::vector<uint32_t> >(
"indices");
62 for(std::vector<uint32_t>::const_iterator
index = indices.begin();
70 collectionName << name << *
index;
71 newDisc.
collName = collectionName.str();
74 newDisc.
plugin = std::unique_ptr<reco::tau::RecoTauDiscriminantPlugin>(
77 discriminators_.push_back(newDisc);
88 newDisc.
plugin = std::unique_ptr<reco::tau::RecoTauDiscriminantPlugin>(
91 discriminators_.push_back(newDisc);
95 for(
auto const&
disc : discriminators_) {
96 produces<PFTauDiscriminator>(
disc.collName);
106 for(
auto const&
disc : discriminators_) {
110 for(
size_t itau = 0; itau < pfTaus->size(); ++itau) {
113 std::vector<double>
result = (*
disc.plugin)(tauRef);
115 double selected_result =
disc.defaultValue;
116 if (result.size()-1 <
disc.index) {
117 selected_result = result[
disc.index];
119 output->setValue(itau, selected_result);
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
std::string discPluginName(const std::string &mvaName)
#define DEFINE_FWK_MODULE(type)
std::string const collectionName[nCollections]
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
T get(const Candidate &c)