From 3144e639016fe84ff3941241d856e84fc8635fc6 Mon Sep 17 00:00:00 2001 From: Juan Alcaraz Maestre Date: Sat, 24 Oct 2009 14:47:59 +0000 Subject: [PATCH] *** empty log message *** --- .../Skimming/src/EWKMuTkSelector.cc | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/ElectroWeakAnalysis/Skimming/src/EWKMuTkSelector.cc b/ElectroWeakAnalysis/Skimming/src/EWKMuTkSelector.cc index 11a40873323ba..81c2275b959c6 100644 --- a/ElectroWeakAnalysis/Skimming/src/EWKMuTkSelector.cc +++ b/ElectroWeakAnalysis/Skimming/src/EWKMuTkSelector.cc @@ -1,19 +1,19 @@ #include #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/MakerMacros.h" -#include "FWCore/Framework/interface/EDProducer.h" +#include "FWCore/Framework/interface/EDFilter.h" // // class declaration // -class EWKMuTkSelector : public edm::EDProducer { +class EWKMuTkSelector : public edm::EDFilter { public: explicit EWKMuTkSelector(const edm::ParameterSet&); ~EWKMuTkSelector(); private: virtual void beginJob(const edm::EventSetup&) ; - virtual void produce(edm::Event&, const edm::EventSetup&); + virtual bool filter(edm::Event&, const edm::EventSetup&); virtual void endJob() ; edm::InputTag muonTag_; @@ -54,13 +54,15 @@ void EWKMuTkSelector::beginJob(const edm::EventSetup&) { void EWKMuTkSelector::endJob(){} ///////////////////////////////////////////////////////////////////////////////////// -void EWKMuTkSelector::produce(edm::Event& ev, const edm::EventSetup&) { +bool EWKMuTkSelector::filter(edm::Event& ev, const edm::EventSetup&) { + + bool selected = false; // Muon collection edm::Handle > muonCollection; if (!ev.getByLabel(muonTag_, muonCollection)) { edm::LogError("") << ">>> Muon collection does not exist !!!"; - return; + return false; } unsigned int muonCollectionSize = muonCollection->size(); @@ -68,7 +70,7 @@ void EWKMuTkSelector::produce(edm::Event& ev, const edm::EventSetup&) { edm::Handle > trackCollection; if (!ev.getByLabel(trackTag_, trackCollection)) { edm::LogError("") << ">>> Track collection does not exist !!!"; - return; + return false; } unsigned int trackCollectionSize = trackCollection->size(); @@ -86,9 +88,11 @@ void EWKMuTkSelector::produce(edm::Event& ev, const edm::EventSetup&) { for (unsigned int i=0; iat(i); if (mu.innerTrack().isNull()) continue; + if (mu.pt()setInnerTrack(reco::TrackRef(trackRefProd,newtracks->size()-1)); // insert it ordered by pt unsigned int newmuonCollectionSize = newmuons->size(); @@ -115,7 +119,9 @@ void EWKMuTkSelector::produce(edm::Event& ev, const edm::EventSetup&) { for (unsigned int i=0; iat(i); if (!mu.innerTrack().isNull()) continue; + if (mu.pt()size(); @@ -138,6 +144,7 @@ void EWKMuTkSelector::produce(edm::Event& ev, const edm::EventSetup&) { // Write new products ev.put(newtracks); ev.put(newmuons); + return selected; } DEFINE_FWK_MODULE(EWKMuTkSelector);