CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/RecoLocalTracker/SiStripRecHitConverter/plugins/StripCPEESProducer.cc

Go to the documentation of this file.
00001 #include "RecoLocalTracker/SiStripRecHitConverter/plugins/StripCPEESProducer.h"
00002 #include "RecoLocalTracker/SiStripRecHitConverter/interface/StripCPE.h"
00003 #include "RecoLocalTracker/SiStripRecHitConverter/interface/StripCPEfromTrackAngle.h"
00004 #include "RecoLocalTracker/SiStripRecHitConverter/interface/StripCPEfromTemplate.h"
00005 #include "RecoLocalTracker/SiStripRecHitConverter/interface/StripCPEgeometric.h"
00006 #include "CondFormats/SiStripObjects/interface/SiStripConfObject.h"
00007 #include "CondFormats/SiStripObjects/interface/SiStripLatency.h"
00008 #include "CondFormats/SiStripObjects/interface/SiStripNoises.h"
00009 #include "CondFormats/SiStripObjects/interface/SiStripApvGain.h"
00010 #include "CondFormats/SiStripObjects/interface/SiStripBadStrip.h"
00011 #include "FWCore/Framework/interface/ESHandle.h"
00012 
00013 StripCPEESProducer::StripCPEESProducer(const edm::ParameterSet & p) 
00014 {
00015   std::string name = p.getParameter<std::string>("ComponentName");
00016 
00017   enumMap[std::string("SimpleStripCPE")]=SIMPLE;
00018   enumMap[std::string("StripCPEfromTrackAngle")]=TRACKANGLE;
00019   enumMap[std::string("StripCPEgeometric")]=GEOMETRIC;
00020   enumMap[std::string("StripCPEfromTemplate")]=TEMPLATE;
00021   if(enumMap.find(name)==enumMap.end()) 
00022     throw cms::Exception("Unknown StripCPE type") << name;
00023 
00024   cpeNum = enumMap[name];
00025   pset = p;
00026   setWhatProduced(this,name);
00027 }
00028 
00029 boost::shared_ptr<StripClusterParameterEstimator> StripCPEESProducer::
00030 produce(const TkStripCPERecord & iRecord) 
00031 { 
00032   edm::ESHandle<TrackerGeometry> pDD;  iRecord.getRecord<TrackerDigiGeometryRecord>().get( pDD );
00033   edm::ESHandle<MagneticField> magfield;  iRecord.getRecord<IdealMagneticFieldRecord>().get(magfield );
00034   edm::ESHandle<SiStripLorentzAngle> lorentzAngle; 
00035   iRecord.getRecord<SiStripLorentzAngleDepRcd>().get(lorentzAngle);
00036   edm::ESHandle<SiStripConfObject> confObj;  iRecord.getRecord<SiStripConfObjectRcd>().get(confObj);
00037   edm::ESHandle<SiStripLatency> latency;  iRecord.getRecord<SiStripLatencyRcd>().get(latency);
00038   edm::ESHandle<SiStripNoises> noise;  iRecord.getRecord<SiStripNoisesRcd>().get(noise);
00039   edm::ESHandle<SiStripApvGain> gain;  iRecord.getRecord<SiStripApvGainRcd>().get(gain);
00040   edm::ESHandle<SiStripBadStrip> bad;  iRecord.getRecord<SiStripBadChannelRcd>().get(bad);
00041  
00042   
00043   switch(cpeNum) {
00044 
00045   case SIMPLE:     
00046     cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPE( pset, *magfield, *pDD, *lorentzAngle, *confObj, *latency ));  
00047     break;
00048     
00049   case TRACKANGLE: 
00050     cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPEfromTrackAngle( pset, *magfield, *pDD, *lorentzAngle, *confObj, *latency )); 
00051     break;
00052     
00053   case GEOMETRIC:  
00054     cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPEgeometric(pset, *magfield, *pDD, *lorentzAngle, *confObj, *latency )); 
00055     break;  
00056 
00057   case TEMPLATE: 
00058     cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPEfromTemplate( pset, *magfield, *pDD, *lorentzAngle, *confObj, *latency )); 
00059     break;
00060 
00061 
00062   }
00063 
00064   return cpe;
00065 }