CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/RecoTauTag/TauTagTools/plugins/RecoTauRandomDiscriminant.cc

Go to the documentation of this file.
00001 /*
00002  * Produce a tau discriminator that produces a random discriminant output,
00003  * useful for testing.
00004  *
00005  * Author: Evan Friis, UC Davis
00006  *
00007  */
00008 
00009 #include "RecoTauTag/RecoTau/interface/TauDiscriminationProducerBase.h"
00010 #include "TRandom3.h"
00011 
00012 class PFTauRandomDiscriminator : public PFTauDiscriminationProducerBase {
00013   public:
00014     PFTauRandomDiscriminator(const edm::ParameterSet& pset):
00015       PFTauDiscriminationProducerBase(pset) {
00016         passRate_ = pset.getParameter<double>("passRate");
00017       }
00018 
00019     double discriminate(const reco::PFTauRef& tau) {
00020       return randy_.Rndm() < passRate_;
00021     }
00022   private:
00023     TRandom3 randy_;
00024     double passRate_;
00025 };
00026 
00027 DEFINE_FWK_MODULE(PFTauRandomDiscriminator);