File indexing completed on 2024-04-06 12:06:48
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "DPGAnalysis/Skims/interface/HLTMuonPtFilter.h"
0010
0011
0012 #include "FWCore/Framework/interface/MakerMacros.h"
0013 #include "FWCore/Framework/interface/Frameworkfwd.h"
0014 #include "FWCore/Framework/interface/ESHandle.h"
0015 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0016
0017 #include "DataFormats/TrackReco/interface/Track.h"
0018 #include "DataFormats/TrackReco/interface/TrackFwd.h"
0019
0020
0021 using namespace std;
0022 using namespace edm;
0023
0024
0025
0026
0027 HLTMuonPtFilter::HLTMuonPtFilter(const edm::ParameterSet& pset) : HLTFilter(pset) {
0028
0029 theSTAMuonLabel = pset.getParameter<std::string>("SALabel");
0030
0031 theMinPt = pset.getParameter<double>("minPt");
0032
0033 LogDebug("HLTMuonPt") << " SALabel : " << theSTAMuonLabel << " Min Pt : " << theMinPt;
0034 }
0035
0036
0037 HLTMuonPtFilter::~HLTMuonPtFilter() {}
0038
0039
0040 bool HLTMuonPtFilter::hltFilter(edm::Event& event,
0041 const edm::EventSetup& eventSetup,
0042 trigger::TriggerFilterObjectWithRefs& filterproduct) const {
0043
0044 Handle<reco::TrackCollection> staTracks;
0045 event.getByLabel(theSTAMuonLabel, staTracks);
0046
0047 reco::TrackCollection::const_iterator staTrack;
0048
0049 for (staTrack = staTracks->begin(); staTrack != staTracks->end(); ++staTrack) {
0050 if (staTrack->pt() > theMinPt)
0051 return true;
0052 }
0053
0054 return false;
0055 }
0056
0057
0058 DEFINE_FWK_MODULE(HLTMuonPtFilter);