CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
JetPartonMatching.h
Go to the documentation of this file.
1 #ifndef JetPartonMatching_h
2 #define JetPartonMatching_h
3 
8 
9 #include <vector>
10 
12  // common class for jet parton matching in ttbar
13  // decays. Several matching algorithms are provided
14 public:
15  typedef std::vector<std::pair<unsigned int, int> > MatchingCollection;
17 
19  JetPartonMatching(const std::vector<const reco::Candidate*>&,
20  const std::vector<reco::GenJet>&,
21  const int,
22  const bool,
23  const bool,
24  const double);
25  JetPartonMatching(const std::vector<const reco::Candidate*>&,
26  const std::vector<reco::CaloJet>&,
27  const int,
28  const bool,
29  const bool,
30  const double);
31  JetPartonMatching(const std::vector<const reco::Candidate*>&,
32  const std::vector<pat::Jet>&,
33  const int,
34  const bool,
35  const bool,
36  const double);
37  JetPartonMatching(const std::vector<const reco::Candidate*>&,
38  const std::vector<const reco::Candidate*>&,
39  const int,
40  const bool,
41  const bool,
42  const double);
44 
45  //matching meta information
46  unsigned int getNumberOfAvailableCombinations() { return matching.size(); }
47  int getNumberOfUnmatchedPartons(const unsigned int comb = 0) {
48  return (comb < numberOfUnmatchedPartons.size() ? (int)numberOfUnmatchedPartons[comb] : -1);
49  }
50  int getMatchForParton(const unsigned int part, const unsigned int comb = 0);
51  std::vector<int> getMatchesForPartons(const unsigned int comb = 0);
52  double getDistanceForParton(const unsigned int part, const unsigned int comb = 0);
53  double getSumDistances(const unsigned int comb = 0);
54 
55  //matching quantities
56  double getSumDeltaE(const unsigned int comb = 0) { return (comb < sumDeltaE.size() ? sumDeltaE[comb] : -999.); }
57  double getSumDeltaPt(const unsigned int comb = 0) { return (comb < sumDeltaPt.size() ? sumDeltaPt[comb] : -999.); }
58  double getSumDeltaR(const unsigned int comb = 0) { return (comb < sumDeltaR.size() ? sumDeltaR[comb] : -999.); }
59 
60  void print();
61 
62 private:
63  void calculate();
65  void matchingTotalMinDist();
66  void minSumDist_recursion(const unsigned int,
67  std::vector<unsigned int>&,
68  std::vector<bool>&,
69  std::vector<std::pair<double, MatchingCollection> >&);
70  void matchingMinSumDist();
73 
74 private:
75  std::vector<const reco::Candidate*> partons;
76  std::vector<const reco::Candidate*> jets;
77  std::vector<MatchingCollection> matching;
78 
79  std::vector<unsigned int> numberOfUnmatchedPartons;
80  std::vector<double> sumDeltaE;
81  std::vector<double> sumDeltaPt;
82  std::vector<double> sumDeltaR;
83 
86  bool useDeltaR_;
87  double maxDist_;
88 };
89 
90 #endif
std::vector< const reco::Candidate * > partons
std::vector< double > sumDeltaE
unsigned int getNumberOfAvailableCombinations()
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
dictionary comb
int getNumberOfUnmatchedPartons(const unsigned int comb=0)
std::vector< int > getMatchesForPartons(const unsigned int comb=0)
double getSumDeltaE(const unsigned int comb=0)
std::vector< unsigned int > numberOfUnmatchedPartons
std::vector< std::pair< unsigned int, int > > MatchingCollection
part
Definition: HCALResponse.h:20
void minSumDist_recursion(const unsigned int, std::vector< unsigned int > &, std::vector< bool > &, std::vector< std::pair< double, MatchingCollection > > &)
int getMatchForParton(const unsigned int part, const unsigned int comb=0)
double distance(const math::XYZTLorentzVector &, const math::XYZTLorentzVector &)
std::vector< const reco::Candidate * > jets
std::vector< MatchingCollection > matching
std::vector< double > sumDeltaR
double getSumDeltaR(const unsigned int comb=0)
std::vector< double > sumDeltaPt
double getSumDistances(const unsigned int comb=0)
double getSumDeltaPt(const unsigned int comb=0)
double getDistanceForParton(const unsigned int part, const unsigned int comb=0)