CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/RecoMuon/L3TrackFinder/plugins/MuonCkfTrajectoryBuilderESProducer.cc

Go to the documentation of this file.
00001 #include "RecoMuon/L3TrackFinder/interface/MuonCkfTrajectoryBuilderESProducer.h"
00002 #include "RecoMuon/L3TrackFinder/interface/MuonCkfTrajectoryBuilder.h"
00003 
00004 #include "FWCore/Framework/interface/EventSetup.h"
00005 #include "FWCore/Framework/interface/ESHandle.h"
00006 //#include "FWCore/Framework/interface/ModuleFactory.h"
00007 #include "FWCore/Framework/interface/ESProducer.h"
00008 
00009 #include "TrackingTools/KalmanUpdators/interface/KFUpdator.h"
00010 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
00011 #include "TrackingTools/PatternTools/interface/TrajectoryStateUpdator.h"
00012 #include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimatorBase.h"
00013 //#include "TrackingTools/PatternTools/interface/MeasurementEstimator.h"
00014 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h"
00015 #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h"
00016 #include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilter.h"
00017 
00018 #include "TrackingTools/Records/interface/TrackingComponentsRecord.h"
00019 #include "TrackingTools/Records/interface/TransientRecHitRecord.h"
00020 
00021 #include <string>
00022 #include <memory>
00023 
00024 using namespace edm;
00025 
00026 MuonCkfTrajectoryBuilderESProducer::MuonCkfTrajectoryBuilderESProducer(const edm::ParameterSet & p) 
00027 { 
00028   std::string myName = p.getParameter<std::string>("ComponentName");
00029   pset_ = p;
00030   setWhatProduced(this,myName);
00031 }
00032 
00033 MuonCkfTrajectoryBuilderESProducer::~MuonCkfTrajectoryBuilderESProducer() {}
00034 
00035 boost::shared_ptr<TrajectoryBuilder> 
00036 MuonCkfTrajectoryBuilderESProducer::produce(const CkfComponentsRecord& iRecord)
00037 { 
00038   std::string updatorName            = pset_.getParameter<std::string>("updator");   
00039   std::string propagatorAlongName    = pset_.getParameter<std::string>("propagatorAlong");
00040   std::string propagatorOppositeName = pset_.getParameter<std::string>("propagatorOpposite");   
00041   std::string propagatorProximityName = pset_.getParameter<std::string>("propagatorProximity");   
00042   std::string estimatorName          = pset_.getParameter<std::string>("estimator"); 
00043   std::string recHitBuilderName      = pset_.getParameter<std::string>("TTRHBuilder");     
00044   std::string measurementTrackerName = pset_.getParameter<std::string>("MeasurementTrackerName");
00045   std::string filterName             = pset_.getParameter<std::string>("trajectoryFilterName");
00046 
00047   edm::ESHandle<TrajectoryStateUpdator> updatorHandle;
00048   edm::ESHandle<Propagator>             propagatorAlongHandle;
00049   edm::ESHandle<Propagator>             propagatorOppositeHandle;
00050   edm::ESHandle<Propagator>             propagatorProximityHandle;
00051   edm::ESHandle<Chi2MeasurementEstimatorBase>   estimatorHandle;
00052   edm::ESHandle<TransientTrackingRecHitBuilder> recHitBuilderHandle;
00053   edm::ESHandle<MeasurementTracker>             measurementTrackerHandle;
00054   edm::ESHandle<TrajectoryFilter>               trajectoryFilterHandle;
00055 
00056   iRecord.getRecord<TrackingComponentsRecord>().get(updatorName,updatorHandle);
00057   iRecord.getRecord<TrackingComponentsRecord>().get(propagatorAlongName,propagatorAlongHandle);
00058   iRecord.getRecord<TrackingComponentsRecord>().get(propagatorOppositeName,propagatorOppositeHandle);
00059   iRecord.getRecord<TrackingComponentsRecord>().get(propagatorProximityName,propagatorProximityHandle);
00060   iRecord.getRecord<TrackingComponentsRecord>().get(estimatorName,estimatorHandle);  
00061   iRecord.getRecord<TransientRecHitRecord>().get(recHitBuilderName,recHitBuilderHandle);  
00062   iRecord.get(measurementTrackerName, measurementTrackerHandle);  
00063   iRecord.get(filterName,trajectoryFilterHandle);
00064     
00065   _trajectoryBuilder  = 
00066     boost::shared_ptr<TrajectoryBuilder>(new MuonCkfTrajectoryBuilder(pset_,
00067                                                                       updatorHandle.product(),
00068                                                                       propagatorAlongHandle.product(),
00069                                                                       propagatorOppositeHandle.product(),
00070                                                                       propagatorProximityHandle.product(),
00071                                                                       estimatorHandle.product(),
00072                                                                       recHitBuilderHandle.product(),
00073                                                                       measurementTrackerHandle.product(),
00074                                                                       trajectoryFilterHandle.product()) );  
00075   return _trajectoryBuilder;
00076 }
00077 
00078