CMS 3D CMS Logo

reco::CaloJet Class Reference

Jets made from CaloTowers. More...

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

Inheritance diagram for reco::CaloJet:

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

List of all members.

Public Member Functions

 CaloJet (const LorentzVector &fP4, const Specific &fSpecific, const Jet::Constituents &fConstituents)
 backward compatible, vertex=(0,0,0)
 CaloJet (const LorentzVector &fP4, const Point &fVertex, const Specific &fSpecific)
 Constructor from values.
 CaloJet (const LorentzVector &fP4, const Point &fVertex, const Specific &fSpecific, const Jet::Constituents &fConstituents)
 Constructor from values.
 CaloJet ()
 Default constructor.
virtual CaloJetclone () const
 Polymorphic clone.
float detectorEta () const
 Detector Eta (default for CaloJets).
float emEnergyFraction () const
 Returns the jet electromagnetic energy fraction.
float emEnergyInEB () const
 Returns the jet electromagnetic energy in EB.
float emEnergyInEE () const
 Returns the jet electromagnetic energy in EE.
float emEnergyInHF () const
 Returns the jet electromagnetic energy extracted from HF.
float energyFractionHadronic () const
 Returns the jet hadronic energy fraction.
virtual CaloTowerPtr getCaloConstituent (unsigned fIndex) const
 get specific constituent
virtual std::vector< CaloTowerPtrgetCaloConstituents () const
 get all constituents
const SpecificgetSpecific () const
std::vector< CaloTowerDetIdgetTowerIndices () const
 CaloTowers indexes.
float hadEnergyInHB () const
 Returns the jet hadronic energy in HB.
float hadEnergyInHE () const
 Returns the jet hadronic energy in HE.
float hadEnergyInHF () const
 Returns the jet hadronic energy in HF.
float hadEnergyInHO () const
 Returns the jet hadronic energy in HO.
float maxEInEmTowers () const
 Returns the maximum energy deposited in ECAL towers.
float maxEInHadTowers () const
 Returns the maximum energy deposited in HCAL towers.
int n60 () const
 Returns the number of constituents carrying a 60% of the total Jet energy.
int n90 () const
 Returns the number of constituents carrying a 90% of the total Jet energy.
float physicsEta (float fZVertex) const
 Physics Eta (use jet Z and kinematics only).
float physicsEtaDetailed (float fZVertex) const
 Physics Eta (loop over constituents).
float physicsEtaQuick (float fZVertex) const
 Physics Eta (use jet Z and kinematics only).
LorentzVector physicsP4 (float fZVertex) const
 Physics p4 (use jet Z and kinematics only).
virtual std::string print () const
 Print object.
float towersArea () const
 Returns area of contributing towers.
virtual ~CaloJet ()

Private Member Functions

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

Private Attributes

Specific m_specific

Classes

struct  Specific


Detailed Description

Jets made from CaloTowers.

CaloJet represents Jets made from CaloTowers Provide energy contributions from different subdetectors in addition to generic Jet parameters

Author:
Fedor Ratnikov, UMd
Version:
Original: April 22, 2005 by Fernando Varela Rodriguez.

Oct 19, 2005, R. Harris, modified to work with real CaloTowers. No energy fractions yet.

May 3, 2006, F.Ratnikov, include all different energy components separately

Id
CaloJet.h,v 1.37 2008/05/26 11:22:12 arizzi Exp

Definition at line 30 of file CaloJet.h.


Constructor & Destructor Documentation

reco::CaloJet::CaloJet (  )  [inline]

Default constructor.

Definition at line 75 of file CaloJet.h.

Referenced by clone().

00075 {}

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

Constructor from values.

Definition at line 20 of file CaloJet.cc.

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

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

Constructor from values.

Definition at line 14 of file CaloJet.cc.

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

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

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

Definition at line 27 of file CaloJet.cc.

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

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

Definition at line 89 of file CaloJet.h.

00089 {};


Member Function Documentation

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

Polymorphic clone.

Reimplemented from reco::CompositePtrCandidate.

Definition at line 92 of file CaloJet.cc.

References CaloJet().

00092                                {
00093   return new CaloJet (*this);
00094 }

float reco::CaloJet::detectorEta (  )  const [inline]

