CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L3MuonCleaner.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 // Framework
13 
15  public:
17  virtual ~L3MuonCleaner(){}
18  virtual void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
19  private:
25 
26 
27 
28 };
29 
31  m_input = parameterSet.getParameter<edm::InputTag>("input");
32  m_minTrkHits = parameterSet.getParameter<int>("minTrkHits");
33  m_minMuonHits = parameterSet.getParameter<int>("minMuonHits");
34  m_maxNormalizedChi2 = parameterSet.getParameter<double>("maxNormalizedChi2");
35  inputToken_ = consumes<reco::TrackCollection>(m_input);
36 
37  produces<reco::TrackCollection>();
38 }
39 
42  event.getByToken(inputToken_,tracks);
43  std::auto_ptr<reco::TrackCollection> outTracks( new reco::TrackCollection() );
44  for ( reco::TrackCollection::const_iterator trk=tracks->begin(); trk!=tracks->end(); ++trk ){
45  if (trk->normalizedChi2()>m_maxNormalizedChi2) continue;
46  if (trk->hitPattern().numberOfValidTrackerHits()<m_minTrkHits) continue;
47  if (trk->hitPattern().numberOfValidMuonHits()<m_minMuonHits) continue;
48  outTracks->push_back(*trk);
49  }
50  event.put(outTracks);
51 }
T getParameter(std::string const &) const
double m_maxNormalizedChi2
edm::InputTag m_input
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
virtual void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
L3MuonCleaner(const edm::ParameterSet &)
virtual ~L3MuonCleaner()
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
tuple tracks
Definition: testEve_cfg.py:39
edm::EDGetTokenT< reco::TrackCollection > inputToken_
ParameterSet const & parameterSet(Provenance const &provenance)
Definition: Provenance.cc:11