00001 #include "HLTrigger/JetMET/interface/HLTCaloJetIDProducer.h" 00002 #include "DataFormats/JetReco/interface/CaloJetCollection.h" 00003 #include "DataFormats/Common/interface/Handle.h" 00004 #include "FWCore/Framework/interface/ESHandle.h" 00005 00006 HLTCaloJetIDProducer::HLTCaloJetIDProducer(const edm::ParameterSet& iConfig) : 00007 jetsInput_ (iConfig.getParameter<edm::InputTag>("jetsInput")), 00008 min_EMF_ (iConfig.getParameter<double>("min_EMF")), 00009 max_EMF_ (iConfig.getParameter<double>("max_EMF")), 00010 min_N90_ (iConfig.getParameter<int>("min_N90")), 00011 min_N90hits_ (iConfig.getParameter<int>("min_N90hits")), 00012 jetID_ (iConfig.getParameter<edm::ParameterSet>("JetIDParams")) 00013 { 00014 // produces< reco::CaloJetCollection > ( "hltCaloJetIDCollection" ); 00015 produces< reco::CaloJetCollection > (); 00016 } 00017 00018 void HLTCaloJetIDProducer::beginJob() 00019 { 00020 00021 } 00022 00023 HLTCaloJetIDProducer::~HLTCaloJetIDProducer() 00024 { 00025 00026 } 00027 00028 void HLTCaloJetIDProducer::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 (std::abs(calojetc->eta()) >= 2.6) { 00040 result->push_back(*calojetc); 00041 } else { 00042 if (min_N90hits_>0) jetID_.calculate( iEvent, *calojetc ); 00043 if ((calojetc->emEnergyFraction() >= min_EMF_) && ((min_N90hits_<=0) || (jetID_.n90Hits() >= min_N90hits_)) && (calojetc->n90() >= min_N90_) && (calojetc->emEnergyFraction() <= max_EMF_)) { 00044 result->push_back(*calojetc); 00045 } 00046 } 00047 } // calojetc 00048 00049 //iEvent.put( result, "hltCaloJetIDCollection"); 00050 iEvent.put( result); 00051 00052 }