CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
pat::CaloJetSelector Class Reference

Selects good Jets. More...

#include "PhysicsTools/PatUtils/CaloJetSelector.h"

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.4 2008/03/05 14:51:02 fronga Exp

Definition at line 23 of file CaloJetSelector.h.

Constructor & Destructor Documentation

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

Definition at line 25 of file CaloJetSelector.h.

25 : config_(config) {}
Definition: config.py:1
pat::CaloJetSelector::~CaloJetSelector ( )
inline

Definition at line 26 of file CaloJetSelector.h.

References filter().

26 {}

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 8 of file CaloJetSelector.cc.

References pat::BAD, config_, PbPb_ZMuSkimMuonDPG_cff::deltaR, reco::CaloJet::emEnergyFraction(), pat::JetSelection::EMFmax, pat::JetSelection::EMvsHadFmax, PVValHelper::eta, pat::JetSelection::Etamax, reco::CaloJet::getCaloConstituents(), pat::GOOD, pat::JetSelection::HighestTowerOverJetmax, reco::CaloJet::n90(), pat::JetSelection::N90max, pat::JetSelection::NCaloTowersmax, pat::JetSelection::NCaloTowersmin, reco::LeafCandidate::p4(), pat::JetSelection::PtJetOverArea_max, pat::JetSelection::Ptmin, pat::JetSelection::PtTowerOverArea_max, mps_fire::result, pat::JetSelection::RWidthmax, and reco::CaloJet::towersArea().

Referenced by ~CaloJetSelector().

10  {
12 
15  if (Jet.p4().Pt() < config_.Ptmin)
16  result = BAD;
17 
19  double eta = fabs(Jet.p4().Eta());
20  if (eta > config_.Etamax)
21  result = BAD;
22 
24  double EMF = Jet.emEnergyFraction();
25  if (EMF < config_.EMFmin || EMF > config_.EMFmax)
26  result = BAD;
27 
29  double HadF = Jet.emEnergyFraction();
30  double EMvsHadF = 0.;
31  if (EMF - HadF != 0.)
32  EMvsHadF = (EMF + HadF) / (EMF - HadF);
33  if (EMvsHadF < config_.EMvsHadFmin || EMvsHadF > config_.EMvsHadFmax)
34  result = BAD;
35 
36  //ratio Energy over Momentum (both from calorimeter)
37  //Useful? Both come from a lorentz-vector
38  //double EoverP = 0.;
39  //if (Jet.p4().P()!=0.) EoverP = Jet.energy() / Jet.p4().P();
40  //if (EoverP > config_.EoverPmax) result = BAD;
41 
43  double n90 = Jet.n90();
44  if (n90 < config_.N90min || n90 > config_.N90max)
45  result = BAD;
46 
48  std::vector<CaloTowerPtr> jetTowers = Jet.getCaloConstituents();
49  if (jetTowers.size() < config_.NCaloTowersmin || jetTowers.size() > config_.NCaloTowersmax)
50  result = BAD;
51 
52  //calculate tower related variables:
53  double MaxEnergyTower = 0., SumTowPt = 0., SumTowPtR = 0.;
54  for (std::vector<CaloTowerPtr>::const_iterator tow = jetTowers.begin(), towend = jetTowers.end(); tow != towend;
55  ++tow) {
56  SumTowPt += (*tow)->et();
57  SumTowPtR += (*tow)->et() * deltaR(Jet.p4().Eta(), Jet.p4().Phi(), (*tow)->eta(), (*tow)->phi());
58  if ((*tow)->et() > MaxEnergyTower)
59  MaxEnergyTower = (*tow)->et();
60  }
61 
63  double EtTowerMaxOverEtJet = 0.;
64  if (Jet.p4().Et() != 0.)
65  EtTowerMaxOverEtJet = MaxEnergyTower / Jet.p4().Et();
66  if (EtTowerMaxOverEtJet < config_.HighestTowerOverJetmin || EtTowerMaxOverEtJet > config_.HighestTowerOverJetmax)
67  result = BAD;
68 
70  double RWidth = 0.;
71  if (SumTowPt != 0.)
72  RWidth = SumTowPtR / SumTowPt;
73  if (RWidth < config_.RWidthmin || RWidth > config_.RWidthmax)
74  result = BAD;
75 
77  double PtJetoverArea = 0.;
78  if (Jet.towersArea() != 0.)
79  PtJetoverArea = Jet.p4().Pt() / Jet.towersArea();
80  if (PtJetoverArea < config_.PtJetOverArea_min || PtJetoverArea > config_.PtJetOverArea_max)
81  result = BAD;
82 
84  double PtToweroverArea = 0.;
85  if (Jet.towersArea() != 0.)
86  PtToweroverArea = MaxEnergyTower / Jet.towersArea();
87  if (PtToweroverArea < config_.PtTowerOverArea_min || PtToweroverArea > config_.PtTowerOverArea_max)
88  result = BAD;
89 
90  return result;
91 }
double PtTowerOverArea_max
Definition: JetSelection.h:38
int n90() const
Definition: CaloJet.h:115
virtual std::vector< CaloTowerPtr > getCaloConstituents() const
get all constituents
Definition: CaloJet.cc:78
1: Failed selection (without additional info)
Definition: ParticleCode.h:32
double PtJetOverArea_max
Definition: JetSelection.h:36
const LorentzVector & p4() const final
four-momentum Lorentz vector
double HighestTowerOverJetmax
Definition: JetSelection.h:32
float towersArea() const
Definition: CaloJet.h:113
0: Passed selection
Definition: ParticleCode.h:31
ParticleStatus
Definition of particle status after selection.
Definition: ParticleCode.h:30
float emEnergyFraction() const
Definition: CaloJet.h:97

Member Data Documentation

JetSelection pat::CaloJetSelector::config_
private

Definition at line 33 of file CaloJetSelector.h.

Referenced by filter().