Detector Eta (default for CaloJets).

Definition at line 131 of file CaloJet.h.

References reco::Particle::eta().

00131 {return eta();}

float reco::CaloJet::emEnergyFraction (  )  const [inline]

Returns the jet electromagnetic energy fraction.

Definition at line 98 of file CaloJet.h.

References m_specific, and reco::CaloJet::Specific::mEnergyFractionEm.

Referenced by JetAnalyzer::analyze(), GlobalFitCorrector::correction(), L4EMFCorrector::correction(), MCJetCorrector3D::correction(), pat::CaloJetSelector::filter(), and print().

00098 {return m_specific.mEnergyFractionEm;}

float reco::CaloJet::emEnergyInEB (  )  const [inline]

Returns the jet electromagnetic energy in EB.

Definition at line 108 of file CaloJet.h.

References m_specific, and reco::CaloJet::Specific::mEmEnergyInEB.

Referenced by JetValidation::analyze(), JetAnalyzer::analyze(), and print().

00108 {return m_specific.mEmEnergyInEB;}

float reco::CaloJet::emEnergyInEE (  )  const [inline]

Returns the jet electromagnetic energy in EE.

Definition at line 110 of file CaloJet.h.

References m_specific, and reco::CaloJet::Specific::mEmEnergyInEE.

Referenced by JetValidation::analyze(), JetAnalyzer::analyze(), and print().

00110 {return m_specific.mEmEnergyInEE;}

float reco::CaloJet::emEnergyInHF (  )  const [inline]

Returns the jet electromagnetic energy extracted from HF.

Definition at line 112 of file CaloJet.h.

References m_specific, and reco::CaloJet::Specific::mEmEnergyInHF.

Referenced by JetValidation::analyze(), JetAnalyzer::analyze(), and print().

00112 {return m_specific.mEmEnergyInHF;}

float reco::CaloJet::energyFractionHadronic (  )  const [inline]

Returns the jet hadronic energy fraction.

Definition at line 96 of file CaloJet.h.

References m_specific, and reco::CaloJet::Specific::mEnergyFractionHadronic.

Referenced by JetAnalyzer::analyze(), and print().

CaloTowerPtr CaloJet::getCaloConstituent ( unsigned  fIndex  )  const [virtual]

get specific constituent

Definition at line 61 of file CaloJet.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 GlobalFitCorrector::correction(), and getCaloConstituents().

00061                                                                {
00062    Constituent dau = daughterPtr (fIndex);
00063 
00064    if ( dau.isNonnull() && dau.isAvailable() ) {
00065 
00066    const CaloTower* towerCandidate = dynamic_cast <const CaloTower*> (dau.get());
00067 
00068     if (towerCandidate) {
00069 //      return towerCandidate;
00070 // 086     Ptr(ProductID const& productID, T const* item, key_type item_key) :
00071       return edm::Ptr<CaloTower> (dau.id(), towerCandidate, dau.key() );
00072     }
00073     else {
00074       throw cms::Exception("Invalid Constituent") << "CaloJet constituent is not of CaloTowere type";
00075     }
00076 
00077    }
00078 
00079    else {
00080      return CaloTowerPtr();
00081    }
00082 }

std::vector< CaloTowerPtr > CaloJet::getCaloConstituents (  )  const [virtual]

get all constituents

Definition at line 85 of file CaloJet.cc.

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

Referenced by GlobalFitCorrector::correction(), pat::CaloJetSelector::filter(), HardTauAlgorithm::getClusterEnergy(), JetMatchingTools::getConstituents(), L2TauIsolationProducer::getECALHits(), L2TauIsolationProducer::getHCALHits(), getTowerIndices(), print(), pat::PATJetProducer::produce(), and HardTauAlgorithm::trackEcalHitPoint().

00085                                                               {
00086   std::vector <CaloTowerPtr> result;
00087   for (unsigned i = 0;  i <  numberOfDaughters (); i++) result.push_back (getCaloConstituent (i));
00088   return result;
00089 }

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

Definition at line 141 of file CaloJet.h.

References m_specific.

Referenced by ToyJetCorrection::applyCorrection().

00141 {return m_specific;}

