CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
StripCPEESProducer.cc
Go to the documentation of this file.
11 
13 {
14  std::string name = p.getParameter<std::string>("ComponentName");
15 
16  enumMap[std::string("SimpleStripCPE")]=SIMPLE;
17  enumMap[std::string("StripCPEfromTrackAngle")]=TRACKANGLE;
18  enumMap[std::string("StripCPEgeometric")]=GEOMETRIC;
19  if(enumMap.find(name)==enumMap.end())
20  throw cms::Exception("Unknown StripCPE type") << name;
21 
22  cpeNum = enumMap[name];
23  pset = p;
24  setWhatProduced(this,name);
25 }
26 
27 boost::shared_ptr<StripClusterParameterEstimator> StripCPEESProducer::
28 produce(const TkStripCPERecord & iRecord)
29 {
32  edm::ESHandle<SiStripLorentzAngle> lorentzAngle; iRecord.getRecord<SiStripLorentzAngleRcd>().get(lorentzAngle);
33  edm::ESHandle<SiStripConfObject> confObj; iRecord.getRecord<SiStripConfObjectRcd>().get(confObj);
34  edm::ESHandle<SiStripLatency> latency; iRecord.getRecord<SiStripLatencyRcd>().get(latency);
35  edm::ESHandle<SiStripNoises> noise; iRecord.getRecord<SiStripNoisesRcd>().get(noise);
38 
39  switch(cpeNum) {
40 
41  case SIMPLE:
42  cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPE( pset, *magfield, *pDD, *lorentzAngle, *confObj, *latency ));
43  break;
44 
45  case TRACKANGLE:
46  cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPEfromTrackAngle( pset, *magfield, *pDD, *lorentzAngle, *confObj, *latency ));
47  break;
48 
49  case GEOMETRIC:
50  cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPEgeometric(pset, *magfield, *pDD, *lorentzAngle, *confObj, *latency ));
51  break;
52 
53  }
54 
55  return cpe;
56 }
T getParameter(std::string const &) const
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
int bad(Items const &cont)
edm::ParameterSet pset
boost::shared_ptr< StripClusterParameterEstimator > cpe
std::map< std::string, CPE_t > enumMap
StripCPEESProducer(const edm::ParameterSet &)
boost::shared_ptr< StripClusterParameterEstimator > produce(const TkStripCPERecord &)