CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/AnalysisDataFormats/EWK/src/WMuNuCandidatePtr.cc

Go to the documentation of this file.
00001 #include "AnalysisDataFormats/EWK/interface/WMuNuCandidatePtr.h"
00002 #include "DataFormats/MuonReco/interface/Muon.h"
00003 #include "DataFormats/MuonReco/interface/MuonFwd.h"
00004 #include "DataFormats/TrackReco/interface/Track.h"
00005 
00006 using namespace edm;
00007 using namespace std;
00008 using namespace reco;
00009 
00010 WMuNuCandidatePtr::WMuNuCandidatePtr(){}
00011 
00012 WMuNuCandidatePtr::WMuNuCandidatePtr(const reco::CandidatePtr muon, const reco::CandidatePtr met): muon_(muon), neutrino_(met)  
00013 {
00014       addDaughter(muon_);
00015       addDaughter(neutrino_);
00016       AddFourMomenta addP4;
00017       addP4.set(*this);
00018       cout<<"WCandidatePtr Created   Wpx="<<muon_->px()<<" + "<<neutrino_->px()<<" ?= "<<this->px()<<endl;
00019       //WARNING: W CandidatePtrs combine the information from a Muon with the (px,py) information of the MET as the Neutrino
00020       // --> There is no Pz information!!!!
00021       // Be very careful when using the default CandidatePtr functions (.mass, .mt, .et, etc). They may not be what you are looking for :-).
00022 }
00023 
00024 WMuNuCandidatePtr::~WMuNuCandidatePtr()
00025 {
00026 }
00027 
00028 double WMuNuCandidatePtr::eT() const{
00029  double e_t=0; 
00030      e_t=muon_->pt()+neutrino_->pt();
00031  return e_t; 
00032 }
00033 
00034 double WMuNuCandidatePtr::massT() const{
00035       // CandidatePtrs have a mt() function which computes the tranverse mass from E & pz. 
00036       // As MET does not have pz information... WMuNuCandidatePtrs have an alternative function to compute the mt quantity
00037       // used in the WMuNu Inclusive analysis just from px, py
00038       double wpx=muon_->px()+neutrino_->px(); double wpy=muon_->py()+neutrino_->py();
00039       double mt = eT()*eT() - wpx*wpx - wpy*wpy;
00040       mt = (mt>0) ? sqrt(mt) : 0;
00041       return mt; 
00042 }
00043 
00044 double WMuNuCandidatePtr::acop() const{
00045       // Acoplanarity between the muon and the MET
00046        Geom::Phi<double> deltaphi(muon_->phi()-neutrino_->phi());
00047        double acop = deltaphi.value();
00048        if (acop<0) acop = - acop;
00049        acop = M_PI - acop;
00050        return acop;
00051 }