CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/RecoTauTag/RecoTau/plugins/CaloRecoTauDiscriminationByCharge.cc

Go to the documentation of this file.
00001 #include "RecoTauTag/RecoTau/interface/TauDiscriminationProducerBase.h"
00002 
00003 /* class CaloRecoTauDiscriminationByCharge
00004  *
00005  *  Discriminates taus by a |charge| == 1 requirement,
00006  *  and optionally nTracks == 1 || 3
00007  *
00008  * Authors : S.Lehti, copied from PFRecoTauDiscriminationByCharge
00009  */
00010 
00011 class CaloRecoTauDiscriminationByCharge : public CaloTauDiscriminationProducerBase  {
00012   public:
00013     explicit CaloRecoTauDiscriminationByCharge(const edm::ParameterSet& iConfig)
00014         :CaloTauDiscriminationProducerBase(iConfig){
00015           chargeReq_        = iConfig.getParameter<uint32_t>("AbsChargeReq");
00016           oneOrThreeProng_  =
00017               iConfig.getParameter<bool>("ApplyOneOrThreeProngCut");
00018         }
00019     ~CaloRecoTauDiscriminationByCharge(){}
00020     double discriminate(const reco::CaloTauRef& pfTau);
00021   private:
00022     uint32_t chargeReq_;
00023     bool oneOrThreeProng_;
00024 };
00025 
00026 double CaloRecoTauDiscriminationByCharge::discriminate(
00027     const reco::CaloTauRef& theTauRef) {
00028   uint16_t nSigTk =  theTauRef->signalTracks().size();
00029   bool chargeok = (abs(theTauRef->charge()) == int(chargeReq_));
00030   bool oneOrThreeProngOK =  ( (nSigTk==1) || (nSigTk==3) || !oneOrThreeProng_ );
00031 
00032   return ( (chargeok && oneOrThreeProngOK) ? 1. : 0. );
00033 }
00034 DEFINE_FWK_MODULE(CaloRecoTauDiscriminationByCharge);