CMS 3D CMS Logo

TrackingQualityChecker.cc
Go to the documentation of this file.
4 
6 
8 
10 
13 
14 #include <iomanip>
15 //
16 // -- Constructor
17 //
19  : pSet_(ps), verbose_(pSet_.getUntrackedParameter<bool>("verbose", false)) {
20  edm::LogInfo("TrackingQualityChecker") << " Creating TrackingQualityChecker "
21  << "\n";
22 
25 
26  TopFolderName_ = pSet_.getUntrackedParameter<std::string>("TopFolderName", "Tracking");
27 
28  TrackingMEs tracking_mes;
29  std::vector<edm::ParameterSet> TrackingGlobalQualityMEs =
30  pSet_.getParameter<std::vector<edm::ParameterSet> >("TrackingGlobalQualityPSets");
31  for (const auto& meQTset : TrackingGlobalQualityMEs) {
32  std::string QTname = meQTset.getParameter<std::string>("QT");
33  tracking_mes.HistoDir = meQTset.getParameter<std::string>("dir");
34  tracking_mes.HistoName = meQTset.getParameter<std::string>("name");
35  if (verbose_)
36  edm::LogInfo("TrackingQualityChecker") << " inserting " << QTname << " in TrackingMEsMap" << std::endl;
37  TrackingMEsMap.insert(std::pair<std::string, TrackingMEs>(QTname, tracking_mes));
38  }
39  if (verbose_)
40  edm::LogInfo("TrackingQualityChecker") << " created TrackingMEsMap" << std::endl;
41 
42  TrackingLSMEs tracking_ls_mes;
43  std::vector<edm::ParameterSet> TrackingLSQualityMEs =
44  pSet_.getParameter<std::vector<edm::ParameterSet> >("TrackingLSQualityPSets");
45  for (const auto& meQTset : TrackingLSQualityMEs) {
46  std::string QTname = meQTset.getParameter<std::string>("QT");
47  tracking_ls_mes.HistoLSDir = meQTset.exists("LSdir") ? meQTset.getParameter<std::string>("LSdir") : "";
48  tracking_ls_mes.HistoLSName = meQTset.exists("LSname") ? meQTset.getParameter<std::string>("LSname") : "";
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.;
51  tracking_ls_mes.TrackingFlag = nullptr;
52 
53  if (verbose_)
54  edm::LogInfo("TrackingQualityChecker") << " inserting " << QTname << " in TrackingMEsMap" << std::endl;
55  TrackingLSMEsMap.insert(std::pair<std::string, TrackingLSMEs>(QTname, tracking_ls_mes));
56  }
57  if (verbose_)
58  edm::LogInfo("TrackingQualityChecker") << " created TrackingLSMEsMap" << std::endl;
59 }
60 //
61 // -- Destructor
62 //
64  edm::LogInfo("TrackingQualityChecker") << " Deleting TrackingQualityChecker "
65  << "\n";
66 }
67 //
68 // -- create reportSummary MEs
69 //
71  if (verbose_)
72  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::bookGlobalStatus] already booked ? "
73  << (bookedTrackingGlobalStatus_ ? "yes" : "nope") << std::endl;
74 
76  ibooker.cd();
77  edm::LogInfo("TrackingQualityChecker") << " booking TrackingQualityStatus"
78  << "\n";
79 
80  std::string tracking_dir = "";
81  TrackingUtility::getTopFolderPath(ibooker, igetter, TopFolderName_, tracking_dir);
82  ibooker.setCurrentFolder(TopFolderName_ + "/EventInfo");
83 
84  TrackGlobalSummaryReportGlobal = ibooker.bookFloat("reportSummary");
85 
86  std::string hname, htitle;
87  hname = "reportSummaryMap";
88  htitle = "Tracking Report Summary Map";
89 
90  size_t nQT = TrackingMEsMap.size();
91  if (verbose_)
92  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::bookGlobalStatus] nQT: " << nQT << std::endl;
93  TrackGlobalSummaryReportMap = ibooker.book2D(hname, htitle, nQT, 0.5, float(nQT) + 0.5, 1, 0.5, 1.5);
94  TrackGlobalSummaryReportMap->setAxisTitle("Track Quality Type", 1);
95  TrackGlobalSummaryReportMap->setAxisTitle("QTest Flag", 2);
96  size_t ibin = 0;
97  for (const auto& meQTset : TrackingMEsMap) {
98  TrackGlobalSummaryReportMap->setBinLabel(ibin + 1, meQTset.first);
99  ibin++;
100  }
101 
102  ibooker.setCurrentFolder(TopFolderName_ + "/EventInfo/reportSummaryContents");
103 
104  for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin(); it != TrackingMEsMap.end(); it++) {
105  std::string meQTname = it->first;
106  it->second.TrackingFlag = ibooker.bookFloat("Track" + meQTname);
107  if (verbose_)
108  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::bookGlobalStatus] " << it->first
109  << " exists ? " << it->second.TrackingFlag << std::endl;
110  if (verbose_)
111  edm::LogInfo("TrackingQualityChecker")
112  << "[TrackingQualityChecker::bookGlobalStatus] DONE w/ TrackingMEsMap" << std::endl;
113  }
114 
116  ibooker.cd();
117  }
118 }
119 
121  if (verbose_)
122  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::bookLSStatus] already booked ? "
123  << (bookedTrackingLSStatus_ ? "yes" : "nope") << std::endl;
124 
126  ibooker.cd();
127  edm::LogInfo("TrackingQualityChecker") << " booking TrackingQualityStatus"
128  << "\n";
129 
130  std::string tracking_dir = "";
131  TrackingUtility::getTopFolderPath(ibooker, igetter, TopFolderName_, tracking_dir);
132  ibooker.setCurrentFolder(TopFolderName_ + "/EventInfo");
133 
134  TrackLSSummaryReportGlobal = ibooker.bookFloat("reportSummary");
135 
136  std::string hname, htitle;
137  hname = "reportSummaryMap";
138  htitle = "Tracking Report Summary Map";
139 
140  if (verbose_) {
141  size_t nQT = TrackingLSMEsMap.size();
142  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::bookLSStatus] nQT: " << nQT << std::endl;
143  }
144 
145  ibooker.setCurrentFolder(TopFolderName_ + "/EventInfo/reportSummaryContents");
146  for (std::map<std::string, TrackingLSMEs>::iterator it = TrackingLSMEsMap.begin(); it != TrackingLSMEsMap.end();
147  it++) {
148  std::string meQTname = it->first;
149  it->second.TrackingFlag = ibooker.bookFloat("Track" + meQTname);
150  if (verbose_)
151  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::bookLSStatus] " << it->first << " exists ? "
152  << it->second.TrackingFlag << std::endl;
153  if (verbose_)
154  edm::LogInfo("TrackingQualityChecker")
155  << "[TrackingQualityChecker::bookLSStatus] DONE w/ TrackingLSMEsMap" << std::endl;
156  }
157 
159  ibooker.cd();
160  }
161 }
162 
163 //
164 // -- Fill Dummy Status
165 //
167  if (verbose_)
168  edm::LogInfo("TrackingQualityChecker")
169  << "[TrackingQualityChecker::fillDummyGlobalStatus] starting ..." << std::endl;
170 
172  if (verbose_)
173  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::fillDummyGlobalStatus] already booked ? "
174  << (bookedTrackingGlobalStatus_ ? "yes" : "nope") << std::endl;
177 
178  for (int ibin = 1; ibin < TrackGlobalSummaryReportMap->getNbinsX() + 1; ibin++) {
180  }
181 
182  for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin(); it != TrackingMEsMap.end(); it++)
183  it->second.TrackingFlag->Fill(-1.0);
184  if (verbose_)
185  edm::LogInfo("TrackingQualityChecker")
186  << "[TrackingQualityChecker::fillDummyGlobalStatus] DONE w/ TrackingMEsMap" << std::endl;
187  }
188 }
190  if (verbose_)
191  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::fillDummyLSStatus] starting ..." << std::endl;
192 
193  resetLSStatus();
194  if (verbose_)
195  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::fillDummyLSStatus] already booked ? "
196  << (bookedTrackingLSStatus_ ? "yes" : "nope") << std::endl;
199  for (std::map<std::string, TrackingLSMEs>::iterator it = TrackingLSMEsMap.begin(); it != TrackingLSMEsMap.end();
200  it++)
201  it->second.TrackingFlag->Fill(-1.0);
202  if (verbose_)
203  edm::LogInfo("TrackingQualityChecker")
204  << "[TrackingQualityChecker::fillDummyLSStatus] DONE w/ TrackingLSMEsMap" << std::endl;
205  }
206 }
207 
208 //
209 // -- Reset Status
210 //
212  if (verbose_)
213  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::resetGlobalStatus] already booked ? "
214  << (bookedTrackingGlobalStatus_ ? "yes" : "nope") << std::endl;
218 
219  for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin(); it != TrackingMEsMap.end(); it++) {
220  MonitorElement* me = it->second.TrackingFlag;
221  if (verbose_)
222  edm::LogInfo("TrackingQualityChecker")
223  << "[TrackingQualityChecker::resetGlobalStatus] " << it->second.HistoName << " exist ? "
224  << (it->second.TrackingFlag == nullptr ? "nope" : "yes") << " ---> " << me << std::endl;
225  me->Reset();
226  }
227  if (verbose_)
228  edm::LogInfo("TrackingQualityChecker")
229  << "[TrackingQualityChecker::resetGlobalStatus] DONE w/ TrackingMEsMap" << std::endl;
230  }
231 }
233  if (verbose_)
234  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::resetLSStatus] already booked ? "
235  << (bookedTrackingLSStatus_ ? "yes" : "nope") << std::endl;
238  for (std::map<std::string, TrackingLSMEs>::iterator it = TrackingLSMEsMap.begin(); it != TrackingLSMEsMap.end();
239  it++) {
240  MonitorElement* me = it->second.TrackingFlag;
241  if (verbose_)
242  edm::LogInfo("TrackingQualityChecker")
243  << "[TrackingQualityChecker::resetLSStatus] " << it->second.HistoLSName << " exist ? "
244  << (it->second.TrackingFlag == nullptr ? "nope" : "yes") << " ---> " << me << std::endl;
245  me->Reset();
246  }
247  if (verbose_)
248  edm::LogInfo("TrackingQualityChecker")
249  << "[TrackingQualityChecker::resetLSStatus] DONE w/ TrackingLSMEsMap" << std::endl;
250  }
251 }
252 
253 //
254 // -- Fill Status
255 //
257  if (verbose_)
258  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::fillGlobalStatus] already booked ? "
259  << (bookedTrackingGlobalStatus_ ? "yes" : "nope") << std::endl;
261  bookGlobalStatus(ibooker, igetter);
262 
264  fillTrackingStatus(ibooker, igetter);
265  if (verbose_)
266  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::fillGlobalStatus] DONE" << std::endl;
267  ibooker.cd();
268 }
269 
271  if (verbose_)
272  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::fillLSStatus] already booked ? "
273  << (bookedTrackingLSStatus_ ? "yes" : "nope") << std::endl;
275  bookLSStatus(ibooker, igetter);
276 
278  fillTrackingStatusAtLumi(ibooker, igetter);
279  if (verbose_)
280  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::fillLSStatus] DONE" << std::endl;
281  ibooker.cd();
282 }
283 
284 //
285 // -- Fill Tracking Status
286 //
288  float gstatus = 0.0;
289 
290  ibooker.cd();
291  if (!TrackingUtility::goToDir(ibooker, igetter, TopFolderName_))
292  return;
293 
294  int ibin = 0;
295  for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin(); it != TrackingMEsMap.end(); it++) {
296  if (verbose_)
297  edm::LogInfo("TrackingQualityChecker")
298  << "fillTrackingStatus ME: " << it->first << " [" << it->second.TrackingFlag->getFullname()
299  << "] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
300 
301  ibin++;
302 
303  std::string localMEdirpath = it->second.HistoDir;
304  std::string MEname = it->second.HistoName;
305 
306  std::vector<MonitorElement*> tmpMEvec = igetter.getContents(ibooker.pwd() + "/" + localMEdirpath);
307  if (verbose_)
308  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus tmpMEvec: " << tmpMEvec.size() << std::endl;
309  MonitorElement* me = nullptr;
310 
311  size_t nMEs = 0;
312  for (auto ime : tmpMEvec) {
313  std::string name = ime->getName();
314  if (verbose_)
315  edm::LogInfo("TrackingQualityChecker") << "name: " << name << " <-- --> " << MEname << std::endl;
316  if (name.find(MEname) != std::string::npos) {
317  me = ime;
318  nMEs++;
319  }
320  }
321  // only one ME found
322  if (verbose_)
323  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus nMEs: " << nMEs << std::endl;
324  if (nMEs == 1) {
325  float status = 0.;
326  for (auto ime : tmpMEvec) {
327  std::string name = ime->getName();
328  if (verbose_)
329  edm::LogInfo("TrackingQualityChecker") << "name: " << name << " [" << MEname << "]" << std::endl;
330  if (name.find(MEname) != std::string::npos) {
331  me = ime;
332  if (verbose_)
333  edm::LogInfo("TrackingQualityChecker") << "inside the loop nQTme: " << me->getQReports().size() << "["
334  << ime->getFullname() << "]" << std::endl;
335  }
336  }
337  if (verbose_)
338  edm::LogInfo("TrackingQualityChecker")
339  << "me: " << me << "[" << me->getName() << ", " << me->getFullname() << "]" << std::endl;
340  if (!me)
341  continue;
342  if (verbose_)
343  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus status: " << status << std::endl;
344  std::vector<QReport*> qt_reports = me->getQReports();
345  size_t nQTme = qt_reports.size();
346  if (verbose_)
347  edm::LogInfo("TrackingQualityChecker") << "nQTme: " << nQTme << std::endl;
348  if (nQTme != 0) {
349  if (verbose_)
350  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus qt_reports: " << qt_reports.size() << std::endl;
351  // loop on possible QTs
352  for (auto iQT : qt_reports) {
353  status += iQT->getQTresult();
354  if (verbose_)
355  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus iQT: " << iQT->getQRName() << std::endl;
356  if (verbose_)
357  edm::LogInfo("TrackingQualityChecker")
358  << "fillTrackingStatus MEname: " << MEname << " status: " << iQT->getQTresult() << " exists ? "
359  << (it->second.TrackingFlag ? "yes " : "no ") << it->second.TrackingFlag << std::endl;
360  if (verbose_)
361  edm::LogInfo("TrackingQualityChecker")
362  << "fillTrackingStatus iQT message: " << iQT->getMessage() << std::endl;
363  if (verbose_)
364  edm::LogInfo("TrackingQualityChecker")
365  << "fillTrackingStatus iQT status: " << iQT->getStatus() << std::endl;
366  }
367  status = status / float(nQTme);
368  if (verbose_)
369  edm::LogInfo("TrackingQualityChecker")
370  << "fillTrackingStatus MEname: " << MEname << " status: " << status << std::endl;
371  it->second.TrackingFlag->Fill(status);
372  if (verbose_)
373  edm::LogInfo("TrackingQualityChecker")
374  << "fillTrackingStatus TrackGlobalSummaryReportMap: " << TrackGlobalSummaryReportMap << std::endl;
376  }
377 
378  if (verbose_)
379  edm::LogInfo("TrackingQualityChecker")
380  << "fillTrackingStatus gstatus: " << gstatus << " x status: " << status << std::endl;
381  if (status < 0.)
382  gstatus = -1.;
383  else
384  gstatus += status;
385  if (verbose_)
386  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus ===> gstatus: " << gstatus << std::endl;
387  if (verbose_)
388  edm::LogInfo("TrackingQualityChecker")
389  << "fillTrackingStatus ME: " << it->first << " [" << it->second.TrackingFlag->getFullname()
390  << "] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
391 
392  } else { // more than 1 ME w/ the same root => they need to be considered together
393  float status = 1.;
394  for (auto ime : tmpMEvec) {
395  float tmp_status = 1.;
396  std::string name = ime->getName();
397  if (name.find(MEname) != std::string::npos) {
398  me = ime;
399 
400  if (verbose_)
401  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus status: " << status << std::endl;
402  std::vector<QReport*> qt_reports = me->getQReports();
403  size_t nQTme = qt_reports.size();
404  if (verbose_)
405  edm::LogInfo("TrackingQualityChecker")
406  << "nQTme: " << nQTme << "[" << name << ", " << ime->getFullname() << "]" << std::endl;
407  if (nQTme != 0) {
408  if (verbose_)
409  edm::LogInfo("TrackingQualityChecker")
410  << "fillTrackingStatus qt_reports: " << qt_reports.size() << std::endl;
411  // loop on possible QTs
412  for (auto iQT : qt_reports) {
413  tmp_status += iQT->getQTresult();
414  if (verbose_)
415  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus iQT: " << iQT->getQRName() << std::endl;
416  if (verbose_)
417  edm::LogInfo("TrackingQualityChecker")
418  << "fillTrackingStatus MEname: " << MEname << " status: " << iQT->getQTresult() << " exists ? "
419  << (it->second.TrackingFlag ? "yes " : "no ") << it->second.TrackingFlag << std::endl;
420  if (verbose_)
421  edm::LogInfo("TrackingQualityChecker")
422  << "fillTrackingStatus iQT message: " << iQT->getMessage() << std::endl;
423  if (verbose_)
424  edm::LogInfo("TrackingQualityChecker")
425  << "fillTrackingStatus iQT status: " << iQT->getStatus() << std::endl;
426  }
427  tmp_status = tmp_status / float(nQTme);
428  }
429  }
430  status = fminf(tmp_status, status);
431  }
432  if (status < 0.)
433  gstatus = -1.;
434  else
435  gstatus += status;
436  if (verbose_)
437  edm::LogInfo("TrackingQualityChecker")
438  << "fillTrackingStatus MEname: " << MEname << " status: " << status << std::endl;
439  it->second.TrackingFlag->Fill(status);
440  if (verbose_)
441  edm::LogInfo("TrackingQualityChecker")
442  << "fillTrackingStatus TrackGlobalSummaryReportMap: " << TrackGlobalSummaryReportMap << std::endl;
443 
445  }
446  }
447 
448  // After harvesting, all per-lumi MEs are reset, to make sure we only get
449  // events of the new lumisection next time.
450  for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin(); it != TrackingMEsMap.end(); it++) {
451  std::string localMEdirpath = it->second.HistoDir;
452  std::vector<MonitorElement*> tmpMEvec = igetter.getContents(ibooker.pwd() + "/" + localMEdirpath);
453  for (auto ime : tmpMEvec) {
454  if (ime->getLumiFlag()) {
455  ime->Reset();
456  }
457  }
458  }
459 
460  if (verbose_)
461  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus gstatus: " << gstatus << std::endl;
462  size_t nQT = TrackingMEsMap.size();
463  if (gstatus < 1.)
464  gstatus = -1.;
465  else
466  gstatus = gstatus / float(nQT);
467 
468  if (verbose_)
469  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus ===> gstatus: " << gstatus << std::endl;
471  ibooker.cd();
472 
473  if (verbose_)
474  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus DONE" << std::endl;
475 }
476 
477 //
478 // -- Fill Report Summary Map
479 //
481  if (me && me->kind() == MonitorElement::Kind::TH2F) {
482  TH2F* th2d = me->getTH2F();
483  th2d->SetBinContent(xbin, ybin, val);
484  }
485 }
486 
487 // Fill Tracking Status MEs at the Lumi block
488 //
490  if (verbose_)
491  edm::LogInfo("TrackingQualityChecker")
492  << "[TrackingQualityChecker::fillTrackingStatusAtLumi] starting .. " << std::endl;
493  float gstatus = 1.0;
494 
495  ibooker.cd();
496  if (!TrackingUtility::goToDir(ibooker, igetter, TopFolderName_))
497  return;
498 
499  int ibin = 0;
500  for (std::map<std::string, TrackingLSMEs>::iterator it = TrackingLSMEsMap.begin(); it != TrackingLSMEsMap.end();
501  it++) {
502  if (verbose_)
503  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ME: " << it->first
504  << " [" << it->second.TrackingFlag->getFullname()
505  << "] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
506 
507  ibin++;
508 
509  std::string localMEdirpath = it->second.HistoLSDir;
510  std::string MEname = it->second.HistoLSName;
511  float lower_cut = it->second.HistoLSLowerCut;
512  float upper_cut = it->second.HistoLSUpperCut;
513 
514  float status = 1.0;
515 
516  std::vector<MonitorElement*> tmpMEvec = igetter.getContents(ibooker.pwd() + "/" + localMEdirpath);
517  if (verbose_)
518  edm::LogInfo("TrackingQualityChecker")
519  << "[TrackingQualityChecker::fillTrackingStatusAtLumi] tmpMEvec: " << tmpMEvec.size() << std::endl;
520 
521  MonitorElement* me = nullptr;
522 
523  size_t nMEs = 0;
524  for (auto ime : tmpMEvec) {
525  std::string name = ime->getName();
526  if (name.find(MEname) != std::string::npos) {
527  me = ime;
528  nMEs++;
529  }
530  }
531  // only one ME found
532  if (nMEs == 1) {
533  for (auto ime : tmpMEvec) {
534  std::string name = ime->getName();
535  if (name.find(MEname) != std::string::npos) {
536  me = ime;
537  }
538  }
539  if (!me)
540  continue;
541 
542  if (me->kind() == MonitorElement::Kind::TH1F) {
543  float x_mean = me->getMean();
544  if (verbose_)
545  edm::LogInfo("TrackingQualityChecker")
546  << "[TrackingQualityChecker::fillTrackingStatusAtLumi] MEname: " << MEname << " x_mean: " << x_mean
547  << std::endl;
548  if (x_mean <= lower_cut || x_mean > upper_cut)
549  status = 0.0;
550  else
551  status = 1.0;
552  }
553  } else { // more than 1 ME w/ the same root => they need to be considered together
554  for (auto ime : tmpMEvec) {
555  float tmp_status = 1.;
556  std::string name = ime->getName();
557  if (name.find(MEname) != std::string::npos) {
558  me = ime;
559  if (!me)
560  continue;
561 
562  if (me->kind() == MonitorElement::Kind::TH1F) {
563  float x_mean = me->getMean();
564  if (verbose_)
565  edm::LogInfo("TrackingQualityChecker")
566  << "[TrackingQualityChecker::fillTrackingStatusAtLumi] MEname: " << MEname << "[" << me->getName()
567  << "] x_mean: " << x_mean << std::endl;
568  if (x_mean <= lower_cut || x_mean > upper_cut)
569  tmp_status = 0.0;
570  else
571  tmp_status = 1.0;
572  if (verbose_)
573  edm::LogInfo("TrackingQualityChecker")
574  << "[TrackingQualityChecker::fillTrackingStatusAtLumi] tmp_status: " << tmp_status << std::endl;
575  }
576  }
577  status = fminf(tmp_status, status);
578  if (verbose_)
579  edm::LogInfo("TrackingQualityChecker")
580  << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ==> status: " << status << std::endl;
581  } // loop on tmpMEvec
582  }
583  it->second.TrackingFlag->Fill(status);
584  if (verbose_)
585  edm::LogInfo("TrackingQualityChecker")
586  << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ===> status: " << status << " [" << gstatus << "]"
587  << std::endl;
588  if (status == 0.0)
589  gstatus = -1.0;
590  else
591  gstatus = gstatus * status;
592  if (verbose_)
593  edm::LogInfo("TrackingQualityChecker")
594  << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ===> gstatus: " << gstatus << std::endl;
595  if (verbose_)
596  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ME: " << it->first
597  << " [" << it->second.TrackingFlag->getFullname()
598  << "] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
599  }
601  ibooker.cd();
602 
603  if (verbose_)
604  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::fillTrackingStatusAtLumi] DONE" << std::endl;
605 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
MonitorElement * TrackGlobalSummaryReportMap
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
virtual std::string pwd()
Definition: DQMStore.cc:16
std::map< std::string, TrackingMEs > TrackingMEsMap
T getUntrackedParameter(std::string const &, T const &) const
void Fill(long long x)
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)
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())
Definition: DQMStore.h:212
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
Definition: DQMStore.cc:593
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)