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.
12 
14 {
15  std::string name = p.getParameter<std::string>("ComponentName");
16 
17  enumMap[std::string("SimpleStripCPE")]=SIMPLE;
18  enumMap[std::string("StripCPEfromTrackAngle")]=TRACKANGLE;
19  enumMap[std::string("StripCPEgeometric")]=GEOMETRIC;
20  enumMap[std::string("StripCPEfromTemplate")]=TEMPLATE;
21  if(enumMap.find(name)==enumMap.end())
22  throw cms::Exception("Unknown StripCPE type") << name;
23 
24  cpeNum = enumMap[name];
25  pset = p;
26  setWhatProduced(this,name);
27 }
28 
29 boost::shared_ptr<StripClusterParameterEstimator> StripCPEESProducer::
30 produce(const TkStripCPERecord & iRecord)
31 {
35  iRecord.getRecord<SiStripLorentzAngleDepRcd>().get(lorentzAngle);
36  edm::ESHandle<SiStripConfObject> confObj; iRecord.getRecord<SiStripConfObjectRcd>().get(confObj);
37  edm::ESHandle<SiStripLatency> latency; iRecord.getRecord<SiStripLatencyRcd>().get(latency);
38  edm::ESHandle<SiStripNoises> noise; iRecord.getRecord<SiStripNoisesRcd>().get(noise);
41 
42 
43  switch(cpeNum) {
44 
45  case SIMPLE:
46  cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPE( pset, *magfield, *pDD, *lorentzAngle, *confObj, *latency ));
47  break;
48 
49  case TRACKANGLE:
50  cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPEfromTrackAngle( pset, *magfield, *pDD, *lorentzAngle, *confObj, *latency ));
51  break;
52 
53  case GEOMETRIC:
54  cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPEgeometric(pset, *magfield, *pDD, *lorentzAngle, *confObj, *latency ));
55  break;
56 
57  case TEMPLATE:
58  cpe = boost::shared_ptr<StripClusterParameterEstimator>(new StripCPEfromTemplate( pset, *magfield, *pDD, *lorentzAngle, *confObj, *latency ));
59  break;
60 
61 
62  }
63 
64  return cpe;
65 }
T getParameter(std::string const &) const
tuple magfield
Definition: HLT_ES_cff.py:2311
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 &)