AnalysisDataFormats
EWK
src
WMuNuCandidatePtr.cc
Go to the documentation of this file.
1
#include "
AnalysisDataFormats/EWK/interface/WMuNuCandidatePtr.h
"
2
#include "
CommonTools/CandUtils/interface/CandCombiner.h
"
3
#include "
CommonTools/CandUtils/interface/AddFourMomenta.h
"
4
#include "
DataFormats/TrackReco/interface/Track.h
"
5
6
using namespace
edm
;
7
using namespace
std
;
8
using namespace
reco
;
9
10
WMuNuCandidatePtr::WMuNuCandidatePtr() {}
11
12
WMuNuCandidatePtr::WMuNuCandidatePtr(
const
reco::CandidatePtr
muon
,
const
reco::CandidatePtr
met
)
13
: muon_(
muon
), neutrino_(
met
) {
14
addDaughter
(
muon_
);
15
addDaughter
(
neutrino_
);
16
AddFourMomenta
addP4;
17
addP4.
set
(*
this
);
18
cout
<<
"WCandidatePtr Created Wpx="
<<
muon_
->px() <<
" + "
<<
neutrino_
->px() <<
" ?= "
<< this->
px
() << endl;
19
//WARNING: W CandidatePtrs 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 CandidatePtr functions (.mass, .mt, .et, etc). They may not be what you are looking for :-).
22
}
23
24
WMuNuCandidatePtr::~WMuNuCandidatePtr
() {}
25
26
double
WMuNuCandidatePtr::eT
()
const
{
27
double
e_t = 0;
28
e_t =
muon_
->pt() +
neutrino_
->pt();
29
return
e_t;
30
}
31
32
double
WMuNuCandidatePtr::massT
()
const
{
33
// CandidatePtrs have a mt() function which computes the tranverse mass from E & pz.
34
// As MET does not have pz information... WMuNuCandidatePtrs have an alternative function to compute the mt quantity
35
// used in the WMuNu Inclusive analysis just from px, py
36
double
wpx =
muon_
->px() +
neutrino_
->px();
37
double
wpy =
muon_
->py() +
neutrino_
->py();
38
double
mt
=
eT
() *
eT
() - wpx * wpx - wpy * wpy;
39
mt
= (
mt
> 0) ?
sqrt
(
mt
) : 0;
40
return
mt
;
41
}
42
43
double
WMuNuCandidatePtr::acop
()
const
{
44
// Acoplanarity between the muon and the MET
45
Geom::Phi<double>
deltaphi(
muon_
->phi() -
neutrino_
->phi());
46
double
acop
= deltaphi.value();
47
if
(
acop
< 0)
48
acop
= -
acop
;
49
acop
=
M_PI
-
acop
;
50
return
acop
;
51
}
muon
Definition:
MuonCocktails.h:17
edm
HLT enums.
Definition:
AlignableModifier.h:19
gather_cfg.cout
cout
Definition:
gather_cfg.py:144
reco::WMuNuCandidatePtr::muon_
edm::Ptr< Muon > muon_
Definition:
WMuNuCandidatePtr.h:39
reco::WMuNuCandidatePtr::~WMuNuCandidatePtr
~WMuNuCandidatePtr() override
Definition:
WMuNuCandidatePtr.cc:24
reco::WMuNuCandidatePtr::neutrino_
edm::Ptr< MET > neutrino_
Definition:
WMuNuCandidatePtr.h:43
reco
fixed size matrix
Definition:
AlignmentAlgorithmBase.h:46
BTaggingMonitor_cfi.met
met
Definition:
BTaggingMonitor_cfi.py:84
reco::WMuNuCandidatePtr::eT
double eT() const
Definition:
WMuNuCandidatePtr.cc:26
Track.h
reco::WMuNuCandidatePtr::acop
double acop() const
Definition:
WMuNuCandidatePtr.cc:43
mathSSE::sqrt
T sqrt(T t)
Definition:
SSEVec.h:19
reco::LeafCandidate::mt
double mt() const final
transverse mass
Definition:
LeafCandidate.h:136
reco::WMuNuCandidatePtr::massT
double massT() const
Definition:
WMuNuCandidatePtr.cc:32
AddFourMomenta.h
M_PI
#define M_PI
Definition:
BXVectorInputProducer.cc:49
Geom::Phi
Definition:
Phi.h:52
edm::Ptr< Candidate >
std
Definition:
JetResolutionObject.h:76
WMuNuCandidatePtr.h
CandCombiner.h
AddFourMomenta::set
void set(reco::Candidate &c) const
set up a candidate
Definition:
AddFourMomenta.cc:6
AddFourMomenta
Definition:
AddFourMomenta.h:18
reco::CompositePtrCandidate::addDaughter
void addDaughter(const CandidatePtr &)
add a daughter via a reference
Definition:
CompositePtrCandidate.h:84
reco::LeafCandidate::px
double px() const final
x coordinate of momentum vector
Definition:
LeafCandidate.h:140
Generated for CMSSW Reference Manual by
1.8.16