CMS 3D CMS Logo

L3MuonCleaner.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 // Framework
13 
15 public:
17  ~L3MuonCleaner() override {}
18  void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
19 
20 private:
26 };
27 
30  m_minTrkHits = parameterSet.getParameter<int>("minTrkHits");
31  m_minMuonHits = parameterSet.getParameter<int>("minMuonHits");
32  m_maxNormalizedChi2 = parameterSet.getParameter<double>("maxNormalizedChi2");
33  inputToken_ = consumes<reco::TrackCollection>(m_input);
34 
35  produces<reco::TrackCollection>();
36 }
37 
40  event.getByToken(inputToken_, tracks);
41  auto outTracks = std::make_unique<reco::TrackCollection>();
42  for (reco::TrackCollection::const_iterator trk = tracks->begin(); trk != tracks->end(); ++trk) {
43  if (trk->normalizedChi2() > m_maxNormalizedChi2)
44  continue;
45  if (trk->hitPattern().numberOfValidTrackerHits() < m_minTrkHits)
46  continue;
47  if (trk->hitPattern().numberOfValidMuonHits() < m_minMuonHits)
48  continue;
49  outTracks->push_back(*trk);
50  }
51  event.put(std::move(outTracks));
52 }
edm::StreamID
Definition: StreamID.h:30
Handle.h
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
MessageLogger.h
edm::EDGetTokenT< reco::TrackCollection >
L3MuonCleaner::L3MuonCleaner
L3MuonCleaner(const edm::ParameterSet &)
Definition: L3MuonCleaner.cc:28
edm::Handle< reco::TrackCollection >
L3MuonCleaner::m_minMuonHits
int m_minMuonHits
Definition: L3MuonCleaner.cc:23
L3MuonCleaner::inputToken_
edm::EDGetTokenT< reco::TrackCollection > inputToken_
Definition: L3MuonCleaner.cc:25
MakerMacros.h
Track.h
TrackFwd.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
L3MuonCleaner::m_input
edm::InputTag m_input
Definition: L3MuonCleaner.cc:21
L3MuonCleaner::produce
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition: L3MuonCleaner.cc:38
edm::global::EDProducer
Definition: EDProducer.h:32
L3MuonCleaner::~L3MuonCleaner
~L3MuonCleaner() override
Definition: L3MuonCleaner.cc:17
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
ModuleDef.h
edm::EventSetup
Definition: EventSetup.h:57
eostools.move
def move(src, dest)
Definition: eostools.py:511
L3MuonCleaner::m_maxNormalizedChi2
double m_maxNormalizedChi2
Definition: L3MuonCleaner.cc:24
edm::parameterSet
ParameterSet const & parameterSet(Provenance const &provenance, ProcessHistory const &history)
Definition: Provenance.cc:11
EventSetup.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ParameterSet.h
EDProducer.h
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
L3MuonCleaner
Definition: L3MuonCleaner.cc:14
L3MuonCleaner::m_minTrkHits
int m_minTrkHits
Definition: L3MuonCleaner.cc:22