26 edm::LogInfo(
"SiStripQualityChecker") <<
" Creating SiStripQualityChecker " 39 edm::LogInfo(
"SiStripQualityChecker") <<
" Deleting SiStripQualityChecker " 53 if (strip_dir.empty()) strip_dir =
"SiStrip";
60 hname =
"detFractionReportMap";
61 htitle =
"SiStrip Report for Good Detector Fraction";
63 dqm_store.
book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
67 hname =
"detFractionReportMap_hasBadChan";
68 htitle =
"SiStrip Report for Good Detector Fraction due to bad channels";
70 dqm_store.
book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
73 hname =
"detFractionReportMap_hasTooManyDigis";
74 htitle =
"SiStrip Report for Good Detector Fraction due to too many digis";
76 dqm_store.
book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
79 hname =
"detFractionReportMap_hasTooManyClu";
80 htitle =
"SiStrip Report for Good Detector Fraction due to too many clusters";
82 dqm_store.
book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
85 hname =
"detFractionReportMap_hasExclFed";
86 htitle =
"SiStrip Report for Good Detector Fraction due to excluded FEDs";
88 dqm_store.
book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
91 hname =
"detFractionReportMap_hasDcsErr";
92 htitle =
"SiStrip Report for Good Detector Fraction due to DCS errors";
94 dqm_store.
book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
98 hname =
"sToNReportMap";
99 htitle =
"SiStrip Report for Signal-to-Noise";
107 hname =
"reportSummaryMap";
108 htitle =
"SiStrip Report Summary Map";
132 else if (det ==
"TECB")
134 else if (det ==
"TIDF")
136 else if (det ==
"TIDB")
142 me_name =
"SiStrip_" + det;
145 me_name =
"SiStrip_DetFraction_" + det;
148 me_name =
"SiStrip_SToNFlag_" + det;
150 SubDetMEsMap.insert(std::pair<std::string, SubDetMEs>(det, local_mes));
161 auto& local_mes =
pr.second;
162 local_mes.SummaryFlag ->
Fill(-1.0);
163 local_mes.DetFraction ->
Fill(-1.0);
164 local_mes.SToNFlag ->
Fill(-1.0);
188 auto& local_mes =
pr.second;
189 local_mes.DetFraction ->
Reset();
190 local_mes.SummaryFlag ->
Reset();
191 local_mes.SToNFlag ->
Reset();
234 unsigned int xbin = 0;
235 float global_flag = 0;
246 if (!dqm_store.
dirExists(dname))
continue;
253 global_flag = global_flag/xbin*1.0;
270 if (status_flag < 1)
return;
272 auto const subDirVec = dqm_store.
getSubdirs();
274 unsigned int ybin = 0;
277 float tot_ston_stat = 0;
279 for (
auto const&
dname : subDirVec) {
280 if (
dname.find(
"BadModuleList") != std::string::npos)
continue;
281 if (
dname.find(
"ring") !=std::string::npos)
continue;
282 std::vector<MonitorElement*> meVec;
289 int errdet_hasBadChan = 0;
290 int errdet_hasTooManyDigis = 0;
291 int errdet_hasTooManyClu = 0;
292 int errdet_hasExclFed = 0;
293 int errdet_hasDcsErr = 0;
296 int lnum = atoi(
dname.substr(
dname.find_last_of(
"_")+1).c_str());
299 getModuleStatus(dqm_store, meVec, errdet, errdet_hasBadChan, errdet_hasTooManyDigis, errdet_hasTooManyClu, errdet_hasExclFed, errdet_hasDcsErr);
301 for (
auto const* me : meVec) {
303 std::vector<QReport *> reports = me->getQReports();
305 if (reports.empty())
continue;
308 if( name.find(
"Summary_ClusterStoNCorr__OnTrack") != std::string::npos){
310 if (reports[0]->getQTresult() == -1) {
319 float eff_fac = 1 - (errdet*1.0/ndet);
320 float eff_fac_hasBadChan = 1 - (errdet_hasBadChan *1.0/ndet);
321 float eff_fac_hasTooManyDigis = 1 - (errdet_hasTooManyDigis*1.0/ndet);
322 float eff_fac_hasTooManyClu = 1 - (errdet_hasTooManyClu *1.0/ndet);
323 float eff_fac_hasExclFed = 1 - (errdet_hasExclFed *1.0/ndet);
324 float eff_fac_hasDcsErr = 1 - (errdet_hasDcsErr *1.0/ndet);
336 tot_errdet += errdet;
337 tot_ston_stat += ston_stat;
342 float tot_eff_fac = 1 - (tot_errdet*1.0/tot_ndet);
344 float tot_ston_fac = tot_ston_stat/ybin;
346 if (tot_ston_fac < 0){
349 gflag =
std::min(tot_eff_fac, tot_ston_fac);
358 std::ostringstream det_summary_str;
359 for (std::map<std::string, SubDetMEs>::const_iterator it =
364 det_summary_str << std::setprecision(4);
367 det_summary_str <<
" Printing Status for " << det <<
" : " << std::endl;
371 float fval1, fval2, fval3;
372 fval1 = fval2 = fval3 = -1.0;
375 if (!sval.empty()) fval1 = atof(sval.c_str());
377 if (!sval.empty()) fval2 = atof(sval.c_str());
379 if (!sval.empty()) fval3 = atof(sval.c_str());
381 det_summary_str << std::setw(7) <<
" % of good detectors " << fval1
382 <<
" SToN Flag " << fval2
383 <<
" Summary Flag " << fval3 << std::endl;
391 std::vector<MonitorElement*>& layer_mes,
393 int& errdet_hasBadChan,
394 int& errdet_hasTooManyDigis,
395 int& errdet_hasTooManyClu,
396 int& errdet_hasExclFed,
397 int& errdet_hasDcsErr)
401 std::map<uint32_t,uint16_t> bad_modules;
402 for (std::vector<MonitorElement*>::const_iterator it = layer_mes.begin();
403 it != layer_mes.end(); it++) {
406 std::vector<QReport *> qreports = me->
getQReports();
407 if (qreports.empty())
continue;
409 std::vector<DQMChannel> bad_channels_me;
411 bad_channels_me = qreports[0]->getBadChannels();
414 bad_channels_me = qreports[0]->getBadChannels();
415 lname = name.substr(name.find(
"TkHMap_")+7);
416 lname = lname.substr(lname.find(
"_T")+1);
419 for (std::vector<DQMChannel>::iterator it = bad_channels_me.begin(); it != bad_channels_me.end(); it++){
420 int xval = (*it).getBinX();
421 int yval = (*it).getBinY();
423 std::map<uint32_t,uint16_t>::iterator iPos = bad_modules.find(detId);
425 if (iPos != bad_modules.end()){
433 std::ostringstream detid_str;
437 std::string thisMEpath = currentdir.substr(0, currentdir.rfind(
"/")) +
438 "/BadModuleList/" + detid_str.str();
444 flag = atoi(val_str.c_str());
449 bad_modules.insert(std::pair<uint32_t, uint16_t>(detId, flag));
453 for(std::map<uint32_t,uint16_t>::const_iterator it = bad_modules.begin();
454 it != bad_modules.end(); it++) {
455 uint32_t detId = it->first;
456 uint16_t
flag = it->second;
457 if (((flag >> 0) & 0
x1) > 0) errdet_hasBadChan++;
458 if (((flag >> 1) & 0
x1) > 0) errdet_hasTooManyDigis++;
459 if (((flag >> 2) & 0
x1) > 0) errdet_hasTooManyClu++;
460 if (((flag >> 3) & 0
x1) > 0) errdet_hasExclFed++;
461 if (((flag >> 4) & 0
x1) > 0) errdet_hasDcsErr++;
462 std::map<uint32_t,uint16_t>::iterator iPos =
badModuleList.find(detId);
466 badModuleList.insert(std::pair<uint32_t,uint16_t>(detId,flag));
469 errdet = bad_modules.size();
482 th2d->SetBinContent(xbin, ybin, val);
508 if (!dqm_store.
dirExists(subdet_folder)) {
509 subdet_folder = mechanical_dir + subdet_folder.substr(subdet_folder.find(
"MechanicalView")+14);
510 if (!dqm_store.
dirExists(subdet_folder))
continue;
512 std::string bad_module_folder = subdet_folder +
"/" +
"BadModuleList";
515 std::ostringstream detid_str;
517 std::string full_path = bad_module_folder +
"/" + detid_str.str();
521 me = dqm_store.
bookInt(detid_str.str());
555 dqm_store.
pwd() +
"/PerLumiSection/" +
"lumiErrorFraction";
559 float global_fraction = 0.0;
561 for (
int ibin = 1; ibin <= th1->GetNbinsX(); ibin++) {
563 std::map<std::string, SubDetMEs>::iterator iPos =
SubDetMEsMap.find(label);
565 float fraction = 1.0 - th1->GetBinContent(ibin);
568 iPos->second.DetFraction ->
Fill(fraction);
569 iPos->second.SToNFlag ->
Fill(-1.0);
570 iPos->second.SummaryFlag ->
Fill(fraction);
573 global_fraction = global_fraction/dets;
MonitorElement * book2D(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
static void setBadModuleFlag(std::string &hname, uint16_t &flg)
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * SToNFlag
std::vector< MonitorElement * > getContents(std::string const &path) const
void getSubDetFolder(const uint32_t &detid, const TrackerTopology *tTopo, std::string &folder_name)
const TkDetMap * tkDetMap_
std::map< std::string, std::string > SubDetFolderMap
MonitorElement * SummaryFlag
MonitorElement * DetFractionReportMap_hasTooManyDigis
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)
const std::string & getName() const
get name of ME
uint32_t connectedNumber(const std::string &subDet, const uint16_t layer) const
MonitorElement * bookInt(char_string const &name)
Book int.
void initialiseBadModuleList()
SiStripQualityChecker(edm::ParameterSet const &ps)
MonitorElement * bookFloat(char_string const &name)
Book float.
static void getMEValue(MonitorElement const *me, std::string &val)
std::map< std::string, SubDetMEs > SubDetMEsMap
currentdir
parse figure configuration if found
void fillFaultyModuleStatus(DQMStore &dqm_store, const edm::EventSetup &eSetup)
void fillSubDetStatus(DQMStore &dqm_store, const edm::ESHandle< SiStripDetCabling > &cabling, SubDetMEs &mes, unsigned int xbin, float &gflag)
void fillStatusHistogram(MonitorElement const *, int xbin, int ybin, float val)
void fillDetectorStatusAtLumi(DQMStore &dqm_store)
bool dirExists(std::string const &path) const
true if directory exists
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * get(std::string const &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
void bookStatus(DQMStore &dqm_store)
void fillStatusAtLumi(DQMStore &dqm_store)
void Reset()
reset ME (ie. contents, errors, etc)
std::vector< std::string > getSubdirs() const
MonitorElement * DetFractionReportMap
MonitorElement * DetFractionReportMap_hasTooManyClu
std::string const & pwd() const
void setCurrentFolder(std::string const &fullpath)
void fillStatus(DQMStore &dqm_store, const edm::ESHandle< SiStripDetCabling > &cabling, const edm::EventSetup &eSetup)
void cd()
go to top directory (ie. root)
MonitorElement * DetFractionReportMap_hasBadChan
std::vector< QReport * > getQReports() const
get map of QReports
MonitorElement * SummaryReportMap
int getNbinsY() const
get # of bins in Y-axis
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)
void fillDetectorStatus(DQMStore &dqm_store, const edm::ESHandle< SiStripDetCabling > &cabling)
std::map< uint32_t, uint16_t > badModuleList
void Reset(std::vector< TH2F > &depth)
static int getMEStatus(MonitorElement const *me)
int getNbinsX() const
get # of bins in X-axis
edm::ParameterSet const pSet_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
T const * product() const
MonitorElement * DetFraction
MonitorElement * DetFractionReportMap_hasDcsErr
Kind kind() const
Get the type of the monitor element.
static void getTopFolderPath(DQMStore &dqm_store, std::string const &top_dir, std::string &path)