CMS 3D CMS Logo

Public Member Functions | Private Attributes

GlobalCosmicMuonProducer Class Reference

#include <GlobalCosmicMuonProducer.h>

Inheritance diagram for GlobalCosmicMuonProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 GlobalCosmicMuonProducer (const edm::ParameterSet &)
virtual void produce (edm::Event &, const edm::EventSetup &)
 ~GlobalCosmicMuonProducer ()

Private Attributes

MuonServiceProxytheService
 the event setup proxy, it takes care the services update
edm::InputTag theTrackCollectionLabel
MuonTrackFindertheTrackFinder

Detailed Description

reconstruct muons using dt,csc,rpc and tracker starting from cosmic muon tracks

Date:
2009/07/29 12:46:25
Revision:
1.10
Author:
: Chang Liu - Purdue University <Chang.Liu@cern.ch>

Definition at line 20 of file GlobalCosmicMuonProducer.h.


Constructor & Destructor Documentation

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.

{

  edm::ParameterSet tbpar = iConfig.getParameter<edm::ParameterSet>("TrajectoryBuilderParameters");
  theTrackCollectionLabel = iConfig.getParameter<edm::InputTag>("MuonCollectionLabel");

  // service parameters
  edm::ParameterSet serviceParameters = iConfig.getParameter<edm::ParameterSet>("ServiceParameters");
  
  // TrackLoader parameters
  edm::ParameterSet trackLoaderParameters = iConfig.getParameter<edm::ParameterSet>("TrackLoaderParameters");
  
  // the services
  theService = new MuonServiceProxy(serviceParameters);
  
  theTrackFinder = new MuonTrackFinder(new GlobalCosmicMuonTrajectoryBuilder(tbpar,theService),
                                       new MuonTrackLoader(trackLoaderParameters, theService));

  produces<reco::TrackCollection>();
  produces<TrackingRecHitCollection>();
  produces<reco::TrackExtraCollection>();
  produces<std::vector<Trajectory> >();
  produces<TrajTrackAssociationCollection>();

  produces<reco::MuonTrackLinksCollection>();

}
GlobalCosmicMuonProducer::~GlobalCosmicMuonProducer ( )

Definition at line 71 of file GlobalCosmicMuonProducer.cc.

References theService, and theTrackFinder.

{
  if (theService) delete theService;
  if (theTrackFinder) delete theTrackFinder;
}

Member Function Documentation

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::HandleBase::isValid(), LogTrace, metname, position, MuonTrackFinder::reconstruct(), theService, theTrackCollectionLabel, theTrackFinder, and MuonServiceProxy::update().

{
  const std::string metname = "Muon|RecoMuon|GlobalCosmicMuonProducer";  
  LogTrace(metname)<<"Global Cosmic Muon Reconstruction started";  
  
  edm::Handle<reco::TrackCollection> cosMuons;
  iEvent.getByLabel(theTrackCollectionLabel,cosMuons);
  if (!cosMuons.isValid()) {
    LogTrace(metname)<< "Muon Track collection is invalid!!!";
    return;
  }
  
  // Update the services
  theService->update(iSetup);
  
  // Reconstruct the tracks in the tracker+muon system
  LogTrace(metname)<<"Track Reconstruction";

  std::vector<MuonTrajectoryBuilder::TrackCand> cosTrackCands;
  for ( unsigned int position = 0; position != cosMuons->size(); ++position ) {
    reco::TrackRef cosTrackRef(cosMuons,position);
    MuonTrajectoryBuilder::TrackCand cosCand = MuonTrajectoryBuilder::TrackCand((Trajectory*)(0),cosTrackRef);
    cosTrackCands.push_back(cosCand); 
  }
  theTrackFinder->reconstruct(cosTrackCands,iEvent);
  LogTrace(metname)<<"Event loaded";

}

Member Data Documentation

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().