CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/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/StripCPEgeometric.h"
00005 #include "CondFormats/SiStripObjects/interface/SiStripConfObject.h"
00006 #include "CondFormats/SiStripObjects/interface/SiStripLatency.h"
00007 #include "CondFormats/SiStripObjects/interface/SiStripNoises.h"
00008 #include "CondFormats/SiStripObjects/interface/SiStripApvGain.h"
00009 #include "CondFormats/SiStripObjects/interface/SiStripBadStrip.h"
00010 #include "FWCore/Framework/interface/ESHandle.h"
00011 
00012 StripCPEESProducer::StripCPEESProducer(const edm::ParameterSet & p) 
00013 {
00014   std::string name = p.getParameter<std::string>("ComponentName");
00015 
00016   enumMap[std::string("SimpleStripCPE")]=SIMPLE;
00017   enumMap[std::string("StripCPEfromTrackAngle")]=TRACKANGLE;
00018   enumMap[std::string("StripCPEgeometric")]=GEOMETRIC;
00019   if(enumMap.find(name)==enumMap.end()) 
00020     throw cms::Exception("Unknown StripCPE type") << name;
00021 
00022   cpeNum = enumMap[name];
00023   pset = p;
00024   setWhatProduced(this,name);
00025 }
00026 
00027 boost::shared_ptr<StripClusterParameterEstimator> StripCPEESProducer::
00028 produce(const TkStripCPERecord & iRecord) 
00029 { 
00030   edm::ESHandle<TrackerGeometry> pDD;  iRecord.getRecord<TrackerDigiGeometryRecord>().get( pDD );
00031   edm::ESHandle<MagneticField> magfield;  iRecord.getRecord<IdealMagneticFieldRecord>().get(magfield );
00032   edm::ESHandle<SiStripLorentzAngle> lorentzAngle;  iRecord.getRecord<SiStripLorentzAngleRcd>().get(lorentzAngle);
00033   edm::ESHandle<SiStripConfObject> confObj;  iRecord.getRecord<SiStripConfObjectRcd>().get(confObj);
00034   edm::ESHandle<SiStripLatency> latency;  iRecord.getRecord<SiStripLatencyRcd>().get(latency);
00035   edm::ESHandle<SiStripNoises> noise;  iRecord.getRecord<SiStripNoisesRcd>().get(noise);
00036   edm::ESHandle<SiStripApvGain> gain;  iRecord.getRecord<SiStripApvGainRcd>().get(gain);
00037   edm::ESHandle<SiStripBadStrip> bad;  iRecord.getRecord<SiStripBadChannelRcd>().get(bad);
00038   
00039   switch(cpeNum) {
00040 
00041   case SIMPLE:     
00042     cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPE( pset, *magfield, *pDD, *lorentzAngle, *confObj, *latency ));  
00043     break;
00044     
00045   case TRACKANGLE: 
00046     cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPEfromTrackAngle( pset, *magfield, *pDD, *lorentzAngle, *confObj, *latency )); 
00047     break;
00048     
00049   case GEOMETRIC:  
00050     cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPEgeometric(pset, *magfield, *pDD, *lorentzAngle, *confObj, *latency )); 
00051     break;  
00052 
00053   }
00054 
00055   return cpe;
00056 }