std::vector< CaloTowerDetId > CaloJet::getTowerIndices (  )  const

CaloTowers indexes.

Definition at line 125 of file CaloJet.cc.

References getCaloConstituents(), i, and HLT_VtxMuL3::result.

00125                                                          {
00126   std::vector<CaloTowerDetId> result;
00127   std::vector <CaloTowerPtr> towers = getCaloConstituents ();
00128   for (unsigned i = 0; i < towers.size(); ++i) {
00129     result.push_back (towers[i]->id());
00130   }
00131   return result;
00132 }

float reco::CaloJet::hadEnergyInHB (  )  const [inline]

Returns the jet hadronic energy in HB.

Definition at line 100 of file CaloJet.h.

References m_specific, and reco::CaloJet::Specific::mHadEnergyInHB.

Referenced by JetValidation::analyze(), JetAnalyzer::analyze(), and print().

00100 {return m_specific.mHadEnergyInHB;}

float reco::CaloJet::hadEnergyInHE (  )  const [inline]

Returns the jet hadronic energy in HE.

Definition at line 104 of file CaloJet.h.

References m_specific, and reco::CaloJet::Specific::mHadEnergyInHE.

Referenced by JetValidation::analyze(), JetAnalyzer::analyze(), and print().

00104 {return m_specific.mHadEnergyInHE;}

float reco::CaloJet::hadEnergyInHF (  )  const [inline]

Returns the jet hadronic energy in HF.

Definition at line 106 of file CaloJet.h.

References m_specific, and reco::CaloJet::Specific::mHadEnergyInHF.

Referenced by JetValidation::analyze(), JetAnalyzer::analyze(), and print().

00106 {return m_specific.mHadEnergyInHF;}

float reco::CaloJet::hadEnergyInHO (  )  const [inline]

Returns the jet hadronic energy in HO.

Definition at line 102 of file CaloJet.h.

References m_specific, and reco::CaloJet::Specific::mHadEnergyInHO.

Referenced by JetValidation::analyze(), JetAnalyzer::analyze(), GlobalFitCorrector::correction(), and print().

00102 {return m_specific.mHadEnergyInHO;}

float reco::CaloJet::maxEInEmTowers (  )  const [inline]

Returns the maximum energy deposited in ECAL towers.

Definition at line 92 of file CaloJet.h.

References m_specific, and reco::CaloJet::Specific::mMaxEInEmTowers.

Referenced by JetValidation::analyze(), and JetAnalyzer::analyze().

00092 {return m_specific.mMaxEInEmTowers;}

float reco::CaloJet::maxEInHadTowers (  )  const [inline]

Returns the maximum energy deposited in HCAL towers.

Definition at line 94 of file CaloJet.h.

References m_specific, and reco::CaloJet::Specific::mMaxEInHadTowers.

Referenced by JetValidation::analyze(), and JetAnalyzer::analyze().

00094 {return m_specific.mMaxEInHadTowers;}

int reco::CaloJet::n60 (  )  const [inline]

Returns the number of constituents carrying a 60% of the total Jet energy.

Definition at line 118 of file CaloJet.h.

References reco::Jet::nCarrying().

00118 {return nCarrying (0.6);}

int reco::CaloJet::n90 (  )  const [inline]

Returns the number of constituents carrying a 90% of the total Jet energy.

Definition at line 116 of file CaloJet.h.

References reco::Jet::nCarrying().

Referenced by JetAnalyzer::analyze(), and pat::CaloJetSelector::filter().

00116 {return nCarrying (0.9);}

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

Polymorphic overlap.

Reimplemented from reco::CompositePtrCandidate.

Definition at line 96 of file CaloJet.cc.

00096                                                {
00097   return false;
00098 }

float reco::CaloJet::physicsEta ( float  fZVertex  )  const [inline]

Physics Eta (use jet Z and kinematics only).

Definition at line 123 of file CaloJet.h.

References physicsEtaQuick().

Referenced by physicsP4().

00123 {return physicsEtaQuick (fZVertex);}

float CaloJet::physicsEtaDetailed ( float  fZVertex  )  const

Physics Eta (loop over constituents).

Definition at line 41 of file CaloJet.cc.

