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 }
mps_fire.i
i
Definition: mps_fire.py:355
reco::Jet::Constituents
std::vector< Constituent > Constituents
Definition: Jet.h:23
reco::PFClusterJet::overlap
bool overlap(const Candidate &dummy) const override
Polymorphic overlap.
Definition: PFClusterJet.cc:32
reco::RecoPFClusterRefCandidate::pfCluster
reco::PFClusterRef pfCluster() const
Definition: RecoPFClusterRefCandidate.h:21
reco::PFClusterJet::clone
PFClusterJet * clone() const override
Polymorphic clone.
Definition: PFClusterJet.cc:11
edm::Ptr::get
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:139
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
reco::PFClusterJet::print
std::string print() const override
Print object.
Definition: PFClusterJet.cc:34
edm::Ref< PFClusterCollection >
reco::PFClusterRef
edm::Ref< PFClusterCollection > PFClusterRef
persistent reference to PFCluster objects
Definition: PFClusterFwd.h:15
Jet
Definition: Jet.py:1
reco::Jet::print
virtual std::string print() const
Print object.
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PFClusterJet.h
Point
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
edm::Ptr< Candidate >
reco::Candidate
Definition: Candidate.h:27
Exception
Definition: hltDiff.cc:246
edm::Ptr::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
edm::Ptr::isAvailable
bool isAvailable() const
Definition: Ptr.h:229
reco::PFClusterJet::pfCluster
reco::PFClusterRef pfCluster(size_t i) const
Easy Constituent access.
Definition: PFClusterJet.cc:13
dummy
Definition: DummySelector.h:38
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
reco::PFClusterJet
Jets made out of PFClusters.
Definition: PFClusterJet.h:23
reco::RecoPFClusterRefCandidate
Definition: RecoPFClusterRefCandidate.h:12
reco::PFClusterJet::PFClusterJet
PFClusterJet()
Default constructor.
Definition: PFClusterJet.cc:4