CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HLTCaloJetIDProducer.cc
Go to the documentation of this file.
5 
7  jetsInput_ (iConfig.getParameter<edm::InputTag>("jetsInput")),
8  min_EMF_ (iConfig.getParameter<double>("min_EMF")),
9  max_EMF_ (iConfig.getParameter<double>("max_EMF")),
10  min_N90_ (iConfig.getParameter<int>("min_N90")),
11  min_N90hits_ (iConfig.getParameter<int>("min_N90hits")),
12  jetID_ (iConfig.getParameter<edm::ParameterSet>("JetIDParams"))
13 {
14  // produces< reco::CaloJetCollection > ( "hltCaloJetIDCollection" );
15  produces< reco::CaloJetCollection > ();
16 }
17 
19 {
20 
21 }
22 
24 {
25 
26 }
27 
29 {
30 
32  iEvent.getByLabel(jetsInput_, calojets);
33 
34  std::auto_ptr<reco::CaloJetCollection> result (new reco::CaloJetCollection);
35 
36  for (reco::CaloJetCollection::const_iterator calojetc = calojets->begin();
37  calojetc != calojets->end(); ++calojetc) {
38 
39  if (std::abs(calojetc->eta()) >= 2.6) {
40  result->push_back(*calojetc);
41  } else {
42  if (min_N90hits_>0) jetID_.calculate( iEvent, *calojetc );
43  if ((calojetc->emEnergyFraction() >= min_EMF_) && ((min_N90hits_<=0) || (jetID_.n90Hits() >= min_N90hits_)) && (calojetc->n90() >= min_N90_) && (calojetc->emEnergyFraction() <= max_EMF_)) {
44  result->push_back(*calojetc);
45  }
46  }
47  } // calojetc
48 
49  //iEvent.put( result, "hltCaloJetIDCollection");
50  iEvent.put( result);
51 
52 }
HLTCaloJetIDProducer(const edm::ParameterSet &)
virtual void produce(edm::Event &, const edm::EventSetup &)
#define abs(x)
Definition: mlp_lapack.h:159
int iEvent
Definition: GenABIO.cc:243
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
tuple result
Definition: query.py:137
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
reco::helper::JetIDHelper jetID_
void calculate(const edm::Event &event, const reco::CaloJet &jet, const int iDbg=0)
Definition: JetIDHelper.cc:86
std::vector< CaloJet > CaloJetCollection
collection of CaloJet objects