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 }
Geom::Phi::value
T1 value() const
Explicit access to value in case implicit conversion not OK.
Definition: Phi.h:75
WMuNuCandidate.h
muon
Definition: MuonCocktails.h:17
edm
HLT enums.
Definition: AlignableModifier.h:19
reco::WMuNuCandidate::acop
double acop() const
Definition: WMuNuCandidate.cc:42
reco::WMuNuCandidate::neutrino_
edm::Ptr< MET > neutrino_
Definition: WMuNuCandidate.h:43
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
reco::WMuNuCandidate::~WMuNuCandidate
~WMuNuCandidate() override
Definition: WMuNuCandidate.cc:23
BTaggingMonitor_cfi.met
met
Definition: BTaggingMonitor_cfi.py:84
reco::WMuNuCandidate::muon_
edm::Ptr< Muon > muon_
Definition: WMuNuCandidate.h:39
Track.h
reco::WMuNuCandidate::massT
double massT() const
Definition: WMuNuCandidate.cc:31
reco::LeafCandidate::py
double py() const final
y coordinate of momentum vector
Definition: LeafCandidate.h:142
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
reco::CompositeCandidate::addDaughter
void addDaughter(const Candidate &, const std::string &s="")
add a clone of the passed candidate as daughter
Definition: CompositeCandidate.cc:108
reco::LeafCandidate::mt
double mt() const final
transverse mass
Definition: LeafCandidate.h:136
AddFourMomenta.h
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
Geom::Phi
Definition: Phi.h:52
edm::Ptr< reco::Muon >
std
Definition: JetResolutionObject.h:76
reco::LeafCandidate::phi
double phi() const final
momentum azimuthal angle
Definition: LeafCandidate.h:148
CandCombiner.h
reco::WMuNuCandidate::eT
double eT() const
Definition: WMuNuCandidate.cc:25
AddFourMomenta::set
void set(reco::Candidate &c) const
set up a candidate
Definition: AddFourMomenta.cc:6
AddFourMomenta
Definition: AddFourMomenta.h:18
reco::CompositeCandidate::daughter
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode)
Definition: CompositeCandidate.cc:30
reco::LeafCandidate::px
double px() const final
x coordinate of momentum vector
Definition: LeafCandidate.h:140