CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MatchStruct.cc
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 {
25  unsigned int objType;
26  float pt;
27  float eta;
28  float phi;
29  float bTag;
31  const void * thepointer;
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  }
72  {
73  return this->pt < match.pt;
74  }
76  {
77  return this->pt > match.pt;
78  }
79 };
80 
83 {
85  {
86  return a.pt > b.pt;
87  }
88 };
90 {
92  {
93  return a.bTag > b.bTag;
94  }
95 };
96 #endif
math::XYZTLorentzVector lorentzVector
Definition: MatchStruct.cc:30
unsigned int objType
Definition: MatchStruct.cc:25
MatchStruct(const reco::Candidate *cand, const unsigned int &obj)
Definition: MatchStruct.cc:42
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.cc:31
double p4[4]
Definition: TauolaWrapper.h:92
bool operator()(MatchStruct a, MatchStruct b)
Definition: MatchStruct.cc:84
bool operator>(MatchStruct match)
Definition: MatchStruct.cc:75
bool operator<(MatchStruct match)
Definition: MatchStruct.cc:71
MatchStruct(const reco::Track *cand, const unsigned int &obj)
Definition: MatchStruct.cc:63
double b
Definition: hdecay.h:120
Helper structure to order MatchStruct.
Definition: MatchStruct.cc:82
bool operator()(MatchStruct a, MatchStruct b)
Definition: MatchStruct.cc:91
double a
Definition: hdecay.h:121
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
MatchStruct(const reco::Candidate *cand, const unsigned int &obj, const float &bTagVal)
Definition: MatchStruct.cc:51