00001 #include "TrackingTools/GsfTracking/plugins/GsfTrajectoryFitterESProducer.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/GsfTrajectoryFitter.h" 00017 00018 #include <string> 00019 #include <memory> 00020 00021 #include <iostream> 00022 00023 GsfTrajectoryFitterESProducer::GsfTrajectoryFitterESProducer(const edm::ParameterSet & p) 00024 { 00025 std::string myname = p.getParameter<std::string>("ComponentName"); 00026 pset_ = p; 00027 setWhatProduced(this,myname); 00028 } 00029 00030 GsfTrajectoryFitterESProducer::~GsfTrajectoryFitterESProducer() {} 00031 00032 boost::shared_ptr<TrajectoryFitter> 00033 GsfTrajectoryFitterESProducer::produce(const TrackingComponentsRecord & iRecord){ 00034 // 00035 // material effects 00036 // 00037 std::string matName = pset_.getParameter<std::string>("MaterialEffectsUpdator"); 00038 edm::ESHandle<GsfMaterialEffectsUpdator> matProducer; 00039 iRecord.get(matName,matProducer); 00040 // 00041 // propagator 00042 // 00043 std::string geomName = pset_.getParameter<std::string>("GeometricalPropagator"); 00044 edm::ESHandle<Propagator> geomProducer; 00045 iRecord.get(geomName,geomProducer); 00046 GsfPropagatorWithMaterial propagator(*geomProducer.product(),*matProducer.product()); 00047 // 00048 // merger 00049 // 00050 std::string mergerName = pset_.getParameter<std::string>("Merger"); 00051 // edm::ESHandle<MultiTrajectoryStateMerger> mergerProducer; 00052 // iRecord.get(mergerName,mergerProducer); 00053 edm::ESHandle< MultiGaussianStateMerger<5> > mergerProducer; 00054 iRecord.get(mergerName,mergerProducer); 00055 MultiTrajectoryStateMerger merger(*mergerProducer.product()); 00056 // 00057 // estimator 00058 // 00059 // double chi2Cut = pset_.getParameter<double>("ChiSquarCut"); 00060 double chi2Cut(100.); 00061 GsfChi2MeasurementEstimator estimator(chi2Cut); 00062 // 00063 // create algorithm 00064 // 00065 return boost::shared_ptr<TrajectoryFitter>(new GsfTrajectoryFitter(propagator, 00066 GsfMultiStateUpdator(), 00067 estimator,merger)); 00068 }