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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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 36 of file HLTCaloJetIDProducer.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file HLTCaloJetIDProducer.cc.

References inputTag_, m_theCaloJetToken, and ~HLTCaloJetIDProducer().

18  :
19  min_N90_ (iConfig.getParameter<int>("min_N90")),
20  min_N90hits_(iConfig.getParameter<int>("min_N90hits")),
21  min_EMF_ (iConfig.getParameter<double>("min_EMF")),
22  max_EMF_ (iConfig.getParameter<double>("max_EMF")),
23  inputTag_ (iConfig.getParameter<edm::InputTag>("jetsInput")),
24  jetIDParams_(iConfig.getParameter<edm::ParameterSet>("JetIDParams")),
26  m_theCaloJetToken = consumes<reco::CaloJetCollection>(inputTag_);
27 
28  // Register the products
29  produces<reco::CaloJetCollection>();
30 }
T getParameter(std::string const &) const
edm::InputTag inputTag_
input CaloJet collection
double min_EMF_
minimum EMF
double max_EMF_
maximum EMF
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::ParameterSet jetIDParams_
CaloJet ID parameters.
reco::helper::JetIDHelper jetIDHelper_
A helper to calculates calo jet ID variables.
int min_N90hits_
mininum N90hits
edm::EDGetTokenT< reco::CaloJetCollection > m_theCaloJetToken
HLTCaloJetIDProducer::~HLTCaloJetIDProducer ( )
overridedefault

Referenced by HLTCaloJetIDProducer().

Member Function Documentation

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

Definition at line 36 of file HLTCaloJetIDProducer.cc.

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

36  {
38  desc.add<int>("min_N90", -2);
39  desc.add<int>("min_N90hits", 2);
40  desc.add<double>("min_EMF", 1e-6);
41  desc.add<double>("max_EMF", 999.);
42  desc.add<edm::InputTag>("jetsInput", edm::InputTag("hltAntiKT4CaloJets"));
43 
45  descNested.add<bool>("useRecHits", true);
46  descNested.add<edm::InputTag>("hbheRecHitsColl", edm::InputTag("hltHbhereco"));
47  descNested.add<edm::InputTag>("hoRecHitsColl", edm::InputTag("hltHoreco"));
48  descNested.add<edm::InputTag>("hfRecHitsColl", edm::InputTag("hltHfreco"));
49  descNested.add<edm::InputTag>("ebRecHitsColl", edm::InputTag("hltEcalRecHit","EcalRecHitsEB"));
50  descNested.add<edm::InputTag>("eeRecHitsColl", edm::InputTag("hltEcalRecHit","EcalRecHitsEE"));
51  desc.add<edm::ParameterSetDescription>("JetIDParams", descNested);
52 
53  descriptions.add("hltCaloJetIDProducer", desc);
54 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HLTCaloJetIDProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 57 of file HLTCaloJetIDProducer.cc.

References funct::abs(), reco::helper::JetIDHelper::calculate(), edm::Event::getByToken(), jetIDHelper_, m_theCaloJetToken, max_EMF_, min_EMF_, min_N90_, min_N90hits_, eostools::move(), reco::helper::JetIDHelper::n90Hits(), edm::Event::put(), and mps_fire::result.

57  {
58 
59  // Create a pointer to the products
60  std::unique_ptr<reco::CaloJetCollection> result (new reco::CaloJetCollection());
61 
63  iEvent.getByToken(m_theCaloJetToken, calojets);
64 
65  for (auto const & j : *calojets) {
66  bool pass = false;
67 
68  if (!(j.energy() > 0.)) continue; // skip jets with zero or negative energy
69 
70  if (std::abs(j.eta()) >= 2.6) {
71  pass = true;
72 
73  } else {
74  if (min_N90hits_ > 0) jetIDHelper_.calculate(iEvent, j);
75  if ((j.emEnergyFraction() >= min_EMF_) &&
76  (j.emEnergyFraction() <= max_EMF_) &&
77  (j.n90() >= min_N90_) &&
78  ((min_N90hits_ <= 0) || (jetIDHelper_.n90Hits() >= min_N90hits_)) ) {
79 
80  pass = true;
81  }
82  }
83 
84  if (pass) result->push_back(j);
85  }
86 
87  // Put the products into the Event
88  iEvent.put(std::move(result));
89 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
double min_EMF_
minimum EMF
double max_EMF_
maximum EMF
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
reco::helper::JetIDHelper jetIDHelper_
A helper to calculates calo jet ID variables.
int min_N90hits_
mininum N90hits
edm::EDGetTokenT< reco::CaloJetCollection > m_theCaloJetToken
def move(src, dest)
Definition: eostools.py:510
void calculate(const edm::Event &event, const reco::CaloJet &jet, const int iDbg=0)
Definition: JetIDHelper.cc:98
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects

Member Data Documentation

edm::InputTag HLTCaloJetIDProducer::inputTag_
private

input CaloJet collection

Definition at line 48 of file HLTCaloJetIDProducer.h.

Referenced by HLTCaloJetIDProducer().

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

A helper to calculates calo jet ID variables.

Definition at line 52 of file HLTCaloJetIDProducer.h.

Referenced by produce().

edm::ParameterSet HLTCaloJetIDProducer::jetIDParams_
private

CaloJet ID parameters.

Definition at line 49 of file HLTCaloJetIDProducer.h.

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

Definition at line 54 of file HLTCaloJetIDProducer.h.

Referenced by HLTCaloJetIDProducer(), and produce().

double HLTCaloJetIDProducer::max_EMF_
private

maximum EMF

Definition at line 47 of file HLTCaloJetIDProducer.h.

Referenced by produce().

double HLTCaloJetIDProducer::min_EMF_
private

minimum EMF

Definition at line 46 of file HLTCaloJetIDProducer.h.

Referenced by produce().

int HLTCaloJetIDProducer::min_N90_
private

mininum N90

Definition at line 44 of file HLTCaloJetIDProducer.h.

Referenced by produce().

int HLTCaloJetIDProducer::min_N90hits_
private

mininum N90hits

Definition at line 45 of file HLTCaloJetIDProducer.h.

Referenced by produce().