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
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
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");
0036 }
0037
0038 double PFTauDiscriminatorLogicalAndProducer::discriminate(const PFTauRef& pfTau) const {
0039
0040
0041
0042 return passResult_;
0043 }
0044
0045 void PFTauDiscriminatorLogicalAndProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0046
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);