CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

TevMuonProducer Class Reference

#include <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< int > theRefitIndex
std::vector< std::string > theRefits
GlobalMuonRefittertheRefitter
MuonServiceProxytheService
 the event setup proxy, it takes care the services update
MuonTrackLoadertheTrackLoader

Detailed Description

TeV muon reconstructor:

Date:
2009/10/20 04:32:09
Revision:
1.5
Author:
Piotr Traczyk (SINS Warsaw)

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

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 edm::ParameterSet::getParameter(), GlobalMuonRefitter_cff::GlobalMuonRefitter, LogDebug, and MuonServiceProxy_cff::MuonServiceProxy.

                                                                 {

  LogDebug("Muon|RecoMuon|TevMuonProducer") << "constructor called" << endl;

  // GLB Muon Collection Label
  theGLBCollectionLabel = parameterSet.getParameter<InputTag>("MuonCollectionLabel");

  // service parameters
  ParameterSet serviceParameters = parameterSet.getParameter<ParameterSet>("ServiceParameters");

  // the services
  theService = new MuonServiceProxy(serviceParameters);
  
  // TrackRefitter parameters
  ParameterSet refitterParameters = parameterSet.getParameter<ParameterSet>("RefitterParameters");
  theRefitter = new GlobalMuonRefitter(refitterParameters, theService);

  // TrackLoader parameters
  ParameterSet trackLoaderParameters = parameterSet.getParameter<ParameterSet>("TrackLoaderParameters");
  theTrackLoader = new MuonTrackLoader(trackLoaderParameters,theService);

  theRefits = parameterSet.getParameter< std::vector<std::string> >("Refits");
  theRefitIndex = parameterSet.getParameter< std::vector<int> >("RefitIndex");

  for(unsigned int ww=0;ww<theRefits.size();ww++){
    LogDebug("Muon|RecoMuon|TevMuonProducer") << "Refit " << theRefits[ww];
    produces<reco::TrackCollection>(theRefits[ww]);
    produces<TrackingRecHitCollection>(theRefits[ww]);
    produces<reco::TrackExtraCollection>(theRefits[ww]);
    produces<vector<Trajectory> >(theRefits[ww]) ;
    produces<TrajTrackAssociationCollection>(theRefits[ww]);
    produces<reco::TrackToTrackMap>(theRefits[ww]);
  }
}
TevMuonProducer::~TevMuonProducer ( ) [virtual]

destructor

Definition at line 83 of file TevMuonProducer.cc.

References LogTrace.

                                  {

  LogTrace("Muon|RecoMuon|TevMuonProducer") << "destructor called" << endl;
  if (theService) delete theService;
  if (theRefitter) delete theRefitter;
  if (theTrackLoader) delete theTrackLoader;
}

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 LogDebug, LogTrace, metname, and edm::Handle< T >::product().

                                                                        {

  const string metname = "Muon|RecoMuon|TevMuonProducer";  
  LogTrace(metname)<< endl << endl;
  LogTrace(metname)<< "TeV Muon Reconstruction started" << endl;  

  // Update the services
  theService->update(eventSetup);

  theRefitter->setEvent(event);

  theRefitter->setServices(theService->eventSetup());

  // Take the GLB muon container(s)
  Handle<reco::TrackCollection> glbMuons;
  event.getByLabel(theGLBCollectionLabel,glbMuons);

  Handle<vector<Trajectory> > glbMuonsTraj;

  LogTrace(metname)<< "Taking " << glbMuons->size() << " Global Muons "<<theGLBCollectionLabel<<endl;

  vector<MuonTrajectoryBuilder::TrackCand> glbTrackCands;

  event.getByLabel(theGLBCollectionLabel.label(), glbMuonsTraj);
    
  const reco::TrackCollection *glbTracks = glbMuons.product();
  
  for(unsigned int ww=0;ww<theRefits.size();ww++) {
    LogDebug(metname)<<"TeVRefit for Refit: " <<theRefitIndex[ww];
    std::vector<std::pair<Trajectory*,reco::TrackRef> > miniMap;
    vector<Trajectory*> trajectories;
    reco::TrackRef::key_type trackIndex = 0;
    for (reco::TrackCollection::const_iterator track = glbTracks->begin(); track!=glbTracks->end(); track++ , ++trackIndex) {
      reco::TrackRef glbRef(glbMuons,trackIndex);
      
      vector<Trajectory> refitted=theRefitter->refit(*track,theRefitIndex[ww]);

      if (refitted.size()>0) {
        Trajectory *refit = new Trajectory(refitted.front());
        LogDebug(metname)<<"TeVTrackLoader for Refit: " <<theRefits[ww];
        trajectories.push_back(refit);
        std::pair<Trajectory*,reco::TrackRef> thisPair(refit,glbRef);
        miniMap.push_back(thisPair);
      }
    }
    theTrackLoader->loadTracks(trajectories,event,miniMap,theRefits[ww]);
  }
    
  LogTrace(metname) << "Done." << endl;    

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

Definition at line 56 of file TevMuonProducer.h.

References theAlias.

                                  {
    alias.erase( alias.size() - 1, alias.size() );
    theAlias=alias;
  }

Member Data Documentation

std::string TevMuonProducer::theAlias [private]

Definition at line 52 of file TevMuonProducer.h.

Referenced by setAlias().

STA Label.

Definition at line 43 of file TevMuonProducer.h.

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

Definition at line 54 of file TevMuonProducer.h.

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

Definition at line 53 of file TevMuonProducer.h.

Definition at line 48 of file TevMuonProducer.h.

the event setup proxy, it takes care the services update

Definition at line 46 of file TevMuonProducer.h.

Definition at line 50 of file TevMuonProducer.h.