Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:27:00

0001 // -*- C++ -*-
0002 //
0003 // Package:    CaloMuonProducer
0004 // Class:      CaloMuonProducer
0005 //
0006 // Original Author:  Dmytro Kovalskyi
0007 //         Created:  Wed Oct  3 16:29:03 CDT 2007
0008 //
0009 //
0010 
0011 // system include files
0012 #include <memory>
0013 
0014 // user include files
0015 #include "FWCore/Framework/interface/Frameworkfwd.h"
0016 
0017 #include "FWCore/Framework/interface/Event.h"
0018 #include "FWCore/Framework/interface/MakerMacros.h"
0019 
0020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0021 
0022 #include "RecoMuon/MuonIdentification/plugins/CaloMuonProducer.h"
0023 
0024 CaloMuonProducer::CaloMuonProducer(const edm::ParameterSet& iConfig) {
0025   produces<reco::CaloMuonCollection>();
0026   inputCollection = iConfig.getParameter<edm::InputTag>("inputCollection");
0027   muonToken_ = consumes<reco::CaloMuonCollection>(inputCollection);
0028 }
0029 
0030 CaloMuonProducer::~CaloMuonProducer() {}
0031 
0032 void CaloMuonProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) {
0033   edm::Handle<reco::CaloMuonCollection> iMuons;
0034   iEvent.getByToken(muonToken_, iMuons);
0035   auto oMuons = std::make_unique<reco::CaloMuonCollection>();
0036   for (reco::CaloMuonCollection::const_iterator muon = iMuons->begin(); muon != iMuons->end(); ++muon)
0037     oMuons->push_back(*muon);
0038   iEvent.put(std::move(oMuons));
0039 }
0040 
0041 //define this as a plug-in
0042 DEFINE_FWK_MODULE(CaloMuonProducer);