00001 #include "RecoTracker/GeometryESProducer/plugins/TrackerRecoGeometryESProducer.h" 00002 #include "Geometry/TrackerNumberingBuilder/interface/GeometricDet.h" 00003 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" 00004 #include "Geometry/Records/interface/IdealGeometryRecord.h" 00005 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" 00006 #include "RecoTracker/TkDetLayers/interface/GeometricSearchTrackerBuilder.h" 00007 00008 #include "FWCore/Framework/interface/EventSetup.h" 00009 #include "FWCore/Framework/interface/ESHandle.h" 00010 #include "FWCore/Framework/interface/ModuleFactory.h" 00011 #include "FWCore/Framework/interface/ESProducer.h" 00012 00013 00014 #include <memory> 00015 #include <string> 00016 00017 using namespace edm; 00018 00019 TrackerRecoGeometryESProducer::TrackerRecoGeometryESProducer(const edm::ParameterSet & p) 00020 { 00021 setWhatProduced(this); 00022 // 08-Oct-2007 - Patrick Janot 00023 // Allow several reco geometries to be created, corresponding to the labelled 00024 // TrackerDigiGeometry's - that must created beforehand. Useful to handle an 00025 // aligned and a misaligned geometry in the same job. 00026 // The default parameter ("") makes this change transparent to the user 00027 // See FastSimulation/Configuration/data/ for examples of cfi's. 00028 geoLabel = p.getUntrackedParameter<std::string>("trackerGeometryLabel",""); 00029 } 00030 00031 TrackerRecoGeometryESProducer::~TrackerRecoGeometryESProducer() {} 00032 00033 boost::shared_ptr<GeometricSearchTracker> 00034 TrackerRecoGeometryESProducer::produce(const TrackerRecoGeometryRecord & iRecord){ 00035 00036 00037 edm::ESHandle<TrackerGeometry> tG; 00038 iRecord.getRecord<TrackerDigiGeometryRecord>().get( geoLabel, tG ); 00039 GeometricSearchTrackerBuilder builder; 00040 _tracker = boost::shared_ptr<GeometricSearchTracker>(builder.build( tG->trackerDet(), &(*tG) )); 00041 return _tracker; 00042 } 00043 00044 00045 DEFINE_FWK_EVENTSETUP_MODULE(TrackerRecoGeometryESProducer);