CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HLTPFJetIDProducer.cc
Go to the documentation of this file.
7 
9  jetsInput_ (iConfig.getParameter<edm::InputTag>("jetsInput")),
10  min_NHEF_ (iConfig.getParameter<double>("min_NHEF")),
11  max_NHEF_ (iConfig.getParameter<double>("max_NHEF")),
12  min_NEMF_ (iConfig.getParameter<double>("min_NEMF")),
13  max_NEMF_ (iConfig.getParameter<double>("max_NEMF")),
14  min_CEMF_ (iConfig.getParameter<double>("min_CEMF")),
15  max_CEMF_ (iConfig.getParameter<double>("max_CEMF")),
16  min_CHEF_ (iConfig.getParameter<double>("min_CHEF")),
17  max_CHEF_ (iConfig.getParameter<double>("max_CHEF")),
18  min_pt_ (iConfig.getParameter<double>("min_pt"))
19 {
20  produces< reco::PFJetCollection > ();
21 }
22 
25  desc.add<edm::InputTag>("jetsInput",edm::InputTag("hltAntiKT5PFJets"));
26  desc.add<double>("min_NHEF",-999.0);
27  desc.add<double>("max_NHEF",999.0);
28  desc.add<double>("min_NEMF",-999.0);
29  desc.add<double>("max_NEMF",999.0);
30  desc.add<double>("min_CEMF",-999.0);
31  desc.add<double>("max_CEMF",999.0);
32  desc.add<double>("min_CHEF",-999.0);
33  desc.add<double>("max_CHEF",999.0);
34  desc.add<double>("min_pt",30.0);
35  descriptions.add("hltPFJetIDProducer", desc);
36 }
37 
39 {
40 
41 }
42 
44 {
45 
46 }
47 
49 {
50 
52  iEvent.getByLabel(jetsInput_, pfjets);
53 
54  std::auto_ptr<reco::PFJetCollection> result (new reco::PFJetCollection);
55 
56  for (reco::PFJetCollection::const_iterator pfjetc = pfjets->begin();
57  pfjetc != pfjets->end(); ++pfjetc) {
58 
59  if (std::abs(pfjetc->eta()) >= 2.4) {
60  result->push_back(*pfjetc);
61  } else {
62  if (pfjetc->pt()<min_pt_) result->push_back(*pfjetc);
63  else if ((pfjetc->neutralHadronEnergyFraction() >= min_NHEF_) && (pfjetc->neutralHadronEnergyFraction() <= max_NHEF_) &&
64  (pfjetc->neutralEmEnergyFraction() >= min_NEMF_) && (pfjetc->neutralEmEnergyFraction() <= max_NEMF_) &&
65  (pfjetc->chargedEmEnergyFraction() >= min_CEMF_) && (pfjetc->chargedEmEnergyFraction() <= max_CEMF_) &&
66  (pfjetc->chargedHadronEnergyFraction() >= min_CHEF_) && (pfjetc->chargedHadronEnergyFraction() <= max_CHEF_)) {
67  result->push_back(*pfjetc);
68  }
69  }
70  } // pfjetc
71 
72  iEvent.put( result);
73 
74 }
edm::InputTag jetsInput_
#define abs(x)
Definition: mlp_lapack.h:159
virtual void produce(edm::Event &, const edm::EventSetup &)
virtual void beginJob()
int iEvent
Definition: GenABIO.cc:243
HLTPFJetIDProducer(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
tuple result
Definition: query.py:137
ParameterDescriptionBase * add(U const &iLabel, T const &value)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::vector< PFJet > PFJetCollection
collection of PFJet objects
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)