00001 #include "RecoTauTag/RecoTau/interface/TauDiscriminationProducerBase.h" 00002 00003 /* class PFRecoTauDiscriminationByCharge 00004 * 00005 * Discriminates taus by a |charge| == 1 requirement, 00006 * and optionally nTracks == 1 || 3 00007 * 00008 * revised : Mon Aug 31 12:59:50 PDT 2009 00009 * Authors : Michele Pioppi, Evan Friis (UC Davis) 00010 */ 00011 00012 using namespace reco; 00013 00014 class PFRecoTauDiscriminationByCharge : public PFTauDiscriminationProducerBase { 00015 public: 00016 explicit PFRecoTauDiscriminationByCharge(const edm::ParameterSet& iConfig):PFTauDiscriminationProducerBase(iConfig){ 00017 chargeReq_ = iConfig.getParameter<uint32_t>("AbsChargeReq"); 00018 oneOrThreeProng_ = iConfig.getParameter<bool>("ApplyOneOrThreeProngCut"); 00019 } 00020 ~PFRecoTauDiscriminationByCharge(){} 00021 double discriminate(const PFTauRef& pfTau); 00022 private: 00023 uint32_t chargeReq_; 00024 bool oneOrThreeProng_; 00025 }; 00026 00027 double PFRecoTauDiscriminationByCharge::discriminate(const PFTauRef& thePFTauRef) 00028 { 00029 uint16_t nSigTk = thePFTauRef->signalPFChargedHadrCands().size(); 00030 bool chargeok = (std::abs(thePFTauRef->charge()) == int(chargeReq_)); 00031 bool oneOrThreeProngOK = ( (nSigTk==1) || (nSigTk==3) || !oneOrThreeProng_ ); 00032 00033 return ( (chargeok && oneOrThreeProngOK) ? 1. : 0. ); 00034 } 00035 DEFINE_FWK_MODULE(PFRecoTauDiscriminationByCharge);