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  if (onDemand != regional) throw cms::Exception("Configuration") << "Currently OnDemand and Regional must have the same values.\n";
56 
57  // ========= SiPixelQuality related tasks =============
58  const SiPixelQuality *ptr_pixelQuality = 0;
59  const SiPixelFedCabling *ptr_pixelCabling = 0;
60  int pixelQualityFlags = 0;
61  int pixelQualityDebugFlags = 0;
62  edm::ESHandle<SiPixelQuality> pixelQuality;
64 
65  if (pset_.getParameter<bool>("UsePixelModuleQualityDB")) {
66  pixelQualityFlags += MeasurementTracker::BadModules;
67  if (pset_.getUntrackedParameter<bool>("DebugPixelModuleQualityDB", false)) {
68  pixelQualityDebugFlags += MeasurementTracker::BadModules;
69  }
70  }
71  if (pset_.getParameter<bool>("UsePixelROCQualityDB")) {
72  pixelQualityFlags += MeasurementTracker::BadROCs;
73  if (pset_.getUntrackedParameter<bool>("DebugPixelROCQualityDB", false)) {
74  pixelQualityDebugFlags += MeasurementTracker::BadROCs;
75  }
76  }
77 
78 
79  if (pixelQualityFlags != 0) {
80  iRecord.getRecord<SiPixelQualityRcd>().get(pixelQuality);
81  ptr_pixelQuality = pixelQuality.product();
82  iRecord.getRecord<SiPixelFedCablingMapRcd>().get(pixelCabling);
83  ptr_pixelCabling = pixelCabling.product();
84  }
85 
86  // ========= SiStripQuality related tasks =============
87  const SiStripQuality *ptr_stripQuality = 0;
88  int stripQualityFlags = 0;
89  int stripQualityDebugFlags = 0;
90  edm::ESHandle<SiStripQuality> stripQuality;
91 
92  if (pset_.getParameter<bool>("UseStripModuleQualityDB")) {
93  stripQualityFlags += MeasurementTracker::BadModules;
94  if (pset_.getUntrackedParameter<bool>("DebugStripModuleQualityDB", false)) {
95  stripQualityDebugFlags += MeasurementTracker::BadModules;
96  }
97  }
98  if (pset_.getParameter<bool>("UseStripAPVFiberQualityDB")) {
99  stripQualityFlags += MeasurementTracker::BadAPVFibers;
100  if (pset_.getUntrackedParameter<bool>("DebugStripAPVFiberQualityDB", false)) {
101  stripQualityDebugFlags += MeasurementTracker::BadAPVFibers;
102  }
103  if (pset_.existsAs<bool>("MaskBadAPVFibers") && pset_.getParameter<bool>("MaskBadAPVFibers")) {
104  stripQualityFlags += MeasurementTracker::MaskBad128StripBlocks;
105  }
106  }
107  if (pset_.getParameter<bool>("UseStripStripQualityDB")) {
108  stripQualityFlags += MeasurementTracker::BadStrips;
109  if (pset_.getUntrackedParameter<bool>("DebugStripStripQualityDB", false)) {
110  stripQualityDebugFlags += MeasurementTracker::BadStrips;
111  }
112  }
113 
114  if (stripQualityFlags != 0) {
115  std::string siStripQualityLabel = pset_.getParameter<std::string>("SiStripQualityLabel");
116  iRecord.getRecord<SiStripQualityRcd>().get(siStripQualityLabel, stripQuality);
117  ptr_stripQuality = stripQuality.product();
118  }
119 
123  edm::ESHandle<TrackerGeometry> trackerGeom;
124  edm::ESHandle<GeometricSearchTracker> geometricSearchTracker;
125 
126 
127  iRecord.getRecord<TkPixelCPERecord>().get(pixelCPEName,pixelCPE);
128  iRecord.getRecord<TkStripCPERecord>().get(stripCPEName,stripCPE);
129  iRecord.getRecord<TkStripCPERecord>().get(matcherName,hitMatcher);
130  iRecord.getRecord<TrackerDigiGeometryRecord>().get(trackerGeom);
131  iRecord.getRecord<TrackerRecoGeometryRecord>().get(geometricSearchTracker);
132 
133  if (!onDemand){
134  _measurementTracker = boost::shared_ptr<MeasurementTracker>(new MeasurementTrackerImpl(pset_,
135  pixelCPE.product(),
136  stripCPE.product(),
137  hitMatcher.product(),
138  trackerGeom.product(),
139  geometricSearchTracker.product(),
140  ptr_stripQuality,
141  stripQualityFlags,
142  stripQualityDebugFlags,
143  ptr_pixelQuality,
144  ptr_pixelCabling,
145  pixelQualityFlags,
146  pixelQualityDebugFlags,
147  regional) );
148  }
149  else{
150  const SiStripRegionCabling * ptr_stripRegionCabling =0;
151  //get regional cabling
153  iRecord.getRecord<SiStripRegionCablingRcd>().get(rcabling);
154  ptr_stripRegionCabling = rcabling.product();
155 
156  _measurementTracker = boost::shared_ptr<MeasurementTracker>( new OnDemandMeasurementTracker(pset_,
157  pixelCPE.product(),
158  stripCPE.product(),
159  hitMatcher.product(),
160  trackerGeom.product(),
161  geometricSearchTracker.product(),
162  ptr_stripQuality,
163  stripQualityFlags,
164  stripQualityDebugFlags,
165  ptr_pixelQuality,
166  ptr_pixelCabling,
167  pixelQualityFlags,
168  pixelQualityDebugFlags,
169  ptr_stripRegionCabling,
170  regional) );
171 
172  }
173  return _measurementTracker;
174 }
175 
176 
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)