CMS 3D CMS Logo

StripCPEESProducer.cc
Go to the documentation of this file.
7 
9 
14 
18 
20 public:
22  std::unique_ptr<StripClusterParameterEstimator> produce(const TkStripCPERecord&);
23 
24 private:
26 
29 
36 };
37 
39  std::string name = p.getParameter<std::string>("ComponentName");
41  if (!p.exists("ComponentType"))
42  edm::LogWarning("StripCPEESProducer") << " the CPE producer should contain a ComponentType, probably identical to "
43  "ComponentName in the first step of migration. Falling back to:"
44  << type;
45  else
46  type = p.getParameter<std::string>("ComponentType");
47 
48  std::map<std::string, CPE_t> enumMap;
49  enumMap[std::string("SimpleStripCPE")] = SIMPLE;
50  enumMap[std::string("StripCPEfromTrackAngle")] = TRACKANGLE;
51  enumMap[std::string("StripCPEgeometric")] = GEOMETRIC;
52  enumMap[std::string("FakeStripCPE")] = FAKE;
53  if (enumMap.find(type) == enumMap.end())
54  throw cms::Exception("Unknown StripCPE type") << type;
55 
56  cpeNum = enumMap[type];
57  parametersPSet = (p.exists("parameters") ? p.getParameter<edm::ParameterSet>("parameters") : p);
58  auto cc = setWhatProduced(this, name);
59  pDDToken_ = cc.consumes();
60  magfieldToken_ = cc.consumes();
61  lorentzAngleToken_ = cc.consumes();
62  backPlaneCorrectionToken_ = cc.consumes();
63  confObjToken_ = cc.consumes();
64  latencyToken_ = cc.consumes();
65 }
66 
67 std::unique_ptr<StripClusterParameterEstimator> StripCPEESProducer::produce(const TkStripCPERecord& iRecord) {
68  TrackerGeometry const& pDD = iRecord.get(pDDToken_);
69  MagneticField const& magfield = iRecord.get(magfieldToken_);
70  SiStripLorentzAngle const& lorentzAngle = iRecord.get(lorentzAngleToken_);
71  SiStripBackPlaneCorrection const& backPlaneCorrection = iRecord.get(backPlaneCorrectionToken_);
72  SiStripConfObject const& confObj = iRecord.get(confObjToken_);
73  SiStripLatency const& latency = iRecord.get(latencyToken_);
74 
75  std::unique_ptr<StripClusterParameterEstimator> cpe;
76 
77  switch (cpeNum) {
78  case SIMPLE:
79  cpe = std::make_unique<StripCPE>(
80  parametersPSet, magfield, pDD, lorentzAngle, backPlaneCorrection, confObj, latency);
81  break;
82 
83  case TRACKANGLE:
84  cpe = std::make_unique<StripCPEfromTrackAngle>(
85  parametersPSet, magfield, pDD, lorentzAngle, backPlaneCorrection, confObj, latency);
86  break;
87 
88  case GEOMETRIC:
89  cpe = std::make_unique<StripCPEgeometric>(
90  parametersPSet, magfield, pDD, lorentzAngle, backPlaneCorrection, confObj, latency);
91  break;
92 
93  case FAKE:
94  cpe = std::make_unique<StripFakeCPE>();
95  break;
96  }
97 
98  return cpe;
99 }
100 
SiStripDependentRecords.h
StripCPEESProducer::backPlaneCorrectionToken_
edm::ESGetToken< SiStripBackPlaneCorrection, SiStripBackPlaneCorrectionDepRcd > backPlaneCorrectionToken_
Definition: StripCPEESProducer.cc:33
config_102169_raw_cff.latency
latency
Definition: config_102169_raw_cff.py:29
ESHandle.h
TkStripCPERecord.h
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
TkStripCPERecord
Definition: TkStripCPERecord.h:13
StripCPEESProducer::CPE_t
CPE_t
Definition: StripCPEESProducer.cc:25
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:163
ESProducer.h
StripCPEgeometric.h
StripCPEESProducer::GEOMETRIC
Definition: StripCPEESProducer.cc:25
StripCPEESProducer::cpeNum
CPE_t cpeNum
Definition: StripCPEESProducer.cc:27
StripFakeCPE.h
StripCPEESProducer::TRACKANGLE
Definition: StripCPEESProducer.cc:25
StripCPEESProducer::magfieldToken_
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > magfieldToken_
Definition: StripCPEESProducer.cc:31
SiStripLorentzAngle
Definition: SiStripLorentzAngle.h:26
StripCPEESProducer::produce
std::unique_ptr< StripClusterParameterEstimator > produce(const TkStripCPERecord &)
Definition: StripCPEESProducer.cc:67
StripCPEESProducer::SIMPLE
Definition: StripCPEESProducer.cc:25
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:109
StripCPEESProducer::StripCPEESProducer
StripCPEESProducer(const edm::ParameterSet &)
Definition: StripCPEESProducer.cc:38
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
StripCPEESProducer::lorentzAngleToken_
edm::ESGetToken< SiStripLorentzAngle, SiStripLorentzAngleDepRcd > lorentzAngleToken_
Definition: StripCPEESProducer.cc:32
edm::ParameterSet
Definition: ParameterSet.h:47
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
SiStripBackPlaneCorrection.h
gainCalibHelper::gainCalibPI::type
type
Definition: SiPixelGainCalibHelper.h:40
StripCPEESProducer::confObjToken_
edm::ESGetToken< SiStripConfObject, SiStripConfObjectRcd > confObjToken_
Definition: StripCPEESProducer.cc:34
cc
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord >
StripCPEESProducer
Definition: StripCPEESProducer.cc:19
StripCPEESProducer::FAKE
Definition: StripCPEESProducer.cc:25
StripCPEESProducer::latencyToken_
edm::ESGetToken< SiStripLatency, SiStripLatencyRcd > latencyToken_
Definition: StripCPEESProducer.cc:35
StripCPEfromTrackAngle.h
ModuleFactory.h
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
StripClusterParameterEstimator.h
edm::ESProducer
Definition: ESProducer.h:104
cms::Exception
Definition: Exception.h:70
SiStripLatency.h
ParameterSet.h
StripCPE.h
SiStripLatency
Definition: SiStripLatency.h:59
MagneticField
Definition: MagneticField.h:19
edm::Log
Definition: MessageLogger.h:70
volumeBasedMagneticField_160812_cfi.magfield
magfield
Definition: volumeBasedMagneticField_160812_cfi.py:11
SiStripBackPlaneCorrection
Definition: SiStripBackPlaneCorrection.h:27
StripCPEESProducer::parametersPSet
edm::ParameterSet parametersPSet
Definition: StripCPEESProducer.cc:28
SiStripConfObject.h
StripCPEESProducer::pDDToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > pDDToken_
Definition: StripCPEESProducer.cc:30
TrackerGeometry
Definition: TrackerGeometry.h:14
SiStripConfObject
Definition: SiStripConfObject.h:31