CMS 3D CMS Logo

reco::PFJet Class Reference

Jets made from PFObjects. More...

#include <DataFormats/JetReco/interface/PFJet.h>

Inheritance diagram for reco::PFJet:

reco::Jet reco::CompositePtrCandidate reco::Candidate reco::Particle

List of all members.

Public Member Functions

float chargedEmEnergy () const
 chargedEmEnergy
float chargedEmEnergyFraction () const
 chargedEmEnergyFraction
float chargedHadronEnergy () const
 chargedHadronEnergy
float chargedHadronEnergyFraction () const
 chargedHadronEnergyFraction
float chargedMuEnergy () const
 chargedMuEnergy
float chargedMuEnergyFraction () const
 chargedMuEnergyFraction
int chargedMultiplicity () const
 chargedMultiplicity
virtual PFJetclone () const
 Polymorphic clone.
virtual const reco::PFCandidategetPFConstituent (unsigned fIndex) const
 get specific constituent
virtual std::vector< const
reco::PFCandidate * > 
getPFConstituents () const
 get all constituents
const SpecificgetSpecific () const
reco::TrackRefVector getTrackRefs () const
 \ brief get all tracks in the jets All PFCandidates hold a reference to a track.
int muonMultiplicity () const
 muonMultiplicity
float neutralEmEnergy () const
 neutralEmEnergy
float neutralEmEnergyFraction () const
 neutralEmEnergyFraction
float neutralHadronEnergy () const
 neutralHadronEnergy
float neutralHadronEnergyFraction () const
 neutralHadronEnergyFraction
int neutralMultiplicity () const
 neutralMultiplicity
 PFJet (const LorentzVector &fP4, const Specific &fSpecific, const Jet::Constituents &fConstituents)
 backward compatible, vertex=(0,0,0)
 PFJet (const LorentzVector &fP4, const Point &fVertex, const Specific &fSpecific)
 PFJet (const LorentzVector &fP4, const Point &fVertex, const Specific &fSpecific, const Jet::Constituents &fConstituents)
 Constructor from values.
 PFJet ()
 Default constructor.
virtual std::string print () const
 Print object.
virtual ~PFJet ()

Static Public Member Functions

static const reco::PFCandidategetPFCandidate (const reco::Candidate *fConstituent)
 convert generic constituent to specific type

Private Member Functions

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

Private Attributes

Specific m_specific

Friends

std::ostream & operator<< (std::ostream &out, const reco::PFJet &jet)

Classes

struct  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.17 2008/07/27 16:22:21 cbern Exp

Definition at line 23 of file PFJet.h.


Constructor & Destructor Documentation

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

Default constructor.

Definition at line 47 of file PFJet.h.

Referenced by clone().

00047 {}

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.

00019   : Jet (fP4, fVertex, fConstituents),
00020     m_specific (fSpecific)
00021 {}

PFJet::PFJet ( const LorentzVector fP4,
const Point fVertex,
const Specific fSpecific 
)

Definition at line 23 of file PFJet.cc.

00025   : Jet (fP4, fVertex),
00026     m_specific (fSpecific)
00027 {}

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.

00032   : Jet (fP4, Point(0,0,0), fConstituents),
00033     m_specific (fSpecific)
00034 {}

virtual reco::PFJet::~PFJet (  )  [inline, virtual]

Definition at line 60 of file PFJet.h.

00060 {};


Member Function Documentation

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

chargedEmEnergy

Definition at line 71 of file PFJet.h.

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

Referenced by PFJetAnalyzer::analyze(), chargedEmEnergyFraction(), print(), and PFJetBenchmark::printPFJet().

00071 {return m_specific.mChargedEmEnergy;}

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

chargedEmEnergyFraction

Definition at line 73 of file PFJet.h.

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

00073 {return chargedEmEnergy () / energy ();}

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

chargedHadronEnergy

Definition at line 63 of file PFJet.h.

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

Referenced by PFJetAnalyzer::analyze(), chargedHadronEnergyFraction(), print(), PFJetBenchmark::printPFJet(), and PFJetBenchmark::process().

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

