CMS 3D CMS Logo

Classes | Public Member Functions | Private Member Functions | Private Attributes

reco::PFJet Class Reference

Jets made from PFObjects. More...

#include <PFJet.h>

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

List of all members.

Classes

struct  Specific

Public Member Functions

float chargedEmEnergy () const
 chargedEmEnergy
float chargedEmEnergyFraction () const
 chargedEmEnergyFraction
float chargedHadronEnergy () const
 chargedHadronEnergy
float chargedHadronEnergyFraction () const
 chargedHadronEnergyFraction
int chargedHadronMultiplicity () const
 chargedHadronMultiplicity
float chargedMuEnergy () const
 chargedMuEnergy
float chargedMuEnergyFraction () const
 chargedMuEnergyFraction
int chargedMultiplicity () const
 chargedMultiplicity
virtual PFJetclone () const
 Polymorphic clone.
float electronEnergy () const
 electronEnergy
float electronEnergyFraction () const
 electronEnergyFraction
int electronMultiplicity () const
 electronMultiplicity
virtual reco::PFCandidatePtr getPFConstituent (unsigned fIndex) const
 get specific constituent
virtual std::vector
< reco::PFCandidatePtr
getPFConstituents () const
 get all constituents
const SpecificgetSpecific () const
reco::TrackRefVector getTrackRefs () const
float HFEMEnergy () const
 HFEMEnergy.
float HFEMEnergyFraction () const
 HFEMEnergyFraction.
int HFEMMultiplicity () const
 HFEMMultiplicity.
float HFHadronEnergy () const
 HFHadronEnergy.
float HFHadronEnergyFraction () const
 HFHadronEnergyFraction.
int HFHadronMultiplicity () const
 HFHadronMultiplicity.
float muonEnergy () const
 muonEnergy
float muonEnergyFraction () const
 muonEnergyFraction
int muonMultiplicity () const
 muonMultiplicity
float neutralEmEnergy () const
 neutralEmEnergy
float neutralEmEnergyFraction () const
 neutralEmEnergyFraction
float neutralHadronEnergy () const
 neutralHadronEnergy
float neutralHadronEnergyFraction () const
 neutralHadronEnergyFraction
int neutralHadronMultiplicity () const
 neutralHadronMultiplicity
int neutralMultiplicity () const
 neutralMultiplicity
 PFJet (const LorentzVector &fP4, const Point &fVertex, const Specific &fSpecific, const Jet::Constituents &fConstituents)
 PFJet (const LorentzVector &fP4, const Specific &fSpecific, const Jet::Constituents &fConstituents)
 PFJet ()
 PFJet (const LorentzVector &fP4, const Point &fVertex, const Specific &fSpecific)
float photonEnergy () const
 photonEnergy
float photonEnergyFraction () const
 photonEnergyFraction
int photonMultiplicity () const
 photonMultiplicity
virtual std::string print () const
 Print object in details.
virtual ~PFJet ()

Private Member Functions

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

Private Attributes

Specific m_specific

Detailed Description

Jets made from PFObjects.

PFJet represents Jets made from Particle Flow objects Provide energy contributions from different PF types in addition to generic Jet parameters

Author:
Fedor Ratnikov, UMd, Apr 24, 2007
Version:
Id:
PFJet.h,v 1.20 2010/03/10 21:52:19 pandolf Exp

Definition at line 22 of file PFJet.h.


Constructor & Destructor Documentation

reco::PFJet::PFJet ( ) [inline]

Default constructor

Definition at line 75 of file PFJet.h.

Referenced by clone().

{}
PFJet::PFJet ( const LorentzVector fP4,
const Point fVertex,
const Specific fSpecific,
const Jet::Constituents fConstituents 
)

Constructor from values

Definition at line 16 of file PFJet.cc.

  : Jet (fP4, fVertex, fConstituents),
    m_specific (fSpecific)
{}
PFJet::PFJet ( const LorentzVector fP4,
const Point fVertex,
const Specific fSpecific 
)

Definition at line 23 of file PFJet.cc.

  : Jet (fP4, fVertex),
    m_specific (fSpecific)
{}
PFJet::PFJet ( const LorentzVector fP4,
const Specific fSpecific,
const Jet::Constituents fConstituents 
)

