CMS 3D CMS Logo

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

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

#include <HLTCaloJetIDProducer.h>

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

Public Member Functions

 HLTCaloJetIDProducer (const edm::ParameterSet &iConfig)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~HLTCaloJetIDProducer () 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

edm::InputTag inputTag_
 input CaloJet collection More...
 
reco::helper::JetIDHelper jetIDHelper_
 A helper to calculates calo jet ID variables. More...
 
edm::ParameterSet jetIDParams_
 CaloJet ID parameters. More...
 
edm::EDGetTokenT< reco::CaloJetCollectionm_theCaloJetToken
 
double max_EMF_
 maximum EMF More...
 
double min_EMF_
 minimum EMF More...
 
int min_N90_
 mininum N90 More...
 
int min_N90hits_
 mininum N90hits 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 CaloJet ID and produces a jet collection with jets that pass the ID.

Author
a Jet/MET person
Michele de Gruttola, Jia Fu Low (Nov 2013)

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

See header file for documentation

Author
a Jet/MET person

Definition at line 35 of file HLTCaloJetIDProducer.h.

Constructor & Destructor Documentation

◆ HLTCaloJetIDProducer()

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

Definition at line 17 of file HLTCaloJetIDProducer.cc.

18  : min_N90_(iConfig.getParameter<int>("min_N90")),
19  min_N90hits_(iConfig.getParameter<int>("min_N90hits")),
20  min_EMF_(iConfig.getParameter<double>("min_EMF")),
21  max_EMF_(iConfig.getParameter<double>("max_EMF")),
22  inputTag_(iConfig.getParameter<edm::InputTag>("jetsInput")),
23  jetIDParams_(iConfig.getParameter<edm::ParameterSet>("JetIDParams")),
24  jetIDHelper_(jetIDParams_, consumesCollector()) {
25  m_theCaloJetToken = consumes<reco::CaloJetCollection>(inputTag_);
26 
27  // Register the products
28  produces<reco::CaloJetCollection>();
29 }

References inputTag_, and m_theCaloJetToken.

◆ ~HLTCaloJetIDProducer()

HLTCaloJetIDProducer::~HLTCaloJetIDProducer ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 35 of file HLTCaloJetIDProducer.cc.

35  {
37  desc.add<int>("min_N90", -2);
38  desc.add<int>("min_N90hits", 2);
39  desc.add<double>("min_EMF", 1e-6);
40  desc.add<double>("max_EMF", 999.);
41  desc.add<edm::InputTag>("jetsInput", edm::InputTag("hltAntiKT4CaloJets"));
42 
44  descNested.add<bool>("useRecHits", true);
45  descNested.add<edm::InputTag>("hbheRecHitsColl", edm::InputTag("hltHbhereco"));
46  descNested.add<edm::InputTag>("hoRecHitsColl", edm::InputTag("hltHoreco"));
47  descNested.add<edm::InputTag>("hfRecHitsColl", edm::InputTag("hltHfreco"));
48  descNested.add<edm::InputTag>("ebRecHitsColl", edm::InputTag("hltEcalRecHit", "EcalRecHitsEB"));
49  descNested.add<edm::InputTag>("eeRecHitsColl", edm::InputTag("hltEcalRecHit", "EcalRecHitsEE"));
50  desc.add<edm::ParameterSetDescription>("JetIDParams", descNested);
51 
52  descriptions.add("hltCaloJetIDProducer", desc);
53 }

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

◆ produce()

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

Definition at line 56 of file HLTCaloJetIDProducer.cc.

56  {
57  // Create a pointer to the products
58  std::unique_ptr<reco::CaloJetCollection> result(new reco::CaloJetCollection());
59 
61  iEvent.getByToken(m_theCaloJetToken, calojets);
62 
63  for (auto const& j : *calojets) {
64  bool pass = false;
65 
66  if (!(j.energy() > 0.))
67  continue; // skip jets with zero or negative energy
68 
69  if (std::abs(j.eta()) >= 2.6) {
70  pass = true;
71 
72  } else {
73  if (min_N90hits_ > 0)
74  jetIDHelper_.calculate(iEvent, iSetup, j);
75  if ((j.emEnergyFraction() >= min_EMF_) && (j.emEnergyFraction() <= max_EMF_) && (j.n90() >= min_N90_) &&
76  ((min_N90hits_ <= 0) || (jetIDHelper_.n90Hits() >= min_N90hits_))) {
77  pass = true;
78  }
79  }
80 
81  if (pass)
82  result->push_back(j);
83  }
84 
85  // Put the products into the Event
86  iEvent.put(std::move(result));
87 }

