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);
359 det_summary_str << std::setiosflags(std::ios::fixed);
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) & 0x1) > 0)
450 if (((flag >> 1) & 0x1) > 0)
451 errdet_hasTooManyDigis++;
452 if (((flag >> 2) & 0x1) > 0)
453 errdet_hasTooManyClu++;
454 if (((flag >> 3) & 0x1) > 0)
456 if (((flag >> 4) & 0x1) > 0)
458 std::map<uint32_t, uint16_t>::iterator iPos =
badModuleList.find(detId);
462 badModuleList.insert(std::pair<uint32_t, uint16_t>(detId, flag));
465 errdet = bad_modules.size();
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();
511 me = dqm_store.
bookInt(detid_str.str());
544 float global_fraction = 0.0;
546 for (
int ibin = 1; ibin <= th1->GetNbinsX(); ibin++) {
548 std::map<std::string, SubDetMEs>::iterator iPos =
SubDetMEsMap.find(label);
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;
static void setBadModuleFlag(std::string &hname, uint16_t &flg)
T getUntrackedParameter(std::string const &, T const &) const
virtual TH2F * getTH2F() const
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
MonitorElement * SToNFlag
void getSubDetFolder(const uint32_t &detid, const TrackerTopology *tTopo, std::string &folder_name)
const TkDetMap * tkDetMap_
virtual int getNbinsY() const
get # of bins in Y-axis
std::map< std::string, std::string > SubDetFolderMap
virtual DQM_DEPRECATED std::vector< std::string > getSubdirs() const
virtual TH1F * getTH1F() const
void fillFaultyModuleStatus(DQMStore &dqm_store, const TrackerTopology *tTopo)
MonitorElement * SummaryFlag
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
void setCurrentFolder(std::string const &fullpath) override
MonitorElement * DetFractionReportMap_hasTooManyDigis
Kind kind() const
Get the type of the monitor element.
const std::string & getName() const
get name of ME
virtual bool dirExists(std::string const &path) const
std::string pwd() override
uint32_t connectedNumber(const std::string &subDet, const uint16_t layer) const
void fillSubDetStatus(DQMStore &dqm_store, const SiStripDetCabling *cabling, SubDetMEs &mes, unsigned int xbin, float &gflag)
void initialiseBadModuleList()
SiStripQualityChecker(edm::ParameterSet const &ps)
static void getMEValue(MonitorElement const *me, std::string &val)
std::map< std::string, SubDetMEs > SubDetMEsMap
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
std::vector< MonitorElementData::QReport * > getQReports() const
get map of QReports
void fillStatusHistogram(MonitorElement const *, int xbin, int ybin, float val)
void fillStatus(DQMStore &dqm_store, const SiStripDetCabling *cabling, const TkDetMap *tkDetMap, const TrackerTopology *tTopo)
void fillDetectorStatusAtLumi(DQMStore &dqm_store)
virtual int getNbinsX() const
get # of bins in X-axis
void bookStatus(DQMStore &dqm_store)
virtual MonitorElement * get(std::string const &fullpath) const
void fillStatusAtLumi(DQMStore &dqm_store)
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * DetFractionReportMap
MonitorElement * DetFractionReportMap_hasTooManyClu
void fillDetectorStatus(DQMStore &dqm_store, const SiStripDetCabling *cabling)
Log< level::Info, false > LogInfo
MonitorElement * DetFractionReportMap_hasBadChan
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
SiStripFolderOrganizer folder_organizer
MonitorElement * SummaryReportMap
std::map< uint32_t, uint16_t > badModuleList
MonitorElement * SummaryReportGlobal
static bool goToDir(DQMStore &dqm_store, std::string const &name)
MonitorElement * SToNReportMap
MonitorElement * DetFractionReportMap_hasExclFed
DetId getDetFromBin(int layer, int ix, int iy) const
static const int STATUS_OK
void getModuleStatus(DQMStore &dqm_store, std::vector< MonitorElement * > &layer_mes, int &errdet, int &errdet_hasBadChan, int &errdet_hasTooManyDigis, int &errdet_hasTooManyClu, int &errdet_hasExclFed, int &errdet_hasDcsErr)
static int getMEStatus(MonitorElement const *me)
edm::ParameterSet const pSet_
MonitorElement * DetFraction
MonitorElement * DetFractionReportMap_hasDcsErr
static void getTopFolderPath(DQMStore &dqm_store, std::string const &top_dir, std::string &path)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)