test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RecoTauRandomDiscriminant.cc
Go to the documentation of this file.
1 /*
2  * Produce a tau discriminator that produces a random discriminant output,
3  * useful for testing.
4  *
5  * Author: Evan Friis, UC Davis
6  *
7  */
8 
10 #include "TRandom3.h"
11 
12 namespace {
13 class PFTauRandomDiscriminator final : public PFTauDiscriminationProducerBase {
14  public:
15  PFTauRandomDiscriminator(const edm::ParameterSet& pset):
17  passRate_ = pset.getParameter<double>("passRate");
18  }
19 
20  double discriminate(const reco::PFTauRef& tau) const override {
21  return randy_.Rndm() < passRate_;
22  }
23  private:
24  mutable TRandom3 randy_;
25  double passRate_;
26 };
27 }
28 DEFINE_FWK_MODULE(PFTauRandomDiscriminator);
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
virtual double discriminate(const TauRef &tau) const =0