Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-03-17 10:40:52

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

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

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

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

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

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

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

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