00001 #include "AnalysisDataFormats/EWK/interface/WMuNuCandidate.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 WMuNuCandidate::WMuNuCandidate(){} 00011 00012 WMuNuCandidate::WMuNuCandidate(edm::Ptr<reco::Muon> muon, edm::Ptr<reco::MET> met): muon_(muon), neutrino_(met) 00013 { 00014 addDaughter(*muon,"Muon"); 00015 addDaughter(*met,"Met"); 00016 AddFourMomenta addP4; 00017 addP4.set(*this); 00018 00019 //WARNING: W Candidates 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 Candidate functions (.mass, .mt, .et, etc). They may not be what you are looking for :-). 00022 } 00023 00024 WMuNuCandidate::~WMuNuCandidate() 00025 { 00026 } 00027 00028 double WMuNuCandidate::eT() const{ 00029 double e_t=0; 00030 e_t=muon_->pt()+neutrino_->pt(); 00031 return e_t; 00032 } 00033 00034 double WMuNuCandidate::massT() const{ 00035 // Candidates have a mt() function which computes the tranverse mass from E & pz. 00036 // As MET does not have pz information... WMuNuCandidates have an alternative function to compute the mt quantity 00037 // used in the WMuNu Inclusive analysis just from px, py 00038 double wpx=px(); double wpy=py(); 00039 double mt = eT()*eT() - wpx*wpx - wpy*wpy; 00040 mt = (mt>0) ? sqrt(mt) : 0; 00041 return mt; 00042 } 00043 00044 double WMuNuCandidate::acop() const{ 00045 // Acoplanarity between the muon and the MET 00046 Geom::Phi<double> deltaphi(daughter(0)->phi()-daughter(1)->phi()); 00047 double acop = deltaphi.value(); 00048 if (acop<0) acop = - acop; 00049 acop = M_PI - acop; 00050 return acop; 00051 }