chargedHadronEnergyFraction

Definition at line 65 of file PFJet.h.

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

Referenced by reco::operator<<().

00065 {return chargedHadronEnergy () / energy ();}

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

chargedMuEnergy

Definition at line 75 of file PFJet.h.

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

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

00075 {return m_specific.mChargedMuEnergy;}

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

chargedMuEnergyFraction

Definition at line 77 of file PFJet.h.

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

00077 {return chargedMuEnergy () / energy ();}

int reco::PFJet::chargedMultiplicity (  )  const [inline]

chargedMultiplicity

Definition at line 83 of file PFJet.h.

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

Referenced by PFJetAnalyzer::analyze(), PFJetTester::fillMatchHists(), getTrackRefs(), print(), and PFJetBenchmark::printPFJet().

PFJet * PFJet::clone ( void   )  const [virtual]

Polymorphic clone.

Reimplemented from reco::CompositePtrCandidate.

Definition at line 76 of file PFJet.cc.

References PFJet().

00076                            {
00077   return new PFJet (*this);
00078 }

const reco::PFCandidate * PFJet::getPFCandidate ( const reco::Candidate fConstituent  )  [static]

convert generic constituent to specific type

Definition at line 36 of file PFJet.cc.

References Exception, edm::RefToBase< T >::get(), reco::Candidate::hasMasterClone(), and reco::Candidate::masterClone().

Referenced by getPFConstituent().

00036                                                                                {
00037   if (!fConstituent) return 0;
00038   const reco::Candidate* base = fConstituent;
00039   if (fConstituent->hasMasterClone ()) base = fConstituent->masterClone().get();
00040   if (!base) return 0; // not in the event
00041   const PFCandidate* candidate = dynamic_cast <const PFCandidate*> (base);
00042   if (!candidate) {
00043     throw cms::Exception("Invalid Constituent") << "PFJet constituent is not of PFCandidate type."
00044                                                 << "Actual type is " << typeid (*base).name();
00045   }
00046   return candidate;
00047 }

const reco::PFCandidate * PFJet::getPFConstituent ( unsigned  fIndex  )  const [virtual]

get specific constituent

Definition at line 49 of file PFJet.cc.

References reco::CompositePtrCandidate::daughter(), and getPFCandidate().

Referenced by getPFConstituents(), and getTrackRefs().

00049                                                                      {
00050   return getPFCandidate (daughter (fIndex));
00051 }

std::vector< const reco::PFCandidate * > PFJet::getPFConstituents (  )  const [virtual]

get all constituents

Definition at line 53 of file PFJet.cc.

References getPFConstituent(), i, reco::CompositePtrCandidate::numberOfDaughters(), and HLT_VtxMuL3::result.

Referenced by print().

00053                                                                    {
00054   std::vector <const reco::PFCandidate*> result;
00055   for (unsigned i = 0;  i <  numberOfDaughters (); i++) result.push_back (getPFConstituent (i));
00056   return result;
00057 }

const Specific& reco::PFJet::getSpecific (  )  const [inline]

Definition at line 106 of file PFJet.h.

References m_specific.

