CMS 3D CMS Logo

TevMuonProducer Class Reference

TeV muon reconstructor:. More...

#include <RecoMuon/GlobalMuonProducer/src/TevMuonProducer.h>

Inheritance diagram for TevMuonProducer:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

virtual void produce (edm::Event &, const edm::EventSetup &)
 reconstruct muons
 TevMuonProducer (const edm::ParameterSet &)
 constructor with config
virtual ~TevMuonProducer ()
 destructor

Private Member Functions

void setAlias (std::string alias)

Private Attributes

std::string theAlias
edm::InputTag theGLBCollectionLabel
 STA Label.
std::vector< inttheRefitIndex
std::vector< std::string > theRefits
GlobalMuonRefittertheRefitter
MuonServiceProxy * theService
 the event setup proxy, it takes care the services update
MuonTrackLoadertheTrackLoader


Detailed Description

TeV muon reconstructor:.

Global muon reconstructor: reconstructs muons using DT, CSC, RPC and tracker information,
starting from a standalone reonstructed muon.

Date
2008/05/13 02:25:45
Revision
1.3

Author:
Piotr Traczyk (SINS Warsaw)
Date
2008/05/13 03:31:44
Revision
1.2

Author:
R.Bellan - INFN TO

Definition at line 27 of file TevMuonProducer.h.


Constructor & Destructor Documentation

TevMuonProducer::TevMuonProducer ( const edm::ParameterSet parameterSet  ) 

constructor with config

Definition at line 44 of file TevMuonProducer.cc.

References lat::endl(), edm::ParameterSet::getParameter(), GlobalMuonRefitter_cff::GlobalMuonRefitter, LogDebug, MuonServiceProxy_cff::MuonServiceProxy, theGLBCollectionLabel, theRefitIndex, theRefits, theRefitter, theService, theTrackLoader, and ww.

00044                                                                  {
00045 
00046   LogDebug("Muon|RecoMuon|TevMuonProducer") << "constructor called" << endl;
00047 
00048   // GLB Muon Collection Label
00049   theGLBCollectionLabel = parameterSet.getParameter<InputTag>("MuonCollectionLabel");
00050 
00051   // service parameters
00052   ParameterSet serviceParameters = parameterSet.getParameter<ParameterSet>("ServiceParameters");
00053 
00054   // the services
00055   theService = new MuonServiceProxy(serviceParameters);
00056   
00057   // TrackRefitter parameters
00058   ParameterSet refitterParameters = parameterSet.getParameter<ParameterSet>("RefitterParameters");
00059   theRefitter = new GlobalMuonRefitter(refitterParameters, theService);
00060 
00061   // TrackLoader parameters
00062   ParameterSet trackLoaderParameters = parameterSet.getParameter<ParameterSet>("TrackLoaderParameters");
00063   theTrackLoader = new MuonTrackLoader(trackLoaderParameters,theService);
00064 
00065   theRefits = parameterSet.getParameter< std::vector<std::string> >("Refits");
00066   theRefitIndex = parameterSet.getParameter< std::vector<int> >("RefitIndex");
00067 
00068   for(unsigned int ww=0;ww<theRefits.size();ww++){
00069     LogDebug("Muon|RecoMuon|TevMuonProducer") << "Refit " << theRefits[ww];
00070     produces<reco::TrackCollection>(theRefits[ww]);
00071     produces<TrackingRecHitCollection>(theRefits[ww]);
00072     produces<reco::TrackExtraCollection>(theRefits[ww]);
00073     produces<vector<Trajectory> >(theRefits[ww]) ;
00074     produces<TrajTrackAssociationCollection>(theRefits[ww]);
00075     produces<reco::TrackToTrackMap>(theRefits[ww]);
00076   }
00077 }

TevMuonProducer::~TevMuonProducer (  )  [virtual]

destructor

Definition at line 83 of file TevMuonProducer.cc.

References lat::endl(), LogTrace, theRefitter, and theService.

00083                                   {
00084 
00085   LogTrace("Muon|RecoMuon|TevMuonProducer") << "destructor called" << endl;
00086   if (theService) delete theService;
00087   if (theRefitter) delete theRefitter;
00088 
00089 }


Member Function Documentation

void TevMuonProducer::produce ( edm::Event event,
const edm::EventSetup eventSetup 
) [virtual]

reconstruct muons

Implements edm::EDProducer.

Definition at line 95 of file TevMuonProducer.cc.

