CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/RecoMuon/MuonIdentification/plugins/CaloMuonProducer.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    CaloMuonProducer
00004 // Class:      CaloMuonProducer
00005 //
00006 // Original Author:  Dmytro Kovalskyi
00007 //         Created:  Wed Oct  3 16:29:03 CDT 2007
00008 // $Id: CaloMuonProducer.cc,v 1.5 2009/09/23 19:15:04 dmytro Exp $
00009 //
00010 //
00011 
00012 
00013 // system include files
00014 #include <memory>
00015 
00016 // user include files
00017 #include "FWCore/Framework/interface/Frameworkfwd.h"
00018 #include "FWCore/Framework/interface/EDProducer.h"
00019 
00020 #include "FWCore/Framework/interface/Event.h"
00021 #include "FWCore/Framework/interface/MakerMacros.h"
00022 
00023 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00024 
00025 #include "DataFormats/MuonReco/interface/MuonFwd.h"
00026 #include "DataFormats/MuonReco/interface/CaloMuon.h"
00027 #include "RecoMuon/MuonIdentification/plugins/CaloMuonProducer.h"
00028 
00029 CaloMuonProducer::CaloMuonProducer(const edm::ParameterSet& iConfig)
00030 {
00031    produces<reco::CaloMuonCollection>();
00032    inputCollection = iConfig.getParameter<edm::InputTag>("inputCollection");
00033 }
00034 
00035 CaloMuonProducer::~CaloMuonProducer()
00036 {
00037 }
00038 
00039 void CaloMuonProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
00040 {
00041    edm::Handle<reco::CaloMuonCollection> iMuons;
00042    iEvent.getByLabel(inputCollection,iMuons);
00043    std::auto_ptr<reco::CaloMuonCollection> oMuons( new reco::CaloMuonCollection );
00044    for ( reco::CaloMuonCollection::const_iterator muon = iMuons->begin();
00045          muon != iMuons->end(); ++muon )
00046      oMuons->push_back( *muon );
00047    iEvent.put(oMuons);
00048 }
00049 
00050 //define this as a plug-in
00051 DEFINE_FWK_MODULE(CaloMuonProducer);