CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/RecoTauTag/RecoTau/plugins/CaloRecoTauDiscriminationByNProngs.cc

Go to the documentation of this file.
00001 #include "RecoTauTag/RecoTau/interface/TauDiscriminationProducerBase.h"
00002 #include "FWCore/Utilities/interface/InputTag.h"
00003 
00004 /* class CaloRecoTauDiscriminationByNProngs
00005  * created : September 23 2010,
00006  * contributors : Sami Lehti (sami.lehti@cern.ch ; HIP, Helsinki)
00007  * based on H+ tau ID by Lauri Wendland
00008  */
00009 
00010 using namespace reco;
00011 using namespace std;
00012 
00013 class CaloRecoTauDiscriminationByNProngs
00014   : public CaloTauDiscriminationProducerBase  {
00015   public:
00016     explicit CaloRecoTauDiscriminationByNProngs(const edm::ParameterSet& iConfig)
00017         :CaloTauDiscriminationProducerBase(iConfig) {
00018       nprongs                   = iConfig.getParameter<uint32_t>("nProngs");
00019       booleanOutput = iConfig.getParameter<bool>("BooleanOutput");
00020     }
00021     ~CaloRecoTauDiscriminationByNProngs(){}
00022     double discriminate(const reco::CaloTauRef&);
00023 
00024   private:
00025     uint32_t nprongs;
00026     bool booleanOutput;
00027 };
00028 
00029 
00030 double CaloRecoTauDiscriminationByNProngs::discriminate(const CaloTauRef& tau){
00031   bool accepted = false;
00032   int np = tau->signalTracks().size();
00033   if((np == 1 && (nprongs == 1 || nprongs == 0)) ||
00034      (np == 3 && (nprongs == 3 || nprongs == 0)) ) accepted = true;
00035   if(!accepted) np = 0;
00036   if(booleanOutput) return accepted;
00037   return np;
00038 }
00039 
00040 DEFINE_FWK_MODULE(CaloRecoTauDiscriminationByNProngs);