backward compatible, vertex=(0,0,0)

Definition at line 29 of file PFJet.cc.

  : Jet (fP4, Point(0,0,0), fConstituents),
    m_specific (fSpecific)
{}
virtual reco::PFJet::~PFJet ( ) [inline, virtual]

Definition at line 88 of file PFJet.h.

{};

Member Function Documentation

float reco::PFJet::chargedEmEnergy ( ) const [inline]
float reco::PFJet::chargedEmEnergyFraction ( ) const [inline]

chargedEmEnergyFraction

Definition at line 137 of file PFJet.h.

References chargedEmEnergy(), and reco::LeafCandidate::energy().

Referenced by PFJetIDSelectionFunctor::firstDataCuts(), and FFTGenericScaleCalculator::mapFFTJet().

{return chargedEmEnergy () / energy ();}
float reco::PFJet::chargedHadronEnergy ( ) const [inline]
float reco::PFJet::chargedHadronEnergyFraction ( ) const [inline]

chargedHadronEnergyFraction

Definition at line 93 of file PFJet.h.

References chargedHadronEnergy(), and reco::LeafCandidate::energy().

Referenced by PFJetIDSelectionFunctor::firstDataCuts(), FFTGenericScaleCalculator::mapFFTJet(), and reco::operator<<().

{return chargedHadronEnergy () / energy ();}
int reco::PFJet::chargedHadronMultiplicity ( ) const [inline]
float reco::PFJet::chargedMuEnergy ( ) const [inline]

chargedMuEnergy

Definition at line 139 of file PFJet.h.

References m_specific, and reco::PFJet::Specific::mChargedMuEnergy.

Referenced by chargedMuEnergyFraction(), print(), and PFJetBenchmark::printPFJet().

float reco::PFJet::chargedMuEnergyFraction ( ) const [inline]

chargedMuEnergyFraction

Definition at line 141 of file PFJet.h.

References chargedMuEnergy(), and reco::LeafCandidate::energy().

Referenced by FFTGenericScaleCalculator::mapFFTJet().

{return chargedMuEnergy () / energy ();}
int reco::PFJet::chargedMultiplicity ( ) const [inline]
PFJet * PFJet::clone ( void  ) const [virtual]

Polymorphic clone.

Reimplemented from reco::CompositePtrCandidate.

Definition at line 76 of file PFJet.cc.

References PFJet().

                           {
  return new PFJet (*this);
}
float reco::PFJet::electronEnergy ( ) const [inline]

electronEnergy

Definition at line 103 of file PFJet.h.

References m_specific, and reco::PFJet::Specific::mElectronEnergy.

Referenced by electronEnergyFraction(), and print().

float reco::PFJet::electronEnergyFraction ( ) const [inline]

electronEnergyFraction

Definition at line 105 of file PFJet.h.

References electronEnergy(), and reco::LeafCandidate::energy().

Referenced by FFTGenericScaleCalculator::mapFFTJet(), and reco::operator<<().

{return electronEnergy () / energy ();}
int reco::PFJet::electronMultiplicity ( ) const [inline]
reco::PFCandidatePtr PFJet::getPFConstituent ( unsigned  fIndex) const [virtual]

get specific constituent

Definition at line 36 of file PFJet.cc.

References reco::CompositePtrCandidate::dau, reco::CompositePtrCandidate::daughterPtr(), Exception, edm::Ptr< T >::get(), edm::Ptr< T >::id(), edm::Ptr< T >::isAvailable(), edm::Ptr< T >::isNonnull(), and edm::Ptr< T >::key().

Referenced by getPFConstituents(), and getTrackRefs().

                                                                 {

  Constituent dau = daughterPtr (fIndex);
  if ( dau.isNonnull() && dau.isAvailable() ) {
    const PFCandidate* pfCandidate = dynamic_cast <const PFCandidate*> (dau.get());
    if (pfCandidate) {
      return edm::Ptr<PFCandidate> (dau.id(), pfCandidate, dau.key() );
    }
    else {
      throw cms::Exception("Invalid Constituent") << "PFJet constituent is not of PFCandidate type";
    }
   }
   else {
     return PFCandidatePtr();
   }
}
std::vector< reco::PFCandidatePtr > PFJet::getPFConstituents ( ) const [virtual]
const Specific& reco::PFJet::getSpecific ( ) const [inline]