References lat::endl(), edm::InputTag::label(), MuonTrackLoader::loadTracks(), LogDebug, LogTrace, edm::Handle< T >::product(), GlobalMuonRefitter::refit(), GlobalMuonRefitter::setEvent(), TrackTransformer::setServices(), theGLBCollectionLabel, theRefitIndex, theRefits, theRefitter, theService, theTrackLoader, track, and ww.

00095                                                                         {
00096 
00097   const string metname = "Muon|RecoMuon|TevMuonProducer";  
00098   LogTrace(metname)<<endl<<endl<<endl;
00099   LogTrace(metname)<<"TeV Muon Reconstruction started"<<endl;  
00100 
00101   // Update the services
00102   theService->update(eventSetup);
00103 
00104   theRefitter->setEvent(event);
00105 
00106   theRefitter->setServices(theService->eventSetup());
00107 
00108   // Take the GLB muon container(s)
00109   Handle<reco::TrackCollection> glbMuons;
00110   event.getByLabel(theGLBCollectionLabel,glbMuons);
00111 
00112   Handle<vector<Trajectory> > glbMuonsTraj;
00113 
00114   LogTrace(metname)<< "Taking " << glbMuons->size() << " Global Muons "<<theGLBCollectionLabel<<endl;
00115 
00116   vector<MuonTrajectoryBuilder::TrackCand> glbTrackCands;
00117 
00118   event.getByLabel(theGLBCollectionLabel.label(), glbMuonsTraj);
00119     
00120   const reco::TrackCollection *glbTracks = glbMuons.product();
00121   
00122   for(unsigned int ww=0;ww<theRefits.size();ww++) {
00123     LogDebug(metname)<<"TeVRefit for Refit: " <<theRefitIndex[ww];
00124     std::vector<std::pair<Trajectory*,reco::TrackRef> > miniMap;
00125     vector<Trajectory*> trajectories;
00126     reco::TrackRef::key_type trackIndex = 0;
00127     for (reco::TrackCollection::const_iterator track = glbTracks->begin(); track!=glbTracks->end(); track++ , ++trackIndex) {
00128       reco::TrackRef glbRef(glbMuons,trackIndex);
00129       
00130       // FIXME temporary protection very energetic tracks crash the refitter...
00131       if (track->pt()>10000.) continue;
00132       
00133       vector<Trajectory> refitted=theRefitter->refit(*track,theRefitIndex[ww]);
00134 
00135       if (refitted.size()>0) {
00136         Trajectory *refit = new Trajectory(refitted.front());
00137         LogDebug(metname)<<"TeVTrackLoader for Refit: " <<theRefits[ww];
00138         trajectories.push_back(refit);
00139         std::pair<Trajectory*,reco::TrackRef> thisPair(refit,glbRef);
00140         miniMap.push_back(thisPair);
00141       }
00142     }
00143     theTrackLoader->loadTracks(trajectories,event,miniMap,theRefits[ww]);
00144   }
00145     
00146   LogTrace(metname) << "Done." << endl;    
00147 
00148 }

void TevMuonProducer::setAlias ( std::string  alias  )  [inline, private]

Definition at line 56 of file TevMuonProducer.h.

References theAlias.

00056                                   {
00057     alias.erase( alias.size() - 1, alias.size() );
00058     theAlias=alias;
00059   }


Member Data Documentation

std::string TevMuonProducer::theAlias [private]

Definition at line 52 of file TevMuonProducer.h.

Referenced by setAlias().

edm::InputTag TevMuonProducer::theGLBCollectionLabel [private]

STA Label.

Definition at line 43 of file TevMuonProducer.h.

Referenced by produce(), and TevMuonProducer().

std::vector<int> TevMuonProducer::theRefitIndex [private]

Definition at line 54 of file TevMuonProducer.h.

Referenced by produce(), and TevMuonProducer().

std::vector<std::string> TevMuonProducer::theRefits [private]

Definition at line 53 of file TevMuonProducer.h.

Referenced by produce(), and TevMuonProducer().

GlobalMuonRefitter* TevMuonProducer::theRefitter [private]

Definition at line 48 of file TevMuonProducer.h.

Referenced by produce(), TevMuonProducer(), and ~TevMuonProducer().

MuonServiceProxy* TevMuonProducer::theService [private]

the event setup proxy, it takes care the services update

Definition at line 46 of file TevMuonProducer.h.

Referenced by produce(), TevMuonProducer(), and ~TevMuonProducer().

MuonTrackLoader* TevMuonProducer::theTrackLoader [private]

Definition at line 50 of file TevMuonProducer.h.

Referenced by produce(), and TevMuonProducer().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:33:22 2009 for CMSSW by  doxygen 1.5.4