CMS 3D CMS Logo

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