CMS 3D CMS Logo

WMuNuCandidate.cc
Go to the documentation of this file.
5 
6 using namespace edm;
7 using namespace std;
8 using namespace reco;
9 
10 WMuNuCandidate::WMuNuCandidate() {}
11 
12 WMuNuCandidate::WMuNuCandidate(edm::Ptr<reco::Muon> muon, edm::Ptr<reco::MET> met) : muon_(muon), neutrino_(met) {
13  addDaughter(*muon, "Muon");
14  addDaughter(*met, "Met");
15  AddFourMomenta addP4;
16  addP4.set(*this);
17 
18  //WARNING: W Candidates combine the information from a Muon with the (px,py) information of the MET as the Neutrino
19  // --> There is no Pz information!!!!
20  // Be very careful when using the default Candidate functions (.mass, .mt, .et, etc). They may not be what you are looking for :-).
21 }
22 
24 
25 double WMuNuCandidate::eT() const {
26  double e_t = 0;
27  e_t = muon_->pt() + neutrino_->pt();
28  return e_t;
29 }
30 
31 double WMuNuCandidate::massT() const {
32  // Candidates have a mt() function which computes the tranverse mass from E & pz.
33  // As MET does not have pz information... WMuNuCandidates have an alternative function to compute the mt quantity
34  // used in the WMuNu Inclusive analysis just from px, py
35  double wpx = px();
36  double wpy = py();
37  double mt = eT() * eT() - wpx * wpx - wpy * wpy;
38  mt = (mt > 0) ? sqrt(mt) : 0;
39  return mt;
40 }
41 
42 double WMuNuCandidate::acop() const {
43  // Acoplanarity between the muon and the MET
44  Geom::Phi<double> deltaphi(daughter(0)->phi() - daughter(1)->phi());
45  double acop = deltaphi.value();
46  if (acop < 0)
47  acop = -acop;
48  acop = M_PI - acop;
49  return acop;
50 }
double mt() const final
transverse mass
double px() const final
x coordinate of momentum vector
T1 value() const
Explicit access to value in case implicit conversion not OK.
Definition: Phi.h:75
T sqrt(T t)
Definition: SSEVec.h:19
double eT() const
double acop() const
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
void addDaughter(const Candidate &, const std::string &s="")
add a clone of the passed candidate as daughter
#define M_PI
~WMuNuCandidate() override
double py() const final
y coordinate of momentum vector
double massT() const
edm::Ptr< Muon > muon_
fixed size matrix
HLT enums.
edm::Ptr< MET > neutrino_
void set(reco::Candidate &c) const
set up a candidate
double phi() const final
momentum azimuthal angle
Definition: Phi.h:52