CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/RecoTauTag/RecoTau/plugins/CaloRecoTauDiscriminationByInvMass.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 CaloRecoTauDiscriminationByInvMass
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 #include "DataFormats/TrackReco/interface/Track.h"
00011 #include "TLorentzVector.h"
00012 
00013 using namespace reco;
00014 using namespace std;
00015 
00016 class CaloRecoTauDiscriminationByInvMass : public CaloTauDiscriminationProducerBase  {
00017   public:
00018     explicit CaloRecoTauDiscriminationByInvMass(
00019         const edm::ParameterSet& iConfig)
00020         :CaloTauDiscriminationProducerBase(iConfig) {
00021       invMassMin                = iConfig.getParameter<double>("invMassMin");
00022       invMassMax                = iConfig.getParameter<double>("invMassMax");
00023       chargedPionMass   = 0.139;
00024       booleanOutput             = iConfig.getParameter<bool>("BooleanOutput");
00025     }
00026 
00027     ~CaloRecoTauDiscriminationByInvMass(){}
00028 
00029     double discriminate(const reco::CaloTauRef&);
00030 
00031   private:
00032     double threeProngInvMass(const CaloTauRef&);
00033     double chargedPionMass;
00034     double invMassMin,invMassMax;
00035     bool booleanOutput;
00036 };
00037 
00038 double CaloRecoTauDiscriminationByInvMass::discriminate(const CaloTauRef& tau){
00039 
00040   double invMass = threeProngInvMass(tau);
00041   if(booleanOutput) return (
00042       invMass > invMassMin && invMass < invMassMax ? 1. : 0. );
00043   return invMass;
00044 }
00045 
00046 double CaloRecoTauDiscriminationByInvMass::threeProngInvMass(
00047     const CaloTauRef& tau){
00048   TLorentzVector sum;
00049   reco::TrackRefVector signalTracks = tau->signalTracks();
00050   for(size_t i = 0; i < signalTracks.size(); ++i){
00051     TLorentzVector p4;
00052     p4.SetXYZM(signalTracks[i]->px(),
00053                signalTracks[i]->py(),
00054                signalTracks[i]->pz(),
00055                chargedPionMass);
00056     sum += p4;
00057   }
00058   return sum.M();
00059 }
00060 
00061 DEFINE_FWK_MODULE(CaloRecoTauDiscriminationByInvMass);