CMS 3D CMS Logo

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

reco::CaloJet Class Reference

Jets made from CaloTowers. More...

#include <CaloJet.h>

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

List of all members.

Classes

struct  Specific

Public Member Functions

 CaloJet ()
 CaloJet (const LorentzVector &fP4, const Point &fVertex, const Specific &fSpecific, const Jet::Constituents &fConstituents)
 CaloJet (const LorentzVector &fP4, const Specific &fSpecific, const Jet::Constituents &fConstituents)
 CaloJet (const LorentzVector &fP4, const Point &fVertex, const Specific &fSpecific)
virtual CaloJetclone () const
 Polymorphic clone.
LorentzVector detectorP4 () const
 detector p4 for full 3d vertex correction.
float emEnergyFraction () const
float emEnergyInEB () const
float emEnergyInEE () const
float emEnergyInHF () const
float energyFractionHadronic () const
virtual CaloTowerPtr getCaloConstituent (unsigned fIndex) const
 Physics Eta (loop over constituents)
virtual std::vector< CaloTowerPtrgetCaloConstituents () const
 get all constituents
const SpecificgetSpecific () const
std::vector< CaloTowerDetIdgetTowerIndices () const
 CaloTowers indexes.
float hadEnergyInHB () const
float hadEnergyInHE () const
float hadEnergyInHF () const
float hadEnergyInHO () const
float maxEInEmTowers () const
float maxEInHadTowers () const
int n60 () const
int n90 () const
LorentzVector physicsP4 (const Particle::Point &vertex) const
 Physics Eta (use jet Z and kinematics only)
virtual std::string print () const
 Print object.
float towersArea () const
virtual ~CaloJet ()

Private Member Functions

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

Private Attributes

Specific m_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.38 2008/10/14 12:26:58 oehler 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().

{}
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.

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

Constructor from values

Definition at line 14 of file CaloJet.cc.

   : Jet (fP4, fVertex),
     m_specific (fSpecific)
 {}
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.

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

Definition at line 89 of file CaloJet.h.

{};

Member Function Documentation

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

Polymorphic clone.

Reimplemented from reco::CompositePtrCandidate.

Definition at line 101 of file CaloJet.cc.

References CaloJet().

                               {
  return new CaloJet (*this);
}
CaloJet::LorentzVector CaloJet::detectorP4 ( ) const

detector p4 for full 3d vertex correction.

Definition at line 65 of file CaloJet.cc.

References reco::LeafCandidate::vertex().

Referenced by JetTracksAssociationXtrpCalo::associateInputTracksToJet().

                                                {
  return Jet::detectorP4(this->vertex(),*this);
}
float reco::CaloJet::emEnergyFraction ( ) const [inline]
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(), reco::helper::JetIDHelper::calculate(), and print().

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(), reco::helper::JetIDHelper::calculate(), and print().

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(), reco::helper::JetIDHelper::calculate(), and print().

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 print().

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

Physics Eta (loop over constituents)

Detector Eta (default for CaloJets) get specific constituent

Definition at line 70 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 getCaloConstituents().

                                                               {
   Constituent dau = daughterPtr (fIndex);

   if ( dau.isNonnull() && dau.isAvailable() ) {

   const CaloTower* towerCandidate = dynamic_cast <const CaloTower*> (dau.get());

    if (towerCandidate) {
//      return towerCandidate;
// 086     Ptr(ProductID const& productID, T const* item, key_type item_key) :
      return edm::Ptr<CaloTower> (dau.id(), towerCandidate, dau.key() );
    }
    else {
      throw cms::Exception("Invalid Constituent") << "CaloJet constituent is not of CaloTowere type";
    }

   }

   else {
     return CaloTowerPtr();
   }
}
std::vector< CaloTowerPtr > CaloJet::getCaloConstituents ( ) const [virtual]
const Specific& reco::CaloJet::getSpecific ( ) const [inline]

Definition at line 145 of file CaloJet.h.

References m_specific.

Referenced by pat::Jet::tryImportSpecific().

{return m_specific;}
std::vector< CaloTowerDetId > CaloJet::getTowerIndices ( ) const

CaloTowers indexes.

Definition at line 134 of file CaloJet.cc.

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

                                                         {
  std::vector<CaloTowerDetId> result;
  std::vector <CaloTowerPtr> towers = getCaloConstituents ();
  for (unsigned i = 0; i < towers.size(); ++i) {
    result.push_back (towers[i]->id());
  }
  return result;
}
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(), reco::helper::JetIDHelper::calculate(), and print().

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(), reco::helper::JetIDHelper::calculate(), and print().

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(), reco::helper::JetIDHelper::calculate(), and print().

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(), reco::helper::JetIDHelper::calculate(), and print().

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.

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.

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().

{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 pat::CaloJetSelector::filter().

{return nCarrying (0.9);}
bool CaloJet::overlap ( const Candidate ) const [private, virtual]

Polymorphic overlap.

Reimplemented from reco::CompositePtrCandidate.

Definition at line 105 of file CaloJet.cc.

                                               {
  return false;
}
CaloJet::LorentzVector CaloJet::physicsP4 ( const Particle::Point vertex) const

Physics Eta (use jet Z and kinematics only)

Physics Eta (use reference Z and jet kinematics only)

Physics Eta (use jet Z and kinematics only) Physics p4 (use jet Z and kinematics only) Physics p4 for full 3d vertex corretion

Physics Eta (loop over constituents) Physics p4 (use jet Z and kinematics only)

Definition at line 61 of file CaloJet.cc.

References reco::LeafCandidate::vertex().

                                                                          {
  return Jet::physicsP4(vertex,*this,this->vertex());
}
std::string CaloJet::print ( void  ) const [virtual]

Print object.

Reimplemented from reco::Jet.

Definition at line 109 of file CaloJet.cc.

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

                                {
  std::ostringstream out;
  out << Jet::print () // generic jet info
      << "    CaloJet specific:" << std::endl
      << "      energy fractions em/had: " << emEnergyFraction () << '/' << energyFractionHadronic () << std::endl
      << "      em energy in EB/EE/HF: " << emEnergyInEB() << '/' << emEnergyInEE() << '/' << emEnergyInHF() << std::endl
      << "      had energy in HB/HO/HE/HF: " << hadEnergyInHB() << '/' << hadEnergyInHO() << '/' << hadEnergyInHE() << '/' << hadEnergyInHF() << std::endl
      << "      constituent towers area: " << towersArea() << std::endl;
  out << "      Towers:" << std::endl;
  std::vector <CaloTowerPtr > towers = getCaloConstituents ();
  for (unsigned i = 0; i < towers.size (); i++) {
    if (towers[i].get ()) {
      out << "      #" << i << " " << *(towers[i]) << std::endl;
    }
    else {
      out << "      #" << i << " tower is not available in the event"  << std::endl;
    }
  }
  return out.str ();
}
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().


Member Data Documentation