22 edm::LogInfo(
"SiStripQualityChecker") <<
" Creating SiStripQualityChecker "
25 SubDetFolderMap.emplace(
"TIB",
"TIB");
26 SubDetFolderMap.emplace(
"TOB",
"TOB");
27 SubDetFolderMap.emplace(
"TECF",
"TEC/PLUS");
28 SubDetFolderMap.emplace(
"TECB",
"TEC/MINUS");
29 SubDetFolderMap.emplace(
"TIDF",
"TID/PLUS");
30 SubDetFolderMap.emplace(
"TIDB",
"TID/MINUS");
34 edm::LogInfo(
"SiStripQualityChecker") <<
" Deleting SiStripQualityChecker "
47 if (strip_dir.empty())
48 strip_dir =
"SiStrip";
55 hname =
"detFractionReportMap";
56 htitle =
"SiStrip Report for Good Detector Fraction";
61 hname =
"detFractionReportMap_hasBadChan";
62 htitle =
"SiStrip Report for Good Detector Fraction due to bad channels";
66 hname =
"detFractionReportMap_hasTooManyDigis";
67 htitle =
"SiStrip Report for Good Detector Fraction due to too many digis";
71 hname =
"detFractionReportMap_hasTooManyClu";
72 htitle =
"SiStrip Report for Good Detector Fraction due to too many clusters";
76 hname =
"detFractionReportMap_hasExclFed";
77 htitle =
"SiStrip Report for Good Detector Fraction due to excluded FEDs";
81 hname =
"detFractionReportMap_hasDcsErr";
82 htitle =
"SiStrip Report for Good Detector Fraction due to DCS errors";
87 hname =
"sToNReportMap";
88 htitle =
"SiStrip Report for Signal-to-Noise";
96 hname =
"reportSummaryMap";
97 htitle =
"SiStrip Report Summary Map";
121 else if (det ==
"TECB")
123 else if (det ==
"TIDF")
125 else if (det ==
"TIDB")
131 me_name =
"SiStrip_" + det;
134 me_name =
"SiStrip_DetFraction_" + det;
137 me_name =
"SiStrip_SToNFlag_" + det;
139 SubDetMEsMap.insert(std::pair<std::string, SubDetMEs>(det, local_mes));
148 auto& local_mes =
pr.second;
149 local_mes.SummaryFlag->Fill(-1.0);
150 local_mes.DetFraction->Fill(-1.0);
151 local_mes.SToNFlag->Fill(-1.0);
175 auto& local_mes =
pr.second;
176 local_mes.DetFraction->Reset();
177 local_mes.SummaryFlag->Reset();
178 local_mes.SToNFlag->Reset();
209 if (faulty_moduleflag)
216 unsigned int xbin = 0;
217 float global_flag = 0;
238 global_flag = global_flag / xbin * 1.0;
255 auto const subDirVec = dqm_store.
getSubdirs();
257 unsigned int ybin = 0;
260 float tot_ston_stat = 0;
262 for (
auto const&
dname : subDirVec) {
263 if (
dname.find(
"BadModuleList") != std::string::npos)
265 if (
dname.find(
"ring") != std::string::npos)
267 std::vector<MonitorElement*> meVec;
274 int errdet_hasBadChan = 0;
275 int errdet_hasTooManyDigis = 0;
276 int errdet_hasTooManyClu = 0;
277 int errdet_hasExclFed = 0;
278 int errdet_hasDcsErr = 0;
281 int lnum = atoi(
dname.substr(
dname.find_last_of(
"_") + 1).c_str());
288 errdet_hasTooManyDigis,
289 errdet_hasTooManyClu,
293 for (
auto const*
me : meVec) {
296 std::vector<QReport*> reports =
me->getQReports();
302 if (
name.find(
"Summary_ClusterStoNCorr__OnTrack") != std::string::npos) {
304 if (reports[0]->getQTresult() == -1) {
315 float eff_fac = 1 - (errdet * 1.0 / ndet);
316 float eff_fac_hasBadChan = 1 - (errdet_hasBadChan * 1.0 / ndet);
317 float eff_fac_hasTooManyDigis = 1 - (errdet_hasTooManyDigis * 1.0 / ndet);
318 float eff_fac_hasTooManyClu = 1 - (errdet_hasTooManyClu * 1.0 / ndet);
319 float eff_fac_hasExclFed = 1 - (errdet_hasExclFed * 1.0 / ndet);
320 float eff_fac_hasDcsErr = 1 - (errdet_hasDcsErr * 1.0 / ndet);
334 tot_errdet += errdet;
335 tot_ston_stat += ston_stat;
340 float tot_eff_fac = 1 - (tot_errdet * 1.0 / tot_ndet);
343 float tot_ston_fac = tot_ston_stat / ybin;
346 if (tot_ston_fac < 0) {
349 gflag =
std::min(tot_eff_fac, tot_ston_fac);
359 std::ostringstream det_summary_str;
362 det_summary_str << std::setprecision(4);
365 det_summary_str <<
" Printing Status for " << det <<
" : " << std::endl;
369 float fval1, fval2, fval3;
370 fval1 = fval2 = fval3 = -1.0;
374 fval1 = atof(sval.c_str());
377 fval2 = atof(sval.c_str());
380 fval3 = atof(sval.c_str());
382 det_summary_str << std::setw(7) <<
" % of good detectors " << fval1 <<
" SToN Flag " << fval2
383 <<
" Summary Flag " << fval3 << std::endl;
390 std::vector<MonitorElement*>& layer_mes,
392 int& errdet_hasBadChan,
393 int& errdet_hasTooManyDigis,
394 int& errdet_hasTooManyClu,
395 int& errdet_hasExclFed,
396 int& errdet_hasDcsErr) {
398 std::map<uint32_t, uint16_t> bad_modules;
399 for (std::vector<MonitorElement*>::const_iterator it = layer_mes.begin(); it != layer_mes.end(); it++) {
403 std::vector<QReport*> qreports =
me->getQReports();
404 if (qreports.empty())
407 std::vector<DQMChannel> bad_channels_me;
409 bad_channels_me = qreports[0]->getBadChannels();
412 bad_channels_me = qreports[0]->getBadChannels();
413 lname =
name.substr(
name.find(
"TkHMap_") + 7);
414 lname = lname.substr(lname.find(
"_T") + 1);
416 for (std::vector<DQMChannel>::iterator it = bad_channels_me.begin(); it != bad_channels_me.end(); it++) {
417 int xval = (*it).getBinX();
418 int yval = (*it).getBinY();
420 std::map<uint32_t, uint16_t>::iterator iPos = bad_modules.find(detId);
422 if (iPos != bad_modules.end()) {
430 std::ostringstream detid_str;
434 std::string thisMEpath = currentdir.substr(0, currentdir.rfind(
"/")) +
"/BadModuleList/" + detid_str.str();
440 flag = atoi(val_str.c_str());
445 bad_modules.insert(std::pair<uint32_t, uint16_t>(detId,
flag));
449 for (std::map<uint32_t, uint16_t>::const_iterator it = bad_modules.begin(); it != bad_modules.end(); it++) {
450 uint32_t detId = it->first;
451 uint16_t
flag = it->second;
452 if (((
flag >> 0) & 0
x1) > 0)
454 if (((
flag >> 1) & 0
x1) > 0)
455 errdet_hasTooManyDigis++;
456 if (((
flag >> 2) & 0
x1) > 0)
457 errdet_hasTooManyClu++;
458 if (((
flag >> 3) & 0
x1) > 0)
460 if (((
flag >> 4) & 0
x1) > 0)
462 std::map<uint32_t, uint16_t>::iterator iPos =
badModuleList.find(detId);
469 errdet = bad_modules.size();
479 auto th2d =
me->getTH2F();
480 th2d->SetBinContent(xbin, ybin,
val);
505 if (!dqm_store.
dirExists(subdet_folder)) {
506 subdet_folder = mechanical_dir + subdet_folder.substr(subdet_folder.find(
"MechanicalView") + 14);
510 std::string bad_module_folder = subdet_folder +
"/" +
"BadModuleList";
513 std::ostringstream detid_str;
515 std::string full_path = bad_module_folder +
"/" + detid_str.str();
552 TH1F* th1 =
me->getTH1F();
553 float global_fraction = 0.0;
555 for (
int ibin = 1; ibin <= th1->GetNbinsX(); ibin++) {
559 float fraction = 1.0 - th1->GetBinContent(ibin);
562 iPos->second.DetFraction->Fill(
fraction);
563 iPos->second.SToNFlag->Fill(-1.0);
564 iPos->second.SummaryFlag->Fill(
fraction);
567 global_fraction = global_fraction / dets;