CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFRecoTauDiscriminationByCharge.cc
Go to the documentation of this file.
2 
3 /* class PFRecoTauDiscriminationByCharge
4  *
5  * Discriminates taus by a |charge| == 1 requirement,
6  * and optionally nTracks == 1 || 3
7  *
8  * revised : Mon Aug 31 12:59:50 PDT 2009
9  * Authors : Michele Pioppi, Evan Friis (UC Davis)
10  */
11 
12 using namespace reco;
13 
15  public:
17  chargeReq_ = iConfig.getParameter<uint32_t>("AbsChargeReq");
18  oneOrThreeProng_ = iConfig.getParameter<bool>("ApplyOneOrThreeProngCut");
19  }
21  double discriminate(const PFTauRef& pfTau) const override;
22  private:
23  uint32_t chargeReq_;
25 };
26 
28 {
29  uint16_t nSigTk = thePFTauRef->signalPFChargedHadrCands().size();
30  bool chargeok = (std::abs(thePFTauRef->charge()) == int(chargeReq_));
31  bool oneOrThreeProngOK = ( (nSigTk==1) || (nSigTk==3) || !oneOrThreeProng_ );
32 
33  return ( (chargeok && oneOrThreeProngOK) ? 1. : 0. );
34 }
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
double discriminate(const PFTauRef &pfTau) const override
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
PFRecoTauDiscriminationByCharge(const edm::ParameterSet &iConfig)