36 : muonSource_( iConfig.getParameter< edm::InputTag >(
"muonSource" ) )
37 , vertexSource_( 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 );
#define DEFINE_FWK_MODULE(type)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
edm::InputTag muonSource_
edm::InputTag vertexSource_
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
MuonSelectorVertex(const edm::ParameterSet &iConfig)