CMS 3D CMS Logo

PFRecoTauDiscriminationByCharge.cc
Go to the documentation of this file.
3 
5 
6 /* class PFRecoTauDiscriminationByCharge
7  *
8  * Discriminates taus by a |charge| == 1 requirement,
9  * and optionally nTracks == 1 || 3
10  *
11  * revised : Mon Aug 31 12:59:50 PDT 2009
12  * Authors : Michele Pioppi, Evan Friis (UC Davis)
13  */
14 
15 using namespace reco;
16 
18  public:
20  chargeReq_ = iConfig.getParameter<uint32_t>("AbsChargeReq");
21  oneOrThreeProng_ = iConfig.getParameter<bool>("ApplyOneOrThreeProngCut");
22  }
24  double discriminate(const PFTauRef& pfTau) const override;
25  static void fillDescriptions(edm::ConfigurationDescriptions & descriptions);
26  private:
27  uint32_t chargeReq_;
29 };
30 
32 {
33  uint16_t nSigTk = thePFTauRef->signalChargedHadrCands().size();
34  bool chargeok = (std::abs(thePFTauRef->charge()) == int(chargeReq_));
35  bool oneOrThreeProngOK = ( (nSigTk==1) || (nSigTk==3) || !oneOrThreeProng_ );
36 
37  return ( (chargeok && oneOrThreeProngOK) ? 1. : 0. );
38 }
39 
40 void
42  // pfRecoTauDiscriminationByCharge
44  desc.add<unsigned int>("AbsChargeReq", 1);
45  desc.add<bool>("ApplyOneOrThreeProngCut", false);
46  {
48  psd0.add<std::string>("BooleanOperator", "and");
49  desc.add<edm::ParameterSetDescription>("Prediscriminants", psd0);
50  }
51  desc.add<edm::InputTag>("PFTauProducer", edm::InputTag("pfRecoTauProducerHighEfficiency"));
52  descriptions.add("pfRecoTauDiscriminationByCharge", desc);
53 }
54 
T getParameter(std::string const &) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ParameterDescriptionBase * add(U const &iLabel, T const &value)
double discriminate(const PFTauRef &pfTau) const override
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
PFRecoTauDiscriminationByCharge(const edm::ParameterSet &iConfig)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
fixed size matrix