src
HLTriggerOffline
Higgs
plugins
MatchStruct.h
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
unsigned
int
objType
;
25
float
pt
;
26
float
eta
;
27
float
phi
;
28
float
bTag
;
29
math::XYZTLorentzVector
lorentzVector
;
30
const
void
*
thepointer
;
31
MatchStruct
() :
objType
(0),
pt
(0),
eta
(0),
phi
(0),
bTag
(0),
lorentzVector
(0, 0, 0, 0),
thepointer
(nullptr) {}
32
MatchStruct
(
const
reco::Candidate
*
cand
,
const
unsigned
int
&
obj
)
33
:
objType
(
obj
),
34
pt
(
cand
->
pt
()),
35
eta
(
cand
->
eta
()),
36
phi
(
cand
->
phi
()),
37
bTag
(0),
38
thepointer
(
cand
)
39
40
{}
41
MatchStruct
(
const
reco::Candidate
*
cand
,
const
unsigned
int
&
obj
,
const
float
& bTagVal)
42
:
objType
(
obj
),
43
pt
(
cand
->
pt
()),
44
eta
(
cand
->
eta
()),
45
phi
(
cand
->
phi
()),
46
bTag
(bTagVal),
47
lorentzVector
(
cand
->p4()),
48
thepointer
(
cand
)
49
50
{}
51
// FIXME: If finally the track is disappeared, then recover the last code...
52
MatchStruct
(
const
reco::Track
*
cand
,
const
unsigned
int
&
obj
)
53
:
objType
(
obj
),
pt
(
cand
->
pt
()),
eta
(
cand
->
eta
()),
phi
(
cand
->
phi
()),
thepointer
(
cand
) {}
54
bool
operator<
(
MatchStruct
match
) {
return
this->pt <
match
.pt; }
55
bool
operator>
(
MatchStruct
match
) {
return
this->pt >
match
.pt; }
56
};
57
59
struct
matchesByDescendingPt
{
60
bool
operator()
(
MatchStruct
a
,
MatchStruct
b
) {
return
a
.pt >
b
.pt; }
61
};
62
struct
matchesByDescendingBtag
{
63
bool
operator()
(
MatchStruct
a
,
MatchStruct
b
) {
return
a
.bTag >
b
.bTag; }
64
};
65
#endif
MatchStruct::lorentzVector
math::XYZTLorentzVector lorentzVector
Definition:
MatchStruct.h:29
MatchStruct::objType
unsigned int objType
Definition:
MatchStruct.h:24
reco::Candidate
Definition:
Candidate.h:27
MatchStruct::MatchStruct
MatchStruct()
Definition:
MatchStruct.h:31
MatchStruct::MatchStruct
MatchStruct(const reco::Candidate *cand, const unsigned int &obj)
Definition:
MatchStruct.h:32
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.h:30
matchesByDescendingBtag
Definition:
MatchStruct.h:62
MatchStruct::eta
float eta
Definition:
MatchStruct.h:26
matchesByDescendingPt::operator()
bool operator()(MatchStruct a, MatchStruct b)
Definition:
MatchStruct.h:60
MatchStruct
Definition:
MatchStruct.h:23
MatchStruct::operator>
bool operator>(MatchStruct match)
Definition:
MatchStruct.h:55
MatchStruct::operator<
bool operator<(MatchStruct match)
Definition:
MatchStruct.h:54
getGTfromDQMFile.obj
obj
Definition:
getGTfromDQMFile.py:32
MatchStruct::MatchStruct
MatchStruct(const reco::Track *cand, const unsigned int &obj)
Definition:
MatchStruct.h:52
b
double b
Definition:
hdecay.h:120
reco::Track
Definition:
Track.h:27
matchesByDescendingPt
Helper structure to order MatchStruct.
Definition:
MatchStruct.h:59
matchesByDescendingBtag::operator()
bool operator()(MatchStruct a, MatchStruct b)
Definition:
MatchStruct.h:63
Vector3D.h
a
double a
Definition:
hdecay.h:121
MatchStruct::phi
float phi
Definition:
MatchStruct.h:27
Track.h
cand
Definition:
decayParser.h:32
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition:
Utils.h:10
MatchStruct::bTag
float bTag
Definition:
MatchStruct.h:28
MatchStruct::MatchStruct
MatchStruct(const reco::Candidate *cand, const unsigned int &obj, const float &bTagVal)
Definition:
MatchStruct.h:41
MatchStruct::pt
float pt
Definition:
MatchStruct.h:25
Generated for CMSSW Reference Manual by
1.8.14