Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:46:21

0001 #include "AnalysisDataFormats/EWK/interface/WMuNuCandidate.h"
0002 #include "DataFormats/TrackReco/interface/Track.h"
0003 #include "CommonTools/CandUtils/interface/CandCombiner.h"
0004 #include "CommonTools/CandUtils/interface/AddFourMomenta.h"
0005 
0006 using namespace edm;
0007 using namespace std;
0008 using namespace reco;
0009 
0010 WMuNuCandidate::WMuNuCandidate() {}
0011 
0012 WMuNuCandidate::WMuNuCandidate(edm::Ptr<reco::Muon> muon, edm::Ptr<reco::MET> met) : muon_(muon), neutrino_(met) {
0013   addDaughter(*muon, "Muon");
0014   addDaughter(*met, "Met");
0015   AddFourMomenta addP4;
0016   addP4.set(*this);
0017 
0018   //WARNING: W Candidates combine the information from a Muon with the (px,py) information of the MET as the Neutrino

0019   // --> There is no Pz information!!!!

0020   // Be very careful when using the default Candidate functions (.mass, .mt, .et, etc). They may not be what you are looking for :-).

0021 }
0022 
0023 WMuNuCandidate::~WMuNuCandidate() {}
0024 
0025 double WMuNuCandidate::eT() const {
0026   double e_t = 0;
0027   e_t = muon_->pt() + neutrino_->pt();
0028   return e_t;
0029 }
0030 
0031 double WMuNuCandidate::massT() const {
0032   // Candidates have a mt() function which computes the tranverse mass from E & pz.

0033   // As MET does not have pz information... WMuNuCandidates have an alternative function to compute the mt quantity

0034   // used in the WMuNu Inclusive analysis just from px, py

0035   double wpx = px();
0036   double wpy = py();
0037   double mt = eT() * eT() - wpx * wpx - wpy * wpy;
0038   mt = (mt > 0) ? sqrt(mt) : 0;
0039   return mt;
0040 }
0041 
0042 double WMuNuCandidate::acop() const {
0043   // Acoplanarity between the muon and the MET

0044   Geom::Phi<double> deltaphi(daughter(0)->phi() - daughter(1)->phi());
0045   double acop = deltaphi.value();
0046   if (acop < 0)
0047     acop = -acop;
0048   acop = M_PI - acop;
0049   return acop;
0050 }