CMS 3D CMS Logo

Phase2StripCPEESProducer.cc
Go to the documentation of this file.
5 
10 
15 
17 
18 #include <memory>
19 #include <map>
20 
22 public:
24  std::unique_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> > produce(const TkStripCPERecord& iRecord);
25 
26 private:
27  enum CPE_t { DEFAULT, GEOMETRIC };
28 
33 };
34 
36  std::string name = p.getParameter<std::string>("ComponentType");
37 
38  std::map<std::string, CPE_t> enumMap;
39  enumMap[std::string("Phase2StripCPE")] = DEFAULT;
40  enumMap[std::string("Phase2StripCPEGeometric")] = GEOMETRIC;
41  if (enumMap.find(name) == enumMap.end())
42  throw cms::Exception("Unknown StripCPE type") << name;
43 
44  cpeNum_ = enumMap[name];
45  pset_ = p.getParameter<edm::ParameterSet>("parameters");
46  auto c = setWhatProduced(this, name);
47  if (cpeNum_ != GEOMETRIC) {
48  c.setConsumes(magfieldToken_);
49  c.setConsumes(pDDToken_);
50  }
51 }
52 
53 std::unique_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> > Phase2StripCPEESProducer::produce(
54  const TkStripCPERecord& iRecord) {
55  std::unique_ptr<ClusterParameterEstimator<Phase2TrackerCluster1D> > cpe_;
56  switch (cpeNum_) {
57  case DEFAULT:
58  cpe_ = std::make_unique<Phase2StripCPE>(pset_, iRecord.get(magfieldToken_), iRecord.get(pDDToken_));
59  break;
60 
61  case GEOMETRIC:
62  cpe_ = std::make_unique<Phase2StripCPEGeometric>(pset_);
63  break;
64  }
65  return cpe_;
66 }
67 
Phase2StripCPEESProducer::GEOMETRIC
Definition: Phase2StripCPEESProducer.cc:27
Phase2StripCPEESProducer::cpeNum_
CPE_t cpeNum_
Definition: Phase2StripCPEESProducer.cc:31
TrackerGeometry.h
ESHandle.h
TkStripCPERecord.h
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
TkStripCPERecord
Definition: TkStripCPERecord.h:13
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
ESProducer.h
TrackerTopology.h
Phase2StripCPEESProducer::produce
std::unique_ptr< ClusterParameterEstimator< Phase2TrackerCluster1D > > produce(const TkStripCPERecord &iRecord)
Definition: Phase2StripCPEESProducer.cc:53
Phase2StripCPEESProducer
Definition: Phase2StripCPEESProducer.cc:21
Phase2StripCPEGeometric.h
IdealMagneticFieldRecord.h
Phase2StripCPEESProducer::magfieldToken_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
Definition: Phase2StripCPEESProducer.cc:29
Phase2StripCPE.h
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:112
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Phase2StripCPEESProducer::pDDToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > pDDToken_
Definition: Phase2StripCPEESProducer.cc:30
edm::ParameterSet
Definition: ParameterSet.h:36
MagneticField.h
Phase2StripCPEESProducer::CPE_t
CPE_t
Definition: Phase2StripCPEESProducer.cc:27
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord >
ModuleFactory.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
Phase2TrackerCluster1D.h
Phase2StripCPEESProducer::DEFAULT
Definition: Phase2StripCPEESProducer.cc:27
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ESProducer
Definition: ESProducer.h:101
cms::Exception
Definition: Exception.h:70
ClusterParameterEstimator.h
ParameterSet.h
Phase2StripCPEESProducer::pset_
edm::ParameterSet pset_
Definition: Phase2StripCPEESProducer.cc:32
Phase2StripCPEESProducer::Phase2StripCPEESProducer
Phase2StripCPEESProducer(const edm::ParameterSet &)
Definition: Phase2StripCPEESProducer.cc:35