CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Phase2StripCPEESProducer.cc
Go to the documentation of this file.
4 
8 
10 
11 #include <boost/shared_ptr.hpp>
12 
13 #include <memory>
14 #include <map>
15 
17 
18  public:
19 
21  boost::shared_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> > produce(const TkStripCPERecord & iRecord);
22 
23  private:
24 
25  enum CPE_t { TRIVIAL };
26  std::map<std::string, CPE_t> enumMap_;
27 
30  boost::shared_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> > cpe_;
31 
32 };
33 
35  std::string name = p.getParameter<std::string>("ComponentType");
36 
37  enumMap_[std::string("Phase2StripCPETrivial")] = TRIVIAL;
38  if (enumMap_.find(name) == enumMap_.end())
39  throw cms::Exception("Unknown StripCPE type") << name;
40 
41  cpeNum_ = enumMap_[name];
42  pset_ = p;
43  setWhatProduced(this, name);
44 }
45 
46 boost::shared_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> > Phase2StripCPEESProducer::produce(const TkStripCPERecord & iRecord) {
47 
48  switch(cpeNum_) {
49 
50  case TRIVIAL:
51  cpe_ = boost::shared_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> >(new Phase2StripCPETrivial());
52  break;
53 
54  }
55 
56  return cpe_;
57 }
58 
59 
T getParameter(std::string const &) const
boost::shared_ptr< ClusterParameterEstimator< Phase2TrackerCluster1D > > produce(const TkStripCPERecord &iRecord)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::map< std::string, CPE_t > enumMap_
Phase2StripCPEESProducer(const edm::ParameterSet &)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
boost::shared_ptr< ClusterParameterEstimator< Phase2TrackerCluster1D > > cpe_