CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/RecoTauTag/RecoTau/plugins/CaloRecoTauDiscriminationByTauPolarization.cc

Go to the documentation of this file.
00001 #include "RecoTauTag/RecoTau/interface/TauDiscriminationProducerBase.h"
00002 #include "DataFormats/TrackReco/interface/Track.h"
00003 
00004 /* class CaloRecoTauDiscriminationByTauPolarization
00005  * created : September 22 2010,
00006  * contributors : Sami Lehti (sami.lehti@cern.ch ; HIP, Helsinki)
00007  */
00008 
00009 using namespace reco;
00010 using namespace std;
00011 
00012 class CaloRecoTauDiscriminationByTauPolarization : public CaloTauDiscriminationProducerBase  {
00013   public:
00014     explicit CaloRecoTauDiscriminationByTauPolarization(
00015         const edm::ParameterSet& iConfig)
00016         :CaloTauDiscriminationProducerBase(iConfig) {
00017           rTauMin = iConfig.getParameter<double>("rtau");
00018           booleanOutput = iConfig.getParameter<bool>("BooleanOutput");
00019         }
00020 
00021     ~CaloRecoTauDiscriminationByTauPolarization(){}
00022     double discriminate(const CaloTauRef&);
00023 
00024   private:
00025     bool booleanOutput;
00026     double rTauMin;
00027 };
00028 
00029 double
00030 CaloRecoTauDiscriminationByTauPolarization::discriminate(const CaloTauRef& tau){
00031   double rTau = 0;
00032   if(tau.isNonnull() && tau->p() > 0 && tau->leadTrack().isNonnull())
00033     rTau = tau->leadTrack()->p()/tau->p();
00034   if(booleanOutput) return ( rTau > rTauMin ? 1. : 0. );
00035   return rTau;
00036 }
00037 
00038 DEFINE_FWK_MODULE(CaloRecoTauDiscriminationByTauPolarization);