CMS 3D CMS Logo

PFClusterJet.cc
Go to the documentation of this file.
1 
3 
4 
5 
7  : reco::Jet()
8 {
9 }
10 
11 
13  : reco::Jet(fP4, fVertex)
14 {
15 }
16 
17 
18 reco::PFClusterJet::PFClusterJet(const LorentzVector & fP4,const Point & fVertex, const Jet::Constituents & fConstituents)
19  : reco::Jet(fP4, fVertex, fConstituents)
20 {
21 }
22 
23 
24 
26  return new reco::PFClusterJet(*this);
27 }
28 
29 
30 
33  // check the daughter to be ok
34  if ( dau.isNonnull() && dau.isAvailable() ) {
35  // convert to concrete candidate type
36  const RecoPFClusterRefCandidate* pfClusterCand = dynamic_cast <const RecoPFClusterRefCandidate*> (dau.get());
37  // check the candidate is of the right type
38  if (pfClusterCand) {
39  return pfClusterCand->pfCluster();
40  } else {
41  throw cms::Exception("Invalid Constituent") << "PFClusterJet constituent is not of RecoPFClusterRefCandidate type";
42  }
43  // otherwise return empty ptr
44  } else {
45  return reco::PFClusterRef();
46  }
47 }
48 
49 
50 
52  return false;
53 }
54 
55 
57  std::ostringstream out;
58  out << Jet::print() << std::endl;
59  out << " Constituents: " << std::endl;
60  for ( size_t i = 0; i < numberOfDaughters(); ++i ) {
61  out << *(pfCluster(i)) << std::endl;
62  }
63  return out.str();
64 }
PFClusterJet * clone() const override
Polymorphic clone.
Definition: PFClusterJet.cc:25
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:159
bool overlap(const Candidate &dummy) const override
Polymorphic overlap.
Definition: PFClusterJet.cc:51
bool isAvailable() const
Definition: Ptr.h:258
std::vector< Constituent > Constituents
Definition: Jet.h:23
size_t numberOfDaughters() const override
number of daughters
daughters dau
collection of references to daughters
Jets made out of PFClusters.
Definition: PFClusterJet.h:26
virtual std::string print() const
Print object.
Definition: Jet.py:1
edm::Ref< PFClusterCollection > PFClusterRef
persistent reference to PFCluster objects
Definition: PFClusterFwd.h:15
reco::PFClusterRef pfCluster() const
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:168
virtual CandidatePtr daughterPtr(size_type i) const
reference to daughter at given position
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
fixed size matrix
math::XYZPoint Point
point in the space
Definition: Candidate.h:41
PFClusterJet()
Default constructor.
Definition: PFClusterJet.cc:6
reco::PFClusterRef pfCluster(size_t i) const
Easy Constituent access.
Definition: PFClusterJet.cc:31
std::string print() const override
Print object.
Definition: PFClusterJet.cc:56