CMS 3D CMS Logo

KFTrajectoryFitterESProducer.cc

Go to the documentation of this file.
00001 #include "TrackingTools/TrackFitters/plugins/KFTrajectoryFitterESProducer.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 KFTrajectoryFitterESProducer::KFTrajectoryFitterESProducer(const edm::ParameterSet & p) 
00021 {
00022   std::string myname = p.getParameter<std::string>("ComponentName");
00023   pset_ = p;
00024   setWhatProduced(this,myname);
00025 }
00026 
00027 KFTrajectoryFitterESProducer::~KFTrajectoryFitterESProducer() {}
00028 
00029 boost::shared_ptr<TrajectoryFitter> 
00030 KFTrajectoryFitterESProducer::produce(const TrackingComponentsRecord & 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   int minHits = pset_.getParameter<int>("minHits");
00036 
00037   edm::ESHandle<Propagator> prop;
00038   edm::ESHandle<TrajectoryStateUpdator> upd;
00039   edm::ESHandle<Chi2MeasurementEstimatorBase> est;
00040 
00041   iRecord.get(pname, prop);
00042   iRecord.get(uname, upd);
00043   iRecord.get(ename, est);
00044 
00045   _fitter  = boost::shared_ptr<TrajectoryFitter>(new KFTrajectoryFitter(prop.product(),
00046                                                                         upd.product(),
00047                                                                         est.product(),
00048                                                                         minHits));
00049   return _fitter;
00050 }
00051 
00052 

Generated on Tue Jun 9 17:48:31 2009 for CMSSW by  doxygen 1.5.4