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 
7 
13 
17 
20 
27 
30 
31 #include <string>
32 #include <memory>
33 
34 using namespace edm;
35 
37 {
38  std::string myname = p.getParameter<std::string>("ComponentName");
39  pset_ = p;
40  setWhatProduced(this,myname);
41 }
42 
44 
45 boost::shared_ptr<MeasurementTracker>
47 {
48  std::string pixelCPEName = pset_.getParameter<std::string>("PixelCPE");
49  std::string stripCPEName = pset_.getParameter<std::string>("StripCPE");
50  std::string matcherName = pset_.getParameter<std::string>("HitMatcher");
51  bool regional = pset_.getParameter<bool>("Regional");
52 
53  bool onDemand = pset_.getParameter<bool>("OnDemand");
54 
55  // ========= SiPixelQuality related tasks =============
56  const SiPixelQuality *ptr_pixelQuality = 0;
57  const SiPixelFedCabling *ptr_pixelCabling = 0;
58  int pixelQualityFlags = 0;
59  int pixelQualityDebugFlags = 0;
60  edm::ESHandle<SiPixelQuality> pixelQuality;
62 
63  if (pset_.getParameter<bool>("UsePixelModuleQualityDB")) {
64  pixelQualityFlags += MeasurementTracker::BadModules;
65  if (pset_.getUntrackedParameter<bool>("DebugPixelModuleQualityDB", false)) {
66  pixelQualityDebugFlags += MeasurementTracker::BadModules;
67  }
68  }
69  if (pset_.getParameter<bool>("UsePixelROCQualityDB")) {
70  pixelQualityFlags += MeasurementTracker::BadROCs;
71  if (pset_.getUntrackedParameter<bool>("DebugPixelROCQualityDB", false)) {
72  pixelQualityDebugFlags += MeasurementTracker::BadROCs;
73  }
74  }
75 
76 
77  if (pixelQualityFlags != 0) {
78  iRecord.getRecord<SiPixelQualityRcd>().get(pixelQuality);
79  ptr_pixelQuality = pixelQuality.product();
80  iRecord.getRecord<SiPixelFedCablingMapRcd>().get(pixelCabling);
81  ptr_pixelCabling = pixelCabling.product();
82  }
83 
84  // ========= SiStripQuality related tasks =============
85  const SiStripQuality *ptr_stripQuality = 0;
86  int stripQualityFlags = 0;
87  int stripQualityDebugFlags = 0;
88  edm::ESHandle<SiStripQuality> stripQuality;
89 
90  if (pset_.getParameter<bool>("UseStripModuleQualityDB")) {
91  stripQualityFlags += MeasurementTracker::BadModules;
92  if (pset_.getUntrackedParameter<bool>("DebugStripModuleQualityDB", false)) {
93  stripQualityDebugFlags += MeasurementTracker::BadModules;
94  }
95  }
96  if (pset_.getParameter<bool>("UseStripAPVFiberQualityDB")) {
97  stripQualityFlags += MeasurementTracker::BadAPVFibers;
98  if (pset_.getUntrackedParameter<bool>("DebugStripAPVFiberQualityDB", false)) {
99  stripQualityDebugFlags += MeasurementTracker::BadAPVFibers;
100  }
101  if (pset_.existsAs<bool>("MaskBadAPVFibers") && pset_.getParameter<bool>("MaskBadAPVFibers")) {
102  stripQualityFlags += MeasurementTracker::MaskBad128StripBlocks;
103  }
104  }
105  if (pset_.getParameter<bool>("UseStripStripQualityDB")) {
106  stripQualityFlags += MeasurementTracker::BadStrips;
107  if (pset_.getUntrackedParameter<bool>("DebugStripStripQualityDB", false)) {
108  stripQualityDebugFlags += MeasurementTracker::BadStrips;
109  }
110  }
111 
112  if (stripQualityFlags != 0) {
113  std::string siStripQualityLabel = pset_.getParameter<std::string>("SiStripQualityLabel");
114  iRecord.getRecord<SiStripQualityRcd>().get(siStripQualityLabel, stripQuality);
115  ptr_stripQuality = stripQuality.product();
116  }
117 
121  edm::ESHandle<TrackerGeometry> trackerGeom;
122  edm::ESHandle<GeometricSearchTracker> geometricSearchTracker;
123 
124 
125  iRecord.getRecord<TkPixelCPERecord>().get(pixelCPEName,pixelCPE);
126  iRecord.getRecord<TkStripCPERecord>().get(stripCPEName,stripCPE);
127  iRecord.getRecord<TkStripCPERecord>().get(matcherName,hitMatcher);
128  iRecord.getRecord<TrackerDigiGeometryRecord>().get(trackerGeom);
129  iRecord.getRecord<TrackerRecoGeometryRecord>().get(geometricSearchTracker);
130 
131  if (!onDemand){
132  _measurementTracker = boost::shared_ptr<MeasurementTracker>(new MeasurementTrackerImpl(pset_,
133  pixelCPE.product(),
134  stripCPE.product(),
135  hitMatcher.product(),
136  trackerGeom.product(),
137  geometricSearchTracker.product(),
138  ptr_stripQuality,
139  stripQualityFlags,
140  stripQualityDebugFlags,
141  ptr_pixelQuality,
142  ptr_pixelCabling,
143  pixelQualityFlags,
144  pixelQualityDebugFlags,
145  regional) );
146  }
147  else{
148  const SiStripRegionCabling * ptr_stripRegionCabling =0;
149  //get regional cabling
151  iRecord.getRecord<SiStripRegionCablingRcd>().get(rcabling);
152  ptr_stripRegionCabling = rcabling.product();
153 
154  _measurementTracker = boost::shared_ptr<MeasurementTracker>( new OnDemandMeasurementTracker(pset_,
155  pixelCPE.product(),
156  stripCPE.product(),
157  hitMatcher.product(),
158  trackerGeom.product(),
159  geometricSearchTracker.product(),
160  ptr_stripQuality,
161  stripQualityFlags,
162  stripQualityDebugFlags,
163  ptr_pixelQuality,
164  ptr_pixelCabling,
165  pixelQualityFlags,
166  pixelQualityDebugFlags,
167  ptr_stripRegionCabling,
168  regional) );
169 
170  }
171  return _measurementTracker;
172 }
173 
174 
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)