Jets made from MC generator particles. More...
#include <GenJet.h>
Classes | |
struct | Specific |
Public Member Functions | |
float | auxiliaryEnergy () const |
virtual GenJet * | clone () const |
Polymorphic clone. | |
float | detectorEta (float fZVertex) const |
Detector Eta (use reference Z and jet kinematics only) | |
float | emEnergy () const |
GenJet (const LorentzVector &fP4, const Point &fVertex, const Specific &fSpecific, const Jet::Constituents &fConstituents) | |
GenJet (const LorentzVector &fP4, const Specific &fSpecific, const Jet::Constituents &fConstituents) | |
GenJet (const LorentzVector &fP4, const Point &fVertex, const Specific &fSpecific) | |
GenJet () | |
virtual const GenParticle * | getGenConstituent (unsigned fIndex) const |
get specific constituent | |
virtual std::vector< const GenParticle * > | getGenConstituents () const |
get all constituents | |
const Specific & | getSpecific () const |
float | hadEnergy () const |
float | invisibleEnergy () const |
virtual std::string | print () const |
Print object. | |
virtual | ~GenJet () |
Static Public Member Functions | |
static const GenParticle * | genParticle (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 |
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
reco::GenJet::GenJet | ( | ) | [inline] |
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.
: Jet (fP4, fVertex, fConstituents), m_specific (fSpecific) {}
GenJet::GenJet | ( | const LorentzVector & | fP4, |
const Point & | fVertex, | ||
const Specific & | fSpecific | ||
) |
Definition at line 14 of file GenJet.cc.
: Jet (fP4, fVertex), m_specific (fSpecific) {}
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.
: Jet (fP4, Point(0,0,0), fConstituents), m_specific (fSpecific) {}
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().
{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().
{ return new GenJet (*this); }
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::LeafCandidate::eta().
{ return Jet::detectorEta (fZVertex, eta()); }
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 main(), and print().
{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 newFWLiteAna::base, Exception, edm::RefToBase< T >::get(), reco::Candidate::hasMasterClone(), reco::Candidate::masterClone(), and query::result.
Referenced by getGenConstituent(), and JetMatchingTools::getGenParticle().
{ const Candidate* base = fConstituent; if (fConstituent->hasMasterClone ()) base = fConstituent->masterClone().get (); const GenParticle* result = dynamic_cast<const GenParticle*> (base); if (!result) throw cms::Exception("Invalid Constituent") << "GenJet constituent is not of the type GenParticle"; return result; }
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().
{ // no direct access, have to iterate for now int index (fIndex); Candidate::const_iterator daugh = begin (); for (; --index >= 0 && daugh != end (); daugh++) {} if (daugh != end ()) { // in range const Candidate* constituent = &*daugh; // deref return genParticle (constituent); } return 0; }
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 query::result.
Referenced by JetMatchingTools::getGenParticles(), PFJetBenchmark::gettrue(), print(), and PFJetBenchmark::printGenJet().
{ std::vector <const GenParticle*> result; for (unsigned i = 0; i < numberOfDaughters (); i++) result.push_back (getGenConstituent (i)); return result; }
const Specific& reco::GenJet::getSpecific | ( | ) | const [inline] |
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 main(), and print().
{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().
{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.
{ return false; }
std::string GenJet::print | ( | void | ) | const [virtual] |
Print object.
Reimplemented from reco::Jet.
Definition at line 73 of file GenJet.cc.
References auxiliaryEnergy(), emEnergy(), reco::LeafCandidate::eta(), getGenConstituents(), hadEnergy(), i, invisibleEnergy(), dbtoconf::out, reco::LeafCandidate::p(), reco::LeafCandidate::pdgId(), reco::LeafCandidate::phi(), and reco::LeafCandidate::pt().
Referenced by TauGenJetDumper::analyze().
{ std::ostringstream out; out << Jet::print () // generic jet info << " GenJet specific:" << std::endl << " em/had/invisible/aux energies: " << emEnergy() << '/' << hadEnergy() << '/' << invisibleEnergy() << '/' << auxiliaryEnergy() << std::endl; out << " MC particles:" << std::endl; std::vector <const GenParticle*> mcparts = getGenConstituents (); for (unsigned i = 0; i < mcparts.size (); i++) { const GenParticle* mcpart = mcparts[i]; if (mcpart) { out << " #" << i << " PDG code:" << mcpart->pdgId() << ", p/pt/eta/phi: " << mcpart->p() << '/' << mcpart->pt() << '/' << mcpart->eta() << '/' << mcpart->phi() << std::endl; } else { out << " #" << i << " No information about constituent" << std::endl; } } return out.str (); }
Specific reco::GenJet::m_specific [private] |
Definition at line 93 of file GenJet.h.
Referenced by auxiliaryEnergy(), emEnergy(), getSpecific(), hadEnergy(), and invisibleEnergy().