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  private:
28  double passResult_;
29 };
30 
32 {
33  passResult_ = iConfig.getParameter<double>("PassValue");
34  prediscriminantFailValue_ = iConfig.getParameter<double>("FailValue"); //defined in base class
35 }
36 
37 double
39 {
40  // if this function is called on a tau, it is has passed (in the base class)
41  // the set of prediscriminants, using the prescribed boolean operation. thus
42  // we only need to return TRUE
43  return passResult_;
44 }
45 
46 void
48  // PFTauDiscriminatorLogicalAndProducer
50 
51  {
53  psd0.add<std::string>("BooleanOperator", "and");
54  {
56  psd1.add<double>("cut", 0.5);
57  psd1.add<edm::InputTag>("Producer", edm::InputTag("pfRecoTauDiscriminationAgainstElectron"));
58  psd0.add<edm::ParameterSetDescription>("discr2", psd1);
59  }
60  {
62  psd1.add<double>("cut", 0.5);
63  psd1.add<edm::InputTag>("Producer", edm::InputTag("pfRecoTauDiscriminationByIsolation"));
64  psd0.add<edm::ParameterSetDescription>("discr1", psd1);
65  }
66  desc.add<edm::ParameterSetDescription>("Prediscriminants", psd0);
67  }
68 
69  desc.add<double>("PassValue", 1.0);
70  desc.add<double>("FailValue", 0.0);
71  desc.add<edm::InputTag>("PFTauProducer", edm::InputTag("pfRecoTauProducer"));
72  descriptions.add("PFTauDiscriminatorLogicalAndProducer", desc);
73 }
74 
T getParameter(std::string const &) const
double discriminate(const PFTauRef &pfTau) const override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
fixed size matrix