Definition at line 166 of file PFJet.h.

References m_specific.

{return m_specific;}
reco::TrackRefVector PFJet::getTrackRefs ( ) const

\ brief get all tracks in the jets All PFCandidates hold a reference to a track. All the non-null references are added to the returned TrackRefVector

Definition at line 60 of file PFJet.cc.

References chargedMultiplicity(), getPFConstituent(), i, edm::Ref< C, T, F >::isNonnull(), reco::CompositePtrCandidate::numberOfDaughters(), edm::RefVector< C, T, F >::push_back(), edm::RefVector< C, T, F >::reserve(), and query::result.

Referenced by JetTracksAssociationExplicit::produce().

                                             {
  // result will contain chargedMultiplicity() elements
  reco::TrackRefVector result;
  result.reserve( chargedMultiplicity() );
  for (unsigned i = 0;  i <  numberOfDaughters (); i++) {
    const reco::PFCandidatePtr pfcand = getPFConstituent (i);
    reco::TrackRef trackref = pfcand->trackRef();
    if( trackref.isNonnull() ) {
      result.push_back( trackref );
    }
  }

  return result;
}
float reco::PFJet::HFEMEnergy ( ) const [inline]

HFEMEnergy.

Definition at line 115 of file PFJet.h.

References m_specific, and reco::PFJet::Specific::mHFEMEnergy.

Referenced by HFEMEnergyFraction(), and print().

float reco::PFJet::HFEMEnergyFraction ( ) const [inline]

HFEMEnergyFraction.

Definition at line 117 of file PFJet.h.

References reco::LeafCandidate::energy(), and HFEMEnergy().

Referenced by FFTGenericScaleCalculator::mapFFTJet(), and reco::operator<<().

{return HFEMEnergy () / energy ();}
int reco::PFJet::HFEMMultiplicity ( ) const [inline]

HFEMMultiplicity.

Definition at line 132 of file PFJet.h.

References m_specific, and reco::PFJet::Specific::mHFEMMultiplicity.

Referenced by FFTGenericScaleCalculator::mapFFTJet(), and print().

float reco::PFJet::HFHadronEnergy ( ) const [inline]
float reco::PFJet::HFHadronEnergyFraction ( ) const [inline]

HFHadronEnergyFraction.

Definition at line 113 of file PFJet.h.

References reco::LeafCandidate::energy(), and HFHadronEnergy().

Referenced by FFTGenericScaleCalculator::mapFFTJet(), and reco::operator<<().

{return HFHadronEnergy () / energy ();}
int reco::PFJet::HFHadronMultiplicity ( ) const [inline]

HFHadronMultiplicity.

Definition at line 130 of file PFJet.h.

References m_specific, and reco::PFJet::Specific::mHFHadronMultiplicity.

Referenced by FFTGenericScaleCalculator::mapFFTJet(), and print().

float reco::PFJet::muonEnergy ( ) const [inline]

muonEnergy

Definition at line 107 of file PFJet.h.

References m_specific, and reco::PFJet::Specific::mMuonEnergy.

Referenced by muonEnergyFraction(), and print().

float reco::PFJet::muonEnergyFraction ( ) const [inline]

muonEnergyFraction

Definition at line 109 of file PFJet.h.

References reco::LeafCandidate::energy(), and muonEnergy().

Referenced by FFTGenericScaleCalculator::mapFFTJet(), and reco::operator<<().

{return muonEnergy () / energy ();}
int reco::PFJet::muonMultiplicity ( ) const [inline]
float reco::PFJet::neutralEmEnergy ( ) const [inline]
float reco::PFJet::neutralEmEnergyFraction ( ) const [inline]

neutralEmEnergyFraction

Definition at line 145 of file PFJet.h.

References reco::LeafCandidate::energy(), and neutralEmEnergy().

Referenced by PFJetIDSelectionFunctor::firstDataCuts(), and FFTGenericScaleCalculator::mapFFTJet().

