CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/TrackingTools/GsfTracking/plugins/GsfTrajectorySmootherESProducer.cc

Go to the documentation of this file.
00001 #include "TrackingTools/GsfTracking/plugins/GsfTrajectorySmootherESProducer.h"
00002 
00003 #include "FWCore/Framework/interface/EventSetup.h"
00004 #include "FWCore/Framework/interface/ESHandle.h"
00005 #include "FWCore/Framework/interface/ModuleFactory.h"
00006 #include "FWCore/Framework/interface/ESProducer.h"
00007 
00008 #include "TrackingTools/GeomPropagators/interface/AnalyticalPropagator.h"
00009 #include "TrackingTools/GsfTracking/interface/GsfMaterialEffectsUpdator.h"
00010 #include "TrackingTools/GsfTracking/interface/GsfPropagatorWithMaterial.h"
00011 #include "TrackingTools/GsfTracking/interface/GsfMultiStateUpdator.h"
00012 #include "TrackingTools/GsfTools/interface/MultiGaussianStateMerger.h"
00013 #include "TrackingTools/GsfTools/interface/CloseComponentsMerger.h"
00014 #include "TrackingTools/GsfTracking/interface/MultiTrajectoryStateMerger.h"
00015 #include "TrackingTools/GsfTracking/interface/GsfChi2MeasurementEstimator.h"
00016 #include "TrackingTools/GsfTracking/interface/GsfTrajectorySmoother.h"
00017 
00018 #include <string>
00019 #include <memory>
00020 
00021 GsfTrajectorySmootherESProducer::GsfTrajectorySmootherESProducer(const edm::ParameterSet & p) 
00022 {
00023   std::string myname = p.getParameter<std::string>("ComponentName");
00024   pset_ = p;
00025   setWhatProduced(this,myname);
00026 }
00027 
00028 GsfTrajectorySmootherESProducer::~GsfTrajectorySmootherESProducer() {}
00029 
00030 boost::shared_ptr<TrajectorySmoother> 
00031 GsfTrajectorySmootherESProducer::produce(const TrajectoryFitterRecord & iRecord){ 
00032   //
00033   // material effects
00034   //
00035   std::string matName = pset_.getParameter<std::string>("MaterialEffectsUpdator");
00036   edm::ESHandle<GsfMaterialEffectsUpdator> matProducer;
00037   iRecord.getRecord<TrackingComponentsRecord>().get(matName,matProducer);
00038   //
00039   // propagator
00040   //
00041   std::string geomName = pset_.getParameter<std::string>("GeometricalPropagator");
00042   edm::ESHandle<Propagator> geomProducer;
00043   iRecord.getRecord<TrackingComponentsRecord>().get(geomName,geomProducer);
00044   GsfPropagatorWithMaterial propagator(*geomProducer.product(),*matProducer.product());
00045   //
00046   // merger
00047   //
00048   std::string mergerName = pset_.getParameter<std::string>("Merger");
00049 //   edm::ESHandle<MultiTrajectoryStateMerger> mergerProducer;
00050 //   iRecord.get(mergerName,mergerProducer);
00051   edm::ESHandle< MultiGaussianStateMerger<5> > mergerProducer;
00052   iRecord.getRecord<TrackingComponentsRecord>().get(mergerName,mergerProducer);
00053   MultiTrajectoryStateMerger merger(*mergerProducer.product());
00054   //
00055   // estimator
00056   //
00057   //   double chi2Cut = pset_.getParameter<double>("ChiSquarCut");
00058   double chi2Cut(100.);
00059   GsfChi2MeasurementEstimator estimator(chi2Cut);
00060   //
00061   // geometry
00062   std::string gname = pset_.getParameter<std::string>("RecoGeometry");
00063   edm::ESHandle<DetLayerGeometry> geo;
00064   iRecord.getRecord<RecoGeometryRecord>().get(gname,geo);
00065   // create algorithm
00066   //
00067   //   bool matBefUpd = pset_.getParameter<bool>("MaterialBeforeUpdate");
00068   double scale = pset_.getParameter<double>("ErrorRescaling");
00069   return boost::shared_ptr<TrajectorySmoother>(new GsfTrajectorySmoother(propagator,
00070                                                                          GsfMultiStateUpdator(), 
00071                                                                          estimator,merger,
00072 //                                                                       matBefUpd,
00073                                                                          scale,
00074                                                                          true,//BM should this be taken from parameterSet?
00075                                                                          geo.product()));
00076 }