CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 
16  typedef std::vector< std::pair<unsigned int, int> > MatchingCollection;
18 
20  JetPartonMatching(const std::vector<const reco::Candidate*>&, const std::vector<reco::GenJet>&,
21  const int, const bool, const bool, const double);
22  JetPartonMatching(const std::vector<const reco::Candidate*>&, const std::vector<reco::CaloJet>&,
23  const int, const bool, const bool, const double);
24  JetPartonMatching(const std::vector<const reco::Candidate*>&, const std::vector<pat::Jet>&,
25  const int, const bool, const bool, const double);
26  JetPartonMatching(const std::vector<const reco::Candidate*>&, const std::vector<const reco::Candidate*>&,
27  const int, const bool, const bool, const double);
29 
30  //matching meta information
31  unsigned int getNumberOfAvailableCombinations() { return matching.size(); }
32  int getNumberOfUnmatchedPartons(const unsigned int comb=0){ return (comb<numberOfUnmatchedPartons.size() ? (int)numberOfUnmatchedPartons[comb] : -1 ); }
33  int getMatchForParton(const unsigned int part, const unsigned int comb=0);
34  std::vector<int> getMatchesForPartons(const unsigned int comb=0);
35  double getDistanceForParton(const unsigned int part, const unsigned int comb=0);
36  double getSumDistances(const unsigned int comb=0);
37 
38  //matching quantities
39  double getSumDeltaE (const unsigned int comb=0) { return (comb<sumDeltaE .size() ? sumDeltaE [comb] : -999.); }
40  double getSumDeltaPt(const unsigned int comb=0) { return (comb<sumDeltaPt.size() ? sumDeltaPt[comb] : -999.); }
41  double getSumDeltaR (const unsigned int comb=0) { return (comb<sumDeltaR .size() ? sumDeltaR [comb] : -999.); }
42 
43  void print();
44 
45  private:
46 
47  void calculate();
49  void matchingTotalMinDist();
50  void minSumDist_recursion(const unsigned int, std::vector<unsigned int>&, std::vector<bool>&, std::vector<std::pair<double, MatchingCollection> >&);
51  void matchingMinSumDist();
54 
55  private:
56 
57  std::vector<const reco::Candidate*> partons;
58  std::vector<const reco::Candidate*> jets;
59  std::vector<MatchingCollection> matching;
60 
61  std::vector<unsigned int> numberOfUnmatchedPartons;
62  std::vector<double> sumDeltaE;
63  std::vector<double> sumDeltaPt;
64  std::vector<double> sumDeltaR;
65 
68  bool useDeltaR_;
69  double maxDist_;
70 };
71 
72 #endif
std::vector< const reco::Candidate * > partons
std::vector< std::pair< unsigned int, int > > MatchingCollection
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
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)
tuple size
Write out results.
double getSumDeltaPt(const unsigned int comb=0)
double getDistanceForParton(const unsigned int part, const unsigned int comb=0)