00001 #include "RecoMuon/L3TrackFinder/interface/MuonRoadTrajectoryBuilderESProducer.h" 00002 00003 #include <RecoTracker/MeasurementDet/interface/MeasurementTracker.h> 00004 #include <TrackingTools/GeomPropagators/interface/Propagator.h> 00005 #include "FWCore/Framework/interface/ESHandle.h" 00006 00007 MuonRoadTrajectoryBuilderESProducer::MuonRoadTrajectoryBuilderESProducer(const edm::ParameterSet& iConfig) 00008 { 00009 std::string myName = iConfig.getParameter<std::string>("ComponentName"); 00010 measurementTrackerName = iConfig.getParameter<std::string>("measurementTrackerName"); 00011 propagatorName = iConfig.getParameter<std::string>("propagatorName"); 00012 pset_ = iConfig; 00013 setWhatProduced(this,myName); 00014 } 00015 00016 MuonRoadTrajectoryBuilderESProducer::~MuonRoadTrajectoryBuilderESProducer() 00017 { 00018 00019 // do anything here that needs to be done at desctruction time 00020 // (e.g. close files, deallocate resources etc.) 00021 00022 } 00023 00024 boost::shared_ptr<TrajectoryBuilder> 00025 MuonRoadTrajectoryBuilderESProducer::produce(const CkfComponentsRecord& iRecord) 00026 { 00027 using namespace edm::es; 00028 00029 edm::ESHandle<MeasurementTracker> measurementTrackerHandle; 00030 edm::ESHandle<Propagator> propagatorHandle; 00031 00032 iRecord.get(measurementTrackerName,measurementTrackerHandle); 00033 iRecord.getRecord<TrackingComponentsRecord>().get(propagatorName,propagatorHandle); 00034 00035 _trajectorybuilder = boost::shared_ptr<TrajectoryBuilder>(new MuonRoadTrajectoryBuilder(pset_, 00036 measurementTrackerHandle.product(), 00037 propagatorHandle->magneticField(), 00038 propagatorHandle.product()) 00039 ); 00040 return _trajectorybuilder; 00041 }