Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
HLTriggerOffline
Higgs
src
MatchStruct.cc
Go to the documentation of this file.
1
#ifndef HLTRIGGEROFFLINE_HIGGS_MATCHSTRUCT_CC
2
#define HLTRIGGEROFFLINE_HIGGS_MATCHSTRUCT_CC
3
13
#include "
DataFormats/Candidate/interface/Candidate.h
"
14
#include "
DataFormats/TrackReco/interface/Track.h
"
15
16
#include "TLorentzVector.h"
17
#include "
DataFormats/Math/interface/Vector3D.h
"
18
19
#include<vector>
20
21
// Matching structure: helper structure to match gen/reco candidates with
22
// hlt trigger objects
23
struct
MatchStruct
24
{
25
unsigned
int
objType
;
26
float
pt
;
27
float
eta
;
28
float
phi
;
29
float
bTag
;
30
math::XYZTLorentzVector
lorentzVector
;
31
const
void
*
thepointer
;
32
MatchStruct
():
33
objType
(0),
34
pt
(0),
35
eta
(0),
36
phi
(0),
37
bTag
(0),
38
lorentzVector
(0,0,0,0),
39
thepointer
(0)
40
{
41
}
42
MatchStruct
(
const
reco::Candidate
* cand,
const
unsigned
int
&
obj
) :
43
objType
(obj),
44
pt
(cand->
pt
()),
45
eta
(cand->
eta
()),
46
phi
(cand->
phi
()),
47
thepointer
(cand)
48
49
{
50
}
51
MatchStruct
(
const
reco::Candidate
* cand,
const
unsigned
int
&
obj
,
const
float
& bTagVal) :
52
objType
(obj),
53
pt
(cand->
pt
()),
54
eta
(cand->
eta
()),
55
phi
(cand->
phi
()),
56
bTag
(bTagVal),
57
lorentzVector
(cand->
p4
()),
58
thepointer
(cand)
59
60
{
61
}
62
// FIXME: If finally the track is disappeared, then recover the last code...
63
MatchStruct
(
const
reco::Track
* cand,
const
unsigned
int
&
obj
) :
64
objType
(obj),
65
pt
(cand->
pt
()),
66
eta
(cand->
eta
()),
67
phi
(cand->
phi
()),
68
thepointer
(cand)
69
{
70
}
71
bool
operator<
(
MatchStruct
match
)
72
{
73
return
this->
pt
< match.
pt
;
74
}
75
bool
operator>
(
MatchStruct
match
)
76
{
77
return
this->
pt
> match.
pt
;
78
}
79
};
80
82
struct
matchesByDescendingPt
83
{
84
bool
operator()
(
MatchStruct
a
,
MatchStruct
b
)
85
{
86
return
a.
pt
> b.
pt
;
87
}
88
};
89
struct
matchesByDescendingBtag
90
{
91
bool
operator()
(
MatchStruct
a
,
MatchStruct
b
)
92
{
93
return
a.
bTag
> b.
bTag
;
94
}
95
};
96
#endif
MatchStruct::lorentzVector
math::XYZTLorentzVector lorentzVector
Definition:
MatchStruct.cc:30
MatchStruct::objType
unsigned int objType
Definition:
MatchStruct.cc:25
reco::Candidate
Definition:
Candidate.h:32
MatchStruct::MatchStruct
MatchStruct()
Definition:
MatchStruct.cc:32
MatchStruct::MatchStruct
MatchStruct(const reco::Candidate *cand, const unsigned int &obj)
Definition:
MatchStruct.cc:42
getGTfromDQMFile.obj
tuple obj
Definition:
getGTfromDQMFile.py:31
lorentzVector
reco::Particle::LorentzVector lorentzVector
Definition:
GenMuonPair.h:9
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition:
LorentzVector.h:29
Candidate.h
MatchStruct::thepointer
const void * thepointer
Definition:
MatchStruct.cc:31
matchesByDescendingBtag
Definition:
MatchStruct.cc:89
p4
double p4[4]
Definition:
TauolaWrapper.h:92
MatchStruct::eta
float eta
Definition:
MatchStruct.cc:27
matchesByDescendingPt::operator()
bool operator()(MatchStruct a, MatchStruct b)
Definition:
MatchStruct.cc:84
MatchStruct
Definition:
MatchStruct.cc:23
MatchStruct::operator>
bool operator>(MatchStruct match)
Definition:
MatchStruct.cc:75
MatchStruct::operator<
bool operator<(MatchStruct match)
Definition:
MatchStruct.cc:71
MatchStruct::MatchStruct
MatchStruct(const reco::Track *cand, const unsigned int &obj)
Definition:
MatchStruct.cc:63
b
double b
Definition:
hdecay.h:120
reco::Track
Definition:
Track.h:28
matchesByDescendingPt
Helper structure to order MatchStruct.
Definition:
MatchStruct.cc:82
matchesByDescendingBtag::operator()
bool operator()(MatchStruct a, MatchStruct b)
Definition:
MatchStruct.cc:91
Vector3D.h
a
double a
Definition:
hdecay.h:121
MatchStruct::phi
float phi
Definition:
MatchStruct.cc:28
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition:
Utils.h:6
Track.h
MatchStruct::bTag
float bTag
Definition:
MatchStruct.cc:29
MatchStruct::MatchStruct
MatchStruct(const reco::Candidate *cand, const unsigned int &obj, const float &bTagVal)
Definition:
MatchStruct.cc:51
MatchStruct::pt
float pt
Definition:
MatchStruct.cc:26
Generated for CMSSW Reference Manual by
1.8.5