CMS 3D CMS Logo

reco::GenJet Class Reference

Jets made from MC generator particles. More...

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

Inheritance diagram for reco::GenJet:

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

List of all members.

Public Member Functions

float auxiliaryEnergy () const
 Returns other energy (undecayed Sigmas etc.
virtual GenJetclone () const
 Polymorphic clone.
float detectorEta (float fZVertex) const
 Detector Eta (use reference Z and jet kinematics only).
float emEnergy () const
 Returns energy of electromagnetic particles.
 GenJet (const LorentzVector &fP4, const Specific &fSpecific, const Jet::Constituents &fConstituents)
 backward compatible, vertex=(0,0,0)
 GenJet (const LorentzVector &fP4, const Point &fVertex, const Specific &fSpecific)
 GenJet (const LorentzVector &fP4, const Point &fVertex, const Specific &fSpecific, const Jet::Constituents &fConstituents)
 Constructor from values.
 GenJet ()
 Default constructor.
virtual const GenParticlegetGenConstituent (unsigned fIndex) const
 get specific constituent
virtual std::vector< const
GenParticle * > 
getGenConstituents () const
 get all constituents
const SpecificgetSpecific () const
float hadEnergy () const
 Returns energy of hadronic particles.
float invisibleEnergy () const
 Returns invisible energy.
virtual std::string print () const
 Print object.
virtual ~GenJet ()

Static Public Member Functions

static const GenParticlegenParticle (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

Classes

struct  Specific


Detailed Description

Jets made from MC generator particles.

GenJet represents Jets made from MC candidates Provide energy contributions from different particle types in addition to generic Jet parameters

Author:
Fedor Ratnikov, UMd
Version:
Original March 31, 2006 by F.R.

Id
GenJet.h,v 1.19 2008/05/26 11:22:12 arizzi Exp

Definition at line 25 of file GenJet.h.


Constructor & Destructor Documentation

reco::GenJet::GenJet (  )  [inline]

Default constructor.

Definition at line 45 of file GenJet.h.

Referenced by clone().

00045 {}

GenJet::GenJet ( const LorentzVector fP4,
const Point fVertex,
const Specific fSpecific,
const Jet::Constituents fConstituents 
)

Constructor from values.

Definition at line 20 of file GenJet.cc.

00023   : Jet (fP4, fVertex, fConstituents),
00024     m_specific (fSpecific)
00025 {}

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

Definition at line 14 of file GenJet.cc.

00016   : Jet (fP4, fVertex),
00017     m_specific (fSpecific)
00018 {}

GenJet::GenJet ( const LorentzVector fP4,
const Specific fSpecific,
const Jet::Constituents fConstituents 
)

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

Definition at line 27 of file GenJet.cc.

00030   : Jet (fP4, Point(0,0,0), fConstituents),
00031     m_specific (fSpecific)
00032 {}

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

Definition at line 56 of file GenJet.h.

00056 {};


Member Function Documentation

float reco::GenJet::auxiliaryEnergy (  )  const [inline]

Returns other energy (undecayed Sigmas etc.

)

Definition at line 64 of file GenJet.h.

References reco::GenJet::Specific::m_AuxiliaryEnergy, and m_specific.

Referenced by print(), and VisGenJetTwig::update().

00064 {return m_specific.m_AuxiliaryEnergy;};

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

Polymorphic clone.

Reimplemented from reco::CompositePtrCandidate.

Definition at line 65 of file GenJet.cc.

References GenJet().

00065                              {
00066   return new GenJet (*this);
00067 }

float GenJet::detectorEta ( float  fZVertex  )  const

Detector Eta (use reference Z and jet kinematics only).

Definition at line 35 of file GenJet.cc.

References reco::Jet::detectorEta(), and reco::Particle::eta().

00035                                                {
00036   return Jet::detectorEta (fZVertex, eta());
00037 }

float reco::GenJet::emEnergy (  )  const [inline]

Returns energy of electromagnetic particles.

Definition at line 58 of file GenJet.h.

References reco::GenJet::Specific::m_EmEnergy, and m_specific.

Referenced by print(), and VisGenJetTwig::update().

00058 {return m_specific.m_EmEnergy;};

const GenParticle * GenJet::genParticle ( const reco::Candidate fConstituent  )  [static]

convert generic constituent to specific type

Definition at line 39 of file GenJet.cc.

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

Referenced by getGenConstituent(), and JetMatchingTools::getGenParticle().

00039                                                                      {
00040   const Candidate* base = fConstituent;
00041   if (fConstituent->hasMasterClone ()) base = fConstituent->masterClone().get ();
00042   const GenParticle* result = dynamic_cast<const GenParticle*> (base);
00043   if (!result) throw cms::Exception("Invalid Constituent") << "GenJet constituent is not of the type GenParticle";
00044   return result;
00045 }

const GenParticle * GenJet::getGenConstituent ( unsigned  fIndex  )  const [virtual]

get specific constituent

Definition at line 47 of file GenJet.cc.

References reco::CompositePtrCandidate::begin(), reco::CompositePtrCandidate::end(), and genParticle().

Referenced by getGenConstituents().

00047                                                                    {
00048   // no direct access, have to iterate for now
00049   int index (fIndex);
00050   Candidate::const_iterator daugh = begin ();
00051   for (; --index >= 0 && daugh != end (); daugh++) {}
00052   if (daugh != end ()) { // in range
00053     const Candidate* constituent = &*daugh; // deref
00054     return genParticle (constituent);
00055   }
00056   return 0;
00057 }

std::vector< const GenParticle * > GenJet::getGenConstituents (  )  const [virtual]

get all constituents

Definition at line 59 of file GenJet.cc.

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

Referenced by JetMatchingTools::getGenParticles(), PFJetBenchmark::gettrue(), print(), and PFJetBenchmark::printGenJet().

00059                                                                  {
00060   std::vector <const GenParticle*> result;
00061   for (unsigned i = 0;  i <  numberOfDaughters (); i++) result.push_back (getGenConstituent (i));
00062   return result;
00063 }

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

Definition at line 78 of file GenJet.h.

References m_specific.

00078 {return m_specific;}

float reco::GenJet::hadEnergy (  )  const [inline]

Returns energy of hadronic particles.

Definition at line 60 of file GenJet.h.

References reco::GenJet::Specific::m_HadEnergy, and m_specific.

Referenced by print(), and VisGenJetTwig::update().

00060 {return m_specific.m_HadEnergy;};

float reco::GenJet::invisibleEnergy (  )  const [inline]

Returns invisible energy.

Definition at line 62 of file GenJet.h.

References reco::GenJet::Specific::m_InvisibleEnergy, and m_specific.

Referenced by print(), and VisGenJetTwig::update().

00062 {return m_specific.m_InvisibleEnergy;};

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

Polymorphic overlap.

Reimplemented from reco::CompositePtrCandidate.

Definition at line 69 of file GenJet.cc.

00069                                               {
00070   return false;
00071 }

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

Print object.

Reimplemented from reco::Jet.

Definition at line 73 of file GenJet.cc.

References auxiliaryEnergy(), emEnergy(), lat::endl(), reco::Particle::eta(), getGenConstituents(), hadEnergy(), i, invisibleEnergy(), out, reco::Particle::p(), reco::Particle::pdgId(), reco::Particle::phi(), print(), and reco::Particle::pt().

00073                                {
00074   std::ostringstream out;
00075   out << Jet::print () // generic jet info
00076       << "    GenJet specific:" << std::endl
00077       << "      em/had/invisible/aux  energies: " 
00078       << emEnergy() << '/' << hadEnergy()  << '/' << invisibleEnergy() << '/' << auxiliaryEnergy() << std::endl;
00079   out << "      MC particles:" << std::endl;
00080   std::vector <const GenParticle*> mcparts = getGenConstituents ();
00081   for (unsigned i = 0; i < mcparts.size (); i++) {
00082     const GenParticle* mcpart = mcparts[i];
00083     if (mcpart) {
00084       out << "      #" << i << "  PDG code:" << mcpart->pdgId() 
00085           << ", p/pt/eta/phi: " << mcpart->p() << '/' << mcpart->pt() << '/' << mcpart->eta() << '/' << mcpart->phi() << std::endl;
00086     }
00087     else {
00088       out << "      #" << i << "  No information about constituent" << std::endl;
00089     }
00090   }
00091   return out.str ();
00092 }


Member Data Documentation

Specific reco::GenJet::m_specific [private]

Definition at line 93 of file GenJet.h.

Referenced by auxiliaryEnergy(), emEnergy(), getSpecific(), hadEnergy(), and invisibleEnergy().


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