00106 {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(), HLT_VtxMuL3::result, and reco::PFCandidate::trackRef().

00060                                              {
00061   // result will contain chargedMultiplicity() elements
00062   reco::TrackRefVector result;
00063   result.reserve( chargedMultiplicity() );
00064   for (unsigned i = 0;  i <  numberOfDaughters (); i++) {
00065     const reco::PFCandidate* pfcand = getPFConstituent (i);
00066     reco::TrackRef trackref = pfcand->trackRef();
00067     if( trackref.isNonnull() ) {
00068       result.push_back( trackref );
00069     }
00070   }
00071 
00072   return result;
00073 }

int reco::PFJet::muonMultiplicity (  )  const [inline]

muonMultiplicity

Definition at line 87 of file PFJet.h.

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

00087 {return m_specific.mMuonMultiplicity;}

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

neutralEmEnergy

Definition at line 79 of file PFJet.h.

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

Referenced by PFJetAnalyzer::analyze(), neutralEmEnergyFraction(), print(), PFJetBenchmark::printPFJet(), and PFJetBenchmark::process().

00079 {return m_specific.mNeutralEmEnergy;}

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

neutralEmEnergyFraction

Definition at line 81 of file PFJet.h.

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

Referenced by reco::operator<<().

00081 {return neutralEmEnergy () / energy ();}

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

neutralHadronEnergy

Definition at line 67 of file PFJet.h.

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

Referenced by PFJetAnalyzer::analyze(), neutralHadronEnergyFraction(), print(), PFJetBenchmark::printPFJet(), and PFJetBenchmark::process().

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

neutralHadronEnergyFraction

Definition at line 69 of file PFJet.h.

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

Referenced by reco::operator<<().

00069 {return neutralHadronEnergy () / energy ();}

int reco::PFJet::neutralMultiplicity (  )  const [inline]

neutralMultiplicity

Definition at line 85 of file PFJet.h.

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

Referenced by PFJetAnalyzer::analyze(), PFJetTester::fillMatchHists(), print(), and PFJetBenchmark::printPFJet().

bool PFJet::overlap ( const Candidate  )  const [private, virtual]

Polymorphic overlap.

Reimplemented from reco::CompositePtrCandidate.

Definition at line 80 of file PFJet.cc.

00080                                              {
00081   return false;
00082 }

std::string PFJet::print ( void   )  const [virtual]

Print object.

Reimplemented from reco::Jet.

Definition at line 84 of file PFJet.cc.

References chargedEmEnergy(), chargedHadronEnergy(), chargedMuEnergy(), chargedMultiplicity(), lat::endl(), getPFConstituents(), i, neutralEmEnergy(), neutralHadronEnergy(), neutralMultiplicity(), out, and print().

00084                               {
00085   std::ostringstream out;
00086   out << Jet::print () // generic jet info
00087       << "    PFJet specific:" << std::endl
00088       << "      charged/neutral hadrons energy: " << chargedHadronEnergy () << '/' << neutralHadronEnergy () << std::endl
00089       << "      charged/neutral em energy: " << chargedEmEnergy () << '/' << neutralEmEnergy () << std::endl
00090       << "      charged muon energy: " << chargedMuEnergy () << '/' << std::endl
00091       << "      charged/neutral multiplicity: " << chargedMultiplicity () << '/' << neutralMultiplicity () << std::endl;
00092   out << "      PFCandidate constituents:" << std::endl;
00093   std::vector <const PFCandidate*> constituents = getPFConstituents ();
00094   for (unsigned i = 0; i < constituents.size (); ++i) {
00095     if (constituents[i]) {
00096       out << "      #" << i << " " << *(constituents[i]) << std::endl;
00097     }
00098     else {
00099       out << "      #" << i << " PFCandidate is not available in the event"  << std::endl;
00100     }
00101   }
00102   return out.str ();
00103 }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const reco::PFJet jet 
) [friend]

Definition at line 105 of file PFJet.cc.

00105                                                                   {
00106 
00107   if(!out ) return out;
00108   out<<"PFJet "
00109      <<"(pt, eta, phi) = "<<jet.pt()<<","<<jet.eta()<<","<<jet.phi()
00110      <<"  (CHEF,NHEF,GEF) = "
00111      <<jet.chargedHadronEnergyFraction()<<","
00112      <<jet.neutralHadronEnergyFraction()<<","
00113      <<jet.neutralEmEnergyFraction();
00114   return out;
00115 }


Member Data Documentation

Specific reco::PFJet::m_specific [private]

Definition at line 121 of file PFJet.h.

Referenced by chargedEmEnergy(), chargedHadronEnergy(), chargedMuEnergy(), chargedMultiplicity(), getSpecific(), muonMultiplicity(), neutralEmEnergy(), neutralHadronEnergy(), and neutralMultiplicity().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:51:21 2009 for CMSSW by  doxygen 1.5.4