CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 27 of file CaloJetSelector.h.

pat::CaloJetSelector::~CaloJetSelector ( )
inline

Definition at line 28 of file CaloJetSelector.h.

28 {}

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

13 {
15 
18  if (Jet.p4().Pt()<config_.Ptmin) result = BAD;
19 
21  double eta = fabs(Jet.p4().Eta());
22  if (eta>config_.Etamax) result = BAD;
23 
25  double EMF = Jet.emEnergyFraction();
26  if (EMF<config_.EMFmin ||
27  EMF>config_.EMFmax ) result = BAD;
28 
30  double HadF = Jet.emEnergyFraction();
31  double EMvsHadF = 0.;
32  if (EMF-HadF!=0.) EMvsHadF = (EMF+HadF)/(EMF-HadF);
33  if (EMvsHadF<config_.EMvsHadFmin ||
34  EMvsHadF>config_.EMvsHadFmax ) 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 ||
45  n90>config_.N90max ) result = BAD;
46 
48  std::vector<CaloTowerPtr> jetTowers = Jet.getCaloConstituents();
49  if (jetTowers.size()<config_.NCaloTowersmin ||
50  jetTowers.size()>config_.NCaloTowersmax ) 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(),
55  towend = jetTowers.end(); tow != towend; ++tow){
56 
57  SumTowPt += (*tow)->et();
58  SumTowPtR += (*tow)->et()*deltaR( Jet.p4().Eta(), Jet.p4().Phi(),
59  (*tow)->eta(), (*tow)->phi() );
60  if ( (*tow)->et() > MaxEnergyTower )
61  MaxEnergyTower = (*tow)->et();
62  }
63 
65  double EtTowerMaxOverEtJet = 0.;
66  if (Jet.p4().Et()!=0.) EtTowerMaxOverEtJet = MaxEnergyTower /Jet.p4().Et();
67  if (EtTowerMaxOverEtJet < config_.HighestTowerOverJetmin ||
68  EtTowerMaxOverEtJet > config_.HighestTowerOverJetmax ) result = BAD;
69 
71  double RWidth = 0.;
72  if (SumTowPt!=0.) RWidth = SumTowPtR /SumTowPt;
73  if (RWidth < config_.RWidthmin ||
74  RWidth > config_.RWidthmax ) result = BAD;
75 
77  double PtJetoverArea = 0.;
78  if (Jet.towersArea() !=0.) PtJetoverArea = Jet.p4().Pt() / Jet.towersArea();
79  if (PtJetoverArea < config_.PtJetOverArea_min ||
80  PtJetoverArea > config_.PtJetOverArea_max ) result = BAD;
81 
83  double PtToweroverArea = 0.;
84  if (Jet.towersArea() !=0.) PtToweroverArea = MaxEnergyTower / Jet.towersArea();
85  if (PtToweroverArea < config_.PtTowerOverArea_min ||
86  PtToweroverArea > config_.PtTowerOverArea_max ) result = BAD;
87 
88  return result;
89 }
double PtTowerOverArea_max
Definition: JetSelection.h:27
int n90() const
Definition: CaloJet.h:120
double PtJetOverArea_min
Definition: JetSelection.h:26
virtual std::vector< CaloTowerPtr > getCaloConstituents() const
get all constituents
Definition: CaloJet.cc:93
1: Failed selection (without additional info)
Definition: ParticleCode.h:34
double PtJetOverArea_max
Definition: JetSelection.h:26
tuple result
Definition: query.py:137
double deltaR(double eta1, double eta2, double phi1, double phi2)
Definition: TreeUtility.cc:17
double HighestTowerOverJetmax
Definition: JetSelection.h:24
float towersArea() const
Definition: CaloJet.h:118
double HighestTowerOverJetmin
Definition: JetSelection.h:24
0: Passed selection
Definition: ParticleCode.h:33
double PtTowerOverArea_min
Definition: JetSelection.h:27
ParticleStatus
Definition of particle status after selection.
Definition: ParticleCode.h:32
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
float emEnergyFraction() const
Definition: CaloJet.h:102

Member Data Documentation

JetSelection pat::CaloJetSelector::config_
private

Definition at line 37 of file CaloJetSelector.h.

Referenced by filter().