CMS 3D CMS Logo

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 }
RandomServiceHelper.t2
t2
Definition: RandomServiceHelper.py:257
reco::Jet
Base class for all types of Jets.
Definition: Jet.h:20
reco::Jet::Constituents
std::vector< Constituent > Constituents
Definition: Jet.h:23
reco::CATopJetProperties
Definition: CATopJetTagInfo.h:21
CATopJetHelper::operator()
reco::CATopJetProperties operator()(reco::Jet const &ihardJet) const
Definition: CATopJetHelper.cc:9
RandomServiceHelper.t1
t1
Definition: RandomServiceHelper.py:256
reco::CATopJetProperties::minMass
double minMass
Definition: CATopJetTagInfo.h:30
reco::Jet::getJetConstituents
virtual Constituents getJetConstituents() const
list of constituents
reco::CATopJetProperties::nSubJets
int nSubJets
Definition: CATopJetTagInfo.h:29
reco::LeafCandidate::mass
double mass() const final
mass
Definition: LeafCandidate.h:131
reco::CATopJetProperties::wMass
double wMass
Definition: CATopJetTagInfo.h:32
GreaterByPtCandPtr
Definition: CATopJetHelper.cc:3
CATopJetHelper.h
CATopJetHelper::WMass_
double WMass_
Definition: CATopJetHelper.h:24
edm::Ptr< reco::Candidate >
reco::CATopJetProperties::topMass
double topMass
Definition: CATopJetTagInfo.h:31
GreaterByPtCandPtr::operator()
bool operator()(const edm::Ptr< reco::Candidate > &t1, const edm::Ptr< reco::Candidate > &t2) const
Definition: CATopJetHelper.cc:4
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36