#include <RecoMuon/CosmicMuonProducer/src/GlobalCosmicMuonProducer.h>
Public Member Functions | |
GlobalCosmicMuonProducer (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
~GlobalCosmicMuonProducer () | |
Private Attributes | |
MuonServiceProxy * | theService |
the event setup proxy, it takes care the services update | |
edm::InputTag | theTrackCollectionLabel |
MuonTrackFinder * | theTrackFinder |
Definition at line 20 of file GlobalCosmicMuonProducer.h.
GlobalCosmicMuonProducer::GlobalCosmicMuonProducer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 42 of file GlobalCosmicMuonProducer.cc.
References edm::ParameterSet::getParameter(), MuonServiceProxy_cff::MuonServiceProxy, theService, theTrackCollectionLabel, and theTrackFinder.
00043 { 00044 00045 edm::ParameterSet tbpar = iConfig.getParameter<edm::ParameterSet>("TrajectoryBuilderParameters"); 00046 theTrackCollectionLabel = iConfig.getParameter<edm::InputTag>("MuonCollectionLabel"); 00047 00048 // service parameters 00049 edm::ParameterSet serviceParameters = iConfig.getParameter<edm::ParameterSet>("ServiceParameters"); 00050 00051 // TrackLoader parameters 00052 edm::ParameterSet trackLoaderParameters = iConfig.getParameter<edm::ParameterSet>("TrackLoaderParameters"); 00053 00054 // the services 00055 theService = new MuonServiceProxy(serviceParameters); 00056 00057 theTrackFinder = new MuonTrackFinder(new GlobalCosmicMuonTrajectoryBuilder(tbpar,theService), 00058 new MuonTrackLoader(trackLoaderParameters, theService)); 00059 00060 produces<reco::TrackCollection>(); 00061 produces<TrackingRecHitCollection>(); 00062 produces<reco::TrackExtraCollection>(); 00063 produces<std::vector<Trajectory> >(); 00064 produces<TrajTrackAssociationCollection>(); 00065 00066 produces<reco::MuonTrackLinksCollection>(); 00067 00068 }
GlobalCosmicMuonProducer::~GlobalCosmicMuonProducer | ( | ) |
Definition at line 71 of file GlobalCosmicMuonProducer.cc.
References theService, and theTrackFinder.
00072 { 00073 if (theService) delete theService; 00074 if (theTrackFinder) delete theTrackFinder; 00075 }
void GlobalCosmicMuonProducer::produce | ( | edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 80 of file GlobalCosmicMuonProducer.cc.
References edm::Event::getByLabel(), edm::Handle< T >::isValid(), LogTrace, MuonTrackFinder::reconstruct(), theService, theTrackCollectionLabel, and theTrackFinder.
00081 { 00082 const std::string metname = "Muon|RecoMuon|GlobalCosmicMuonProducer"; 00083 LogTrace(metname)<<"Global Cosmic Muon Reconstruction started"; 00084 00085 edm::Handle<reco::TrackCollection> cosMuons; 00086 iEvent.getByLabel(theTrackCollectionLabel,cosMuons); 00087 if (!cosMuons.isValid()) { 00088 LogTrace(metname)<< "Muon Track collection is invalid!!!"; 00089 return; 00090 } 00091 00092 // Update the services 00093 theService->update(iSetup); 00094 00095 // Reconstruct the tracks in the tracker+muon system 00096 LogTrace(metname)<<"Track Reconstruction"; 00097 00098 std::vector<MuonTrajectoryBuilder::TrackCand> cosTrackCands; 00099 for ( unsigned int position = 0; position != cosMuons->size(); ++position ) { 00100 reco::TrackRef cosTrackRef(cosMuons,position); 00101 MuonTrajectoryBuilder::TrackCand cosCand = MuonTrajectoryBuilder::TrackCand(0,cosTrackRef); 00102 cosTrackCands.push_back(cosCand); 00103 } 00104 theTrackFinder->reconstruct(cosTrackCands,iEvent); 00105 LogTrace(metname)<<"Event loaded"; 00106 00107 }
the event setup proxy, it takes care the services update
Definition at line 33 of file GlobalCosmicMuonProducer.h.
Referenced by GlobalCosmicMuonProducer(), produce(), and ~GlobalCosmicMuonProducer().
Definition at line 29 of file GlobalCosmicMuonProducer.h.
Referenced by GlobalCosmicMuonProducer(), and produce().
Definition at line 30 of file GlobalCosmicMuonProducer.h.
Referenced by GlobalCosmicMuonProducer(), produce(), and ~GlobalCosmicMuonProducer().