CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_6/src/DataFormats/JetReco/src/PFClusterJet.cc

Go to the documentation of this file.
00001 // $Id: PFClusterJet.cc,v 1.1 2010/12/28 16:11:35 srappocc Exp $
00002 
00003 #include "DataFormats/JetReco/interface/PFClusterJet.h"
00004 
00005 
00006 
00007 reco::PFClusterJet::PFClusterJet()
00008   : reco::Jet()
00009 {
00010 }
00011 
00012 
00013 reco::PFClusterJet::PFClusterJet(const LorentzVector & fP4, const Point & fVertex) 
00014   : reco::Jet(fP4, fVertex)
00015 {
00016 }
00017 
00018 
00019 reco::PFClusterJet::PFClusterJet(const LorentzVector & fP4,const Point & fVertex, const Jet::Constituents & fConstituents)
00020   : reco::Jet(fP4, fVertex, fConstituents)
00021 {
00022 }
00023 
00024 
00025 
00026 reco::PFClusterJet * reco::PFClusterJet::clone() const {
00027   return new reco::PFClusterJet(*this);
00028 }
00029 
00030 
00031 
00032 reco::PFClusterRef reco::PFClusterJet::pfCluster(size_t i) const {
00033   Constituent dau = daughterPtr (i);
00034   // check the daughter to be ok
00035   if ( dau.isNonnull() && dau.isAvailable() ) {
00036     // convert to concrete candidate type
00037     const RecoPFClusterRefCandidate* pfClusterCand = dynamic_cast <const RecoPFClusterRefCandidate*> (dau.get());
00038     // check the candidate is of the right type
00039     if (pfClusterCand) {
00040       return pfClusterCand->pfCluster();
00041     } else {
00042      throw cms::Exception("Invalid Constituent") << "PFClusterJet constituent is not of RecoPFClusterRefCandidate type";
00043     }
00044   // otherwise return empty ptr
00045   } else {
00046     return reco::PFClusterRef();
00047   }
00048 }
00049 
00050 
00051 
00052 bool reco::PFClusterJet::overlap(const Candidate & dummy) const {
00053   return false;
00054 }
00055 
00056 
00057 std::string reco::PFClusterJet::print() const {
00058   std::ostringstream out;
00059   out << Jet::print() << std::endl;
00060   out << "    Constituents: " << std::endl;
00061   for ( size_t i = 0; i < numberOfDaughters(); ++i ) {
00062     out <<  *(pfCluster(i)) << std::endl;
00063   } 
00064   return out.str();
00065 }