CMS 3D CMS Logo

Public Member Functions | Private Member Functions

reco::PFClusterJet Class Reference

Jets made out of PFClusters. More...

#include <PFClusterJet.h>

Inheritance diagram for reco::PFClusterJet:
reco::Jet reco::CompositePtrCandidate reco::LeafCandidate reco::Candidate

List of all members.

Public Member Functions

virtual PFClusterJetclone () const
 Polymorphic clone.
reco::PFClusterRef pfCluster (size_t i) const
 Easy Constituent access.
 PFClusterJet ()
 Default constructor.
 PFClusterJet (const LorentzVector &fP4, const Point &fVertex)
 Constructor without constituents.
 PFClusterJet (const LorentzVector &fP4, const Point &fVertex, const Jet::Constituents &fConstituents)
 Constructor from RecoChargedRefCandidate constituents.
virtual std::string print () const
 Print object.
virtual ~PFClusterJet ()
 Destructor.

Private Member Functions

virtual bool overlap (const Candidate &dummy) const
 Polymorphic overlap.

Detailed Description

Jets made out of PFClusters.

PFClusterJet represents Jets with PFClusters as constituents. The consitutents are in this case RecoPFClusterRefCandidates, that preserve the Refs to the original PFClusters. Those Refs are used to provide transparent access to the PFClusters.

Author:
Salvatore Rappoccio
Id:
PFClusterJet.h,v 1.1 2010/12/28 16:11:35 srappocc Exp

Definition at line 27 of file PFClusterJet.h.


Constructor & Destructor Documentation

reco::PFClusterJet::PFClusterJet ( )

Default constructor.

Definition at line 7 of file PFClusterJet.cc.

  : reco::Jet()
{
}
reco::PFClusterJet::PFClusterJet ( const LorentzVector fP4,
const Point fVertex 
)

Constructor without constituents.

Definition at line 13 of file PFClusterJet.cc.

  : reco::Jet(fP4, fVertex)
{
}
reco::PFClusterJet::PFClusterJet ( const LorentzVector fP4,
const Point fVertex,
const Jet::Constituents fConstituents 
)

Constructor from RecoChargedRefCandidate constituents.

Definition at line 19 of file PFClusterJet.cc.

  : reco::Jet(fP4, fVertex, fConstituents)
{
}
virtual reco::PFClusterJet::~PFClusterJet ( ) [inline, virtual]

Destructor.

Definition at line 38 of file PFClusterJet.h.

{}

Member Function Documentation

reco::PFClusterJet * reco::PFClusterJet::clone ( void  ) const [virtual]

Polymorphic clone.

Reimplemented from reco::CompositePtrCandidate.

Definition at line 26 of file PFClusterJet.cc.

                                                 {
  return new reco::PFClusterJet(*this);
}
bool reco::PFClusterJet::overlap ( const Candidate dummy) const [private, virtual]

Polymorphic overlap.

Reimplemented from reco::CompositePtrCandidate.

Definition at line 52 of file PFClusterJet.cc.

                                                            {
  return false;
}
reco::PFClusterRef reco::PFClusterJet::pfCluster ( size_t  i) const

Easy Constituent access.

Definition at line 32 of file PFClusterJet.cc.

References Exception, edm::Ptr< T >::get(), edm::Ptr< T >::isAvailable(), edm::Ptr< T >::isNonnull(), and reco::RecoPFClusterRefCandidate::pfCluster().

                                                           {
  Constituent dau = daughterPtr (i);
  // check the daughter to be ok
  if ( dau.isNonnull() && dau.isAvailable() ) {
    // convert to concrete candidate type
    const RecoPFClusterRefCandidate* pfClusterCand = dynamic_cast <const RecoPFClusterRefCandidate*> (dau.get());
    // check the candidate is of the right type
    if (pfClusterCand) {
      return pfClusterCand->pfCluster();
    } else {
     throw cms::Exception("Invalid Constituent") << "PFClusterJet constituent is not of RecoPFClusterRefCandidate type";
    }
  // otherwise return empty ptr
  } else {
    return reco::PFClusterRef();
  }
}
std::string reco::PFClusterJet::print ( void  ) const [virtual]

Print object.

Reimplemented from reco::Jet.

Definition at line 57 of file PFClusterJet.cc.

References i, dbtoconf::out, and reco::Jet::print().

                                        {
  std::ostringstream out;
  out << Jet::print() << std::endl;
  out << "    Constituents: " << std::endl;
  for ( size_t i = 0; i < numberOfDaughters(); ++i ) {
    out <<  *(pfCluster(i)) << std::endl;
  } 
  return out.str();
}