CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTPFJetIDProducer (const edm::ParameterSet &iConfig)
 
virtual void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
 ~HLTPFJetIDProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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

double CEF_
 charged EM fraction More...
 
double CHF_
 charged hadron fraction More...
 
edm::InputTag inputTag_
 input PFJet collection More...
 
edm::EDGetTokenT
< reco::PFJetCollection
m_thePFJetToken
 
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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 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 28 of file HLTPFJetIDProducer.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file HLTPFJetIDProducer.cc.

References inputTag_, and m_thePFJetToken.

18  :
19  minPt_ (iConfig.getParameter<double>("minPt")),
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  NCH_ (iConfig.getParameter<int>("NCH")),
25  NTOT_ (iConfig.getParameter<int>("NTOT")),
26  inputTag_ (iConfig.getParameter<edm::InputTag>("jetsInput")) {
27  m_thePFJetToken = consumes<reco::PFJetCollection>(inputTag_);
28 
29  // Register the products
30  produces<reco::PFJetCollection>();
31 }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::PFJetCollection > m_thePFJetToken
double NHF_
neutral hadron fraction
double NEF_
neutral EM fraction
int NTOT_
number of constituents
double CHF_
charged hadron fraction
int NCH_
number of charged constituents
edm::InputTag inputTag_
input PFJet collection
double CEF_
charged EM fraction
HLTPFJetIDProducer::~HLTPFJetIDProducer ( )

Definition at line 34 of file HLTPFJetIDProducer.cc.

34 {}

Member Function Documentation

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

Definition at line 37 of file HLTPFJetIDProducer.cc.

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

37  {
39  desc.add<double>("minPt", 20.);
40  desc.add<double>("CHF", -99.);
41  desc.add<double>("NHF", 99.);
42  desc.add<double>("CEF", 99.);
43  desc.add<double>("NEF", 99.);
44  desc.add<int>("NCH", 0);
45  desc.add<int>("NTOT", 0);
46  desc.add<edm::InputTag>("jetsInput", edm::InputTag("hltAntiKT4PFJets"));
47  descriptions.add("hltPFJetIDProducer", desc);
48 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HLTPFJetIDProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::stream::EDProducerBase.

Definition at line 51 of file HLTPFJetIDProducer.cc.

References funct::abs(), CHF_, eta(), edm::Event::getByToken(), j, m_thePFJetToken, minPt_, NCH_, NEF_, NHF_, NTOT_, EnergyCorrector::pt, edm::Event::put(), and query::result.

51  {
52 
53  // Create a pointer to the products
54  std::auto_ptr<reco::PFJetCollection> result (new reco::PFJetCollection());
55 
57  iEvent.getByToken(m_thePFJetToken, pfjets);
58 
59  for (reco::PFJetCollection::const_iterator j = pfjets->begin(); j != pfjets->end(); ++j) {
60  bool pass = false;
61  double pt = j->pt();
62  double eta = j->eta();
63 
64  if (!(pt > 0.)) continue; // skip jets with zero or negative pt
65 
66  if (pt < minPt_) {
67  pass = true;
68 
69  //} else if (std::abs(eta) >= 2.4) {
70  // pass = true;
71 
72  } else {
73  double chf = j->chargedHadronEnergyFraction();
74  //double nhf = j->neutralHadronEnergyFraction() + j->HFHadronEnergyFraction();
75  double nhf = j->neutralHadronEnergyFraction();
76  double cef = j->chargedEmEnergyFraction();
77  double nef = j->neutralEmEnergyFraction();
78  int nch = j->chargedMultiplicity();
79  int ntot = j->numberOfDaughters();
80 
81  pass = true;
82  pass = pass && (ntot > NTOT_);
83  pass = pass && (nef < NEF_);
84  pass = pass && (nhf < NHF_);
85  pass = pass && (cef < CEF_ || std::abs(eta) >= 2.4);
86  pass = pass && (chf > CHF_ || std::abs(eta) >= 2.4);
87  pass = pass && (nch > NCH_ || std::abs(eta) >= 2.4);
88  }
89 
90  if (pass) result->push_back(*j);
91  }
92 
93  // Put the products into the Event
94  iEvent.put(result);
95 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
T eta() const
edm::EDGetTokenT< reco::PFJetCollection > m_thePFJetToken
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
tuple result
Definition: query.py:137
double NHF_
neutral hadron fraction
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
double NEF_
neutral EM fraction
int NTOT_
number of constituents
double CHF_
charged hadron fraction
int NCH_
number of charged constituents
std::vector< PFJet > PFJetCollection
collection of PFJet objects

Member Data Documentation

double HLTPFJetIDProducer::CEF_
private

charged EM fraction

Definition at line 39 of file HLTPFJetIDProducer.h.

double HLTPFJetIDProducer::CHF_
private

charged hadron fraction

Definition at line 37 of file HLTPFJetIDProducer.h.

Referenced by produce().

edm::InputTag HLTPFJetIDProducer::inputTag_
private

input PFJet collection

Definition at line 43 of file HLTPFJetIDProducer.h.

Referenced by HLTPFJetIDProducer().

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

Definition at line 45 of file HLTPFJetIDProducer.h.

Referenced by HLTPFJetIDProducer(), and produce().

double HLTPFJetIDProducer::minPt_
private

Definition at line 36 of file HLTPFJetIDProducer.h.

Referenced by produce().

int HLTPFJetIDProducer::NCH_
private

number of charged constituents

Definition at line 41 of file HLTPFJetIDProducer.h.

Referenced by produce().

double HLTPFJetIDProducer::NEF_
private

neutral EM fraction

Definition at line 40 of file HLTPFJetIDProducer.h.

Referenced by produce().

double HLTPFJetIDProducer::NHF_
private

neutral hadron fraction

Definition at line 38 of file HLTPFJetIDProducer.h.

Referenced by produce().

int HLTPFJetIDProducer::NTOT_
private

number of constituents

Definition at line 42 of file HLTPFJetIDProducer.h.

Referenced by produce().