CMS 3D CMS Logo

PFClusterJet.cc
Go to the documentation of this file.
1 
3 
5 
6 reco::PFClusterJet::PFClusterJet(const LorentzVector& fP4, const Point& fVertex) : reco::Jet(fP4, fVertex) {}
7 
8 reco::PFClusterJet::PFClusterJet(const LorentzVector& fP4, const Point& fVertex, const Jet::Constituents& fConstituents)
9  : reco::Jet(fP4, fVertex, fConstituents) {}
10 
12 
14  Constituent dau = daughterPtr(i);
15  // check the daughter to be ok
16  if (dau.isNonnull() && dau.isAvailable()) {
17  // convert to concrete candidate type
18  const RecoPFClusterRefCandidate* pfClusterCand = dynamic_cast<const RecoPFClusterRefCandidate*>(dau.get());
19  // check the candidate is of the right type
20  if (pfClusterCand) {
21  return pfClusterCand->pfCluster();
22  } else {
23  throw cms::Exception("Invalid Constituent")
24  << "PFClusterJet constituent is not of RecoPFClusterRefCandidate type";
25  }
26  // otherwise return empty ptr
27  } else {
28  return reco::PFClusterRef();
29  }
30 }
31 
32 bool reco::PFClusterJet::overlap(const Candidate& dummy) const { return false; }
33 
35  std::ostringstream out;
36  out << Jet::print() << std::endl;
37  out << " Constituents: " << std::endl;
38  for (size_t i = 0; i < numberOfDaughters(); ++i) {
39  out << *(pfCluster(i)) << std::endl;
40  }
41  return out.str();
42 }
PFClusterJet * clone() const override
Polymorphic clone.
Definition: PFClusterJet.cc:11
bool overlap(const Candidate &dummy) const override
Polymorphic overlap.
Definition: PFClusterJet.cc:32
std::vector< Constituent > Constituents
Definition: Jet.h:23
std::string print() const override
Print object.
Definition: PFClusterJet.cc:34
reco::PFClusterRef pfCluster() const
bool isAvailable() const
Definition: Ptr.h:232
Jets made out of PFClusters.
Definition: PFClusterJet.h:23
Definition: Jet.py:1
edm::Ref< PFClusterCollection > PFClusterRef
persistent reference to PFCluster objects
Definition: PFClusterFwd.h:15
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
virtual std::string print() const
Print object.
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:139
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
fixed size matrix
Structure Point Contains parameters of Gaussian fits to DMRs.
PFClusterJet()
Default constructor.
Definition: PFClusterJet.cc:4
reco::PFClusterRef pfCluster(size_t i) const
Easy Constituent access.
Definition: PFClusterJet.cc:13