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 std::cout <<
"[TrackingQualityChecker::TrackingQualityChecker] inserting " << QTname <<
" in TrackingMEsMap"
38 TrackingMEsMap.insert(std::pair<std::string, TrackingMEs>(QTname, tracking_mes));
41 std::cout <<
"[TrackingQualityChecker::TrackingQualityChecker] created TrackingMEsMap" << std::endl;
48 tracking_ls_mes.
HistoLSDir = meQTset.exists(
"LSdir") ? meQTset.getParameter<
std::string>(
"LSdir") :
"";
50 tracking_ls_mes.
HistoLSLowerCut = meQTset.exists(
"LSlowerCut") ? meQTset.getParameter<
double>(
"LSlowerCut") : -1.;
51 tracking_ls_mes.
HistoLSUpperCut = meQTset.exists(
"LSupperCut") ? meQTset.getParameter<
double>(
"LSupperCut") : -1.;
55 std::cout <<
"[TrackingQualityChecker::TrackingQualityChecker] inserting " << QTname <<
" in TrackingMEsMap"
57 TrackingLSMEsMap.insert(std::pair<std::string, TrackingLSMEs>(QTname, tracking_ls_mes));
60 std::cout <<
"[TrackingQualityChecker::TrackingQualityChecker] created TrackingLSMEsMap" << std::endl;
66 edm::LogInfo(
"TrackingQualityChecker") <<
" Deleting TrackingQualityChecker "
74 std::cout <<
"[TrackingQualityChecker::bookGlobalStatus] already booked ? "
79 edm::LogInfo(
"TrackingQualityChecker") <<
" booking TrackingQualityStatus"
89 hname =
"reportSummaryMap";
90 htitle =
"Tracking Report Summary Map";
94 std::cout <<
"[TrackingQualityChecker::bookGlobalStatus] nQT: " << nQT << std::endl;
108 it->second.TrackingFlag = ibooker.
bookFloat(
"Track" + meQTname);
110 std::cout <<
"[TrackingQualityChecker::bookGlobalStatus] " << it->first <<
" exists ? "
111 << it->second.TrackingFlag << std::endl;
113 std::cout <<
"[TrackingQualityChecker::bookGlobalStatus] DONE w/ TrackingMEsMap" << std::endl;
123 std::cout <<
"[TrackingQualityChecker::bookLSStatus] already booked ? "
128 edm::LogInfo(
"TrackingQualityChecker") <<
" booking TrackingQualityStatus"
138 hname =
"reportSummaryMap";
139 htitle =
"Tracking Report Summary Map";
143 std::cout <<
"[TrackingQualityChecker::bookLSStatus] nQT: " << nQT << std::endl;
150 it->second.TrackingFlag = ibooker.
bookFloat(
"Track" + meQTname);
152 std::cout <<
"[TrackingQualityChecker::bookLSStatus] " << it->first <<
" exists ? " << it->second.TrackingFlag
155 std::cout <<
"[TrackingQualityChecker::bookLSStatus] DONE w/ TrackingLSMEsMap" << std::endl;
168 std::cout <<
"[TrackingQualityChecker::fillDummyGlobalStatus] starting ..." << std::endl;
172 std::cout <<
"[TrackingQualityChecker::fillDummyGlobalStatus] already booked ? "
182 it->second.TrackingFlag->Fill(-1.0);
184 std::cout <<
"[TrackingQualityChecker::fillDummyGlobalStatus] DONE w/ TrackingMEsMap" << std::endl;
189 std::cout <<
"[TrackingQualityChecker::fillDummyLSStatus] starting ..." << std::endl;
193 std::cout <<
"[TrackingQualityChecker::fillDummyLSStatus] already booked ? "
199 it->second.TrackingFlag->Fill(-1.0);
201 std::cout <<
"[TrackingQualityChecker::fillDummyLSStatus] DONE w/ TrackingLSMEsMap" << std::endl;
210 std::cout <<
"[TrackingQualityChecker::resetGlobalStatus] already booked ? "
219 std::cout <<
"[TrackingQualityChecker::resetGlobalStatus] " << it->second.HistoName <<
" exist ? "
220 << (it->second.TrackingFlag ==
nullptr ?
"nope" :
"yes") <<
" ---> " <<
me << std::endl;
224 std::cout <<
"[TrackingQualityChecker::resetGlobalStatus] DONE w/ TrackingMEsMap" << std::endl;
229 std::cout <<
"[TrackingQualityChecker::resetLSStatus] already booked ? "
237 std::cout <<
"[TrackingQualityChecker::resetLSStatus] " << it->second.HistoLSName <<
" exist ? "
238 << (it->second.TrackingFlag ==
nullptr ?
"nope" :
"yes") <<
" ---> " <<
me << std::endl;
242 std::cout <<
"[TrackingQualityChecker::resetLSStatus] DONE w/ TrackingLSMEsMap" << std::endl;
251 std::cout <<
"[TrackingQualityChecker::fillGlobalStatus] already booked ? "
259 std::cout <<
"[TrackingQualityChecker::fillGlobalStatus] DONE" << std::endl;
265 std::cout <<
"[TrackingQualityChecker::fillLSStatus] already booked ? "
273 std::cout <<
"[TrackingQualityChecker::fillLSStatus] DONE" << std::endl;
290 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] ME: " << it->first <<
" ["
291 << it->second.TrackingFlag->getFullname() <<
"] flag: " << it->second.TrackingFlag->getFloatValue()
299 std::vector<MonitorElement*> tmpMEvec = igetter.
getContents(ibooker.
pwd() +
"/" + localMEdirpath);
301 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] tmpMEvec: " << tmpMEvec.size() << std::endl;
305 for (
auto ime : tmpMEvec) {
308 std::cout <<
"name: " <<
name <<
" <-- --> " << MEname << std::endl;
309 if (
name.find(MEname) != std::string::npos) {
316 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] nMEs: " << nMEs << std::endl;
319 for (
auto ime : tmpMEvec) {
322 std::cout <<
"name: " <<
name <<
" [" << MEname <<
"]" << std::endl;
323 if (
name.find(MEname) != std::string::npos) {
326 std::cout <<
"inside the loop nQTme: " <<
me->getQReports().size() <<
"[" << ime->getFullname() <<
"]"
331 std::cout <<
"me: " <<
me <<
"[" <<
me->getName() <<
", " <<
me->getFullname() <<
"]" << std::endl;
335 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] status: " <<
status << std::endl;
336 std::vector<QReport*> qt_reports =
me->getQReports();
337 size_t nQTme = qt_reports.size();
339 std::cout <<
"nQTme: " << nQTme << std::endl;
342 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] qt_reports: " << qt_reports.size() << std::endl;
344 for (
auto iQT : qt_reports) {
345 status += iQT->getQTresult();
347 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] iQT: " << iQT->getQRName() << std::endl;
349 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] MEname: " << MEname
350 <<
" status: " << iQT->getQTresult() <<
" exists ? " << (it->second.TrackingFlag ?
"yes " :
"no ")
351 << it->second.TrackingFlag << std::endl;
353 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] iQT message: " << iQT->getMessage() << std::endl;
355 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] iQT status: " << iQT->getStatus() << std::endl;
359 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] MEname: " << MEname <<
" status: " <<
status
361 it->second.TrackingFlag->Fill(
status);
363 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] TrackGlobalSummaryReportMap: "
369 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] gstatus: " << gstatus <<
" x status: " <<
status
376 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] ===> gstatus: " << gstatus << std::endl;
378 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] ME: " << it->first <<
" ["
379 << it->second.TrackingFlag->getFullname() <<
"] flag: " << it->second.TrackingFlag->getFloatValue()
384 for (
auto ime : tmpMEvec) {
385 float tmp_status = 1.;
387 if (
name.find(MEname) != std::string::npos) {
391 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] status: " <<
status << std::endl;
392 std::vector<QReport*> qt_reports =
me->getQReports();
393 size_t nQTme = qt_reports.size();
395 std::cout <<
"nQTme: " << nQTme <<
"[" <<
name <<
", " << ime->getFullname() <<
"]" << std::endl;
398 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] qt_reports: " << qt_reports.size()
401 for (
auto iQT : qt_reports) {
402 tmp_status += iQT->getQTresult();
404 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] iQT: " << iQT->getQRName() << std::endl;
406 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] MEname: " << MEname
407 <<
" status: " << iQT->getQTresult() <<
" exists ? "
408 << (it->second.TrackingFlag ?
"yes " :
"no ") << it->second.TrackingFlag << std::endl;
410 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] iQT message: " << iQT->getMessage()
413 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] iQT status: " << iQT->getStatus()
416 tmp_status = tmp_status /
float(nQTme);
426 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] MEname: " << MEname <<
" status: " <<
status
428 it->second.TrackingFlag->Fill(
status);
430 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] TrackGlobalSummaryReportMap: "
441 std::vector<MonitorElement*> tmpMEvec = igetter.
getContents(ibooker.
pwd() +
"/" + localMEdirpath);
442 for (
auto ime : tmpMEvec) {
443 if (ime->getLumiFlag()) {
450 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] gstatus: " << gstatus << std::endl;
455 gstatus = gstatus /
float(nQT);
458 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] ===> gstatus: " << gstatus << std::endl;
463 std::cout <<
"[TrackingQualityChecker::fillTrackingStatus] DONE" << std::endl;
471 TH2F* th2d =
me->getTH2F();
472 th2d->SetBinContent(xbin, ybin,
val);
480 std::cout <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] starting .. " << std::endl;
491 std::cout <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] ME: " << it->first <<
" ["
492 << it->second.TrackingFlag->getFullname() <<
"] flag: " << it->second.TrackingFlag->getFloatValue()
497 std::string localMEdirpath = it->second.HistoLSDir;
499 float lower_cut = it->second.HistoLSLowerCut;
500 float upper_cut = it->second.HistoLSUpperCut;
504 std::vector<MonitorElement*> tmpMEvec = igetter.
getContents(ibooker.
pwd() +
"/" + localMEdirpath);
506 std::cout <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] tmpMEvec: " << tmpMEvec.size() << std::endl;
511 for (
auto ime : tmpMEvec) {
513 if (
name.find(MEname) != std::string::npos) {
520 for (
auto ime : tmpMEvec) {
522 if (
name.find(MEname) != std::string::npos) {
530 float x_mean =
me->getMean();
532 std::cout <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] MEname: " << MEname <<
" x_mean: " << x_mean
534 if (x_mean <= lower_cut || x_mean > upper_cut)
540 for (
auto ime : tmpMEvec) {
541 float tmp_status = 1.;
543 if (
name.find(MEname) != std::string::npos) {
549 float x_mean =
me->getMean();
551 std::cout <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] MEname: " << MEname <<
"["
552 <<
me->getName() <<
"] x_mean: " << x_mean << std::endl;
553 if (x_mean <= lower_cut || x_mean > upper_cut)
558 std::cout <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] tmp_status: " << tmp_status << std::endl;
563 std::cout <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] ==> status: " <<
status << std::endl;
566 it->second.TrackingFlag->Fill(
status);
568 std::cout <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] ===> status: " <<
status <<
" [" << gstatus
573 gstatus = gstatus *
status;
575 std::cout <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] ===> gstatus: " << gstatus << std::endl;
577 std::cout <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] ME: " << it->first <<
" ["
578 << it->second.TrackingFlag->getFullname() <<
"] flag: " << it->second.TrackingFlag->getFloatValue()
585 std::cout <<
"[TrackingQualityChecker::fillTrackingStatusAtLumi] DONE" << std::endl;