CMS 3D CMS Logo

CaloMuonProducer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CaloMuonProducer
4 // Class: CaloMuonProducer
5 //
6 // Original Author: Dmytro Kovalskyi
7 // Created: Wed Oct 3 16:29:03 CDT 2007
8 //
9 //
10 
11 
12 // system include files
13 #include <memory>
14 
15 // user include files
17 
20 
22 
24 
26 {
27  produces<reco::CaloMuonCollection>();
28  inputCollection = iConfig.getParameter<edm::InputTag>("inputCollection");
29  muonToken_ = consumes<reco::CaloMuonCollection>(inputCollection);
30 }
31 
33 {
34 }
35 
37 {
39  iEvent.getByToken(muonToken_,iMuons);
40  auto oMuons = std::make_unique<reco::CaloMuonCollection>();
41  for ( reco::CaloMuonCollection::const_iterator muon = iMuons->begin();
42  muon != iMuons->end(); ++muon )
43  oMuons->push_back( *muon );
44  iEvent.put(std::move(oMuons));
45 }
46 
47 //define this as a plug-in
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
edm::InputTag inputCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
~CaloMuonProducer() override
int iEvent
Definition: GenABIO.cc:230
CaloMuonProducer(const edm::ParameterSet &)
void produce(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< reco::CaloMuonCollection > muonToken_
def move(src, dest)
Definition: eostools.py:510