CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 // system include files
12 #include <memory>
13 
14 // user include files
16 
19 
21 
23 
25  produces<reco::CaloMuonCollection>();
26  inputCollection = iConfig.getParameter<edm::InputTag>("inputCollection");
27  muonToken_ = consumes<reco::CaloMuonCollection>(inputCollection);
28 }
29 
31 
34  iEvent.getByToken(muonToken_, iMuons);
35  auto oMuons = std::make_unique<reco::CaloMuonCollection>();
36  for (reco::CaloMuonCollection::const_iterator muon = iMuons->begin(); muon != iMuons->end(); ++muon)
37  oMuons->push_back(*muon);
38  iEvent.put(std::move(oMuons));
39 }
40 
41 //define this as a plug-in
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
edm::InputTag inputCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
~CaloMuonProducer() override
edm::EDGetTokenT< reco::CaloMuonCollection > muonToken_
int iEvent
Definition: GenABIO.cc:224
CaloMuonProducer(const edm::ParameterSet &)
def move
Definition: eostools.py:511
void produce(edm::Event &, const edm::EventSetup &) override
T getParameter(std::string const &) const
Definition: ParameterSet.h:303