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

#include <HLTPFJetIDProducer.h>

Inheritance diagram for HLTPFJetIDProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

virtual void beginJob ()
 
 HLTPFJetIDProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~HLTPFJetIDProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- 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
 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
 
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::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::InputTag jetsInput_
 
edm::EDGetTokenT
< reco::PFJetCollection
m_thePFJetToken
 
double max_CEMF_
 
double max_CHEF_
 
double max_NEMF_
 
double max_NHEF_
 
double min_CEMF_
 
double min_CHEF_
 
double min_NEMF_
 
double min_NHEF_
 
double min_pt_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer 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

Definition at line 13 of file HLTPFJetIDProducer.h.

Constructor & Destructor Documentation

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

Definition at line 6 of file HLTPFJetIDProducer.cc.

References jetsInput_, and m_thePFJetToken.

6  :
7  jetsInput_ (iConfig.getParameter<edm::InputTag>("jetsInput")),
8  min_NHEF_ (iConfig.getParameter<double>("min_NHEF")),
9  max_NHEF_ (iConfig.getParameter<double>("max_NHEF")),
10  min_NEMF_ (iConfig.getParameter<double>("min_NEMF")),
11  max_NEMF_ (iConfig.getParameter<double>("max_NEMF")),
12  min_CEMF_ (iConfig.getParameter<double>("min_CEMF")),
13  max_CEMF_ (iConfig.getParameter<double>("max_CEMF")),
14  min_CHEF_ (iConfig.getParameter<double>("min_CHEF")),
15  max_CHEF_ (iConfig.getParameter<double>("max_CHEF")),
16  min_pt_ (iConfig.getParameter<double>("min_pt"))
17 {
18  m_thePFJetToken = consumes<reco::PFJetCollection>(jetsInput_);
19  produces< reco::PFJetCollection > ();
20 }
edm::InputTag jetsInput_
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::PFJetCollection > m_thePFJetToken
HLTPFJetIDProducer::~HLTPFJetIDProducer ( )

Definition at line 42 of file HLTPFJetIDProducer.cc.

43 {
44 
45 }

Member Function Documentation

void HLTPFJetIDProducer::beginJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 37 of file HLTPFJetIDProducer.cc.

38 {
39 
40 }
void HLTPFJetIDProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 22 of file HLTPFJetIDProducer.cc.

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

22  {
24  desc.add<edm::InputTag>("jetsInput",edm::InputTag("hltAntiKT5PFJets"));
25  desc.add<double>("min_NHEF",-999.0);
26  desc.add<double>("max_NHEF",999.0);
27  desc.add<double>("min_NEMF",-999.0);
28  desc.add<double>("max_NEMF",999.0);
29  desc.add<double>("min_CEMF",-999.0);
30  desc.add<double>("max_CEMF",999.0);
31  desc.add<double>("min_CHEF",-999.0);
32  desc.add<double>("max_CHEF",999.0);
33  desc.add<double>("min_pt",30.0);
34  descriptions.add("hltPFJetIDProducer", desc);
35 }
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::EDProducer.

Definition at line 47 of file HLTPFJetIDProducer.cc.

References funct::abs(), edm::Event::getByToken(), m_thePFJetToken, max_CEMF_, max_CHEF_, max_NEMF_, max_NHEF_, min_CEMF_, min_CHEF_, min_NEMF_, min_NHEF_, min_pt_, edm::Event::put(), and query::result.

48 {
49 
51  iEvent.getByToken(m_thePFJetToken,pfjets);
52 
53  std::auto_ptr<reco::PFJetCollection> result (new reco::PFJetCollection);
54 
55  for (reco::PFJetCollection::const_iterator pfjetc = pfjets->begin();
56  pfjetc != pfjets->end(); ++pfjetc) {
57 
58  if (std::abs(pfjetc->eta()) >= 2.4) {
59  result->push_back(*pfjetc);
60  } else {
61  if (pfjetc->pt()<min_pt_) result->push_back(*pfjetc);
62  else if ((pfjetc->neutralHadronEnergyFraction() >= min_NHEF_) && (pfjetc->neutralHadronEnergyFraction() <= max_NHEF_) &&
63  (pfjetc->neutralEmEnergyFraction() >= min_NEMF_) && (pfjetc->neutralEmEnergyFraction() <= max_NEMF_) &&
64  (pfjetc->chargedEmEnergyFraction() >= min_CEMF_) && (pfjetc->chargedEmEnergyFraction() <= max_CEMF_) &&
65  (pfjetc->chargedHadronEnergyFraction() >= min_CHEF_) && (pfjetc->chargedHadronEnergyFraction() <= max_CHEF_)) {
66  result->push_back(*pfjetc);
67  }
68  }
69  } // pfjetc
70 
71  iEvent.put( result);
72 
73 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
edm::EDGetTokenT< reco::PFJetCollection > m_thePFJetToken
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
tuple result
Definition: query.py:137
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
std::vector< PFJet > PFJetCollection
collection of PFJet objects

Member Data Documentation

edm::InputTag HLTPFJetIDProducer::jetsInput_
private

Definition at line 22 of file HLTPFJetIDProducer.h.

Referenced by HLTPFJetIDProducer().

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

Definition at line 21 of file HLTPFJetIDProducer.h.

Referenced by HLTPFJetIDProducer(), and produce().

double HLTPFJetIDProducer::max_CEMF_
private

Definition at line 28 of file HLTPFJetIDProducer.h.

Referenced by produce().

double HLTPFJetIDProducer::max_CHEF_
private

Definition at line 30 of file HLTPFJetIDProducer.h.

Referenced by produce().

double HLTPFJetIDProducer::max_NEMF_
private

Definition at line 26 of file HLTPFJetIDProducer.h.

Referenced by produce().

double HLTPFJetIDProducer::max_NHEF_
private

Definition at line 24 of file HLTPFJetIDProducer.h.

Referenced by produce().

double HLTPFJetIDProducer::min_CEMF_
private

Definition at line 27 of file HLTPFJetIDProducer.h.

Referenced by produce().

double HLTPFJetIDProducer::min_CHEF_
private

Definition at line 29 of file HLTPFJetIDProducer.h.

Referenced by produce().

double HLTPFJetIDProducer::min_NEMF_
private

Definition at line 25 of file HLTPFJetIDProducer.h.

Referenced by produce().

double HLTPFJetIDProducer::min_NHEF_
private

Definition at line 23 of file HLTPFJetIDProducer.h.

Referenced by produce().

double HLTPFJetIDProducer::min_pt_
private

Definition at line 31 of file HLTPFJetIDProducer.h.

Referenced by produce().