CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/RecoTracker/SiTrackerMRHTools/plugins/SiTrackerMultiRecHitUpdatorESProducer.cc

Go to the documentation of this file.
00001 #include "RecoTracker/SiTrackerMRHTools/plugins/SiTrackerMultiRecHitUpdatorESProducer.h"
00002 #include "TrackingTools/Records/interface/TransientRecHitRecord.h"
00003 #include "RecoTracker/Record/interface/CkfComponentsRecord.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 <string>
00011 #include <memory>
00012 
00013 using namespace edm;
00014 
00015 SiTrackerMultiRecHitUpdatorESProducer::SiTrackerMultiRecHitUpdatorESProducer(const edm::ParameterSet & p) 
00016 {
00017   std::string myname = p.getParameter<std::string>("ComponentName");
00018   pset_ = p;
00019   setWhatProduced(this,myname);
00020 }
00021 
00022 SiTrackerMultiRecHitUpdatorESProducer::~SiTrackerMultiRecHitUpdatorESProducer() {}
00023 
00024 boost::shared_ptr<SiTrackerMultiRecHitUpdator> 
00025 SiTrackerMultiRecHitUpdatorESProducer::produce(const MultiRecHitRecord & iRecord){ 
00026   std::vector<double> annealingProgram = pset_.getParameter<std::vector<double> >("AnnealingProgram");
00027   float Chi2Cut=pset_.getParameter<double>("ChiSquareCut");
00028 
00029   edm::ESHandle<TransientTrackingRecHitBuilder> hbuilder;
00030   std::string sname = pset_.getParameter<std::string>("TTRHBuilder");
00031   iRecord.getRecord<TransientRecHitRecord>().get(sname, hbuilder);
00032   std::string hitpropagator = pset_.getParameter<std::string>("HitPropagator");
00033   edm::ESHandle<TrackingRecHitPropagator> hhitpropagator;
00034   iRecord.getRecord<CkfComponentsRecord>().getRecord<TrackingComponentsRecord>().get(hitpropagator, hhitpropagator);            
00035  
00036   //_updator  = boost::shared_ptr<SiTrackerMultiRecHitUpdator>(new SiTrackerMultiRecHitUpdator(pDD.product(), pp, sp, mp, annealingProgram));
00037   _updator  = boost::shared_ptr<SiTrackerMultiRecHitUpdator>(new SiTrackerMultiRecHitUpdator(hbuilder.product(),hhitpropagator.product(), Chi2Cut, annealingProgram));
00038    // _updator  = boost::shared_ptr<SiTrackerMultiRecHitUpdator>(new SiTrackerMultiRecHitUpdator(hhitpropagator.product(),annealingProgram));
00039   return _updator;
00040 }
00041 
00042