CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CATopJetHelper.cc
Go to the documentation of this file.
2 
5  return t1->pt() > t2->pt();
6  }
7 };
8 
10  reco::CATopJetProperties properties;
11  // Get subjets
12  reco::Jet::Constituents subjets = ihardJet.getJetConstituents();
13  properties.nSubJets = subjets.size(); // number of subjets
14  properties.topMass = ihardJet.mass(); // jet mass
15  properties.wMass = 99999.; // best W mass
16  properties.minMass = 999999.; // minimum mass pairing
17 
18  // Require at least three subjets in all cases, if not, untagged
19  if (properties.nSubJets >= 3) {
20  // Take the highest 3 pt subjets for cuts
21  sort(subjets.begin(), subjets.end(), GreaterByPtCandPtr());
22 
23  // Now look at the subjets that were formed
24  for (int isub = 0; isub < 2; ++isub) {
25  // Get this subjet
26  reco::Jet::Constituent icandJet = subjets[isub];
27 
28  // Now look at the "other" subjets than this one, form the minimum invariant mass
29  // pairing, as well as the "closest" combination to the W mass
30  for (int jsub = isub + 1; jsub < 3; ++jsub) {
31  // Get the second subjet
32  reco::Jet::Constituent jcandJet = subjets[jsub];
33 
34  reco::Candidate::LorentzVector wCand = icandJet->p4() + jcandJet->p4();
35 
36  // Get the candidate mass
37  double imw = wCand.mass();
38 
39  // Find the combination closest to the W mass
40  if (fabs(imw - WMass_) < fabs(properties.wMass - WMass_)) {
41  properties.wMass = imw;
42  }
43  // Find the minimum mass pairing.
44  if (fabs(imw) < properties.minMass) {
45  properties.minMass = imw;
46  }
47  } // end second loop over subjets
48  } // end first loop over subjets
49  } // endif 3 subjets
50 
51  if (properties.minMass == 999999) {
52  properties.minMass = -1;
53  }
54 
55  return properties;
56 }
bool operator()(const edm::Ptr< reco::Candidate > &t1, const edm::Ptr< reco::Candidate > &t2) const
Base class for all types of Jets.
Definition: Jet.h:20
std::vector< Constituent > Constituents
Definition: Jet.h:23
virtual Constituents getJetConstituents() const
list of constituents
reco::CATopJetProperties operator()(reco::Jet const &ihardJet) const
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
double mass() const final
mass