{return neutralEmEnergy () / energy ();}
float reco::PFJet::neutralHadronEnergy ( ) const [inline]
float reco::PFJet::neutralHadronEnergyFraction ( ) const [inline]

neutralHadronEnergyFraction

Definition at line 97 of file PFJet.h.

References reco::LeafCandidate::energy(), and neutralHadronEnergy().

Referenced by FFTGenericScaleCalculator::mapFFTJet(), and reco::operator<<().

{return neutralHadronEnergy () / energy ();}
int reco::PFJet::neutralHadronMultiplicity ( ) const [inline]
int reco::PFJet::neutralMultiplicity ( ) const [inline]
bool PFJet::overlap ( const Candidate ) const [private, virtual]

Polymorphic overlap.

Reimplemented from reco::CompositePtrCandidate.

Definition at line 80 of file PFJet.cc.

                                             {
  return false;
}
float reco::PFJet::photonEnergy ( ) const [inline]

photonEnergy

Definition at line 99 of file PFJet.h.

References m_specific, and reco::PFJet::Specific::mPhotonEnergy.

Referenced by photonEnergyFraction(), and print().

float reco::PFJet::photonEnergyFraction ( ) const [inline]

photonEnergyFraction

Definition at line 101 of file PFJet.h.

References reco::LeafCandidate::energy(), and photonEnergy().

Referenced by FFTGenericScaleCalculator::mapFFTJet(), and reco::operator<<().

{return photonEnergy () / energy ();}
int reco::PFJet::photonMultiplicity ( ) const [inline]
std::string PFJet::print ( void  ) const [virtual]

Print object in details.

Reimplemented from reco::Jet.

Definition at line 84 of file PFJet.cc.

References chargedEmEnergy(), chargedHadronEnergy(), chargedHadronMultiplicity(), chargedMuEnergy(), chargedMultiplicity(), electronEnergy(), electronMultiplicity(), getPFConstituents(), HFEMEnergy(), HFEMMultiplicity(), HFHadronEnergy(), HFHadronMultiplicity(), i, muonEnergy(), muonMultiplicity(), neutralEmEnergy(), neutralHadronEnergy(), neutralHadronMultiplicity(), neutralMultiplicity(), dbtoconf::out, photonEnergy(), and photonMultiplicity().

Referenced by PFJetBenchmark::printPFJet().

                              {
  std::ostringstream out;
  out << Jet::print () // generic jet info
      << "    PFJet specific:" << std::endl
      << "      charged hadron energy/multiplicity: " << chargedHadronEnergy () << '/' << chargedHadronMultiplicity () << std::endl
      << "      neutral hadron energy/multiplicity: " << neutralHadronEnergy () << '/' << neutralHadronMultiplicity () << std::endl
      << "      photon energy/multiplicity: " << photonEnergy () << '/' << photonMultiplicity () << std::endl
      << "      electron energy/multiplicity: " << electronEnergy () << '/' << electronMultiplicity () << std::endl
      << "      muon energy/multiplicity: " << muonEnergy () << '/' << muonMultiplicity () << std::endl
      << "      HF Hadron energy/multiplicity: " << HFHadronEnergy () << '/' << HFHadronMultiplicity () << std::endl
      << "      HF EM particle energy/multiplicity: " << HFEMEnergy () << '/' << HFEMMultiplicity () << std::endl
      << "      charged/neutral hadrons energy: " << chargedHadronEnergy () << '/' << neutralHadronEnergy () << std::endl
      << "      charged/neutral em energy: " << chargedEmEnergy () << '/' << neutralEmEnergy () << std::endl
      << "      charged muon energy: " << chargedMuEnergy () << '/' << std::endl
      << "      charged/neutral multiplicity: " << chargedMultiplicity () << '/' << neutralMultiplicity () << std::endl;
  out << "      PFCandidate constituents:" << std::endl;
  std::vector <PFCandidatePtr> constituents = getPFConstituents ();
  for (unsigned i = 0; i < constituents.size (); ++i) {
    if (constituents[i].get()) {
      out << "      #" << i << " " << *(constituents[i]) << std::endl;
    }
    else {
      out << "      #" << i << " PFCandidate is not available in the event"  << std::endl;
    }
  }
  return out.str ();
}

Member Data Documentation