CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
HLTPFJetIDProducer Class Reference

This applies PFJet ID and produces a jet collection with jets that pass the ID. More...

#include <HLTPFJetIDProducer.h>

Inheritance diagram for HLTPFJetIDProducer:
edm::stream::EDProducer<>

Public Member Functions

 HLTPFJetIDProducer (const edm::ParameterSet &iConfig)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~HLTPFJetIDProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Attributes

double CEF_
 charged EM fraction More...
 
double CHF_
 charged hadron fraction More...
 
edm::InputTag inputTag_
 input PFJet collection More...
 
edm::EDGetTokenT< reco::PFJetCollectionm_thePFJetToken
 
double maxCF_
 total charged energy fraction More...
 
double maxEta_
 
double minPt_
 
int NCH_
 number of charged constituents More...
 
double NEF_
 neutral EM fraction More...
 
double NHF_
 neutral hadron fraction More...
 
int NTOT_
 number of constituents More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

This applies PFJet ID and produces a jet collection with jets that pass the ID.

Author
Michele de Gruttola, Jia Fu Low (Nov 2013)

This receives a PFJet collection, selects jets that pass PFJet ID, and makes an output PFJet collection with only jets that pass.

See header file for documentation

Author
a Jet/MET person

Definition at line 27 of file HLTPFJetIDProducer.h.

Constructor & Destructor Documentation

◆ HLTPFJetIDProducer()

HLTPFJetIDProducer::HLTPFJetIDProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 17 of file HLTPFJetIDProducer.cc.

18  : minPt_(iConfig.getParameter<double>("minPt")),
19  maxEta_(iConfig.getParameter<double>("maxEta")),
20  CHF_(iConfig.getParameter<double>("CHF")),
21  NHF_(iConfig.getParameter<double>("NHF")),
22  CEF_(iConfig.getParameter<double>("CEF")),
23  NEF_(iConfig.getParameter<double>("NEF")),
24  maxCF_(iConfig.getParameter<double>("maxCF")),
25  NCH_(iConfig.getParameter<int>("NCH")),
26  NTOT_(iConfig.getParameter<int>("NTOT")),
27  inputTag_(iConfig.getParameter<edm::InputTag>("jetsInput")) {
28  m_thePFJetToken = consumes<reco::PFJetCollection>(inputTag_);
29 
30  // Register the products
31  produces<reco::PFJetCollection>();
32 }

References inputTag_, and m_thePFJetToken.

◆ ~HLTPFJetIDProducer()

HLTPFJetIDProducer::~HLTPFJetIDProducer ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

void HLTPFJetIDProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 38 of file HLTPFJetIDProducer.cc.

