00001 #include "RecoLocalTracker/SiStripRecHitConverter/interface/StripCPEfromTrackAngleESProducer.h" 00002 #include "RecoLocalTracker/SiStripRecHitConverter/interface/StripCPEfromTrackAngle.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 #include "CondFormats/DataRecord/interface/SiStripLorentzAngleRcd.h" 00014 00015 #include <string> 00016 #include <memory> 00017 00018 using namespace edm; 00019 00020 StripCPEfromTrackAngleESProducer::StripCPEfromTrackAngleESProducer(const edm::ParameterSet & p) 00021 { 00022 std::string myname = p.getParameter<std::string>("ComponentName"); 00023 pset_ = p; 00024 setWhatProduced(this,myname); 00025 } 00026 00027 StripCPEfromTrackAngleESProducer::~StripCPEfromTrackAngleESProducer() {} 00028 00029 boost::shared_ptr<StripClusterParameterEstimator> 00030 StripCPEfromTrackAngleESProducer::produce(const TkStripCPERecord & iRecord){ 00031 // if (_propagator){ 00032 // delete _propagator; 00033 // _propagator = 0; 00034 // } 00035 ESHandle<MagneticField> magfield; 00036 iRecord.getRecord<IdealMagneticFieldRecord>().get(magfield ); 00037 00038 edm::ESHandle<TrackerGeometry> pDD; 00039 iRecord.getRecord<TrackerDigiGeometryRecord>().get( pDD ); 00040 00041 edm::ESHandle<SiStripLorentzAngle> SiStripLorentzAngle_; 00042 iRecord.getRecord<SiStripLorentzAngleRcd>().get(SiStripLorentzAngle_); 00043 _cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPEfromTrackAngle(pset_,magfield.product(), pDD.product(),SiStripLorentzAngle_.product() )); 00044 00045 return _cpe; 00046 } 00047 00048