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 // $Id: PFClusterJet.cc,v 1.1 2010/12/28 16:11:35 srappocc Exp $
2 
4 
5 
6 
8  : reco::Jet()
9 {
10 }
11 
12 
14  : reco::Jet(fP4, fVertex)
15 {
16 }
17 
18 
19 reco::PFClusterJet::PFClusterJet(const LorentzVector & fP4,const Point & fVertex, const Jet::Constituents & fConstituents)
20  : reco::Jet(fP4, fVertex, fConstituents)
21 {
22 }
23 
24 
25 
27  return new reco::PFClusterJet(*this);
28 }
29 
30 
31 
33  Constituent dau = daughterPtr (i);
34  // check the daughter to be ok
35  if ( dau.isNonnull() && dau.isAvailable() ) {
36  // convert to concrete candidate type
37  const RecoPFClusterRefCandidate* pfClusterCand = dynamic_cast <const RecoPFClusterRefCandidate*> (dau.get());
38  // check the candidate is of the right type
39  if (pfClusterCand) {
40  return pfClusterCand->pfCluster();
41  } else {
42  throw cms::Exception("Invalid Constituent") << "PFClusterJet constituent is not of RecoPFClusterRefCandidate type";
43  }
44  // otherwise return empty ptr
45  } else {
46  return reco::PFClusterRef();
47  }
48 }
49 
50 
51 
52 bool reco::PFClusterJet::overlap(const Candidate & dummy) const {
53  return false;
54 }
55 
56 
58  std::ostringstream out;
59  out << Jet::print() << std::endl;
60  out << " Constituents: " << std::endl;
61  for ( size_t i = 0; i < numberOfDaughters(); ++i ) {
62  out << *(pfCluster(i)) << std::endl;
63  }
64  return out.str();
65 }
int i
Definition: DBlmapReader.cc:9
Base class for all types of Jets.
Definition: Jet.h:21
std::vector< Constituent > Constituents
Definition: Jet.h:24
virtual std::string print() const
Print object.
Definition: PFClusterJet.cc:57
virtual PFClusterJet * clone() const
Polymorphic clone.
Definition: PFClusterJet.cc:26
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:152
Jets made out of PFClusters.
Definition: PFClusterJet.h:27
virtual bool overlap(const Candidate &dummy) const
Polymorphic overlap.
Definition: PFClusterJet.cc:52
T const * get() const
Returns C++ pointer to the item.
Definition: Ptr.h:143
edm::Ref< PFClusterCollection > PFClusterRef
persistent reference to PFCluster objects
Definition: PFClusterFwd.h:15
reco::PFClusterRef const & pfCluster() const
tuple out
Definition: dbtoconf.py:99
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:41
bool isAvailable() const
Definition: Ptr.h:158
math::XYZPoint Point
point in the space
Definition: Candidate.h:45
virtual std::string print() const
Print object.
Definition: Jet.cc:425
PFClusterJet()
Default constructor.
Definition: PFClusterJet.cc:7
reco::PFClusterRef pfCluster(size_t i) const
Easy Constituent access.
Definition: PFClusterJet.cc:32