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::shared_ptr<MeasurementTracker>
59 {
60 
61 
62  // ========= SiPixelQuality related tasks =============
63  const SiPixelQuality *ptr_pixelQuality = 0;
64  const SiPixelFedCabling *ptr_pixelCabling = 0;
65  int pixelQualityFlags = 0;
66  int pixelQualityDebugFlags = 0;
67  edm::ESHandle<SiPixelQuality> pixelQuality;
69 
70  if (pset_.getParameter<bool>("UsePixelModuleQualityDB")) {
71  pixelQualityFlags += MeasurementTracker::BadModules;
72  if (pset_.getUntrackedParameter<bool>("DebugPixelModuleQualityDB", false)) {
73  pixelQualityDebugFlags += MeasurementTracker::BadModules;
74  }
75  }
76  if (pset_.getParameter<bool>("UsePixelROCQualityDB")) {
77  pixelQualityFlags += MeasurementTracker::BadROCs;
78  if (pset_.getUntrackedParameter<bool>("DebugPixelROCQualityDB", false)) {
79  pixelQualityDebugFlags += MeasurementTracker::BadROCs;
80  }
81  }
82 
83 
84  if (pixelQualityFlags != 0) {
85  iRecord.getRecord<SiPixelQualityRcd>().get(pixelQuality);
86  ptr_pixelQuality = pixelQuality.product();
87  iRecord.getRecord<SiPixelFedCablingMapRcd>().get(pixelCabling);
88  ptr_pixelCabling = pixelCabling.product();
89  }
90 
91  // ========= SiStripQuality related tasks =============
92  const SiStripQuality *ptr_stripQuality = 0;
93  int stripQualityFlags = 0;
94  int stripQualityDebugFlags = 0;
95  edm::ESHandle<SiStripQuality> stripQuality;
96 
97  if (pset_.getParameter<bool>("UseStripModuleQualityDB")) {
98  stripQualityFlags += MeasurementTracker::BadModules;
99  if (pset_.getUntrackedParameter<bool>("DebugStripModuleQualityDB", false)) {
100  stripQualityDebugFlags += MeasurementTracker::BadModules;
101  }
102  }
103  if (pset_.getParameter<bool>("UseStripAPVFiberQualityDB")) {
104  stripQualityFlags += MeasurementTracker::BadAPVFibers;
105  if (pset_.getUntrackedParameter<bool>("DebugStripAPVFiberQualityDB", false)) {
106  stripQualityDebugFlags += MeasurementTracker::BadAPVFibers;
107  }
108  if (pset_.getParameter<bool>("MaskBadAPVFibers")) {
109  stripQualityFlags += MeasurementTracker::MaskBad128StripBlocks;
110  }
111  }
112  if (pset_.getParameter<bool>("UseStripStripQualityDB")) {
113  stripQualityFlags += MeasurementTracker::BadStrips;
114  if (pset_.getUntrackedParameter<bool>("DebugStripStripQualityDB", false)) {
115  stripQualityDebugFlags += MeasurementTracker::BadStrips;
116  }
117  }
118 
119  if (stripQualityFlags != 0) {
120  std::string siStripQualityLabel = pset_.getParameter<std::string>("SiStripQualityLabel");
121  iRecord.getRecord<SiStripQualityRcd>().get(siStripQualityLabel, stripQuality);
122  ptr_stripQuality = stripQuality.product();
123  }
124 
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<TrackerDigiGeometryRecord>().get(trackerGeom);
136  iRecord.getRecord<TrackerRecoGeometryRecord>().get(geometricSearchTracker);
137 
138  if(phase2TrackerCPEName != ""){
139  iRecord.getRecord<TkStripCPERecord>().get(phase2TrackerCPEName,phase2TrackerCPE);
140  _measurementTracker = std::make_shared<MeasurementTrackerImpl>(pset_,
141  pixelCPE.product(),
142  stripCPE.product(),
143  hitMatcher.product(),
144  trackerGeom.product(),
145  geometricSearchTracker.product(),
146  ptr_stripQuality,
147  stripQualityFlags,
148  stripQualityDebugFlags,
149  ptr_pixelQuality,
150  ptr_pixelCabling,
151  pixelQualityFlags,
152  pixelQualityDebugFlags,
153  phase2TrackerCPE.product());
154  } else {
155  _measurementTracker = std::make_shared<MeasurementTrackerImpl>(pset_,
156  pixelCPE.product(),
157  stripCPE.product(),
158  hitMatcher.product(),
159  trackerGeom.product(),
160  geometricSearchTracker.product(),
161  ptr_stripQuality,
162  stripQualityFlags,
163  stripQualityDebugFlags,
164  ptr_pixelQuality,
165  ptr_pixelCabling,
166  pixelQualityFlags,
167  pixelQualityDebugFlags);
168  }
169  return _measurementTracker;
170 }
171 
172 
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::shared_ptr< MeasurementTracker > produce(const CkfComponentsRecord &)
HLT enums.
T const * product() const
Definition: ESHandle.h:86
MeasurementTrackerESProducer(const edm::ParameterSet &p)