CMS 3D CMS Logo

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