36 : muonSource_( consumes< std::vector< pat::Muon > >( iConfig.getParameter< edm::InputTag >(
"muonSource" ) ) )
37 , vertexSource_( consumes< std::vector<
reco::Vertex > >( iConfig.getParameter< edm::InputTag >(
"vertexSource" ) ) )
38 , maxDZ_( iConfig.getParameter< double >(
"maxDZ" ) )
41 produces< std::vector< pat::Muon > >();
55 std::vector< pat::Muon > *
selectedMuons(
new std::vector< pat::Muon > );
57 if ( vertices->size() > 0 ) {
59 for (
unsigned iMuon = 0; iMuon < muons->size(); ++iMuon ) {
60 if ( std::fabs( muons->at( iMuon ).vertex().z() - vertices->at( 0 ).z() ) <
maxDZ_ ) {
61 selectedMuons->push_back( muons->at( iMuon ) );
66 std::auto_ptr< std::vector< pat::Muon > > selectedMuonsPtr( selectedMuons );
67 iEvent.
put( selectedMuonsPtr );
edm::EDGetTokenT< std::vector< pat::Muon > > muonSource_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< std::vector< reco::Vertex > > vertexSource_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
MuonSelectorVertex(const edm::ParameterSet &iConfig)