CMS 3D CMS Logo

CkfTrajectoryBuilderESProducer.cc

Go to the documentation of this file.
00001 #include "RecoTracker/CkfPattern/plugins/CkfTrajectoryBuilderESProducer.h"
00002 #include "RecoTracker/CkfPattern/interface/CkfTrajectoryBuilder.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/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h"
00014 #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h"
00015 
00016 #include "TrackingTools/Records/interface/TrackingComponentsRecord.h"
00017 #include "TrackingTools/Records/interface/TransientRecHitRecord.h"
00018 #include "RecoTracker/Record/interface/CkfComponentsRecord.h"
00019 
00020 #include "TrackingTools/TrajectoryFiltering/interface/TrajectoryFilter.h"
00021 #include <string>
00022 #include <memory>
00023 
00024 using namespace edm;
00025 
00026 CkfTrajectoryBuilderESProducer::CkfTrajectoryBuilderESProducer(const edm::ParameterSet & p) 
00027 { 
00028   std::string myName = p.getParameter<std::string>("ComponentName");
00029   pset_ = p;
00030   setWhatProduced(this,myName);
00031 }
00032 
00033 CkfTrajectoryBuilderESProducer::~CkfTrajectoryBuilderESProducer() {}
00034 
00035 boost::shared_ptr<TrajectoryBuilder> 
00036 CkfTrajectoryBuilderESProducer::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 estimatorName          = pset_.getParameter<std::string>("estimator"); 
00042   std::string recHitBuilderName      = pset_.getParameter<std::string>("TTRHBuilder");     
00043   std::string measurementTrackerName = pset_.getParameter<std::string>("MeasurementTrackerName");     
00044   std::string filterName = pset_.getParameter<std::string>("trajectoryFilterName");
00045   
00046 
00047   edm::ESHandle<TrajectoryStateUpdator> updatorHandle;
00048   edm::ESHandle<Propagator>             propagatorAlongHandle;
00049   edm::ESHandle<Propagator>             propagatorOppositeHandle;
00050   edm::ESHandle<Chi2MeasurementEstimatorBase>   estimatorHandle;
00051   edm::ESHandle<TransientTrackingRecHitBuilder> recHitBuilderHandle;
00052   edm::ESHandle<MeasurementTracker>             measurementTrackerHandle;
00053   edm::ESHandle<TrajectoryFilter> filterHandle;
00054 
00055   iRecord.getRecord<TrackingComponentsRecord>().get(updatorName,updatorHandle);
00056   iRecord.getRecord<TrackingComponentsRecord>().get(propagatorAlongName,propagatorAlongHandle);
00057   iRecord.getRecord<TrackingComponentsRecord>().get(propagatorOppositeName,propagatorOppositeHandle);
00058   iRecord.getRecord<TrackingComponentsRecord>().get(estimatorName,estimatorHandle);  
00059   iRecord.getRecord<TransientRecHitRecord>().get(recHitBuilderName,recHitBuilderHandle);  
00060   iRecord.get(measurementTrackerName, measurementTrackerHandle);
00061   iRecord.getRecord<TrajectoryFilter::Record>().get(filterName, filterHandle);
00062 
00063   _trajectoryBuilder  = 
00064     boost::shared_ptr<TrajectoryBuilder>(new CkfTrajectoryBuilder(pset_,
00065                                                                   updatorHandle.product(),
00066                                                                   propagatorAlongHandle.product(),
00067                                                                   propagatorOppositeHandle.product(),
00068                                                                   estimatorHandle.product(),
00069                                                                   recHitBuilderHandle.product(),
00070                                                                   measurementTrackerHandle.product(),
00071                                                                   filterHandle.product()) );  
00072   return _trajectoryBuilder;
00073 }
00074 
00075 

Generated on Tue Jun 9 17:45:19 2009 for CMSSW by  doxygen 1.5.4