Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:37:55

0001 #include "RecoTauTag/RecoTau/interface/TauDiscriminationProducerBase.h"
0002 #include <FWCore/ParameterSet/interface/ConfigurationDescriptions.h>
0003 #include <FWCore/ParameterSet/interface/ParameterSetDescription.h>
0004 
0005 /* 
0006  * class PFRecoTauDiscriminatioLogicalAndProducer
0007  *
0008  * Applies a boolean operator (AND or OR) to a set 
0009  * of PFTauDiscriminators.  Note that the set of PFTauDiscriminators
0010  * is accessed/combined in the base class (the Prediscriminants).
0011  *
0012  * This class merely exposes this behavior directly by 
0013  * returning true for all taus that pass the prediscriminants
0014  *
0015  * revised : Mon Aug 31 12:59:50 PDT 2009
0016  * Authors : Michele Pioppi, Evan Friis (UC Davis)
0017  */
0018 
0019 using namespace reco;
0020 
0021 class PFTauDiscriminatorLogicalAndProducer : public PFTauDiscriminationProducerBase {
0022 public:
0023   explicit PFTauDiscriminatorLogicalAndProducer(const edm::ParameterSet&);
0024   ~PFTauDiscriminatorLogicalAndProducer() override {}
0025   double discriminate(const PFTauRef& pfTau) const override;
0026   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0027 
0028 private:
0029   double passResult_;
0030 };
0031 
0032 PFTauDiscriminatorLogicalAndProducer::PFTauDiscriminatorLogicalAndProducer(const edm::ParameterSet& iConfig)
0033     : PFTauDiscriminationProducerBase(iConfig) {
0034   passResult_ = iConfig.getParameter<double>("PassValue");
0035   prediscriminantFailValue_ = iConfig.getParameter<double>("FailValue");  //defined in base class
0036 }
0037 
0038 double PFTauDiscriminatorLogicalAndProducer::discriminate(const PFTauRef& pfTau) const {
0039   // if this function is called on a tau, it is has passed (in the base class)
0040   // the set of prediscriminants, using the prescribed boolean operation.  thus
0041   // we only need to return TRUE
0042   return passResult_;
0043 }
0044 
0045 void PFTauDiscriminatorLogicalAndProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0046   // PFTauDiscriminatorLogicalAndProducer
0047   edm::ParameterSetDescription desc;
0048 
0049   {
0050     edm::ParameterSetDescription psd0;
0051     psd0.add<std::string>("BooleanOperator", "and");
0052     {
0053       edm::ParameterSetDescription psd1;
0054       psd1.add<double>("cut", 0.5);
0055       psd1.add<edm::InputTag>("Producer", edm::InputTag("pfRecoTauDiscriminationAgainstElectron"));
0056       psd0.add<edm::ParameterSetDescription>("discr2", psd1);
0057     }
0058     {
0059       edm::ParameterSetDescription psd1;
0060       psd1.add<double>("cut", 0.5);
0061       psd1.add<edm::InputTag>("Producer", edm::InputTag("pfRecoTauDiscriminationByIsolation"));
0062       psd0.add<edm::ParameterSetDescription>("discr1", psd1);
0063     }
0064     desc.add<edm::ParameterSetDescription>("Prediscriminants", psd0);
0065   }
0066 
0067   desc.add<double>("PassValue", 1.0);
0068   desc.add<double>("FailValue", 0.0);
0069   desc.add<edm::InputTag>("PFTauProducer", edm::InputTag("pfRecoTauProducer"));
0070   descriptions.add("PFTauDiscriminatorLogicalAndProducer", desc);
0071 }
0072 
0073 DEFINE_FWK_MODULE(PFTauDiscriminatorLogicalAndProducer);