CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/TrackingTools/RecoGeometry/plugins/GlobalDetLayerGeometryESProducer.cc

Go to the documentation of this file.
00001 #include "TrackingTools/RecoGeometry/plugins/GlobalDetLayerGeometryESProducer.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 <memory>
00009 #include <string>
00010 
00011 using namespace edm;
00012 
00013 GlobalDetLayerGeometryESProducer::GlobalDetLayerGeometryESProducer(const edm::ParameterSet & p) 
00014 {
00015   std::string myName = p.getParameter<std::string>("ComponentName");
00016   setWhatProduced(this,myName);
00017 }
00018  
00019 GlobalDetLayerGeometryESProducer::~GlobalDetLayerGeometryESProducer() {}
00020 
00021 boost::shared_ptr<DetLayerGeometry> 
00022 GlobalDetLayerGeometryESProducer::produce(const RecoGeometryRecord & iRecord){ 
00023   
00024   edm::ESHandle<GeometricSearchTracker> tracker;  
00025   edm::ESHandle<MuonDetLayerGeometry> muon;
00026 
00027   iRecord.getRecord<TrackerRecoGeometryRecord>().get(tracker);
00028   iRecord.getRecord<MuonRecoGeometryRecord>().get(muon);
00029 
00030   geometry_  = boost::shared_ptr<DetLayerGeometry>(new GlobalDetLayerGeometry(tracker.product(),
00031                                                                               muon.product() ));
00032   return geometry_;
00033 }
00034 
00035 
00036 DEFINE_FWK_EVENTSETUP_MODULE(GlobalDetLayerGeometryESProducer);