CMS 3D CMS Logo

Public Member Functions | Private Attributes

pat::CaloJetSelector Class Reference

Selects good Jets. More...

#include <PhysicsTools/PatUtils/CaloJetSelector.h>

List of all members.

Public Member Functions

 CaloJetSelector (const JetSelection &config)
const ParticleStatus filter (const reco::CaloJet &Jet) const
 ~CaloJetSelector ()

Private Attributes

JetSelection config_

Detailed Description

Selects good Jets.

The calo jet selector returns a flag (see pat::ParticleStatus) based on one of the possible selections. It is called by the generic JetSelector in case of "custom" selection.

Author:
C. Autermann (Uni Hamburg)
Version:
Id:
CaloJetSelector.h,v 1.5 2008/03/10 14:23:58 fronga Exp

Definition at line 23 of file CaloJetSelector.h.


Constructor & Destructor Documentation

pat::CaloJetSelector::CaloJetSelector ( const JetSelection config) [inline]

Definition at line 27 of file CaloJetSelector.h.

: config_( config ) {}
pat::CaloJetSelector::~CaloJetSelector ( ) [inline]

Definition at line 28 of file CaloJetSelector.h.

{}

Member Function Documentation

const pat::ParticleStatus CaloJetSelector::filter ( const reco::CaloJet Jet) const

Returns 0 if Jet matches criteria, a flag otherwise. Criteria depend on the selector's configuration.

Retrieve information Pt Jet

eta region

electromagnetic fraction

(EMCalEnergyFraction + HadCalEnergyFraction) / (EMCalEnergyFraction - HadCalEnergyFraction)

n90: number of towers containing 90% of the jet's energy

Tower Number

Highest Et Tower / Et Jet

Sum(E Twr * DeltaR(Twr-Jet)) / Sum(E Twr)

Pt Jet / Towers Area

Highest Et Tower / Towers Area

Definition at line 9 of file CaloJetSelector.cc.

References pat::BAD, config_, deltaR(), reco::CaloJet::emEnergyFraction(), pat::JetSelection::EMFmax, pat::JetSelection::EMFmin, pat::JetSelection::EMvsHadFmax, pat::JetSelection::EMvsHadFmin, eta(), pat::JetSelection::Etamax, reco::CaloJet::getCaloConstituents(), pat::GOOD, pat::JetSelection::HighestTowerOverJetmax, pat::JetSelection::HighestTowerOverJetmin, reco::CaloJet::n90(), pat::JetSelection::N90max, pat::JetSelection::N90min, pat::JetSelection::NCaloTowersmax, pat::JetSelection::NCaloTowersmin, reco::LeafCandidate::p4(), pat::JetSelection::PtJetOverArea_max, pat::JetSelection::PtJetOverArea_min, pat::JetSelection::Ptmin, pat::JetSelection::PtTowerOverArea_max, pat::JetSelection::PtTowerOverArea_min, query::result, pat::JetSelection::RWidthmax, pat::JetSelection::RWidthmin, and reco::CaloJet::towersArea().

{
  ParticleStatus result = GOOD;

  if (Jet.p4().Pt()<config_.Ptmin) result = BAD;
  
  double eta = fabs(Jet.p4().Eta());
  if (eta>config_.Etamax) result = BAD;

  double EMF = Jet.emEnergyFraction();              
  if (EMF<config_.EMFmin ||
      EMF>config_.EMFmax    ) result = BAD;

  double HadF = Jet.emEnergyFraction();              
  double EMvsHadF = 0.;
  if (EMF-HadF!=0.) EMvsHadF = (EMF+HadF)/(EMF-HadF);
  if (EMvsHadF<config_.EMvsHadFmin ||
      EMvsHadF>config_.EMvsHadFmax    ) result = BAD;

  //ratio Energy over Momentum (both from calorimeter)
  //Useful? Both come from a lorentz-vector
  //double EoverP = 0.;
  //if (Jet.p4().P()!=0.) EoverP = Jet.energy() / Jet.p4().P();
  //if (EoverP > config_.EoverPmax) result = BAD;
  
  double n90 = Jet.n90();
  if (n90<config_.N90min ||
      n90>config_.N90max    ) result = BAD;

  std::vector<CaloTowerPtr> jetTowers = Jet.getCaloConstituents();
  if (jetTowers.size()<config_.NCaloTowersmin ||
      jetTowers.size()>config_.NCaloTowersmax  ) result = BAD;

  //calculate tower related variables:
  double MaxEnergyTower = 0., SumTowPt=0., SumTowPtR=0.;
  for(std::vector<CaloTowerPtr>::const_iterator tow = jetTowers.begin(),
      towend = jetTowers.end(); tow != towend; ++tow){

    SumTowPt  += (*tow)->et();
    SumTowPtR += (*tow)->et()*deltaR( Jet.p4().Eta(), Jet.p4().Phi(),
                                      (*tow)->eta(),  (*tow)->phi()     );
    if ( (*tow)->et() > MaxEnergyTower )
       MaxEnergyTower = (*tow)->et();
  }

  double EtTowerMaxOverEtJet = 0.;
  if (Jet.p4().Et()!=0.) EtTowerMaxOverEtJet = MaxEnergyTower /Jet.p4().Et();
  if (EtTowerMaxOverEtJet < config_.HighestTowerOverJetmin ||
      EtTowerMaxOverEtJet > config_.HighestTowerOverJetmax  ) result = BAD;

  double RWidth = 0.;
  if (SumTowPt!=0.) RWidth = SumTowPtR /SumTowPt;
  if (RWidth < config_.RWidthmin ||
      RWidth > config_.RWidthmax  ) result = BAD;
  
  double PtJetoverArea = 0.;
  if (Jet.towersArea() !=0.) PtJetoverArea = Jet.p4().Pt() / Jet.towersArea();
  if (PtJetoverArea < config_.PtJetOverArea_min ||
      PtJetoverArea > config_.PtJetOverArea_max  ) result = BAD;

  double PtToweroverArea = 0.;
  if (Jet.towersArea() !=0.) PtToweroverArea = MaxEnergyTower / Jet.towersArea();
  if (PtToweroverArea < config_.PtTowerOverArea_min ||
      PtToweroverArea > config_.PtTowerOverArea_max  ) result = BAD;

  return result;
}

Member Data Documentation

Definition at line 37 of file CaloJetSelector.h.

Referenced by filter().