References funct::abs(), reco::helper::JetIDHelper::calculate(), iEvent, dqmiolumiharvest::j, jetIDHelper_, m_theCaloJetToken, max_EMF_, min_EMF_, min_N90_, min_N90hits_, eostools::move(), reco::helper::JetIDHelper::n90Hits(), and mps_fire::result.

Member Data Documentation

◆ inputTag_

edm::InputTag HLTCaloJetIDProducer::inputTag_
private

input CaloJet collection

Definition at line 47 of file HLTCaloJetIDProducer.h.

Referenced by HLTCaloJetIDProducer().

◆ jetIDHelper_

reco::helper::JetIDHelper HLTCaloJetIDProducer::jetIDHelper_
private

A helper to calculates calo jet ID variables.

Definition at line 51 of file HLTCaloJetIDProducer.h.

Referenced by produce().

◆ jetIDParams_

edm::ParameterSet HLTCaloJetIDProducer::jetIDParams_
private

CaloJet ID parameters.

Definition at line 48 of file HLTCaloJetIDProducer.h.

◆ m_theCaloJetToken

edm::EDGetTokenT<reco::CaloJetCollection> HLTCaloJetIDProducer::m_theCaloJetToken
private

Definition at line 53 of file HLTCaloJetIDProducer.h.

Referenced by HLTCaloJetIDProducer(), and produce().

◆ max_EMF_

double HLTCaloJetIDProducer::max_EMF_
private

maximum EMF

Definition at line 46 of file HLTCaloJetIDProducer.h.

Referenced by produce().

◆ min_EMF_

double HLTCaloJetIDProducer::min_EMF_
private

minimum EMF

Definition at line 45 of file HLTCaloJetIDProducer.h.

Referenced by produce().

◆ min_N90_

int HLTCaloJetIDProducer::min_N90_
private

mininum N90

Definition at line 43 of file HLTCaloJetIDProducer.h.

Referenced by produce().

◆ min_N90hits_

int HLTCaloJetIDProducer::min_N90hits_
private

mininum N90hits

Definition at line 44 of file HLTCaloJetIDProducer.h.

Referenced by produce().

HLTCaloJetIDProducer::min_N90hits_
int min_N90hits_
mininum N90hits
Definition: HLTCaloJetIDProducer.h:44
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
reco::helper::JetIDHelper::calculate
void calculate(const edm::Event &event, const edm::EventSetup &setup, const reco::CaloJet &jet, const int iDbg=0)
Definition: JetIDHelper.cc:93
HLTCaloJetIDProducer::inputTag_
edm::InputTag inputTag_
input CaloJet collection
Definition: HLTCaloJetIDProducer.h:47
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Handle< reco::CaloJetCollection >
HLTCaloJetIDProducer::m_theCaloJetToken
edm::EDGetTokenT< reco::CaloJetCollection > m_theCaloJetToken
Definition: HLTCaloJetIDProducer.h:53
reco::helper::JetIDHelper::n90Hits
int n90Hits() const
Definition: JetIDHelper.h:45
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
HLTCaloJetIDProducer::min_EMF_
double min_EMF_
minimum EMF
Definition: HLTCaloJetIDProducer.h:45
iEvent
int iEvent
Definition: GenABIO.cc:224
reco::CaloJetCollection
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects
Definition: CaloJetCollection.h:15
HLTCaloJetIDProducer::min_N90_
int min_N90_
mininum N90
Definition: HLTCaloJetIDProducer.h:43
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
HLTCaloJetIDProducer::jetIDParams_
edm::ParameterSet jetIDParams_
CaloJet ID parameters.
Definition: HLTCaloJetIDProducer.h:48
mps_fire.result
result
Definition: mps_fire.py:303
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HLTCaloJetIDProducer::jetIDHelper_
reco::helper::JetIDHelper jetIDHelper_
A helper to calculates calo jet ID variables.
Definition: HLTCaloJetIDProducer.h:51
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
HLTCaloJetIDProducer::max_EMF_
double max_EMF_
maximum EMF
Definition: HLTCaloJetIDProducer.h:46
edm::InputTag
Definition: InputTag.h:15
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37