File indexing completed on 2024-04-06 12:27:00
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include <memory>
0013
0014
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
0042 DEFINE_FWK_MODULE(CaloMuonProducer);