CMS 3D CMS Logo

Public Member Functions | Private Attributes

FastL3MuonProducer Class Reference

#include <FastL3MuonProducer.h>

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

List of all members.

Public Member Functions

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

Private Attributes

L3MuonTrajectoryBuilderl3mtb
edm::InputTag theL2CollectionLabel
 Seed STA (input)
std::string theL2SeededTkLabel
 Label for L2SeededTracks (output)
bool theL2TrajectoryFlag
MuonServiceProxytheService
 the event setup proxy, it takes care the services update
edm::InputTag theTrackerTrackCollectionLabel
 Tracker tracks (input)
MuonTrackFindertheTrackFinder
bool updatedAtVtx

Detailed Description

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

Date:
2010/07/20 02:58:31
Revision:
1.6
Author:
Patrick Janot - CERN

Fast L3 muon reconstructor: reconstructs muons using DT, CSC, RPC and tracker information,
starting from a L2 reonstructed muon and from pixel seeded tracks (by default - the latter is configuratble)

Date:
2010/07/19 19:54:14
Revision:
1.4
Author:
P. Janot - CERN

Definition at line 27 of file FastL3MuonProducer.h.


Constructor & Destructor Documentation

FastL3MuonProducer::FastL3MuonProducer ( const edm::ParameterSet parameterSet)

constructor with config

Definition at line 33 of file FastL3MuonProducer.cc.

References edm::ParameterSet::getParameter(), l3mtb, LogTrace, MuonServiceProxy_cff::MuonServiceProxy, theL2CollectionLabel, theL2SeededTkLabel, theService, theTrackFinder, and updatedAtVtx.

                                                                          {

  LogTrace("FastL3MuonProducer") << "constructor called" << std::endl;

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

  // L2 Muon Collection Label
  theL2CollectionLabel = 
    parameterSet.getParameter<edm::InputTag>("MuonCollectionLabel");
  updatedAtVtx = (theL2CollectionLabel.instance() == "UpdatedAtVtx");

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

  // TrackLoader parameters
  edm::ParameterSet trackLoaderParameters = 
    parameterSet.getParameter<edm::ParameterSet>("TrackLoaderParameters");
  
  // the services
  theService = new MuonServiceProxy(serviceParameters);
  
  // instantiate the concrete trajectory builder in the Track Finder
  MuonTrackLoader* mtl = new MuonTrackLoader(trackLoaderParameters,theService);
//  l3mtb = new FastL3MuonTrajectoryBuilder(trajectoryBuilderParameters, theService);
  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<std::vector<Trajectory> >(theL2SeededTkLabel) ;
  produces<TrajTrackAssociationCollection>(theL2SeededTkLabel);

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

  produces<reco::MuonTrackLinksCollection>();

}
FastL3MuonProducer::~FastL3MuonProducer ( ) [virtual]

destructor

Definition at line 86 of file FastL3MuonProducer.cc.

References LogTrace, theService, and theTrackFinder.

                                        {

  LogTrace("FastL3MuonProducer") << "destructor called" << std::endl;
  if (theService) delete theService;
  if (theTrackFinder) delete theTrackFinder;

}

Member Function Documentation

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

reconstruct muons

Implements edm::EDProducer.

Definition at line 98 of file FastL3MuonProducer.cc.

References L2Muons_cfi::L2Muons, edm::InputTag::label(), lt, MuonTrackFinder::reconstruct(), theL2CollectionLabel, theService, theTrackFinder, MuonServiceProxy::update(), and updatedAtVtx.

                                                                                 {
  // const std::string metname = "Muon|RecoMuon|FastL3MuonProducer";  
  // LogTrace(metname)<<endl<<endl<<endl;
  // LogTrace(metname)<<"Fast L3 Muon Reconstruction started"<<endl;  

  typedef std::vector<Trajectory> TrajColl;

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

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

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

  edm::Handle<std::vector<Trajectory> > L2MuonsTraj;
  std::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);
  
  TrajTrackAssociationCollection::const_iterator it = L2AssoMap->begin();
  TrajTrackAssociationCollection::const_iterator lt = L2AssoMap->end();

  for( ; it!=lt; ++it){ 
    
    const edm::Ref<std::vector<Trajectory> > traj = it->key;
    const reco::TrackRef tk 
      = updatedAtVtx && updatedL2AssoMap->find(it->val) != updatedL2AssoMap->end() ? 
      (*updatedL2AssoMap)[it->val] : it->val;
    MuonTrajectoryBuilder::TrackCand L2Cand = MuonTrajectoryBuilder::TrackCand(0,tk);
    if( traj->isValid() ) L2Cand.first = &*traj ;
    L2TrackCands.push_back(L2Cand);
    
  }

  theTrackFinder->reconstruct(L2TrackCands, event);      
  // l3mtb->clear();
  
  /*
  LogTrace(metname)<<"Event loaded"
                   <<"================================"
                   <<endl<<endl;
  */
}

Member Data Documentation

Definition at line 55 of file FastL3MuonProducer.h.

Referenced by FastL3MuonProducer().

Seed STA (input)

Definition at line 44 of file FastL3MuonProducer.h.

Referenced by FastL3MuonProducer(), and produce().

Label for L2SeededTracks (output)

Definition at line 50 of file FastL3MuonProducer.h.

Referenced by FastL3MuonProducer().

Definition at line 57 of file FastL3MuonProducer.h.

the event setup proxy, it takes care the services update

Definition at line 61 of file FastL3MuonProducer.h.

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

Tracker tracks (input)

Definition at line 47 of file FastL3MuonProducer.h.

Definition at line 53 of file FastL3MuonProducer.h.

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

Definition at line 58 of file FastL3MuonProducer.h.

Referenced by FastL3MuonProducer(), and produce().