CMS 3D CMS Logo

MeasurementTrackerESProducer.cc
Go to the documentation of this file.
2 
4 
9 
16 
20 
23 
28 
32 
33 #include <string>
34 #include <memory>
35 
36 using namespace edm;
37 
39 {
40  std::string myname = p.getParameter<std::string>("ComponentName");
41  pixelCPEName = p.getParameter<std::string>("PixelCPE");
42  stripCPEName = p.getParameter<std::string>("StripCPE");
43  matcherName = p.getParameter<std::string>("HitMatcher");
44 
45  //FIXME:: just temporary solution for phase2!
46  phase2TrackerCPEName = "";
47  if (p.existsAs<std::string>("Phase2StripCPE")) {
48  phase2TrackerCPEName = p.getParameter<std::string>("Phase2StripCPE");
49  }
50 
51  pset_ = p;
52  setWhatProduced(this,myname);
53 }
54 
56 
57 std::unique_ptr<MeasurementTracker>
59 {
60 
61  // ========= SiPixelQuality related tasks =============
62  const SiPixelQuality *ptr_pixelQuality = nullptr;
63  const SiPixelFedCabling *ptr_pixelCabling = nullptr;
64  int pixelQualityFlags = 0;
65  int pixelQualityDebugFlags = 0;
66  edm::ESHandle<SiPixelQuality> pixelQuality;
68 
69  if (pset_.getParameter<bool>("UsePixelModuleQualityDB")) {
70  pixelQualityFlags += MeasurementTracker::BadModules;
71  if (pset_.getUntrackedParameter<bool>("DebugPixelModuleQualityDB", false)) {
72  pixelQualityDebugFlags += MeasurementTracker::BadModules;
73  }
74  }
75  if (pset_.getParameter<bool>("UsePixelROCQualityDB")) {
76  pixelQualityFlags += MeasurementTracker::BadROCs;
77  if (pset_.getUntrackedParameter<bool>("DebugPixelROCQualityDB", false)) {
78  pixelQualityDebugFlags += MeasurementTracker::BadROCs;
79  }
80  }
81 
82 
83  if (pixelQualityFlags != 0) {
84  iRecord.getRecord<SiPixelQualityRcd>().get(pixelQuality);
85  ptr_pixelQuality = pixelQuality.product();
86  iRecord.getRecord<SiPixelFedCablingMapRcd>().get(pixelCabling);
87  ptr_pixelCabling = pixelCabling.product();
88  }
89 
90  // ========= SiStripQuality related tasks =============
91  const SiStripQuality *ptr_stripQuality = nullptr;
92  int stripQualityFlags = 0;
93  int stripQualityDebugFlags = 0;
94  edm::ESHandle<SiStripQuality> stripQuality;
95 
96  if (pset_.getParameter<bool>("UseStripModuleQualityDB")) {
97  stripQualityFlags += MeasurementTracker::BadModules;
98  if (pset_.getUntrackedParameter<bool>("DebugStripModuleQualityDB", false)) {
99  stripQualityDebugFlags += MeasurementTracker::BadModules;
100  }
101  }
102  if (pset_.getParameter<bool>("UseStripAPVFiberQualityDB")) {
103  stripQualityFlags += MeasurementTracker::BadAPVFibers;
104  if (pset_.getUntrackedParameter<bool>("DebugStripAPVFiberQualityDB", false)) {
105  stripQualityDebugFlags += MeasurementTracker::BadAPVFibers;
106  }
107  if (pset_.getParameter<bool>("MaskBadAPVFibers")) {
108  stripQualityFlags += MeasurementTracker::MaskBad128StripBlocks;
109  }
110  }
111  if (pset_.getParameter<bool>("UseStripStripQualityDB")) {
112  stripQualityFlags += MeasurementTracker::BadStrips;
113  if (pset_.getUntrackedParameter<bool>("DebugStripStripQualityDB", false)) {
114  stripQualityDebugFlags += MeasurementTracker::BadStrips;
115  }
116  }
117 
118  if (stripQualityFlags != 0) {
119  std::string siStripQualityLabel = pset_.getParameter<std::string>("SiStripQualityLabel");
120  iRecord.getRecord<SiStripQualityRcd>().get(siStripQualityLabel, stripQuality);
121  ptr_stripQuality = stripQuality.product();
122  }
123 
127  edm::ESHandle<TrackerTopology> trackerTopology;
128  edm::ESHandle<TrackerGeometry> trackerGeom;
129  edm::ESHandle<GeometricSearchTracker> geometricSearchTracker;
131 
132  iRecord.getRecord<TkPixelCPERecord>().get(pixelCPEName,pixelCPE);
133  iRecord.getRecord<TkStripCPERecord>().get(stripCPEName,stripCPE);
134  iRecord.getRecord<TkStripCPERecord>().get(matcherName,hitMatcher);
135  iRecord.getRecord<TrackerTopologyRcd>().get(trackerTopology);
136  iRecord.getRecord<TrackerDigiGeometryRecord>().get(trackerGeom);
137  iRecord.getRecord<TrackerRecoGeometryRecord>().get(geometricSearchTracker);
138 
139 
140  if(phase2TrackerCPEName != ""){
141  iRecord.getRecord<TkStripCPERecord>().get(phase2TrackerCPEName,phase2TrackerCPE);
142  return std::make_unique<MeasurementTrackerImpl>(pset_,
143  pixelCPE.product(),
144  stripCPE.product(),
145  hitMatcher.product(),
146  trackerTopology.product(),
147  trackerGeom.product(),
148  geometricSearchTracker.product(),
149  ptr_stripQuality,
150  stripQualityFlags,
151  stripQualityDebugFlags,
152  ptr_pixelQuality,
153  ptr_pixelCabling,
154  pixelQualityFlags,
155  pixelQualityDebugFlags,
156  phase2TrackerCPE.product());
157  } else {
158  return std::make_unique<MeasurementTrackerImpl>(pset_,
159  pixelCPE.product(),
160  stripCPE.product(),
161  hitMatcher.product(),
162  trackerTopology.product(),
163  trackerGeom.product(),
164  geometricSearchTracker.product(),
165  ptr_stripQuality,
166  stripQualityFlags,
167  stripQualityDebugFlags,
168  ptr_pixelQuality,
169  ptr_pixelCabling,
170  pixelQualityFlags,
171  pixelQualityDebugFlags);
172  }
173 }
174 
175 
T getParameter(std::string const &) const
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
std::unique_ptr< MeasurementTracker > produce(const CkfComponentsRecord &)
HLT enums.
T const * product() const
Definition: ESHandle.h:86
MeasurementTrackerESProducer(const edm::ParameterSet &p)