38  {
40  desc.add<double>("minPt", 20.);
41  desc.add<double>("maxEta", 1e99);
42  desc.add<double>("CHF", -99.);
43  desc.add<double>("NHF", 99.);
44  desc.add<double>("CEF", 99.);
45  desc.add<double>("NEF", 99.);
46  desc.add<double>("maxCF", 99.);
47  desc.add<int>("NCH", 0);
48  desc.add<int>("NTOT", 0);
49  desc.add<edm::InputTag>("jetsInput", edm::InputTag("hltAntiKT4PFJets"));
50  descriptions.add("hltPFJetIDProducer", desc);
51 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLT_2018_cff::InputTag.

◆ produce()

void HLTPFJetIDProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 54 of file HLTPFJetIDProducer.cc.

54  {
55  // Create a pointer to the products
56  std::unique_ptr<reco::PFJetCollection> result(new reco::PFJetCollection());
57 
59  iEvent.getByToken(m_thePFJetToken, pfjets);
60 
61  for (auto const& j : *pfjets) {
62  bool pass = false;
63  double pt = j.pt();
64  double eta = j.eta();
65  double abseta = std::abs(eta);
66 
67  if (!(pt > 0.))
68  continue; // skip jets with zero or negative pt
69 
70  if (pt < minPt_) {
71  pass = true;
72 
73  } else if (abseta >= maxEta_) {
74  pass = true;
75 
76  } else {
77  double chf = j.chargedHadronEnergyFraction();
78  //double nhf = j->neutralHadronEnergyFraction() + j->HFHadronEnergyFraction();
79  double nhf = j.neutralHadronEnergyFraction();
80  double cef = j.chargedEmEnergyFraction();
81  double nef = j.neutralEmEnergyFraction();
82  double cftot = chf + cef + j.chargedMuEnergyFraction();
83  int nch = j.chargedMultiplicity();
84  int ntot = j.numberOfDaughters();
85 
86  pass = true;
87  pass = pass && (ntot > NTOT_);
88  pass = pass && (nef < NEF_);
89  pass = pass && (nhf < NHF_ || abseta >= 2.4); //NHF-cut does not work in HF anymore with recent PF
90  pass = pass && (cef < CEF_ || abseta >= 2.4);
91  pass = pass && (chf > CHF_ || abseta >= 2.4);
92  pass = pass && (nch > NCH_ || abseta >= 2.4);
93  pass = pass && (cftot < maxCF_ || abseta >= 2.4);
94  }
95 
96  if (pass)
97  result->push_back(j);
98  }
99 
100  // Put the products into the Event
101  iEvent.put(std::move(result));
102 }

References funct::abs(), CHF_, PVValHelper::eta, iEvent, dqmiolumiharvest::j, m_thePFJetToken, maxEta_, minPt_, eostools::move(), NCH_, NEF_, NTOT_, DiDispStaMuonMonitor_cfi::pt, and mps_fire::result.

Member Data Documentation

◆ CEF_

double HLTPFJetIDProducer::CEF_
private

charged EM fraction

Definition at line 39 of file HLTPFJetIDProducer.h.

◆ CHF_

double HLTPFJetIDProducer::CHF_
private

charged hadron fraction

Definition at line 37 of file HLTPFJetIDProducer.h.

Referenced by produce().

◆ inputTag_

edm::InputTag HLTPFJetIDProducer::inputTag_
private

input PFJet collection

Definition at line 44 of file HLTPFJetIDProducer.h.

Referenced by HLTPFJetIDProducer().

◆ m_thePFJetToken

edm::EDGetTokenT<reco::PFJetCollection> HLTPFJetIDProducer::m_thePFJetToken
private

Definition at line 46 of file HLTPFJetIDProducer.h.

Referenced by HLTPFJetIDProducer(), and produce().

◆ maxCF_

double HLTPFJetIDProducer::maxCF_
private

total charged energy fraction

Definition at line 41 of file HLTPFJetIDProducer.h.

◆ maxEta_

double HLTPFJetIDProducer::maxEta_
private

Definition at line 36 of file HLTPFJetIDProducer.h.

Referenced by produce().

◆ minPt_

double HLTPFJetIDProducer::minPt_
private

Definition at line 35 of file HLTPFJetIDProducer.h.

Referenced by produce().

◆ NCH_

int HLTPFJetIDProducer::NCH_
private

number of charged constituents

Definition at line 42 of file HLTPFJetIDProducer.h.

Referenced by produce().

◆ NEF_

double HLTPFJetIDProducer::NEF_
private

neutral EM fraction

Definition at line 40 of file HLTPFJetIDProducer.h.

Referenced by produce().

◆ NHF_

double HLTPFJetIDProducer::NHF_
private

neutral hadron fraction

Definition at line 38 of file HLTPFJetIDProducer.h.

◆ NTOT_

int HLTPFJetIDProducer::NTOT_
private

number of constituents

Definition at line 43 of file HLTPFJetIDProducer.h.

Referenced by produce().

edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
HLTPFJetIDProducer::inputTag_
edm::InputTag inputTag_
input PFJet collection
Definition: HLTPFJetIDProducer.h:44
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HLTPFJetIDProducer::CEF_
double CEF_
charged EM fraction
Definition: HLTPFJetIDProducer.h:39
edm::Handle< reco::PFJetCollection >
HLTPFJetIDProducer::NHF_
double NHF_
neutral hadron fraction
Definition: HLTPFJetIDProducer.h:38
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HLTPFJetIDProducer::NTOT_
int NTOT_
number of constituents
Definition: HLTPFJetIDProducer.h:43
PVValHelper::eta
Definition: PVValidationHelpers.h:69
HLTPFJetIDProducer::NCH_
int NCH_
number of charged constituents
Definition: HLTPFJetIDProducer.h:42
HLTPFJetIDProducer::maxCF_
double maxCF_
total charged energy fraction
Definition: HLTPFJetIDProducer.h:41
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
iEvent
int iEvent
Definition: GenABIO.cc:224
HLTPFJetIDProducer::minPt_
double minPt_
Definition: HLTPFJetIDProducer.h:35
HLTPFJetIDProducer::maxEta_
double maxEta_
Definition: HLTPFJetIDProducer.h:36
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
HLTPFJetIDProducer::CHF_
double CHF_
charged hadron fraction
Definition: HLTPFJetIDProducer.h:37
eostools.move
def move(src, dest)
Definition: eostools.py:511
reco::PFJetCollection
std::vector< PFJet > PFJetCollection
collection of PFJet objects
Definition: PFJetCollection.h:14
HLTPFJetIDProducer::m_thePFJetToken
edm::EDGetTokenT< reco::PFJetCollection > m_thePFJetToken
Definition: HLTPFJetIDProducer.h:46
HLTPFJetIDProducer::NEF_
double NEF_
neutral EM fraction
Definition: HLTPFJetIDProducer.h:40
mps_fire.result
result
Definition: mps_fire.py:303
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::InputTag
Definition: InputTag.h:15