CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RecoTauRandomCleanerPlugin.cc
Go to the documentation of this file.
1 /*
2  * RecoTauRandomCleanerPlugin
3  *
4  * Author: Evan K. Friis, UC Davis
5  *
6  * A reco tau cleaner plugin that selects a *random* PFTau.
7  *
8  */
9 
10 #include <boost/functional/hash.hpp>
12 
13 
14 namespace reco { namespace tau {
15 
17  public:
20  // Get discriminant value for a given tau Ref
21  double operator()(const reco::PFTauRef&) const override;
22  private:
23  unsigned int seed_;
24 };
25 
28  seed_ = pset.exists("seed") ? pset.getParameter<unsigned int>("seed") : 1234;
29 }
30 
32  size_t output = seed_;
33  boost::hash_combine(output, tau->pt());
34  boost::hash_combine(output, tau->eta());
35  return output;
36 }
37 
38 }} // end namespace reco::tautools
39 
40 // Register our plugin
44  "RecoTauRandomCleanerPlugin");
T getParameter(std::string const &) const
bool exists(std::string const &parameterName) const
checks if a parameter exists
RecoTauRandomCleanerPlugin(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
def move
Definition: eostools.py:510
double operator()(const reco::PFTauRef &) const override
#define DEFINE_EDM_PLUGIN(factory, type, name)