CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/RecoTracker/DebugTools/plugins/CkfDebugTrajectoryBuilderESProducer.cc

Go to the documentation of this file.
00001 #include "RecoTracker/DebugTools/interface/CkfDebugTrajectoryBuilderESProducer.h"
00002 #include "RecoTracker/DebugTools/interface/CkfDebugTrajectoryBuilder.h"
00003 
00004 #include "FWCore/Framework/interface/EventSetup.h"
00005 #include "FWCore/Framework/interface/ESHandle.h"
00006 #include "FWCore/Framework/interface/ModuleFactory.h"
00007 #include "FWCore/Framework/interface/ESProducer.h"
00008 
00009 #include "TrackingTools/KalmanUpdators/interface/KFUpdator.h"
00010 #include "TrackingTools/GeomPropagators/interface/Propagator.h"
00011 #include "TrackingTools/PatternTools/interface/TrajectoryStateUpdator.h"
00012 #include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimatorBase.h"
00013 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h"
00014 #include "RecoTracker/MeasurementDet/interface/MeasurementTracker.h"
00015 
00016 #include "TrackingTools/Records/interface/TrackingComponentsRecord.h"
00017 #include "TrackingTools/Records/interface/TransientRecHitRecord.h"
00018 #include "RecoTracker/Record/interface/CkfComponentsRecord.h"
00019 
00020 #include <string>
00021 #include <memory>
00022 
00023 using namespace edm;
00024 
00025 CkfDebugTrajectoryBuilderESProducer::CkfDebugTrajectoryBuilderESProducer(const edm::ParameterSet & p) 
00026 { 
00027   std::string myName = p.getParameter<std::string>("ComponentName");
00028   pset_ = p;
00029   setWhatProduced(this,myName);
00030 }
00031 
00032 CkfDebugTrajectoryBuilderESProducer::~CkfDebugTrajectoryBuilderESProducer() {}
00033 
00034 boost::shared_ptr<TrajectoryBuilder> 
00035 CkfDebugTrajectoryBuilderESProducer::produce(const CkfComponentsRecord& iRecord)
00036 { 
00037   std::string updatorName            = pset_.getParameter<std::string>("updator");   
00038   std::string propagatorAlongName    = pset_.getParameter<std::string>("propagatorAlong");
00039   std::string propagatorOppositeName = pset_.getParameter<std::string>("propagatorOpposite");   
00040   std::string estimatorName          = pset_.getParameter<std::string>("estimator"); 
00041   std::string recHitBuilderName      = pset_.getParameter<std::string>("TTRHBuilder");     
00042 
00043   edm::ESHandle<TrajectoryStateUpdator> updatorHandle;
00044   edm::ESHandle<Propagator>             propagatorAlongHandle;
00045   edm::ESHandle<Propagator>             propagatorOppositeHandle;
00046   edm::ESHandle<Chi2MeasurementEstimatorBase>   estimatorHandle;
00047   edm::ESHandle<TransientTrackingRecHitBuilder> recHitBuilderHandle;
00048   edm::ESHandle<MeasurementTracker>             measurementTrackerHandle;
00049 
00050   iRecord.getRecord<TrackingComponentsRecord>().get(updatorName,updatorHandle);
00051   iRecord.getRecord<TrackingComponentsRecord>().get(propagatorAlongName,propagatorAlongHandle);
00052   iRecord.getRecord<TrackingComponentsRecord>().get(propagatorOppositeName,propagatorOppositeHandle);
00053   iRecord.getRecord<TrackingComponentsRecord>().get(estimatorName,estimatorHandle);  
00054   iRecord.getRecord<TransientRecHitRecord>().get(recHitBuilderName,recHitBuilderHandle);  
00055   iRecord.get(measurementTrackerHandle);  
00056   
00057   _trajectoryBuilder  = 
00058     boost::shared_ptr<TrajectoryBuilder>(new CkfDebugTrajectoryBuilder(pset_,
00059                                                                        updatorHandle.product(),
00060                                                                        propagatorAlongHandle.product(),
00061                                                                        propagatorOppositeHandle.product(),
00062                                                                        estimatorHandle.product(),
00063                                                                        recHitBuilderHandle.product(),
00064                                                                        measurementTrackerHandle.product()) );  
00065   //  CkfDebugger dbg( es, theMeasurementTracker);
00066   //   _trajectoryBuilder->setDebugger( dbg);
00067   return _trajectoryBuilder;
00068 }