00001 #include "RecoLocalTracker/SiPixelRecHits/interface/PixelCPETemplateRecoESProducer.h" 00002 #include "RecoLocalTracker/SiPixelRecHits/interface/PixelCPETemplateReco.h" 00003 #include "MagneticField/Engine/interface/MagneticField.h" 00004 #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" 00005 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" 00006 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.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 00015 #include <string> 00016 #include <memory> 00017 00018 using namespace edm; 00019 00020 PixelCPETemplateRecoESProducer::PixelCPETemplateRecoESProducer(const edm::ParameterSet & p) 00021 { 00022 std::string myname = p.getParameter<std::string>("ComponentName"); 00023 pset_ = p; 00024 setWhatProduced(this,myname); 00025 } 00026 00027 PixelCPETemplateRecoESProducer::~PixelCPETemplateRecoESProducer() {} 00028 00029 boost::shared_ptr<PixelClusterParameterEstimator> 00030 PixelCPETemplateRecoESProducer::produce(const TkPixelCPERecord & iRecord){ 00031 00032 ESHandle<MagneticField> magfield; 00033 iRecord.getRecord<IdealMagneticFieldRecord>().get(magfield ); 00034 00035 edm::ESHandle<TrackerGeometry> pDD; 00036 iRecord.getRecord<TrackerDigiGeometryRecord>().get( pDD ); 00037 00038 edm::ESHandle<SiPixelLorentzAngle> lorentzAngle; 00039 iRecord.getRecord<SiPixelLorentzAngleRcd>().get(lorentzAngle); 00040 00041 ESHandle<SiPixelTemplateDBObject> templateDBobject; 00042 iRecord.getRecord<SiPixelTemplateDBObjectESProducerRcd>().get(templateDBobject); 00043 00044 cpe_ = boost::shared_ptr<PixelClusterParameterEstimator>(new PixelCPETemplateReco(pset_,magfield.product(),lorentzAngle.product(),templateDBobject.product() )); 00045 return cpe_; 00046 } 00047 00048