CMS 3D CMS Logo

Public Member Functions | Private Attributes

L3MuonProducer Class Reference

#include <L3MuonProducer.h>

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

List of all members.

Public Member Functions

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

Private Attributes

edm::InputTag theL2CollectionLabel
 Seed STA Label.
std::string theL2SeededTkLabel
 Label for L2SeededTracks.
MuonServiceProxytheService
 the event setup proxy, it takes care the services update
MuonTrackFindertheTrackFinder

Detailed Description

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

Date:
2009/07/29 12:26:48
Revision:
1.15
Author:
A. Everett - Purdue University

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

Date:
2008/02/14 16:26:32
Revision:
1.4
Author:
A. Everett - Purdue University

Definition at line 23 of file L3MuonProducer.h.


Constructor & Destructor Documentation

L3MuonProducer::L3MuonProducer ( const edm::ParameterSet parameterSet)

constructor with config

Definition at line 44 of file L3MuonProducer.cc.

References edm::ParameterSet::getParameter(), LogTrace, and MuonServiceProxy_cff::MuonServiceProxy.

                                                               {

  LogTrace("L3MuonProducer") << "constructor called" << endl;

  // Parameter set for the Builder
  ParameterSet trajectoryBuilderParameters = parameterSet.getParameter<ParameterSet>("L3TrajBuilderParameters");

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

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

  // TrackLoader parameters
  ParameterSet trackLoaderParameters = parameterSet.getParameter<ParameterSet>("TrackLoaderParameters");
  
  // the services
  theService = new MuonServiceProxy(serviceParameters);
  
  // instantiate the concrete trajectory builder in the Track Finder
  MuonTrackLoader* mtl = new MuonTrackLoader(trackLoaderParameters,theService);
  L3MuonTrajectoryBuilder* l3mtb = new L3MuonTrajectoryBuilder(trajectoryBuilderParameters, theService);
  theTrackFinder = new MuonTrackFinder(l3mtb, mtl);

  theL2SeededTkLabel = trackLoaderParameters.getUntrackedParameter<std::string>("MuonSeededTracksInstance",std::string());
  
  produces<reco::TrackCollection>(theL2SeededTkLabel);
  produces<TrackingRecHitCollection>(theL2SeededTkLabel);
  produces<reco::TrackExtraCollection>(theL2SeededTkLabel);
  produces<vector<Trajectory> >(theL2SeededTkLabel) ;
  produces<TrajTrackAssociationCollection>(theL2SeededTkLabel);

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

  produces<reco::MuonTrackLinksCollection>();

}
L3MuonProducer::~L3MuonProducer ( ) [virtual]

destructor

Definition at line 90 of file L3MuonProducer.cc.

References LogTrace.

                                {

  LogTrace("L3MuonProducer") << "destructor called" << endl;
  if (theService) delete theService;
  if (theTrackFinder) delete theTrackFinder;

}

Member Function Documentation

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

reconstruct muons

Implements edm::EDProducer.

Definition at line 102 of file L3MuonProducer.cc.

References edm::Ref< C, T, F >::isNonnull(), edm::Ref< C, T, F >::key(), L2Muons_cfi::L2Muons, LogTrace, and metname.

                                                                       {
  const string metname = "Muon|RecoMuon|L3MuonProducer";  
  LogTrace(metname)<<endl<<endl<<endl;
  LogTrace(metname)<<"L3 Muon Reconstruction started"<<endl;  

  typedef vector<Trajectory> TrajColl;

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

  // Take the L2 muon container(s)
  LogTrace(metname)<<"Taking the L2 Muons "<<theL2CollectionLabel<<endl;

  Handle<reco::TrackCollection> L2Muons;
  event.getByLabel(theL2CollectionLabel,L2Muons);

  Handle<vector<Trajectory> > L2MuonsTraj;
  vector<MuonTrajectoryBuilder::TrackCand> L2TrackCands;


  event.getByLabel(theL2CollectionLabel.label(), L2MuonsTraj);      
  
  edm::Handle<TrajTrackAssociationCollection> L2AssoMap;
  event.getByLabel(theL2CollectionLabel.label(),L2AssoMap);
  
  edm::Handle<reco::TrackToTrackMap> updatedL2AssoMap;
  event.getByLabel(theL2CollectionLabel.label(),updatedL2AssoMap);
      
  for(TrajTrackAssociationCollection::const_iterator it = L2AssoMap->begin(); it != L2AssoMap->end(); ++it){    
    const Ref<vector<Trajectory> > traj = it->key;
    const reco::TrackRef tkRegular  = it->val;
    reco::TrackRef tkUpdated;
    reco::TrackToTrackMap::const_iterator iEnd;
    reco::TrackToTrackMap::const_iterator iii;
    if ( theL2CollectionLabel.instance() == "UpdatedAtVtx") {
      iEnd = updatedL2AssoMap->end();
      iii = updatedL2AssoMap->find(it->val);
      if (iii != iEnd ) tkUpdated = (*updatedL2AssoMap)[it->val] ;
    }
    
    const reco::TrackRef tk = ( tkUpdated.isNonnull() ) ? tkUpdated : tkRegular ;      
    
    MuonTrajectoryBuilder::TrackCand L2Cand = MuonTrajectoryBuilder::TrackCand((Trajectory*)(0),tk);
    if( traj->isValid() ) L2Cand.first = &*traj ;
    L2TrackCands.push_back(L2Cand);
  }
  
  theTrackFinder->reconstruct(L2TrackCands, event);      
  
  LogTrace(metname)<<"Event loaded"
                   <<"================================"
                   <<endl<<endl;
    
}

Member Data Documentation

Seed STA Label.

Definition at line 40 of file L3MuonProducer.h.

std::string L3MuonProducer::theL2SeededTkLabel [private]

Label for L2SeededTracks.

Definition at line 43 of file L3MuonProducer.h.

the event setup proxy, it takes care the services update

Definition at line 48 of file L3MuonProducer.h.

Definition at line 45 of file L3MuonProducer.h.