CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/HLTrigger/JetMET/src/HLTJetIDProducer.cc

Go to the documentation of this file.
00001 #include "HLTrigger/JetMET/interface/HLTJetIDProducer.h"
00002 #include "DataFormats/JetReco/interface/CaloJetCollection.h"
00003 #include "DataFormats/Common/interface/Handle.h"
00004 #include "FWCore/Framework/interface/ESHandle.h"
00005 
00006 HLTJetIDProducer::HLTJetIDProducer(const edm::ParameterSet& iConfig)
00007 {
00008   jetsInput_ = iConfig.getParameter<edm::InputTag>("jetsInput");
00009   min_EMF_ = iConfig.getParameter<double>("min_EMF");
00010   max_EMF_ = iConfig.getParameter<double>("max_EMF");
00011   min_N90_ = iConfig.getParameter<int>("min_N90");
00012 
00013 
00014   //  produces< reco::CaloJetCollection > ( "hltJetIDCollection" );
00015   produces< reco::CaloJetCollection > ();
00016 }
00017 
00018 void HLTJetIDProducer::beginJob()
00019 {
00020 
00021 }
00022 
00023 HLTJetIDProducer::~HLTJetIDProducer()
00024 {
00025 
00026 }
00027 
00028 void HLTJetIDProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
00029 {
00030 
00031   edm::Handle<reco::CaloJetCollection> calojets;
00032   iEvent.getByLabel(jetsInput_, calojets);
00033 
00034   std::auto_ptr<reco::CaloJetCollection> result (new reco::CaloJetCollection);
00035 
00036   for (reco::CaloJetCollection::const_iterator calojetc = calojets->begin(); 
00037        calojetc != calojets->end(); ++calojetc) {
00038       
00039     if (fabs(calojetc->eta()) >= 2.6) {
00040       result->push_back(*calojetc);
00041     } else if ((calojetc->emEnergyFraction() >= min_EMF_) && (calojetc->n90() >= min_N90_) && (calojetc->emEnergyFraction() <= max_EMF_)) {
00042       result->push_back(*calojetc);
00043     }
00044 
00045   } // calojetc
00046 
00047   //iEvent.put( result, "hltJetIDCollection");
00048   iEvent.put( result);
00049 
00050 }