CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/TrackingTools/TrackFitters/plugins/KFFittingSmootherESProducer.cc

Go to the documentation of this file.
00001 #include "TrackingTools/TrackFitters/plugins/KFFittingSmootherESProducer.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 KFFittingSmootherESProducer::KFFittingSmootherESProducer(const edm::ParameterSet & p) 
00021 {
00022   std::string myname = p.getParameter<std::string>("ComponentName");
00023   pset_ = p;
00024   setWhatProduced(this,myname);
00025 }
00026 
00027 KFFittingSmootherESProducer::~KFFittingSmootherESProducer() {}
00028 
00029 boost::shared_ptr<TrajectoryFitter> 
00030 KFFittingSmootherESProducer::produce(const TrajectoryFitterRecord & iRecord){ 
00031 
00032   std::string fname = pset_.getParameter<std::string>("Fitter");
00033   std::string sname = pset_.getParameter<std::string>("Smoother");
00034   double theEstimateCut = pset_.getParameter<double>("EstimateCut");
00035 
00036   double theLogPixelProbabilityCut = pset_.getParameter<double>("LogPixelProbabilityCut"); // ggiurgiu@fnal.gov
00037 
00038   int theMinNumberOfHits = pset_.getParameter<int>("MinNumberOfHits");
00039   bool rejectTracksFlag = pset_.getParameter<bool>("RejectTracks");
00040   bool breakTrajWith2ConsecutiveMissing = pset_.getParameter<bool>("BreakTrajWith2ConsecutiveMissing");
00041   bool noInvalidHitsBeginEnd = pset_.getParameter<bool>("NoInvalidHitsBeginEnd");
00042 
00043   edm::ESHandle<TrajectoryFitter> fit;
00044   edm::ESHandle<TrajectorySmoother> smooth;
00045   
00046   iRecord.get(fname, fit);
00047   iRecord.get(sname, smooth);
00048   
00049   _fitter  = boost::shared_ptr<TrajectoryFitter>(new KFFittingSmoother(*fit.product(), *smooth.product(),
00050                                                                        theEstimateCut,
00051                                                                        theLogPixelProbabilityCut, // ggiurgiu@fnal.gov
00052                                                                        theMinNumberOfHits,rejectTracksFlag,
00053                                                                        breakTrajWith2ConsecutiveMissing,noInvalidHitsBeginEnd));
00054   return _fitter;
00055 }
00056 
00057