CMS 3D CMS Logo

PFTauDiscriminatorLogicalAndProducer.cc
Go to the documentation of this file.
4 
5 /*
6  * class PFRecoTauDiscriminatioLogicalAndProducer
7  *
8  * Applies a boolean operator (AND or OR) to a set
9  * of PFTauDiscriminators. Note that the set of PFTauDiscriminators
10  * is accessed/combined in the base class (the Prediscriminants).
11  *
12  * This class merely exposes this behavior directly by
13  * returning true for all taus that pass the prediscriminants
14  *
15  * revised : Mon Aug 31 12:59:50 PDT 2009
16  * Authors : Michele Pioppi, Evan Friis (UC Davis)
17  */
18 
19 using namespace reco;
20 
22 public:
25  double discriminate(const PFTauRef& pfTau) const override;
26  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
27 
28 private:
29  double passResult_;
30 };
31 
34  passResult_ = iConfig.getParameter<double>("PassValue");
35  prediscriminantFailValue_ = iConfig.getParameter<double>("FailValue"); //defined in base class
36 }
37 
39  // if this function is called on a tau, it is has passed (in the base class)
40  // the set of prediscriminants, using the prescribed boolean operation. thus
41  // we only need to return TRUE
42  return passResult_;
43 }
44 
46  // PFTauDiscriminatorLogicalAndProducer
48 
49  {
51  psd0.add<std::string>("BooleanOperator", "and");
52  {
54  psd1.add<double>("cut", 0.5);
55  psd1.add<edm::InputTag>("Producer", edm::InputTag("pfRecoTauDiscriminationAgainstElectron"));
56  psd0.add<edm::ParameterSetDescription>("discr2", psd1);
57  }
58  {
60  psd1.add<double>("cut", 0.5);
61  psd1.add<edm::InputTag>("Producer", edm::InputTag("pfRecoTauDiscriminationByIsolation"));
62  psd0.add<edm::ParameterSetDescription>("discr1", psd1);
63  }
64  desc.add<edm::ParameterSetDescription>("Prediscriminants", psd0);
65  }
66 
67  desc.add<double>("PassValue", 1.0);
68  desc.add<double>("FailValue", 0.0);
69  desc.add<edm::InputTag>("PFTauProducer", edm::InputTag("pfRecoTauProducer"));
70  descriptions.add("PFTauDiscriminatorLogicalAndProducer", desc);
71 }
72 
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ParameterDescriptionBase * add(U const &iLabel, T const &value)
double discriminate(const PFTauRef &pfTau) const override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
fixed size matrix