4 #include <boost/foreach.hpp>
5 #include <boost/bind.hpp>
15 namespace reco {
namespace tau {
20 name_(name), eslabel_(eslabel), pluginOptions_(pluginOptions) {}
32 const MVAComputerContainer *container = handle.
product();
40 plugin.second->setup(evt, es);
46 typedef std::vector<PhysicsTools::Calibration::Variable> VarList;
52 if (std::strncmp(var.name.c_str(),
"__", 2) != 0) {
61 if (!options.
exists(
"name"))
70 if (options.
exists(
"plugin")) {
75 pluginName, options));
86 std::vector<double> pluginOutput = (
plugin->second)->
operator()(
tau);
90 std::ostringstream
error;
91 error <<
"A nan was detected in"
92 <<
" the tau MVA variable " <<
id <<
" returning zero instead!"
93 <<
" The PFTau: " << *tau << std::endl;
101 std::for_each(pluginOutput.begin(), pluginOutput.end(),
T getParameter(std::string const &) const
void setEvent(const edm::Event &evt, const edm::EventSetup &es)
auto_ptr< JetDefinition::Plugin > plugin
static PFTauRenderPlugin instance
void fillValues(const reco::PFTauRef &tau) const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
std::string discPluginName(const std::string &mvaName)
PhysicsTools::Variable::ValueList values_
void addParameter(std::string const &name, T const &value)
double operator()(const PFTauRef &tau) const
edm::ParameterSet pluginOptions_
const PhysicsTools::Variable::ValueList & discriminants(const PFTauRef &tau) const
Container::value_type value_type
RecoTauMVAHelper(const std::string &name, const std::string &eslabel, const edm::ParameterSet &pluginOptions)
void train(const PFTauRef &tau, bool target, double weight=1.0) const
T const * product() const
PhysicsTools::MVAComputerCache computer_
void loadDiscriminantPlugins(const PhysicsTools::Calibration::MVAComputer &computer)
T get(const Candidate &c)