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;
43 std::vector<edm::ParameterSet> TrackingLSQualityMEs =
45 for (
const auto& meQTset : TrackingLSQualityMEs) {
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;
104 for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin(); it != TrackingMEsMap.end(); it++) {
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) {
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;
367 status = status / float(nQTme);
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);
430 status = fminf(tmp_status, status);
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;
483 th2d->SetBinContent(xbin, ybin, val);
492 <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] starting .. " << std::endl;
503 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] ME: " << it->first
504 <<
" [" << it->second.TrackingFlag->getFullname()
505 <<
"] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
509 std::string localMEdirpath = it->second.HistoLSDir;
511 float lower_cut = it->second.HistoLSLowerCut;
512 float upper_cut = it->second.HistoLSUpperCut;
516 std::vector<MonitorElement*> tmpMEvec = igetter.
getContents(ibooker.
pwd() +
"/" + localMEdirpath);
519 <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] tmpMEvec: " << tmpMEvec.size() << std::endl;
524 for (
auto ime : tmpMEvec) {
526 if (name.find(MEname) != std::string::npos) {
533 for (
auto ime : tmpMEvec) {
535 if (name.find(MEname) != std::string::npos) {
546 <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] MEname: " << MEname <<
" x_mean: " << x_mean
548 if (x_mean <= lower_cut || x_mean > upper_cut)
554 for (
auto ime : tmpMEvec) {
555 float tmp_status = 1.;
557 if (name.find(MEname) != std::string::npos) {
566 <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] MEname: " << MEname <<
"[" << me->
getName()
567 <<
"] x_mean: " << x_mean << std::endl;
568 if (x_mean <= lower_cut || x_mean > upper_cut)
574 <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] tmp_status: " << tmp_status << std::endl;
577 status = fminf(tmp_status, status);
580 <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] ==> status: " << status << std::endl;
583 it->second.TrackingFlag->Fill(status);
586 <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] ===> status: " << status <<
" [" << gstatus <<
"]"
591 gstatus = gstatus *
status;
594 <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] ===> gstatus: " << gstatus << std::endl;
596 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] ME: " << it->first
597 <<
" [" << it->second.TrackingFlag->getFullname()
598 <<
"] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
604 edm::LogInfo(
"TrackingQualityChecker") <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] DONE" << std::endl;
T getUntrackedParameter(std::string const &, T const &) const
MonitorElement * TrackingFlag
virtual TH2F * getTH2F() const
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
MonitorElement * TrackGlobalSummaryReportMap
void fillDummyGlobalStatus()
virtual void setCurrentFolder(std::string const &fullpath)
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
virtual std::string pwd()
std::map< std::string, TrackingMEs > TrackingMEsMap
Kind kind() const
Get the type of the monitor element.
const std::string & getName() const
get name of ME
virtual ~TrackingQualityChecker()
std::string TopFolderName_
TrackingQualityChecker(edm::ParameterSet const &ps)
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 fillGlobalStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
MonitorElement * TrackLSSummaryReportGlobal
virtual int getNbinsX() const
get # of bins in X-axis
void fillLSStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
bool bookedTrackingGlobalStatus_
if(conf_.getParameter< bool >("UseStripCablingDB"))
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
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
T getParameter(std::string const &) const
bool bookedTrackingLSStatus_
void bookLSStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void bookGlobalStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
std::string getFullname() const
get full name of ME including Pathname
void fillTrackingStatusAtLumi(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
MonitorElement * TrackGlobalSummaryReportGlobal
void fillTrackingStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
static void getTopFolderPath(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, std::string top_dir, std::string &path)
std::map< std::string, TrackingLSMEs > TrackingLSMEsMap
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)