CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 
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  std::auto_ptr<reco::CaloMuonCollection> oMuons( new reco::CaloMuonCollection );
41  for ( reco::CaloMuonCollection::const_iterator muon = iMuons->begin();
42  muon != iMuons->end(); ++muon )
43  oMuons->push_back( *muon );
44  iEvent.put(oMuons);
45 }
46 
47 //define this as a plug-in
T getParameter(std::string const &) const
edm::InputTag inputCollection
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:449
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::vector< CaloMuon > CaloMuonCollection
collection of Muon objects
Definition: MuonFwd.h:27
int iEvent
Definition: GenABIO.cc:230
CaloMuonProducer(const edm::ParameterSet &)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:113
virtual void produce(edm::Event &, const edm::EventSetup &) override
edm::EDGetTokenT< reco::CaloMuonCollection > muonToken_