CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/TrackingTools/TrackFitters/plugins/KFTrajectorySmootherESProducer.cc

Go to the documentation of this file.
00001 #include "TrackingTools/TrackFitters/plugins/KFTrajectorySmootherESProducer.h"
00002 #include "MagneticField/Engine/interface/MagneticField.h"
00003 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
00004 
00005 #include "FWCore/Framework/interface/EventSetup.h"
00006 #include "FWCore/Framework/interface/ESHandle.h"
00007 #include "FWCore/Framework/interface/ModuleFactory.h"
00008 #include "FWCore/Framework/interface/ESProducer.h"
00009 
00010 #include "TrackingTools/PatternTools/interface/TrajectoryStateUpdator.h"
00011 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
00012 #include "TrackingTools/PatternTools/interface/TrajectoryStateUpdator.h"
00013 #include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimatorBase.h"
00014 
00015 #include <string>
00016 #include <memory>
00017 
00018 using namespace edm;
00019 
00020 KFTrajectorySmootherESProducer::KFTrajectorySmootherESProducer(const edm::ParameterSet & p) 
00021 {
00022   std::string myname = p.getParameter<std::string>("ComponentName");
00023   pset_ = p;
00024   setWhatProduced(this,myname);
00025 }
00026 
00027 KFTrajectorySmootherESProducer::~KFTrajectorySmootherESProducer() {}
00028 
00029 boost::shared_ptr<TrajectorySmoother> 
00030 KFTrajectorySmootherESProducer::produce(const TrajectoryFitterRecord & iRecord){ 
00031 
00032   std::string pname = pset_.getParameter<std::string>("Propagator");
00033   std::string uname = pset_.getParameter<std::string>("Updator");
00034   std::string ename = pset_.getParameter<std::string>("Estimator");
00035   std::string gname = pset_.getParameter<std::string>("RecoGeometry");
00036   double rescaleFactor =  pset_.getParameter<double>("errorRescaling");
00037   int minHits = pset_.getParameter<int>("minHits");
00038 
00039   edm::ESHandle<Propagator> prop;
00040   edm::ESHandle<TrajectoryStateUpdator> upd;
00041   edm::ESHandle<Chi2MeasurementEstimatorBase> est;
00042   edm::ESHandle<DetLayerGeometry> geo;
00043 
00044 
00045   iRecord.getRecord<TrackingComponentsRecord>().get(pname, prop);
00046   iRecord.getRecord<TrackingComponentsRecord>().get(uname, upd);
00047   iRecord.getRecord<TrackingComponentsRecord>().get(ename, est);
00048   iRecord.getRecord<RecoGeometryRecord>().get(gname,geo);
00049 
00050   _smoother  = boost::shared_ptr<TrajectorySmoother>(new KFTrajectorySmoother(prop.product(),
00051                                                                               upd.product(),
00052                                                                               est.product(),
00053                                                                               rescaleFactor,
00054                                                                               minHits,
00055                                                                               geo.product() ));
00056   return _smoother;
00057 }
00058 
00059