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;
00033 iRecord.getRecord<SiStripLorentzAngleDepRcd>().get(lorentzAngle);
00034 edm::ESHandle<SiStripConfObject> confObj; iRecord.getRecord<SiStripConfObjectRcd>().get(confObj);
00035 edm::ESHandle<SiStripLatency> latency; iRecord.getRecord<SiStripLatencyRcd>().get(latency);
00036 edm::ESHandle<SiStripNoises> noise; iRecord.getRecord<SiStripNoisesRcd>().get(noise);
00037 edm::ESHandle<SiStripApvGain> gain; iRecord.getRecord<SiStripApvGainRcd>().get(gain);
00038 edm::ESHandle<SiStripBadStrip> bad; iRecord.getRecord<SiStripBadChannelRcd>().get(bad);
00039
00040
00041 switch(cpeNum) {
00042
00043 case SIMPLE:
00044 cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPE( pset, *magfield, *pDD, *lorentzAngle, *confObj, *latency ));
00045 break;
00046
00047 case TRACKANGLE:
00048 cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPEfromTrackAngle( pset, *magfield, *pDD, *lorentzAngle, *confObj, *latency ));
00049 break;
00050
00051 case GEOMETRIC:
00052 cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPEgeometric(pset, *magfield, *pDD, *lorentzAngle, *confObj, *latency ));
00053 break;
00054
00055 }
00056
00057 return cpe;
00058 }