test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
32  Constituent dau = daughterPtr (i);
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 
51 bool reco::PFClusterJet::overlap(const Candidate & dummy) const {
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 }
int i
Definition: DBlmapReader.cc:9
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:160
Base class for all types of Jets.
Definition: Jet.h:20
bool isAvailable() const
Definition: Ptr.h:259
std::vector< Constituent > Constituents
Definition: Jet.h:23
virtual std::string print() const
Print object.
Definition: PFClusterJet.cc:56
virtual PFClusterJet * clone() const
Polymorphic clone.
Definition: PFClusterJet.cc:25
Jets made out of PFClusters.
Definition: PFClusterJet.h:26
virtual bool overlap(const Candidate &dummy) const
Polymorphic overlap.
Definition: PFClusterJet.cc:51
virtual std::string print() const
Print object.
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:169
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
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