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();
208 if (faulty_moduleflag)
215 unsigned int xbin = 0;
216 float global_flag = 0;
237 global_flag = global_flag / xbin * 1.0;
251 auto const subDirVec = dqm_store.
getSubdirs();
253 unsigned int ybin = 0;
256 float tot_ston_stat = 0;
258 for (
auto const&
dname : subDirVec) {
259 if (
dname.find(
"BadModuleList") != std::string::npos)
261 if (
dname.find(
"ring") != std::string::npos)
263 std::vector<MonitorElement*> meVec;
270 int errdet_hasBadChan = 0;
271 int errdet_hasTooManyDigis = 0;
272 int errdet_hasTooManyClu = 0;
273 int errdet_hasExclFed = 0;
274 int errdet_hasDcsErr = 0;
277 int lnum = atoi(
dname.substr(
dname.find_last_of(
'_') + 1).c_str());
284 errdet_hasTooManyDigis,
285 errdet_hasTooManyClu,
289 for (
auto const*
me : meVec) {
292 std::vector<QReport*> reports =
me->getQReports();
298 if (
name.find(
"Summary_ClusterStoNCorr__OnTrack") != std::string::npos) {
300 if (reports[0]->getQTresult() == -1) {
311 float eff_fac = 1 - (errdet * 1.0 / ndet);
312 float eff_fac_hasBadChan = 1 - (errdet_hasBadChan * 1.0 / ndet);
313 float eff_fac_hasTooManyDigis = 1 - (errdet_hasTooManyDigis * 1.0 / ndet);
314 float eff_fac_hasTooManyClu = 1 - (errdet_hasTooManyClu * 1.0 / ndet);
315 float eff_fac_hasExclFed = 1 - (errdet_hasExclFed * 1.0 / ndet);
316 float eff_fac_hasDcsErr = 1 - (errdet_hasDcsErr * 1.0 / ndet);
330 tot_errdet += errdet;
331 tot_ston_stat += ston_stat;
336 float tot_eff_fac = 1 - (tot_errdet * 1.0 / tot_ndet);
339 float tot_ston_fac = tot_ston_stat / ybin;
342 if (tot_ston_fac < 0) {
345 gflag =
std::min(tot_eff_fac, tot_ston_fac);
355 std::ostringstream det_summary_str;
358 det_summary_str << std::setprecision(4);
361 det_summary_str <<
" Printing Status for " << det <<
" : " << std::endl;
365 float fval1, fval2, fval3;
366 fval1 = fval2 = fval3 = -1.0;
370 fval1 = atof(sval.c_str());
373 fval2 = atof(sval.c_str());
376 fval3 = atof(sval.c_str());
378 det_summary_str << std::setw(7) <<
" % of good detectors " << fval1 <<
" SToN Flag " << fval2
379 <<
" Summary Flag " << fval3 << std::endl;
386 std::vector<MonitorElement*>& layer_mes,
388 int& errdet_hasBadChan,
389 int& errdet_hasTooManyDigis,
390 int& errdet_hasTooManyClu,
391 int& errdet_hasExclFed,
392 int& errdet_hasDcsErr) {
394 std::map<uint32_t, uint16_t> bad_modules;
395 for (std::vector<MonitorElement*>::const_iterator it = layer_mes.begin(); it != layer_mes.end(); it++) {
399 std::vector<QReport*> qreports =
me->getQReports();
400 if (qreports.empty())
403 std::vector<DQMChannel> bad_channels_me;
405 bad_channels_me = qreports[0]->getBadChannels();
408 bad_channels_me = qreports[0]->getBadChannels();
409 lname =
name.substr(
name.find(
"TkHMap_") + 7);
410 lname = lname.substr(lname.find(
"_T") + 1);
412 for (std::vector<DQMChannel>::iterator it = bad_channels_me.begin(); it != bad_channels_me.end(); it++) {
413 int xval = (*it).getBinX();
414 int yval = (*it).getBinY();
416 std::map<uint32_t, uint16_t>::iterator iPos = bad_modules.find(detId);
418 if (iPos != bad_modules.end()) {
426 std::ostringstream detid_str;
430 std::string thisMEpath = currentdir.substr(0, currentdir.rfind(
'/')) +
"/BadModuleList/" + detid_str.str();
436 flag = atoi(val_str.c_str());
441 bad_modules.insert(std::pair<uint32_t, uint16_t>(detId,
flag));
445 for (std::map<uint32_t, uint16_t>::const_iterator it = bad_modules.begin(); it != bad_modules.end(); it++) {
446 uint32_t detId = it->first;
447 uint16_t
flag = it->second;
448 if (((
flag >> 0) & 0
x1) > 0)
450 if (((
flag >> 1) & 0
x1) > 0)
451 errdet_hasTooManyDigis++;
452 if (((
flag >> 2) & 0
x1) > 0)
453 errdet_hasTooManyClu++;
454 if (((
flag >> 3) & 0
x1) > 0)
456 if (((
flag >> 4) & 0
x1) > 0)
458 std::map<uint32_t, uint16_t>::iterator iPos =
badModuleList.find(detId);
465 errdet = bad_modules.size();
475 auto th2d =
me->getTH2F();
476 th2d->SetBinContent(xbin, ybin,
val);
496 if (!dqm_store.
dirExists(subdet_folder)) {
497 subdet_folder = mechanical_dir + subdet_folder.substr(subdet_folder.find(
"MechanicalView") + 14);
501 std::string bad_module_folder = subdet_folder +
"/" +
"BadModuleList";
504 std::ostringstream detid_str;
506 std::string full_path = bad_module_folder +
"/" + detid_str.str();
543 TH1F* th1 =
me->getTH1F();
544 float global_fraction = 0.0;
546 for (
int ibin = 1; ibin <= th1->GetNbinsX(); ibin++) {
550 float fraction = 1.0 - th1->GetBinContent(ibin);
553 iPos->second.DetFraction->Fill(
fraction);
554 iPos->second.SToNFlag->Fill(-1.0);
555 iPos->second.SummaryFlag->Fill(
fraction);
558 global_fraction = global_fraction / dets;