CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/RecoTracker/CkfPattern/plugins/GroupedCkfTrajectoryBuilderESProducer.cc

Go to the documentation of this file.
00001 #include "RecoTracker/CkfPattern/plugins/GroupedCkfTrajectoryBuilderESProducer.h"
00002 #include "RecoTracker/CkfPattern/interface/GroupedCkfTrajectoryBuilder.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 
00022 #include <string>
00023 #include <memory>
00024 
00025 using namespace edm;
00026 
00027 GroupedCkfTrajectoryBuilderESProducer::GroupedCkfTrajectoryBuilderESProducer(const edm::ParameterSet & p) 
00028 { 
00029   std::string myName = p.getParameter<std::string>("ComponentName");
00030   pset_ = p;
00031   setWhatProduced(this,myName);
00032 }
00033 
00034 GroupedCkfTrajectoryBuilderESProducer::~GroupedCkfTrajectoryBuilderESProducer() {}
00035 
00036 boost::shared_ptr<TrajectoryBuilder> 
00037 GroupedCkfTrajectoryBuilderESProducer::produce(const CkfComponentsRecord& iRecord)
00038 { 
00039   std::string updatorName            = pset_.getParameter<std::string>("updator");   
00040   std::string propagatorAlongName    = pset_.getParameter<std::string>("propagatorAlong");
00041   std::string propagatorOppositeName = pset_.getParameter<std::string>("propagatorOpposite");   
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   std::string inOutFilterName = pset_.getParameter<std::string>("inOutTrajectoryFilterName");
00047   bool useSameTrajFilter = pset_.getParameter<bool>("useSameTrajFilter");
00048 
00049   edm::ESHandle<TrajectoryStateUpdator> updatorHandle;
00050   edm::ESHandle<Propagator>             propagatorAlongHandle;
00051   edm::ESHandle<Propagator>             propagatorOppositeHandle;
00052   edm::ESHandle<Chi2MeasurementEstimatorBase> estimatorHandle;
00053   edm::ESHandle<TransientTrackingRecHitBuilder> recHitBuilderHandle;
00054   edm::ESHandle<MeasurementTracker>             measurementTrackerHandle;
00055   edm::ESHandle<TrajectoryFilter> filterHandle;
00056   edm::ESHandle<TrajectoryFilter> inOutFilterHandle;
00057 
00058   iRecord.getRecord<TrackingComponentsRecord>().get(updatorName,updatorHandle);
00059   iRecord.getRecord<TrackingComponentsRecord>().get(propagatorAlongName,propagatorAlongHandle);
00060   iRecord.getRecord<TrackingComponentsRecord>().get(propagatorOppositeName,propagatorOppositeHandle);
00061   iRecord.getRecord<TrackingComponentsRecord>().get(estimatorName,estimatorHandle);  
00062   iRecord.getRecord<TransientRecHitRecord>().get(recHitBuilderName,recHitBuilderHandle);  
00063   iRecord.get(measurementTrackerName, measurementTrackerHandle);  
00064   iRecord.get(filterName, filterHandle);
00065   if (useSameTrajFilter) {
00066     inOutFilterHandle = filterHandle;
00067   } else {
00068     iRecord.get(inOutFilterName, inOutFilterHandle);
00069   }
00070 
00071   _trajectoryBuilder  = 
00072     boost::shared_ptr<TrajectoryBuilder>(new GroupedCkfTrajectoryBuilder(pset_,
00073                                                                          updatorHandle.product(),
00074                                                                          propagatorAlongHandle.product(),
00075                                                                          propagatorOppositeHandle.product(),
00076                                                                          estimatorHandle.product(),
00077                                                                          recHitBuilderHandle.product(),
00078                                                                          measurementTrackerHandle.product(),
00079                                                                          filterHandle.product(),
00080                                                                          inOutFilterHandle.product()) );  
00081   return _trajectoryBuilder;
00082 }
00083 
00084