CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/src/RecoLocalTracker/SiPixelRecHits/plugins/PixelCPEGenericESProducer.cc

Go to the documentation of this file.
00001 #include "RecoLocalTracker/SiPixelRecHits/interface/PixelCPEGenericESProducer.h"
00002 #include "RecoLocalTracker/SiPixelRecHits/interface/PixelCPEGeneric.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 PixelCPEGenericESProducer::PixelCPEGenericESProducer(const edm::ParameterSet & p) 
00021 {
00022   std::string myname = p.getParameter<std::string>("ComponentName");
00023   pset_ = p;
00024   setWhatProduced(this,myname);
00025 }
00026 
00027 PixelCPEGenericESProducer::~PixelCPEGenericESProducer() {}
00028 
00029 boost::shared_ptr<PixelClusterParameterEstimator>
00030 PixelCPEGenericESProducer::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   ESHandle<SiPixelLorentzAngle> lorentzAngle;
00039   iRecord.getRecord<SiPixelLorentzAngleRcd>().get(lorentzAngle );
00040         
00041         ESHandle<SiPixelCPEGenericErrorParm> genErrorParm;
00042         iRecord.getRecord<SiPixelCPEGenericErrorParmRcd>().get(genErrorParm);
00043 
00044         ESHandle<SiPixelTemplateDBObject> templateDBobject;
00045         iRecord.getRecord<SiPixelTemplateDBObjectESProducerRcd>().get(templateDBobject);
00046 
00047   cpe_  = boost::shared_ptr<PixelClusterParameterEstimator>(new PixelCPEGeneric(pset_,magfield.product(),lorentzAngle.product(),genErrorParm.product(),templateDBobject.product()) );
00048         //ToDo? Replace blah.product() with ESHandle
00049         
00050   return cpe_;
00051 }
00052 
00053