CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MatchStruct.h
Go to the documentation of this file.
1 #ifndef HLTRIGGEROFFLINE_HIGGS_MATCHSTRUCT_CC
2 #define HLTRIGGEROFFLINE_HIGGS_MATCHSTRUCT_CC
3 
15 
16 #include "TLorentzVector.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;
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  thepointer(cand)
38 
39  {}
40  MatchStruct(const reco::Candidate* cand, const unsigned int& obj, const float& bTagVal)
41  : objType(obj),
42  pt(cand->pt()),
43  eta(cand->eta()),
44  phi(cand->phi()),
45  bTag(bTagVal),
46  lorentzVector(cand->p4()),
47  thepointer(cand)
48 
49  {}
50  // FIXME: If finally the track is disappeared, then recover the last code...
51  MatchStruct(const reco::Track* cand, const unsigned int& obj)
52  : objType(obj), pt(cand->pt()), eta(cand->eta()), phi(cand->phi()), thepointer(cand) {}
53  bool operator<(MatchStruct match) { return this->pt < match.pt; }
54  bool operator>(MatchStruct match) { return this->pt > match.pt; }
55 };
56 
59  bool operator()(MatchStruct a, MatchStruct b) { return a.pt > b.pt; }
60 };
62  bool operator()(MatchStruct a, MatchStruct b) { return a.bTag > b.bTag; }
63 };
64 #endif
math::XYZTLorentzVector lorentzVector
Definition: MatchStruct.h:29
unsigned int objType
Definition: MatchStruct.h:24
MatchStruct(const reco::Candidate *cand, const unsigned int &obj)
Definition: MatchStruct.h:32
reco::Particle::LorentzVector lorentzVector
Definition: GenMuonPair.h:9
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
const void * thepointer
Definition: MatchStruct.h:30
bool operator()(MatchStruct a, MatchStruct b)
Definition: MatchStruct.h:59
bool operator>(MatchStruct match)
Definition: MatchStruct.h:54
bool operator<(MatchStruct match)
Definition: MatchStruct.h:53
MatchStruct(const reco::Track *cand, const unsigned int &obj)
Definition: MatchStruct.h:51
double b
Definition: hdecay.h:118
Helper structure to order MatchStruct.
Definition: MatchStruct.h:58
bool operator()(MatchStruct a, MatchStruct b)
Definition: MatchStruct.h:62
double a
Definition: hdecay.h:119
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
float bTag
Definition: MatchStruct.h:28
MatchStruct(const reco::Candidate *cand, const unsigned int &obj, const float &bTagVal)
Definition: MatchStruct.h:40