19 : pSet_(ps), verbose_(pSet_.getUntrackedParameter<
bool>(
"verbose",
false)) {
20 edm::LogInfo(
"TrackingQualityChecker") <<
" Creating TrackingQualityChecker " 29 std::vector<edm::ParameterSet> TrackingGlobalQualityMEs =
30 pSet_.
getParameter<std::vector<edm::ParameterSet> >(
"TrackingGlobalQualityPSets");
31 for (
const auto& meQTset : TrackingGlobalQualityMEs) {
33 tracking_mes.HistoDir = meQTset.getParameter<
std::string>(
"dir");
34 tracking_mes.HistoName = meQTset.getParameter<
std::string>(
"name");
36 edm::LogInfo(
"TrackingQualityChecker") <<
" inserting " << QTname <<
" in TrackingMEsMap" << std::endl;
37 TrackingMEsMap.insert(std::pair<std::string, TrackingMEs>(QTname, tracking_mes));
40 edm::LogInfo(
"TrackingQualityChecker") <<
" created TrackingMEsMap" << std::endl;
47 tracking_ls_mes.
HistoLSDir = meQTset.exists(
"LSdir") ? meQTset.getParameter<
std::string>(
"LSdir") :
"";
49 tracking_ls_mes.
HistoLSLowerCut = meQTset.exists(
"LSlowerCut") ? meQTset.getParameter<
double>(
"LSlowerCut") : -1.;
50 tracking_ls_mes.
HistoLSUpperCut = meQTset.exists(
"LSupperCut") ? meQTset.getParameter<
double>(
"LSupperCut") : -1.;
54 edm::LogInfo(
"TrackingQualityChecker") <<
" inserting " << QTname <<
" in TrackingMEsMap" << std::endl;
55 TrackingLSMEsMap.insert(std::pair<std::string, TrackingLSMEs>(QTname, tracking_ls_mes));
58 edm::LogInfo(
"TrackingQualityChecker") <<
" created TrackingLSMEsMap" << std::endl;
64 edm::LogInfo(
"TrackingQualityChecker") <<
" Deleting TrackingQualityChecker " 72 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::bookGlobalStatus] already booked ? " 77 edm::LogInfo(
"TrackingQualityChecker") <<
" booking TrackingQualityStatus" 87 hname =
"reportSummaryMap";
88 htitle =
"Tracking Report Summary Map";
92 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::bookGlobalStatus] nQT: " << nQT << std::endl;
106 it->second.TrackingFlag = ibooker.
bookFloat(
"Track" + meQTname);
108 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::bookGlobalStatus] " << it->first
109 <<
" exists ? " << it->second.TrackingFlag << std::endl;
112 <<
"[TrackingQualityChecker::bookGlobalStatus] DONE w/ TrackingMEsMap" << std::endl;
122 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::bookLSStatus] already booked ? " 127 edm::LogInfo(
"TrackingQualityChecker") <<
" booking TrackingQualityStatus" 137 hname =
"reportSummaryMap";
138 htitle =
"Tracking Report Summary Map";
142 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::bookLSStatus] nQT: " << nQT << std::endl;
149 it->second.TrackingFlag = ibooker.
bookFloat(
"Track" + meQTname);
151 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::bookLSStatus] " << it->first <<
" exists ? " 152 << it->second.TrackingFlag << std::endl;
155 <<
"[TrackingQualityChecker::bookLSStatus] DONE w/ TrackingLSMEsMap" << std::endl;
169 <<
"[TrackingQualityChecker::fillDummyGlobalStatus] starting ..." << std::endl;
173 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::fillDummyGlobalStatus] already booked ? " 183 it->second.TrackingFlag->Fill(-1.0);
186 <<
"[TrackingQualityChecker::fillDummyGlobalStatus] DONE w/ TrackingMEsMap" << std::endl;
191 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::fillDummyLSStatus] starting ..." << std::endl;
195 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::fillDummyLSStatus] already booked ? " 201 it->second.TrackingFlag->Fill(-1.0);
204 <<
"[TrackingQualityChecker::fillDummyLSStatus] DONE w/ TrackingLSMEsMap" << std::endl;
213 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::resetGlobalStatus] already booked ? " 223 <<
"[TrackingQualityChecker::resetGlobalStatus] " << it->second.HistoName <<
" exist ? " 224 << (it->second.TrackingFlag ==
nullptr ?
"nope" :
"yes") <<
" ---> " <<
me << std::endl;
229 <<
"[TrackingQualityChecker::resetGlobalStatus] DONE w/ TrackingMEsMap" << std::endl;
234 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::resetLSStatus] already booked ? " 243 <<
"[TrackingQualityChecker::resetLSStatus] " << it->second.HistoLSName <<
" exist ? " 244 << (it->second.TrackingFlag ==
nullptr ?
"nope" :
"yes") <<
" ---> " <<
me << std::endl;
249 <<
"[TrackingQualityChecker::resetLSStatus] DONE w/ TrackingLSMEsMap" << std::endl;
258 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::fillGlobalStatus] already booked ? " 266 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::fillGlobalStatus] DONE" << std::endl;
272 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::fillLSStatus] already booked ? " 280 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::fillLSStatus] DONE" << std::endl;
298 <<
"fillTrackingStatus ME: " << it->first <<
" [" << it->second.TrackingFlag->getFullname()
299 <<
"] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
306 std::vector<MonitorElement*> tmpMEvec = igetter.
getContents(ibooker.
pwd() +
"/" + localMEdirpath);
308 edm::LogInfo(
"TrackingQualityChecker") <<
"fillTrackingStatus tmpMEvec: " << tmpMEvec.size() << std::endl;
312 for (
auto ime : tmpMEvec) {
315 edm::LogInfo(
"TrackingQualityChecker") <<
"name: " <<
name <<
" <-- --> " << MEname << std::endl;
316 if (
name.find(MEname) != std::string::npos) {
323 edm::LogInfo(
"TrackingQualityChecker") <<
"fillTrackingStatus nMEs: " << nMEs << std::endl;
326 for (
auto ime : tmpMEvec) {
329 edm::LogInfo(
"TrackingQualityChecker") <<
"name: " <<
name <<
" [" << MEname <<
"]" << std::endl;
330 if (
name.find(MEname) != std::string::npos) {
333 edm::LogInfo(
"TrackingQualityChecker") <<
"inside the loop nQTme: " <<
me->getQReports().size() <<
"[" 334 << ime->getFullname() <<
"]" << std::endl;
339 <<
"me: " <<
me <<
"[" <<
me->getName() <<
", " <<
me->getFullname() <<
"]" << std::endl;
343 edm::LogInfo(
"TrackingQualityChecker") <<
"fillTrackingStatus status: " <<
status << std::endl;
344 std::vector<QReport*> qt_reports =
me->getQReports();
345 size_t nQTme = qt_reports.size();
347 edm::LogInfo(
"TrackingQualityChecker") <<
"nQTme: " << nQTme << std::endl;
350 edm::LogInfo(
"TrackingQualityChecker") <<
"fillTrackingStatus qt_reports: " << qt_reports.size() << std::endl;
352 for (
auto iQT : qt_reports) {
353 status += iQT->getQTresult();
355 edm::LogInfo(
"TrackingQualityChecker") <<
"fillTrackingStatus iQT: " << iQT->getQRName() << std::endl;
358 <<
"fillTrackingStatus MEname: " << MEname <<
" status: " << iQT->getQTresult() <<
" exists ? " 359 << (it->second.TrackingFlag ?
"yes " :
"no ") << it->second.TrackingFlag << std::endl;
362 <<
"fillTrackingStatus iQT message: " << iQT->getMessage() << std::endl;
365 <<
"fillTrackingStatus iQT status: " << iQT->getStatus() << std::endl;
370 <<
"fillTrackingStatus MEname: " << MEname <<
" status: " <<
status << std::endl;
371 it->second.TrackingFlag->Fill(
status);
380 <<
"fillTrackingStatus gstatus: " << gstatus <<
" x status: " <<
status << std::endl;
386 edm::LogInfo(
"TrackingQualityChecker") <<
"fillTrackingStatus ===> gstatus: " << gstatus << std::endl;
389 <<
"fillTrackingStatus ME: " << it->first <<
" [" << it->second.TrackingFlag->getFullname()
390 <<
"] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
394 for (
auto ime : tmpMEvec) {
395 float tmp_status = 1.;
397 if (
name.find(MEname) != std::string::npos) {
401 edm::LogInfo(
"TrackingQualityChecker") <<
"fillTrackingStatus status: " <<
status << std::endl;
402 std::vector<QReport*> qt_reports =
me->getQReports();
403 size_t nQTme = qt_reports.size();
406 <<
"nQTme: " << nQTme <<
"[" <<
name <<
", " << ime->getFullname() <<
"]" << std::endl;
410 <<
"fillTrackingStatus qt_reports: " << qt_reports.size() << std::endl;
412 for (
auto iQT : qt_reports) {
413 tmp_status += iQT->getQTresult();
415 edm::LogInfo(
"TrackingQualityChecker") <<
"fillTrackingStatus iQT: " << iQT->getQRName() << std::endl;
418 <<
"fillTrackingStatus MEname: " << MEname <<
" status: " << iQT->getQTresult() <<
" exists ? " 419 << (it->second.TrackingFlag ?
"yes " :
"no ") << it->second.TrackingFlag << std::endl;
422 <<
"fillTrackingStatus iQT message: " << iQT->getMessage() << std::endl;
425 <<
"fillTrackingStatus iQT status: " << iQT->getStatus() << std::endl;
427 tmp_status = tmp_status /
float(nQTme);
438 <<
"fillTrackingStatus MEname: " << MEname <<
" status: " <<
status << std::endl;
439 it->second.TrackingFlag->Fill(
status);
452 std::vector<MonitorElement*> tmpMEvec = igetter.
getContents(ibooker.
pwd() +
"/" + localMEdirpath);
453 for (
auto ime : tmpMEvec) {
454 if (ime->getLumiFlag()) {
461 edm::LogInfo(
"TrackingQualityChecker") <<
"fillTrackingStatus gstatus: " << gstatus << std::endl;
466 gstatus = gstatus /
float(nQT);
469 edm::LogInfo(
"TrackingQualityChecker") <<
"fillTrackingStatus ===> gstatus: " << gstatus << std::endl;
474 edm::LogInfo(
"TrackingQualityChecker") <<
"fillTrackingStatus DONE" << std::endl;
482 TH2F* th2d =
me->getTH2F();
483 th2d->SetBinContent(xbin, ybin,
val);
492 <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] starting .. " << std::endl;
502 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] ME: " << it->first
503 <<
" [" << it->second.TrackingFlag->getFullname()
504 <<
"] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
506 std::string localMEdirpath = it->second.HistoLSDir;
508 float lower_cut = it->second.HistoLSLowerCut;
509 float upper_cut = it->second.HistoLSUpperCut;
513 std::vector<MonitorElement*> tmpMEvec = igetter.
getContents(ibooker.
pwd() +
"/" + localMEdirpath);
516 <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] tmpMEvec: " << tmpMEvec.size() << std::endl;
521 for (
auto ime : tmpMEvec) {
523 if (
name.find(MEname) != std::string::npos) {
530 for (
auto ime : tmpMEvec) {
532 if (
name.find(MEname) != std::string::npos) {
540 float x_mean =
me->getMean();
543 <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] MEname: " << MEname <<
" x_mean: " << x_mean
545 if (x_mean <= lower_cut || x_mean > upper_cut)
551 for (
auto ime : tmpMEvec) {
552 float tmp_status = 1.;
554 if (
name.find(MEname) != std::string::npos) {
560 float x_mean =
me->getMean();
563 <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] MEname: " << MEname <<
"[" <<
me->getName()
564 <<
"] x_mean: " << x_mean << std::endl;
565 if (x_mean <= lower_cut || x_mean > upper_cut)
571 <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] tmp_status: " << tmp_status << std::endl;
577 <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] ==> status: " <<
status << std::endl;
580 it->second.TrackingFlag->Fill(
status);
583 <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] ===> status: " <<
status <<
" [" << gstatus <<
"]" 588 gstatus = gstatus *
status;
591 <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] ===> gstatus: " << gstatus << std::endl;
593 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] ME: " << it->first
594 <<
" [" << it->second.TrackingFlag->getFullname()
595 <<
"] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
601 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] DONE" << std::endl;
MonitorElement * TrackingFlag
T getParameter(std::string const &) const
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
MonitorElement * TrackGlobalSummaryReportMap
void fillDummyGlobalStatus()
virtual void setCurrentFolder(std::string const &fullpath)
virtual std::string pwd()
std::map< std::string, TrackingMEs > TrackingMEsMap
virtual ~TrackingQualityChecker()
std::string TopFolderName_
T getUntrackedParameter(std::string const &, T const &) const
TrackingQualityChecker(edm::ParameterSet const &ps)
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
void fillGlobalStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
MonitorElement * TrackLSSummaryReportGlobal
void fillLSStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
bool bookedTrackingGlobalStatus_
static bool goToDir(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, std::string name)
void fillStatusHistogram(MonitorElement *, int xbin, int ybin, float val)
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)
Log< level::Info, false > LogInfo
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
bool bookedTrackingLSStatus_
void bookLSStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void bookGlobalStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void fillTrackingStatusAtLumi(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
MonitorElement * TrackGlobalSummaryReportGlobal
void fillTrackingStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
virtual int getNbinsX() const
get # of bins in X-axis
static void getTopFolderPath(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, std::string top_dir, std::string &path)
std::map< std::string, TrackingLSMEs > TrackingLSMEsMap
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)