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

◆ CaloJetSelector()

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

Definition at line 25 of file CaloJetSelector.h.

25 : config_(config) {}

◆ ~CaloJetSelector()

pat::CaloJetSelector::~CaloJetSelector ( )
inline

Definition at line 26 of file CaloJetSelector.h.

26 {}

Member Function Documentation

◆ filter()

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.

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 }

References pat::BAD, config_, PbPb_ZMuSkimMuonDPG_cff::deltaR, pat::JetSelection::EMFmax, pat::JetSelection::EMvsHadFmax, PVValHelper::eta, pat::JetSelection::Etamax, pat::GOOD, pat::JetSelection::HighestTowerOverJetmax, pat::JetSelection::N90max, pat::JetSelection::NCaloTowersmax, pat::JetSelection::NCaloTowersmin, pat::JetSelection::PtJetOverArea_max, pat::JetSelection::Ptmin, pat::JetSelection::PtTowerOverArea_max, mps_fire::result, and pat::JetSelection::RWidthmax.

Member Data Documentation

◆ config_

JetSelection pat::CaloJetSelector::config_
private

Definition at line 33 of file CaloJetSelector.h.

Referenced by filter().

pat::JetSelection::N90max
double N90max
Definition: JetSelection.h:28
pat::JetSelection::EMFmax
double EMFmax
Definition: JetSelection.h:19
pat::JetSelection::EMvsHadFmax
double EMvsHadFmax
Definition: JetSelection.h:24
pat::JetSelection::HighestTowerOverJetmax
double HighestTowerOverJetmax
Definition: JetSelection.h:32
pat::CaloJetSelector::config_
JetSelection config_
Definition: CaloJetSelector.h:33
pat::JetSelection::NCaloTowersmax
double NCaloTowersmax
Definition: JetSelection.h:30
pat::JetSelection::NCaloTowersmin
double NCaloTowersmin
Definition: JetSelection.h:29
pat::JetSelection::RWidthmax
double RWidthmax
Definition: JetSelection.h:34
pat::GOOD
0: Passed selection
Definition: ParticleCode.h:31
pat::JetSelection::PtJetOverArea_max
double PtJetOverArea_max
Definition: JetSelection.h:36
config
Definition: config.py:1
pat::JetSelection::Ptmin
double Ptmin
Definition: JetSelection.h:22
Jet
Definition: Jet.py:1
PVValHelper::eta
Definition: PVValidationHelpers.h:69
pat::JetSelection::Etamax
double Etamax
Definition: JetSelection.h:20
PbPb_ZMuSkimMuonDPG_cff.deltaR
deltaR
Definition: PbPb_ZMuSkimMuonDPG_cff.py:63
pat::ParticleStatus
ParticleStatus
Definition of particle status after selection.
Definition: ParticleCode.h:30
pat::BAD
1: Failed selection (without additional info)
Definition: ParticleCode.h:32
mps_fire.result
result
Definition: mps_fire.py:303
pat::JetSelection::PtTowerOverArea_max
double PtTowerOverArea_max
Definition: JetSelection.h:38