References c, reco::Particle::eta(), reco::Jet::getJetConstituentsQuick(), i, reco::Particle::mass(), reco::Particle::p(), reco::Particle::p4(), reco::Particle::phi(), and reco::Jet::physicsEta().

00041                                                        {
00042   Jet::LorentzVector correctedMomentum;
00043   std::vector<const Candidate*> towers = getJetConstituentsQuick ();
00044   for (unsigned i = 0; i < towers.size(); ++i) {
00045     const Candidate* c = towers[i];
00046     double etaRef = Jet::physicsEta (fZVertex, c->eta());
00047     math::PtEtaPhiMLorentzVectorD p4 (c->p()/cosh(etaRef), etaRef, c->phi(), c->mass());
00048     correctedMomentum += p4;
00049   }
00050   return correctedMomentum.eta();
00051 }

float CaloJet::physicsEtaQuick ( float  fZVertex  )  const

Physics Eta (use jet Z and kinematics only).

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

Definition at line 36 of file CaloJet.cc.

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

Referenced by physicsEta().

00036                                                     {
00037   return Jet::physicsEta (fZVertex, eta());
00038 }

CaloJet::LorentzVector CaloJet::physicsP4 ( float  fZVertex  )  const

Physics p4 (use jet Z and kinematics only).

Definition at line 54 of file CaloJet.cc.

References reco::Particle::eta(), reco::Particle::mass(), reco::Particle::p(), reco::Particle::p4(), reco::Particle::phi(), reco::Jet::physicsEta(), and physicsEta().

00054                                                              {
00055   double physicsEta = Jet::physicsEta (fZVertex, eta());
00056   math::PtEtaPhiMLorentzVectorD p4 (p()/cosh(physicsEta), physicsEta, phi(), mass());
00057   return CaloJet::LorentzVector (p4);
00058 }

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

Print object.

Reimplemented from reco::Jet.

Definition at line 100 of file CaloJet.cc.

References emEnergyFraction(), emEnergyInEB(), emEnergyInEE(), emEnergyInHF(), lat::endl(), energyFractionHadronic(), getCaloConstituents(), hadEnergyInHB(), hadEnergyInHE(), hadEnergyInHF(), hadEnergyInHO(), i, out, print(), and towersArea().

00100                                 {
00101   std::ostringstream out;
00102   out << Jet::print () // generic jet info
00103       << "    CaloJet specific:" << std::endl
00104       << "      energy fractions em/had: " << emEnergyFraction () << '/' << energyFractionHadronic () << std::endl
00105       << "      em energy in EB/EE/HF: " << emEnergyInEB() << '/' << emEnergyInEE() << '/' << emEnergyInHF() << std::endl
00106       << "      had energy in HB/HO/HE/HF: " << hadEnergyInHB() << '/' << hadEnergyInHO() << '/' << hadEnergyInHE() << '/' << hadEnergyInHF() << std::endl
00107       << "      constituent towers area: " << towersArea() << std::endl;
00108   out << "      Towers:" << std::endl;
00109   std::vector <CaloTowerPtr > towers = getCaloConstituents ();
00110   for (unsigned i = 0; i < towers.size (); i++) {
00111     if (towers[i].get ()) {
00112       out << "      #" << i << " " << *(towers[i]) << std::endl;
00113     }
00114     else {
00115       out << "      #" << i << " tower is not available in the event"  << std::endl;
00116     }
00117   }
00118   return out.str ();
00119 }

float reco::CaloJet::towersArea (  )  const [inline]

Returns area of contributing towers.

Definition at line 114 of file CaloJet.h.

References m_specific, and reco::CaloJet::Specific::mTowersArea.

Referenced by pat::CaloJetSelector::filter(), and print().

00114 {return m_specific.mTowersArea;}


Member Data Documentation

Specific reco::CaloJet::m_specific [private]

Definition at line 156 of file CaloJet.h.

Referenced by emEnergyFraction(), emEnergyInEB(), emEnergyInEE(), emEnergyInHF(), energyFractionHadronic(), getSpecific(), hadEnergyInHB(), hadEnergyInHE(), hadEnergyInHF(), hadEnergyInHO(), maxEInEmTowers(), maxEInHadTowers(), and towersArea().


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