CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/TrackingTools/TransientTrack/plugins/TransientTrackBuilderESProducer.cc

Go to the documentation of this file.
00001 #include "TransientTrackBuilderESProducer.h"
00002 #include "Geometry/Records/interface/GlobalTrackingGeometryRecord.h"
00003 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h"
00004 #include "boost/mpl/vector.hpp" 
00005 #include "Geometry/CommonDetUnit/interface/GlobalTrackingGeometry.h"
00006 
00007 #include "FWCore/Framework/interface/ESHandle.h"
00008 
00009 #include <string>
00010 #include <memory>
00011 
00012 using namespace edm;
00013 
00014 TransientTrackBuilderESProducer::TransientTrackBuilderESProducer(const edm::ParameterSet & p) 
00015 {
00016   std::string myname = p.getParameter<std::string>("ComponentName");
00017   pset_ = p;
00018   setWhatProduced(this,myname);
00019 }
00020 
00021 TransientTrackBuilderESProducer::~TransientTrackBuilderESProducer() {}
00022 
00023 boost::shared_ptr<TransientTrackBuilder> 
00024 TransientTrackBuilderESProducer::produce(const TransientTrackRecord & iRecord){ 
00025 
00026   edm::ESHandle<MagneticField> magfield;
00027   iRecord.getRecord<IdealMagneticFieldRecord>().get( magfield );     
00028   edm::ESHandle<GlobalTrackingGeometry> theTrackingGeometry;
00029   iRecord.getRecord<GlobalTrackingGeometryRecord>().get(theTrackingGeometry); 
00030 
00031   _builder  = boost::shared_ptr<TransientTrackBuilder>(
00032         new TransientTrackBuilder(magfield.product(), theTrackingGeometry ));
00033   return _builder;
00034 
00035 }
00036 
00037