CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SiStripTrackerMapCreator.cc
Go to the documentation of this file.
8 
10 
13 
19 
20 #include <iostream>
21 
23  const TkDetMap* tkDetMap,
24  const TrackerTopology* tTopo)
25  : detCabling_(detCabling), tkDetMap_(tkDetMap), tTopo_(tTopo) {}
26 
27 //
28 // -- Create Geometric and Fed Tracker Map
29 //
31  DQMStore& dqm_store,
32  std::string const& map_type) {
33  const SiStripFedCabling* fedcabling = detCabling_->fedCabling();
34 
35  if (!fedcabling)
36  return;
37 
38  trackerMap_ = std::make_unique<TrackerMap>(tkmapPset, fedcabling, tTopo_);
39  std::string tmap_title = " Tracker Map from " + map_type;
40  trackerMap_->setTitle(tmap_title);
41 
42  nDet_ = 0;
43  tkMapMax_ = 0.0;
44  tkMapMin_ = 0.0;
45  meanToMaxFactor_ = 2.5;
46  stripTopLevelDir_ = "SiStrip";
47 
48  if (map_type == "QTestAlarm") {
49  setTkMapFromAlarm(dqm_store, nullptr);
50  } else {
51  trackerMap_->fill_all_blank();
52  setTkMapFromHistogram(dqm_store, map_type);
53  setTkMapRange(map_type);
54  }
55  trackerMap_->printonline();
56  trackerMap_.reset();
57 }
58 
60  DQMStore& dqm_store,
61  std::string& map_type,
62  const SiStripQuality* stripQuality) {
63  // Determine the strip top level dirctory in the DQM file: it is the
64  // path where MechanicalView is minus one directory
65  std::string const mdir{"MechanicalView"};
66  dqm_store.cd();
67  if (!SiStripUtility::goToDir(dqm_store, mdir)) {
68  edm::LogError("SiStripTopLevelDirNotFound") << "I cannot find the SiStrip top level directory in the DQM file";
69  } else {
70  const std::string& mechanicalview_dir = dqm_store.pwd();
71  stripTopLevelDir_ = mechanicalview_dir.substr(0, mechanicalview_dir.find_last_of('/'));
72  edm::LogInfo("SiStripTopLevelDirFound") << "SiStrip top level directory is " << stripTopLevelDir_;
73  }
74  dqm_store.cd();
75 
76  //
77  const SiStripFedCabling* fedcabling = detCabling_->fedCabling();
78 
79  if (!fedcabling)
80  return;
81 
82  trackerMap_ = std::make_unique<TrackerMap>(tkmapPset, fedcabling, tTopo_);
83 
84  meanToMaxFactor_ = tkmapPset.getUntrackedParameter<double>("meanToMaxFact", 2.5);
85  bool tkMapPSU = tkmapPset.getUntrackedParameter<bool>("psuMap", false);
86  bool tkMapFED = tkmapPset.getUntrackedParameter<bool>("fedMap", false);
87  std::string namesuffix = tkmapPset.getUntrackedParameter<std::string>("mapSuffix", "");
88 
89  // std::string tmap_title = " Tracker Map from " + map_type;
90  unsigned int runNumber_ = tkmapPset.getUntrackedParameter<unsigned int>("RunNumber", 1);
91  std::stringstream ss;
92  ss << runNumber_;
93  sRunNumber = ss.str();
94  std::cout << sRunNumber << "\n\n\n\n\n\n";
95  std::string tmap_title;
96  if (runNumber_ > 0) {
97  tmap_title = " Run: " + sRunNumber + ", Tracker Map from " + map_type;
98  } else {
99  tmap_title = " Tracker Map from " + map_type;
100  }
101  trackerMap_->setTitle(tmap_title);
102 
103  if (tkmapPset.exists("TopModules"))
104  topModules_ = tkmapPset.getUntrackedParameter<bool>("TopModules");
105  else
106  topModules_ = false;
107 
108  if (tkmapPset.exists("numberTopModules"))
109  numTopModules_ = tkmapPset.getUntrackedParameter<uint32_t>("numberTopModules");
110  else
111  numTopModules_ = 20;
112 
113  if (tkmapPset.exists("topModLabel"))
114  topModLabel_ = tkmapPset.getUntrackedParameter<int32_t>("topModLabel");
115  else
116  topModLabel_ = " top Modules " + map_type;
117 
118  if (map_type == "QTestAlarm") {
119  setTkMapFromAlarm(dqm_store, stripQuality);
120  } else {
121  setTkMapFromHistogram(dqm_store, map_type);
122  }
123  // if not overwitten by manual configuration min=0 and max= mean value * meanToMaxFactor_
125 
126  // check manual setting
127 
128  if (tkmapPset.exists("mapMax"))
129  tkMapMax_ = tkmapPset.getUntrackedParameter<double>("mapMax");
130  if (tkmapPset.exists("mapMin"))
131  tkMapMin_ = tkmapPset.getUntrackedParameter<double>("mapMin");
132 
133  if (map_type == "ResidualsMean") {
134  ResidualsRMS_ = false;
135  setTkMapFromHistogram(dqm_store, map_type);
136  edm::LogInfo("TkMapToBeSaved") << "Ready to save TkMap " << map_type << namesuffix << " with range set to "
137  << tkMapMin_ << " - " << tkMapMax_;
138  trackerMap_->save(true, 0.0000000001, 0.005, map_type + namesuffix + ".svg");
139  trackerMap_->save(true, 0.0000000001, 0.005, map_type + namesuffix + ".png", 4500, 2400);
140  ResidualsRMS_ = true;
141  map_type = "ResidualsRMS";
142  if (runNumber_ > 0) {
143  tmap_title = " Run: " + sRunNumber + ", Tracker Map from " + map_type;
144  } else {
145  tmap_title = " Tracker Map from " + map_type;
146  }
147  trackerMap_->setTitle(tmap_title);
148  setTkMapFromHistogram(dqm_store, map_type);
149  edm::LogInfo("TkMapToBeSaved") << "Ready to save TkMap " << map_type << namesuffix
150  << " with range set to 0.0 - 1.0";
151  trackerMap_->save(true, 0.0, 1.0, map_type + namesuffix + ".svg");
152  trackerMap_->save(true, 0.0, 1.0, map_type + namesuffix + ".png", 4500, 2400);
153  // reset the map name to ResidualsMean to restore the
154  // correct behaviour for the summary file creation
155  map_type = "ResidualsMean";
156  } else {
157  edm::LogInfo("TkMapToBeSaved") << "Ready to save TkMap " << map_type << namesuffix << " with range set to "
158  << tkMapMin_ << " - " << tkMapMax_;
159  trackerMap_->save(true, tkMapMin_, tkMapMax_, map_type + namesuffix + ".svg");
160  trackerMap_->save(true, tkMapMin_, tkMapMax_, map_type + namesuffix + ".png", 4500, 2400);
161  }
162 
163  if (tkMapPSU) {
164  edm::LogInfo("PSUMapToBeSaved") << "Ready to save PSU TkMap " << map_type << namesuffix << " with range set to "
165  << tkMapMin_ << " - " << tkMapMax_;
166  trackerMap_->save_as_psutrackermap(true, tkMapMin_, tkMapMax_, map_type + namesuffix + "_psu.png");
167  }
168 
169  if (tkMapFED) {
170  edm::LogInfo("FEDMapToBeSaved") << "Ready to save FED TkMap " << map_type << namesuffix << " with range set to "
171  << tkMapMin_ << " - " << tkMapMax_;
172  trackerMap_->save_as_fedtrackermap(true, tkMapMin_, tkMapMax_, map_type + namesuffix + "_fed.png");
173  }
174  trackerMap_.reset();
175 }
176 
177 //
178 // -- Fill Tracker Map with QTest Alarms and SiStripQuality bad modules
179 //
181  nDet_ = 0;
182  tkMapMax_ = 0.0;
183  tkMapMin_ = 0.0;
184 
185  trackerMap_->fillc_all_blank();
186 
187  std::map<unsigned int, std::string> badmodmap;
188 
189  // used to avoid multiple checks on the same detid since the loop is done on the FED channels
190  uint32_t detId_save = 0;
191  // example of loop using SiStripDetCabling
192  for (auto const& module : detCabling_->getDetCabling()) {
193  uint32_t detId = module.first;
194  if (detId == 0 || detId == 0xFFFFFFFF)
195  continue;
196  if (detId_save != detId) {
197  detId_save = detId;
198  bool isBad = stripQuality && stripQuality->IsModuleBad(detId);
199  paintTkMapFromAlarm(detId, dqm_store, isBad, badmodmap);
200  } else {
201  edm::LogWarning("TwiceTheSameDetId")
202  << "The detid " << detId << " was found already in the loop on SiStripDetCabling";
203  }
204  }
205  printBadModuleList(badmodmap);
206 }
207 //
208 //
209 // -- Paint Tracker Map with QTest Alarms
210 //
212  DQMStore& dqm_store,
213  bool const isBad,
214  std::map<unsigned int, std::string>& badmodmap) {
215  std::ostringstream comment;
216  uint16_t flag = 0;
217  flag = getDetectorFlagAndComment(&dqm_store, det_id, comment);
218 
219  int rval, gval, bval;
220  SiStripUtility::getDetectorStatusColor(flag, rval, gval, bval);
221  if (isBad) {
222  rval = 255;
223  gval = 255;
224  bval = 0;
225  comment << " PCLBadModule ";
226  }
227  trackerMap_->setText(det_id, comment.str());
228  trackerMap_->fillc(det_id, rval, gval, bval);
229 
230  if (flag != 0 || isBad) {
231  uint lay = tTopo_->layer(SiStripDetId(det_id));
232  std::string layer = " Layer " + std::to_string(lay);
233  badmodmap[det_id] = comment.str() + layer;
234  }
235 
236  detFlag_[det_id] = flag;
237 }
238 
239 //
240 // -- Paint Tracker Map from TkHistoMap Histograms
242  dqm_store.cd();
243 
244  std::string const mdir{"MechanicalView"};
245  if (!SiStripUtility::goToDir(dqm_store, mdir))
246  return;
247  std::string mechanicalview_dir = dqm_store.pwd();
248 
249  std::vector<std::string> subdet_folder;
250  subdet_folder.push_back("TIB");
251  subdet_folder.push_back("TOB");
252  subdet_folder.push_back("TEC/MINUS");
253  subdet_folder.push_back("TEC/PLUS");
254  subdet_folder.push_back("TID/MINUS");
255  subdet_folder.push_back("TID/PLUS");
256 
257  nDet_ = 0;
258  tkMapMax_ = 0.0;
259  tkMapMin_ = 0.0;
260 
261  auto topNmodVec = topModules_ ? new std::vector<std::pair<float, uint32_t>>{} : nullptr;
262  for (auto const& sd : subdet_folder) {
263  std::string dname = mechanicalview_dir + "/" + sd;
264  if (!dqm_store.dirExists(dname))
265  continue;
266  dqm_store.cd(dname);
267  std::vector<std::string> layerVec = dqm_store.getSubdirs();
268  for (auto const& layer : layerVec) {
269  if (layer.find("BadModuleList") != std::string::npos)
270  continue;
271  std::vector<MonitorElement*> meVec = dqm_store.getContents(layer);
272  MonitorElement* tkhmap_me{nullptr};
274  for (auto tkh : meVec) {
275  name = tkh->getName();
276  if (name.find("TkHMap") == std::string::npos)
277  continue;
278  if (htype == "QTestAlarm") {
279  edm::LogError("ItShouldNotBeHere") << "QTestAlarm map: you should not be here!";
280  tkhmap_me = tkh;
281  break;
282  } else if (name.find(htype) != std::string::npos) {
283  tkhmap_me = tkh;
284  break;
285  }
286  }
287  if (tkhmap_me != nullptr) {
288  paintTkMapFromHistogram(tkhmap_me, htype, topNmodVec);
289  }
290  }
291  dqm_store.cd(mechanicalview_dir);
292  }
293  dqm_store.cd();
294  if (topNmodVec)
295  printTopModules(*topNmodVec);
296 }
297 
299  std::string const& htype,
300  std::vector<std::pair<float, uint32_t>>* topNmodVec) {
301  const std::string& name = me->getName();
302  std::string lname = name.substr(name.find("TkHMap_") + 7);
303  lname = lname.substr(lname.find("_T") + 1);
304  for (DetId det_id : tkDetMap_->getDetsForLayer(TkDetMap::getLayerNum(lname))) {
305  if (det_id.rawId() <= 0)
306  continue;
307  nDet_++;
309  float fval = 0.0;
310  if (name.find("Residuals") != std::string::npos) {
311  if (ResidualsRMS_ == true) {
312  if (me->kind() == MonitorElement::Kind::TPROFILE2D) {
313  TProfile2D* tp = me->getTProfile2D();
314  float fval_prov =
315  tp->GetBinError(xyval.ix, xyval.iy) * sqrt(tp->GetBinEntries(tp->GetBin(xyval.ix, xyval.iy)));
316  fval = fval_prov;
317  }
318  } else {
319  float fval_prov = me->getBinContent(xyval.ix, xyval.iy);
320  fval = std::abs(fval_prov);
321  }
322  } else
323  fval = me->getBinContent(xyval.ix, xyval.iy);
324  if (htype == "QTestAlarm") {
325  edm::LogError("ItShouldNotBeHere") << "QTestAlarm map: you should not be here!";
326  } else {
327  if (fval == 0.0)
328  trackerMap_->fillc(det_id, 255, 255, 255);
329  else {
330  trackerMap_->fill_current_val(det_id, fval);
331  if (topNmodVec) {
332  topNmodVec->emplace_back(fval, det_id);
333  }
334  }
335  tkMapMax_ += fval;
336  }
337  }
338 }
339 //
340 // -- Get Flag and status Comment
341 //
343  uint32_t const det_id,
344  std::ostringstream& comment) {
345  comment << "Module " << det_id;
346  uint16_t flag = 0;
347 
348  // get FED channels corresponding to the det_id
349 
350  comment << " FEDCHs ";
351  constexpr std::size_t indent_width{7ull};
352  std::vector<const FedChannelConnection*> conns = detCabling_->getConnections(det_id);
353  for (auto const conn : conns) {
354  if (conn) {
355  comment << std::setw(3) << conn->fedId() << "/" << std::setw(2) << conn->fedCh() << " ";
356  } else {
357  comment << std::string(indent_width, ' ');
358  }
359  }
360  if (conns.empty()) {
361  comment << std::string(indent_width * 3, ' ');
362  } else if (conns.size() == 1) {
363  comment << std::string(indent_width * 2, ' ');
364  } else if (conns.size() == 2) {
365  comment << std::string(indent_width, ' ');
366  }
367 
368  if (!dqm_store)
369  return flag;
370 
372  std::string subdet_folder, badmodule_folder;
373 
374  dqm_store->cd();
375 
376  folder_organizer.setSiStripFolderName(stripTopLevelDir_);
377  folder_organizer.getSubDetFolder(det_id, tTopo_, subdet_folder);
378 
379  LogDebug("SearchBadModule") << det_id << " " << subdet_folder << " " << stripTopLevelDir_;
380 
381  if (dqm_store->dirExists(subdet_folder)) {
382  badmodule_folder = subdet_folder + "/BadModuleList";
383  LogDebug("SearchBadModule") << subdet_folder << " exists: " << badmodule_folder;
384  } else {
385  edm::LogError("SubDetFolderNotFound") << subdet_folder << " does not exist for detid " << det_id;
386  return flag;
387  }
388  if (!dqm_store->dirExists(badmodule_folder)) {
389  LogDebug("BadModuleFolderNotFound") << badmodule_folder << " does not exist for detid " << det_id;
390  return flag;
391  }
392  std::ostringstream badmodule_path;
393  badmodule_path << badmodule_folder << "/" << det_id;
394  LogDebug("SearchBadModule") << badmodule_folder << " exists: " << badmodule_path.str();
395 
396  auto const* bad_module_me = dqm_store->get(badmodule_path.str());
397  if (bad_module_me && bad_module_me->kind() == MonitorElement::Kind::INT) {
398  LogDebug("SearchBadModule") << "Monitor Element found";
399  flag = bad_module_me->getIntValue();
400  std::string message;
401  SiStripUtility::getBadModuleStatus(flag, message);
402  comment << message.c_str();
403  }
404  return flag;
405 }
406 //
407 // -- create branches for root file with tracker map values by detId and fill it
408 //
409 void SiStripTrackerMapCreator::createInfoFile(std::vector<std::string> const& map_names,
410  TTree* tkinfo_tree,
411  DQMStore& dqm_store,
412  const GeometricDet* geomDet) {
413  std::map<std::string, float> tkhmap_value;
414  int qtalarm_flag = 0;
415  uint32_t det_id = 0;
416 
417  if (!tkinfo_tree) {
418  edm::LogError("SiStripTrackerMapCreator::createInfoFile") << "Tree not found!";
419  } else {
420  tkinfo_tree->Branch("DetId", &det_id, "DetId/i");
421  for (auto const& mapname : map_names) {
422  if (mapname == "QTestAlarm") {
423  qtalarm_flag = 0;
424  tkinfo_tree->Branch(mapname.c_str(), &qtalarm_flag, std::string(mapname + "/I").c_str());
425  } else {
426  tkhmap_value[mapname] = -1.0;
427  tkinfo_tree->Branch(mapname.c_str(), &tkhmap_value[mapname], std::string(mapname + "/F").c_str());
428  }
429  }
430 
431  std::string dirname = "";
432 
433  std::string mdir = "MechanicalView";
434  dqm_store.cd();
435  if (!SiStripUtility::goToDir(dqm_store, mdir)) {
436  edm::LogError("SiStripTrackerMapCreator::createInfoFile")
437  << "I cannot find the SiStrip top level directory in the DQM file";
438  } else {
439  const std::string& mechanicalview_dir = dqm_store.pwd();
440  dirname = mechanicalview_dir.substr(0, mechanicalview_dir.find_last_of('/'));
441  edm::LogInfo("SiStripTrackerMapCreator::createInfoFile") << "SiStrip top level directory is " << dirname;
442  }
443  dqm_store.cd();
444 
445  std::vector<TkHistoMap> tkHMaps;
446 
447  uint32_t nHists = map_names.size();
448 
449  for (uint32_t ih = 0; ih < nHists; ++ih) {
450  tkHMaps.emplace_back(tkDetMap_);
451  if (map_names.at(ih) != "QTestAlarm") {
452  std::string tkhmap_name = "TkHMap_" + map_names.at(ih);
453  tkHMaps.at(ih).loadTkHistoMap(dirname, tkhmap_name, true);
454  }
455  }
456 
457  const auto detidList = TrackerGeometryUtils::getSiStripDetIds(*geomDet);
458  for (auto const id : detidList) {
459  det_id = id;
460  for (uint32_t ih = 0; ih < nHists; ++ih) {
461  if (map_names.at(ih) == "QTestAlarm") {
462  qtalarm_flag = getDetectorFlag(id);
463  } else {
464  tkhmap_value[map_names.at(ih)] = tkHMaps.at(ih).getValue(id);
465  }
466  }
467  if (!tkinfo_tree) {
468  edm::LogError("SiStripTrackerMapCreator::createInfoFile") << "Tree not found!";
469  } else {
470  tkinfo_tree->Fill();
471  }
472  }
473  }
474 }
475 
476 // DQMStore-explicit usages
477 
478 void SiStripTrackerMapCreator::printBadModuleList(std::map<unsigned int, std::string> const& badmodmap) {
479  // Retrieve tracker topology from geometry
480  bool tibDone = false, tidSide1Done = false, tidSide2Done = false, tobDone = false, tecSide1Done = false,
481  tecSide2Done = false;
482  constexpr unsigned int tibFirst = 369120277 - 1, tidSide1First = 402664197 - 1, tidSide2First = 402672389 - 1,
483  tobFirst = 436228134 - 1, tecSide1First = 470044965 - 1, tecSide2First = 470307109 - 1;
484 
485  int ntib = 0, ntids1 = 0, ntids2 = 0, ntob = 0, ntecs1 = 0, ntecs2 = 0;
486 
487  for (auto const& badmod : badmodmap) {
488  SiStripDetId ssdetid(badmod.first);
489  if (ssdetid.subDetector() == SiStripDetId::TIB)
490  ntib++;
491  if (ssdetid.subDetector() == SiStripDetId::TID) {
492  if (tTopo_->tidSide(ssdetid) == 1)
493  ntids1++;
494  if (tTopo_->tidSide(ssdetid) == 2)
495  ntids2++;
496  }
497  if (ssdetid.subDetector() == SiStripDetId::TOB)
498  ntob++;
499  if (ssdetid.subDetector() == SiStripDetId::TEC) {
500  if (tTopo_->tecSide(ssdetid) == 1)
501  ntecs1++;
502  if (tTopo_->tecSide(ssdetid) == 2)
503  ntecs2++;
504  }
505  }
506 
507  edm::LogVerbatim("BadModuleList") << "Run: " << sRunNumber << ", Number of bad modules in total:";
508  edm::LogVerbatim("BadModuleList") << "--------------------------------------------------------------";
509  edm::LogVerbatim("BadModuleList") << "TIB: " << ntib;
510  edm::LogVerbatim("BadModuleList") << "TID/MINUS: " << ntids1;
511  edm::LogVerbatim("BadModuleList") << "TID/PLUS: " << ntids2;
512  edm::LogVerbatim("BadModuleList") << "TOB: " << ntob;
513  edm::LogVerbatim("BadModuleList") << "TEC/MINUS: " << ntecs1;
514  edm::LogVerbatim("BadModuleList") << "TEC/PLUS: " << ntecs2;
515  edm::LogVerbatim("BadModuleList") << "-------------------------------";
516  edm::LogVerbatim("BadModuleList");
517  edm::LogVerbatim("BadModuleList") << "List of bad modules per partition:";
518  edm::LogVerbatim("BadModuleList") << "----------------------------------";
519 
520  for (auto const& badmod : badmodmap) {
521  if (!tibDone && badmod.first >= tibFirst) {
522  tibDone = true;
523  edm::LogVerbatim("BadModuleList");
524  edm::LogVerbatim("BadModuleList") << "SubDetector TIB";
525  edm::LogVerbatim("BadModuleList");
526  }
527  if (!tidSide1Done && badmod.first >= tidSide1First) {
528  tidSide1Done = true;
529  edm::LogVerbatim("BadModuleList");
530  edm::LogVerbatim("BadModuleList") << "SubDetector TID/MINUS";
531  edm::LogVerbatim("BadModuleList");
532  }
533  if (!tidSide2Done && badmod.first >= tidSide2First) {
534  tidSide2Done = true;
535  edm::LogVerbatim("BadModuleList");
536  edm::LogVerbatim("BadModuleList") << "SubDetector TID/PLUS";
537  edm::LogVerbatim("BadModuleList");
538  }
539  if (!tobDone && badmod.first >= tobFirst) {
540  tobDone = true;
541  edm::LogVerbatim("BadModuleList");
542  edm::LogVerbatim("BadModuleList") << "SubDetector TOB";
543  edm::LogVerbatim("BadModuleList");
544  }
545  if (!tecSide1Done && badmod.first >= tecSide1First) {
546  tecSide1Done = true;
547  edm::LogVerbatim("BadModuleList");
548  edm::LogVerbatim("BadModuleList") << "SubDetector TEC/MINUS";
549  edm::LogVerbatim("BadModuleList");
550  }
551  if (!tecSide2Done && badmod.first >= tecSide2First) {
552  tecSide2Done = true;
553  edm::LogVerbatim("BadModuleList");
554  edm::LogVerbatim("BadModuleList") << "SubDetector TEC/PLUS";
555  edm::LogVerbatim("BadModuleList");
556  }
557  edm::LogVerbatim("BadModuleList") << badmod.second;
558  }
559 }
560 
561 void SiStripTrackerMapCreator::printTopModules(std::vector<std::pair<float, uint32_t>>& topNmodVec) {
562  if (topNmodVec.empty())
563  return;
564 
565  std::sort(topNmodVec.rbegin(), topNmodVec.rend());
566  if (topNmodVec.size() > numTopModules_)
567  topNmodVec.resize(numTopModules_);
568 
569  edm::LogVerbatim("TopModules") << topModLabel_;
570  edm::LogVerbatim("TopModules") << "------------------------------------------------------";
571 
572  for (auto const& aPair : topNmodVec) {
573  uint32_t det_id = aPair.second;
574  std::ostringstream comment;
576  SiStripDetId ssdetid(aPair.second);
577  if (ssdetid.subDetector() == SiStripDetId::TIB)
578  subdetector = "TIB ";
579  if (ssdetid.subDetector() == SiStripDetId::TID) {
580  if (tTopo_->tidSide(ssdetid) == 1)
581  subdetector = "TID/MINUS ";
582  if (tTopo_->tidSide(ssdetid) == 2)
583  subdetector = "TID/PLUS ";
584  }
585  if (ssdetid.subDetector() == SiStripDetId::TOB)
586  subdetector = "TOB ";
587  if (ssdetid.subDetector() == SiStripDetId::TEC) {
588  if (tTopo_->tecSide(ssdetid) == 1)
589  subdetector = "TEC/MINUS ";
590  if (tTopo_->tecSide(ssdetid) == 2)
591  subdetector = "TEC/PLUS ";
592  }
593  uint16_t flag = getDetectorFlagAndComment(nullptr, det_id, comment);
594  if (flag == 0)
595  edm::LogVerbatim("TopModules") << subdetector << comment.str() << " value: " << aPair.first;
596  }
597  edm::LogVerbatim("TopModules") << "------------------------------------------------------";
598 }
599 
600 //
601 // -- Get Tracker Map Fill Range
602 //
604  tkMapMin_ = 0.0;
605  if (tkMapMax_ == 0.0) {
606  if (map_type.find("FractionOfBadChannels") != std::string::npos)
607  tkMapMax_ = 1.0;
608  else if (map_type.find("NumberOfCluster") != std::string::npos)
609  tkMapMax_ = 0.01;
610  else if (map_type.find("NumberOfDigi") != std::string::npos)
611  tkMapMax_ = 0.6;
612  else if (map_type.find("NumberOfOffTrackCluster") != std::string::npos)
613  tkMapMax_ = 100.0;
614  else if (map_type.find("NumberOfOnTrackCluster") != std::string::npos)
615  tkMapMax_ = 50.0;
616  else if (map_type.find("StoNCorrOnTrack") != std::string::npos)
617  tkMapMax_ = 200.0;
618  } else {
619  tkMapMax_ = tkMapMax_ / nDet_ * 1.0;
621  }
622  trackerMap_->setRange(tkMapMin_, tkMapMax_);
623 }
624 
626  tkMapMin_ = 0.0;
627  if (tkMapMax_ != 0.0) {
628  tkMapMax_ = tkMapMax_ / (nDet_ * 1.0);
630  }
631 }
static const char runNumber_[]
void paintTkMapFromAlarm(uint32_t det_id, DQMStore &dqm_store, bool isBad, std::map< unsigned int, std::string > &badmodmap)
Log< level::Info, true > LogVerbatim
std::unique_ptr< TrackerMap > trackerMap_
void printBadModuleList(std::map< unsigned int, std::string > const &badmodmap)
const std::map< uint32_t, std::vector< const FedChannelConnection * > > & getDetCabling() const
void setSiStripFolderName(std::string name)
uint16_t getDetectorFlag(uint32_t const det_id)
void getSubDetFolder(const uint32_t &detid, const TrackerTopology *tTopo, std::string &folder_name)
uint16_t *__restrict__ id
void printTopModules(std::vector< std::pair< float, uint32_t >> &topNmodVec)
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
Definition: DQMStore.cc:700
static constexpr auto TID
Definition: SiStripDetId.h:38
TString subdetector
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:593
static void getDetectorStatusColor(int status, int &rval, int &gval, int &bval)
Kind kind() const
Get the type of the monitor element.
const std::string & getName() const
get name of ME
std::string to_string(const V &value)
Definition: OMSAccess.h:71
virtual bool dirExists(std::string const &path) const
Definition: DQMStore.cc:730
std::string pwd() override
Definition: DQMStore.h:644
void paintTkMapFromHistogram(MonitorElement const *me, std::string const &map_type, std::vector< std::pair< float, uint32_t >> *topNmodVec)
Log< level::Error, false > LogError
static void getBadModuleStatus(uint16_t flag, std::string &message)
std::vector< DetId > getDetsForLayer(int layer) const
Definition: TkDetMap.h:196
const SiStripDetCabling * detCabling_
constexpr std::array< uint8_t, layerIndexSize > layer
void createForOffline(edm::ParameterSet const &tkmapPset, DQMStore &dqm_store, std::string &htype, const SiStripQuality *)
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
static int getLayerNum(const std::string &in)
Definition: TkDetMap.cc:311
unsigned int tidSide(const DetId &id) const
void create(edm::ParameterSet const &tkmapPset, DQMStore &dqm_store, std::string const &htype)
T sqrt(T t)
Definition: SSEVec.h:19
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
std::vector< uint32_t > getSiStripDetIds(const GeometricDet &geomDet)
Definition: utils.cc:5
void createInfoFile(std::vector< std::string > const &map_names, TTree *tkinfo_tree, DQMStore &dqm_store, const GeometricDet *geomDet)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
SiStripTrackerMapCreator(const SiStripDetCabling *detCabling, const TkDetMap *tkDetMap, const TrackerTopology *tTopo)
virtual double getBinContent(int binx) const
get content of bin (1-D)
static constexpr auto TOB
Definition: SiStripDetId.h:39
virtual TProfile2D * getTProfile2D() const
const SiStripFedCabling * fedCabling() const
Log< level::Info, false > LogInfo
Detector identifier class for the strip tracker.
Definition: SiStripDetId.h:18
SubDetector subDetector() const
Definition: SiStripDetId.h:105
Definition: DetId.h:17
double sd
void setTkMapRange(std::string const &map_type)
SiStripFolderOrganizer folder_organizer
bool IsModuleBad(uint32_t detid) const
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
static constexpr auto TIB
Definition: SiStripDetId.h:37
unsigned int layer(const DetId &id) const
std::map< uint32_t, uint16_t > detFlag_
static bool goToDir(DQMStore &dqm_store, std::string const &name)
tuple conn
Definition: getInfo.py:9
void setTkMapFromHistogram(DQMStore &dqm_store, std::string const &htype)
tuple cout
Definition: gather_cfg.py:144
const TkLayerMap::XYbin & getXY(DetId detid, DetId &cached_detid, int16_t &cached_layer, TkLayerMap::XYbin &cached_XYbin) const
Definition: TkDetMap.cc:548
Log< level::Warning, false > LogWarning
const TrackerTopology * tTopo_
void setTkMapFromAlarm(DQMStore &dqm_store, const SiStripQuality *stripQuality)
static constexpr auto TEC
Definition: SiStripDetId.h:40
uint16_t getDetectorFlagAndComment(DQMStore *dqm_store, uint32_t det_id, std::ostringstream &comment)
tuple module
Definition: callgraph.py:69
unsigned int tecSide(const DetId &id) const
#define LogDebug(id)