test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MeasurementTrackerESProducer.cc
Go to the documentation of this file.
2 
4 
9 
15 
19 
22 
27 
31 
32 #include <string>
33 #include <memory>
34 
35 using namespace edm;
36 
38 {
39  std::string myname = p.getParameter<std::string>("ComponentName");
40  pset_ = p;
41  setWhatProduced(this,myname);
42 }
43 
45 
46 boost::shared_ptr<MeasurementTracker>
48 {
49  std::string pixelCPEName = pset_.getParameter<std::string>("PixelCPE");
50  std::string stripCPEName = pset_.getParameter<std::string>("StripCPE");
51  std::string matcherName = pset_.getParameter<std::string>("HitMatcher");
52 
53  // ========= SiPixelQuality related tasks =============
54  const SiPixelQuality *ptr_pixelQuality = 0;
55  const SiPixelFedCabling *ptr_pixelCabling = 0;
56  int pixelQualityFlags = 0;
57  int pixelQualityDebugFlags = 0;
58  edm::ESHandle<SiPixelQuality> pixelQuality;
60 
61  if (pset_.getParameter<bool>("UsePixelModuleQualityDB")) {
62  pixelQualityFlags += MeasurementTracker::BadModules;
63  if (pset_.getUntrackedParameter<bool>("DebugPixelModuleQualityDB", false)) {
64  pixelQualityDebugFlags += MeasurementTracker::BadModules;
65  }
66  }
67  if (pset_.getParameter<bool>("UsePixelROCQualityDB")) {
68  pixelQualityFlags += MeasurementTracker::BadROCs;
69  if (pset_.getUntrackedParameter<bool>("DebugPixelROCQualityDB", false)) {
70  pixelQualityDebugFlags += MeasurementTracker::BadROCs;
71  }
72  }
73 
74 
75  if (pixelQualityFlags != 0) {
76  iRecord.getRecord<SiPixelQualityRcd>().get(pixelQuality);
77  ptr_pixelQuality = pixelQuality.product();
78  iRecord.getRecord<SiPixelFedCablingMapRcd>().get(pixelCabling);
79  ptr_pixelCabling = pixelCabling.product();
80  }
81 
82  // ========= SiStripQuality related tasks =============
83  const SiStripQuality *ptr_stripQuality = 0;
84  int stripQualityFlags = 0;
85  int stripQualityDebugFlags = 0;
86  edm::ESHandle<SiStripQuality> stripQuality;
87 
88  if (pset_.getParameter<bool>("UseStripModuleQualityDB")) {
89  stripQualityFlags += MeasurementTracker::BadModules;
90  if (pset_.getUntrackedParameter<bool>("DebugStripModuleQualityDB", false)) {
91  stripQualityDebugFlags += MeasurementTracker::BadModules;
92  }
93  }
94  if (pset_.getParameter<bool>("UseStripAPVFiberQualityDB")) {
95  stripQualityFlags += MeasurementTracker::BadAPVFibers;
96  if (pset_.getUntrackedParameter<bool>("DebugStripAPVFiberQualityDB", false)) {
97  stripQualityDebugFlags += MeasurementTracker::BadAPVFibers;
98  }
99  if (pset_.existsAs<bool>("MaskBadAPVFibers") && pset_.getParameter<bool>("MaskBadAPVFibers")) {
100  stripQualityFlags += MeasurementTracker::MaskBad128StripBlocks;
101  }
102  }
103  if (pset_.getParameter<bool>("UseStripStripQualityDB")) {
104  stripQualityFlags += MeasurementTracker::BadStrips;
105  if (pset_.getUntrackedParameter<bool>("DebugStripStripQualityDB", false)) {
106  stripQualityDebugFlags += MeasurementTracker::BadStrips;
107  }
108  }
109 
110  if (stripQualityFlags != 0) {
111  std::string siStripQualityLabel = pset_.getParameter<std::string>("SiStripQualityLabel");
112  iRecord.getRecord<SiStripQualityRcd>().get(siStripQualityLabel, stripQuality);
113  ptr_stripQuality = stripQuality.product();
114  }
115 
119  edm::ESHandle<TrackerGeometry> trackerGeom;
120  edm::ESHandle<GeometricSearchTracker> geometricSearchTracker;
121 
122 
123  iRecord.getRecord<TkPixelCPERecord>().get(pixelCPEName,pixelCPE);
124  iRecord.getRecord<TkStripCPERecord>().get(stripCPEName,stripCPE);
125  iRecord.getRecord<TkStripCPERecord>().get(matcherName,hitMatcher);
126  iRecord.getRecord<TrackerDigiGeometryRecord>().get(trackerGeom);
127  iRecord.getRecord<TrackerRecoGeometryRecord>().get(geometricSearchTracker);
128 
129  _measurementTracker = boost::shared_ptr<MeasurementTracker>(new MeasurementTrackerImpl(pset_,
130  pixelCPE.product(),
131  stripCPE.product(),
132  hitMatcher.product(),
133  trackerGeom.product(),
134  geometricSearchTracker.product(),
135  ptr_stripQuality,
136  stripQualityFlags,
137  stripQualityDebugFlags,
138  ptr_pixelQuality,
139  ptr_pixelCabling,
140  pixelQualityFlags,
141  pixelQualityDebugFlags) );
142  return _measurementTracker;
143 }
144 
145 
T getParameter(std::string const &) const
boost::shared_ptr< MeasurementTracker > produce(const CkfComponentsRecord &)
T const * product() const
Definition: ESHandle.h:62
MeasurementTrackerESProducer(const edm::ParameterSet &p)