CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes
TrackingQualityChecker Class Reference

#include <TrackingQualityChecker.h>

Classes

struct  TrackingLSMEs
 
struct  TrackingMEs
 

Public Types

typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 

Public Member Functions

void bookGlobalStatus (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
void bookLSStatus (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
void fillDummyGlobalStatus ()
 
void fillDummyLSStatus ()
 
void fillGlobalStatus (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
void fillLSStatus (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
void resetGlobalStatus ()
 
void resetLSStatus ()
 
 TrackingQualityChecker (edm::ParameterSet const &ps)
 
virtual ~TrackingQualityChecker ()
 

Private Member Functions

void fillStatusHistogram (MonitorElement *, int xbin, int ybin, float val)
 
void fillTrackingStatus (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
void fillTrackingStatusAtLumi (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 

Private Attributes

bool bookedTrackingGlobalStatus_
 
bool bookedTrackingLSStatus_
 
edm::ParameterSet pSet_
 
std::string TopFolderName_
 
MonitorElementTrackGlobalSummaryReportGlobal
 
MonitorElementTrackGlobalSummaryReportMap
 
std::map< std::string, TrackingLSMEsTrackingLSMEsMap
 
std::map< std::string, TrackingMEsTrackingMEsMap
 
MonitorElementTrackLSSummaryReportGlobal
 
bool verbose_
 

Detailed Description

Definition at line 18 of file TrackingQualityChecker.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 20 of file TrackingQualityChecker.h.

◆ MonitorElement

Definition at line 21 of file TrackingQualityChecker.h.

Constructor & Destructor Documentation

◆ TrackingQualityChecker()

TrackingQualityChecker::TrackingQualityChecker ( edm::ParameterSet const &  ps)

Definition at line 18 of file TrackingQualityChecker.cc.

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 (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  std::cout << "[TrackingQualityChecker::TrackingQualityChecker] inserting " << QTname << " in TrackingMEsMap"
37  << std::endl;
38  TrackingMEsMap.insert(std::pair<std::string, TrackingMEs>(QTname, tracking_mes));
39  }
40  if (verbose_)
41  std::cout << "[TrackingQualityChecker::TrackingQualityChecker] created TrackingMEsMap" << std::endl;
42 
43  TrackingLSMEs tracking_ls_mes;
44  std::vector<edm::ParameterSet> TrackingLSQualityMEs =
45  pSet_.getParameter<std::vector<edm::ParameterSet> >("TrackingLSQualityPSets");
46  for (auto meQTset : TrackingLSQualityMEs) {
47  std::string QTname = meQTset.getParameter<std::string>("QT");
48  tracking_ls_mes.HistoLSDir = meQTset.exists("LSdir") ? meQTset.getParameter<std::string>("LSdir") : "";
49  tracking_ls_mes.HistoLSName = meQTset.exists("LSname") ? meQTset.getParameter<std::string>("LSname") : "";
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.;
52  tracking_ls_mes.TrackingFlag = nullptr;
53 
54  if (verbose_)
55  std::cout << "[TrackingQualityChecker::TrackingQualityChecker] inserting " << QTname << " in TrackingMEsMap"
56  << std::endl;
57  TrackingLSMEsMap.insert(std::pair<std::string, TrackingLSMEs>(QTname, tracking_ls_mes));
58  }
59  if (verbose_)
60  std::cout << "[TrackingQualityChecker::TrackingQualityChecker] created TrackingLSMEsMap" << std::endl;
61 }

References bookedTrackingGlobalStatus_, bookedTrackingLSStatus_, gather_cfg::cout, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), TrackingQualityChecker::TrackingLSMEs::HistoLSDir, TrackingQualityChecker::TrackingLSMEs::HistoLSLowerCut, TrackingQualityChecker::TrackingLSMEs::HistoLSName, TrackingQualityChecker::TrackingLSMEs::HistoLSUpperCut, pSet_, AlCaHLTBitMon_QueryRunRegistry::string, TopFolderName_, TrackingQualityChecker::TrackingLSMEs::TrackingFlag, TrackingLSMEsMap, TrackingCertification_cfi::TrackingLSQualityMEs, TrackingMEsMap, and verbose_.

◆ ~TrackingQualityChecker()

TrackingQualityChecker::~TrackingQualityChecker ( )
virtual

Definition at line 65 of file TrackingQualityChecker.cc.

65  {
66  edm::LogInfo("TrackingQualityChecker") << " Deleting TrackingQualityChecker "
67  << "\n";
68 }

Member Function Documentation

◆ bookGlobalStatus()

void TrackingQualityChecker::bookGlobalStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 72 of file TrackingQualityChecker.cc.

72  {
73  if (verbose_)
74  std::cout << "[TrackingQualityChecker::bookGlobalStatus] already booked ? "
75  << (bookedTrackingGlobalStatus_ ? "yes" : "nope") << std::endl;
76 
78  ibooker.cd();
79  edm::LogInfo("TrackingQualityChecker") << " booking TrackingQualityStatus"
80  << "\n";
81 
82  std::string tracking_dir = "";
83  TrackingUtility::getTopFolderPath(ibooker, igetter, TopFolderName_, tracking_dir);
84  ibooker.setCurrentFolder(TopFolderName_ + "/EventInfo");
85 
86  TrackGlobalSummaryReportGlobal = ibooker.bookFloat("reportSummary");
87 
88  std::string hname, htitle;
89  hname = "reportSummaryMap";
90  htitle = "Tracking Report Summary Map";
91 
92  size_t nQT = TrackingMEsMap.size();
93  if (verbose_)
94  std::cout << "[TrackingQualityChecker::bookGlobalStatus] nQT: " << nQT << std::endl;
95  TrackGlobalSummaryReportMap = ibooker.book2D(hname, htitle, nQT, 0.5, float(nQT) + 0.5, 1, 0.5, 1.5);
96  TrackGlobalSummaryReportMap->setAxisTitle("Track Quality Type", 1);
97  TrackGlobalSummaryReportMap->setAxisTitle("QTest Flag", 2);
98  size_t ibin = 0;
99  for (auto meQTset : TrackingMEsMap) {
100  TrackGlobalSummaryReportMap->setBinLabel(ibin + 1, meQTset.first);
101  ibin++;
102  }
103 
104  ibooker.setCurrentFolder(TopFolderName_ + "/EventInfo/reportSummaryContents");
105 
106  for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin(); it != TrackingMEsMap.end(); it++) {
107  std::string meQTname = it->first;
108  it->second.TrackingFlag = ibooker.bookFloat("Track" + meQTname);
109  if (verbose_)
110  std::cout << "[TrackingQualityChecker::bookGlobalStatus] " << it->first << " exists ? "
111  << it->second.TrackingFlag << std::endl;
112  if (verbose_)
113  std::cout << "[TrackingQualityChecker::bookGlobalStatus] DONE w/ TrackingMEsMap" << std::endl;
114  }
115 
117  ibooker.cd();
118  }
119 }

References dqm::implementation::IBooker::book2D(), bookedTrackingGlobalStatus_, dqm::implementation::IBooker::bookFloat(), dqm::implementation::NavigatorBase::cd(), gather_cfg::cout, TrackingUtility::getTopFolderPath(), dqm::impl::MonitorElement::setAxisTitle(), dqm::impl::MonitorElement::setBinLabel(), dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, TopFolderName_, TrackGlobalSummaryReportGlobal, TrackGlobalSummaryReportMap, TrackingMEsMap, and verbose_.

Referenced by TrackingActionExecutor::createGlobalStatus(), and fillGlobalStatus().

◆ bookLSStatus()

void TrackingQualityChecker::bookLSStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 121 of file TrackingQualityChecker.cc.

121  {
122  if (verbose_)
123  std::cout << "[TrackingQualityChecker::bookLSStatus] already booked ? "
124  << (bookedTrackingLSStatus_ ? "yes" : "nope") << std::endl;
125 
127  ibooker.cd();
128  edm::LogInfo("TrackingQualityChecker") << " booking TrackingQualityStatus"
129  << "\n";
130 
131  std::string tracking_dir = "";
132  TrackingUtility::getTopFolderPath(ibooker, igetter, TopFolderName_, tracking_dir);
133  ibooker.setCurrentFolder(TopFolderName_ + "/EventInfo");
134 
135  TrackLSSummaryReportGlobal = ibooker.bookFloat("reportSummary");
136 
137  std::string hname, htitle;
138  hname = "reportSummaryMap";
139  htitle = "Tracking Report Summary Map";
140 
141  if (verbose_) {
142  size_t nQT = TrackingLSMEsMap.size();
143  std::cout << "[TrackingQualityChecker::bookLSStatus] nQT: " << nQT << std::endl;
144  }
145 
146  ibooker.setCurrentFolder(TopFolderName_ + "/EventInfo/reportSummaryContents");
147  for (std::map<std::string, TrackingLSMEs>::iterator it = TrackingLSMEsMap.begin(); it != TrackingLSMEsMap.end();
148  it++) {
149  std::string meQTname = it->first;
150  it->second.TrackingFlag = ibooker.bookFloat("Track" + meQTname);
151  if (verbose_)
152  std::cout << "[TrackingQualityChecker::bookLSStatus] " << it->first << " exists ? " << it->second.TrackingFlag
153  << std::endl;
154  if (verbose_)
155  std::cout << "[TrackingQualityChecker::bookLSStatus] DONE w/ TrackingLSMEsMap" << std::endl;
156  }
157 
159  ibooker.cd();
160  }
161 }

References bookedTrackingLSStatus_, dqm::implementation::IBooker::bookFloat(), dqm::implementation::NavigatorBase::cd(), gather_cfg::cout, TrackingUtility::getTopFolderPath(), dqm::implementation::NavigatorBase::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, TopFolderName_, TrackingLSMEsMap, TrackLSSummaryReportGlobal, and verbose_.

Referenced by TrackingActionExecutor::createLSStatus(), and fillLSStatus().

◆ fillDummyGlobalStatus()

void TrackingQualityChecker::fillDummyGlobalStatus ( )

Definition at line 166 of file TrackingQualityChecker.cc.

166  {
167  if (verbose_)
168  std::cout << "[TrackingQualityChecker::fillDummyGlobalStatus] starting ..." << std::endl;
169 
171  if (verbose_)
172  std::cout << "[TrackingQualityChecker::fillDummyGlobalStatus] already booked ? "
173  << (bookedTrackingGlobalStatus_ ? "yes" : "nope") << std::endl;
176 
177  for (int ibin = 1; ibin < TrackGlobalSummaryReportMap->getNbinsX() + 1; ibin++) {
179  }
180 
181  for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin(); it != TrackingMEsMap.end(); it++)
182  it->second.TrackingFlag->Fill(-1.0);
183  if (verbose_)
184  std::cout << "[TrackingQualityChecker::fillDummyGlobalStatus] DONE w/ TrackingMEsMap" << std::endl;
185  }
186 }

References bookedTrackingGlobalStatus_, gather_cfg::cout, dqm::impl::MonitorElement::Fill(), fillStatusHistogram(), dqm::impl::MonitorElement::getNbinsX(), resetGlobalStatus(), TrackGlobalSummaryReportGlobal, TrackGlobalSummaryReportMap, TrackingMEsMap, and verbose_.

Referenced by TrackingActionExecutor::fillDummyGlobalStatus(), and fillGlobalStatus().

◆ fillDummyLSStatus()

void TrackingQualityChecker::fillDummyLSStatus ( )

Definition at line 187 of file TrackingQualityChecker.cc.

187  {
188  if (verbose_)
189  std::cout << "[TrackingQualityChecker::fillDummyLSStatus] starting ..." << std::endl;
190 
191  resetLSStatus();
192  if (verbose_)
193  std::cout << "[TrackingQualityChecker::fillDummyLSStatus] already booked ? "
194  << (bookedTrackingLSStatus_ ? "yes" : "nope") << std::endl;
197  for (std::map<std::string, TrackingLSMEs>::iterator it = TrackingLSMEsMap.begin(); it != TrackingLSMEsMap.end();
198  it++)
199  it->second.TrackingFlag->Fill(-1.0);
200  if (verbose_)
201  std::cout << "[TrackingQualityChecker::fillDummyLSStatus] DONE w/ TrackingLSMEsMap" << std::endl;
202  }
203 }

References bookedTrackingLSStatus_, gather_cfg::cout, dqm::impl::MonitorElement::Fill(), resetLSStatus(), TrackingLSMEsMap, TrackLSSummaryReportGlobal, and verbose_.

Referenced by TrackingActionExecutor::fillDummyLSStatus(), and fillLSStatus().

◆ fillGlobalStatus()

void TrackingQualityChecker::fillGlobalStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 249 of file TrackingQualityChecker.cc.

249  {
250  if (verbose_)
251  std::cout << "[TrackingQualityChecker::fillGlobalStatus] already booked ? "
252  << (bookedTrackingGlobalStatus_ ? "yes" : "nope") << std::endl;
254  bookGlobalStatus(ibooker, igetter);
255 
257  fillTrackingStatus(ibooker, igetter);
258  if (verbose_)
259  std::cout << "[TrackingQualityChecker::fillGlobalStatus] DONE" << std::endl;
260  ibooker.cd();
261 }

References bookedTrackingGlobalStatus_, bookGlobalStatus(), dqm::implementation::NavigatorBase::cd(), gather_cfg::cout, fillDummyGlobalStatus(), fillTrackingStatus(), and verbose_.

Referenced by TrackingActionExecutor::fillGlobalStatus().

◆ fillLSStatus()

void TrackingQualityChecker::fillLSStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 263 of file TrackingQualityChecker.cc.

263  {
264  if (verbose_)
265  std::cout << "[TrackingQualityChecker::fillLSStatus] already booked ? "
266  << (bookedTrackingLSStatus_ ? "yes" : "nope") << std::endl;
268  bookLSStatus(ibooker, igetter);
269 
271  fillTrackingStatusAtLumi(ibooker, igetter);
272  if (verbose_)
273  std::cout << "[TrackingQualityChecker::fillLSStatus] DONE" << std::endl;
274  ibooker.cd();
275 }

References bookedTrackingLSStatus_, bookLSStatus(), dqm::implementation::NavigatorBase::cd(), gather_cfg::cout, fillDummyLSStatus(), fillTrackingStatusAtLumi(), and verbose_.

Referenced by TrackingActionExecutor::fillStatusAtLumi().

◆ fillStatusHistogram()

void TrackingQualityChecker::fillStatusHistogram ( MonitorElement me,
int  xbin,
int  ybin,
float  val 
)
private

Definition at line 469 of file TrackingQualityChecker.cc.

469  {
470  if (me && me->kind() == MonitorElement::Kind::TH2F) {
471  TH2F* th2d = me->getTH2F();
472  th2d->SetBinContent(xbin, ybin, val);
473  }
474 }

References hlt_dqm_clientPB-live_cfg::me, MonitorElementData::TH2F, and heppy_batch::val.

Referenced by fillDummyGlobalStatus(), and fillTrackingStatus().

◆ fillTrackingStatus()

void TrackingQualityChecker::fillTrackingStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
private

Definition at line 280 of file TrackingQualityChecker.cc.

280  {
281  float gstatus = 0.0;
282 
283  ibooker.cd();
284  if (!TrackingUtility::goToDir(ibooker, igetter, TopFolderName_))
285  return;
286 
287  int ibin = 0;
288  for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin(); it != TrackingMEsMap.end(); it++) {
289  if (verbose_)
290  std::cout << "[TrackingQualityChecker::fillTrackingStatus] ME: " << it->first << " ["
291  << it->second.TrackingFlag->getFullname() << "] flag: " << it->second.TrackingFlag->getFloatValue()
292  << std::endl;
293 
294  ibin++;
295 
296  std::string localMEdirpath = it->second.HistoDir;
297  std::string MEname = it->second.HistoName;
298 
299  std::vector<MonitorElement*> tmpMEvec = igetter.getContents(ibooker.pwd() + "/" + localMEdirpath);
300  if (verbose_)
301  std::cout << "[TrackingQualityChecker::fillTrackingStatus] tmpMEvec: " << tmpMEvec.size() << std::endl;
302  MonitorElement* me = nullptr;
303 
304  size_t nMEs = 0;
305  for (auto ime : tmpMEvec) {
306  std::string name = ime->getName();
307  if (verbose_)
308  std::cout << "name: " << name << " <-- --> " << MEname << std::endl;
309  if (name.find(MEname) != std::string::npos) {
310  me = ime;
311  nMEs++;
312  }
313  }
314  // only one ME found
315  if (verbose_)
316  std::cout << "[TrackingQualityChecker::fillTrackingStatus] nMEs: " << nMEs << std::endl;
317  if (nMEs == 1) {
318  float status = 0.;
319  for (auto ime : tmpMEvec) {
320  std::string name = ime->getName();
321  if (verbose_)
322  std::cout << "name: " << name << " [" << MEname << "]" << std::endl;
323  if (name.find(MEname) != std::string::npos) {
324  me = ime;
325  if (verbose_)
326  std::cout << "inside the loop nQTme: " << me->getQReports().size() << "[" << ime->getFullname() << "]"
327  << std::endl;
328  }
329  }
330  if (verbose_)
331  std::cout << "me: " << me << "[" << me->getName() << ", " << me->getFullname() << "]" << std::endl;
332  if (!me)
333  continue;
334  if (verbose_)
335  std::cout << "[TrackingQualityChecker::fillTrackingStatus] status: " << status << std::endl;
336  std::vector<QReport*> qt_reports = me->getQReports();
337  size_t nQTme = qt_reports.size();
338  if (verbose_)
339  std::cout << "nQTme: " << nQTme << std::endl;
340  if (nQTme != 0) {
341  if (verbose_)
342  std::cout << "[TrackingQualityChecker::fillTrackingStatus] qt_reports: " << qt_reports.size() << std::endl;
343  // loop on possible QTs
344  for (auto iQT : qt_reports) {
345  status += iQT->getQTresult();
346  if (verbose_)
347  std::cout << "[TrackingQualityChecker::fillTrackingStatus] iQT: " << iQT->getQRName() << std::endl;
348  if (verbose_)
349  std::cout << "[TrackingQualityChecker::fillTrackingStatus] MEname: " << MEname
350  << " status: " << iQT->getQTresult() << " exists ? " << (it->second.TrackingFlag ? "yes " : "no ")
351  << it->second.TrackingFlag << std::endl;
352  if (verbose_)
353  std::cout << "[TrackingQualityChecker::fillTrackingStatus] iQT message: " << iQT->getMessage() << std::endl;
354  if (verbose_)
355  std::cout << "[TrackingQualityChecker::fillTrackingStatus] iQT status: " << iQT->getStatus() << std::endl;
356  }
357  status = status / float(nQTme);
358  if (verbose_)
359  std::cout << "[TrackingQualityChecker::fillTrackingStatus] MEname: " << MEname << " status: " << status
360  << std::endl;
361  it->second.TrackingFlag->Fill(status);
362  if (verbose_)
363  std::cout << "[TrackingQualityChecker::fillTrackingStatus] TrackGlobalSummaryReportMap: "
364  << TrackGlobalSummaryReportMap << std::endl;
366  }
367 
368  if (verbose_)
369  std::cout << "[TrackingQualityChecker::fillTrackingStatus] gstatus: " << gstatus << " x status: " << status
370  << std::endl;
371  if (status < 0.)
372  gstatus = -1.;
373  else
374  gstatus += status;
375  if (verbose_)
376  std::cout << "[TrackingQualityChecker::fillTrackingStatus] ===> gstatus: " << gstatus << std::endl;
377  if (verbose_)
378  std::cout << "[TrackingQualityChecker::fillTrackingStatus] ME: " << it->first << " ["
379  << it->second.TrackingFlag->getFullname() << "] flag: " << it->second.TrackingFlag->getFloatValue()
380  << std::endl;
381 
382  } else { // more than 1 ME w/ the same root => they need to be considered together
383  float status = 1.;
384  for (auto ime : tmpMEvec) {
385  float tmp_status = 1.;
386  std::string name = ime->getName();
387  if (name.find(MEname) != std::string::npos) {
388  me = ime;
389 
390  if (verbose_)
391  std::cout << "[TrackingQualityChecker::fillTrackingStatus] status: " << status << std::endl;
392  std::vector<QReport*> qt_reports = me->getQReports();
393  size_t nQTme = qt_reports.size();
394  if (verbose_)
395  std::cout << "nQTme: " << nQTme << "[" << name << ", " << ime->getFullname() << "]" << std::endl;
396  if (nQTme != 0) {
397  if (verbose_)
398  std::cout << "[TrackingQualityChecker::fillTrackingStatus] qt_reports: " << qt_reports.size()
399  << std::endl;
400  // loop on possible QTs
401  for (auto iQT : qt_reports) {
402  tmp_status += iQT->getQTresult();
403  if (verbose_)
404  std::cout << "[TrackingQualityChecker::fillTrackingStatus] iQT: " << iQT->getQRName() << std::endl;
405  if (verbose_)
406  std::cout << "[TrackingQualityChecker::fillTrackingStatus] MEname: " << MEname
407  << " status: " << iQT->getQTresult() << " exists ? "
408  << (it->second.TrackingFlag ? "yes " : "no ") << it->second.TrackingFlag << std::endl;
409  if (verbose_)
410  std::cout << "[TrackingQualityChecker::fillTrackingStatus] iQT message: " << iQT->getMessage()
411  << std::endl;
412  if (verbose_)
413  std::cout << "[TrackingQualityChecker::fillTrackingStatus] iQT status: " << iQT->getStatus()
414  << std::endl;
415  }
416  tmp_status = tmp_status / float(nQTme);
417  }
418  }
419  status = fminf(tmp_status, status);
420  }
421  if (status < 0.)
422  gstatus = -1.;
423  else
424  gstatus += status;
425  if (verbose_)
426  std::cout << "[TrackingQualityChecker::fillTrackingStatus] MEname: " << MEname << " status: " << status
427  << std::endl;
428  it->second.TrackingFlag->Fill(status);
429  if (verbose_)
430  std::cout << "[TrackingQualityChecker::fillTrackingStatus] TrackGlobalSummaryReportMap: "
431  << TrackGlobalSummaryReportMap << std::endl;
432 
434  }
435  }
436 
437  // After harvesting, all per-lumi MEs are reset, to make sure we only get
438  // events of the new lumisection next time.
439  for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin(); it != TrackingMEsMap.end(); it++) {
440  std::string localMEdirpath = it->second.HistoDir;
441  std::vector<MonitorElement*> tmpMEvec = igetter.getContents(ibooker.pwd() + "/" + localMEdirpath);
442  for (auto ime : tmpMEvec) {
443  if (ime->getLumiFlag()) {
444  ime->Reset();
445  }
446  }
447  }
448 
449  if (verbose_)
450  std::cout << "[TrackingQualityChecker::fillTrackingStatus] gstatus: " << gstatus << std::endl;
451  size_t nQT = TrackingMEsMap.size();
452  if (gstatus < 1.)
453  gstatus = -1.;
454  else
455  gstatus = gstatus / float(nQT);
456 
457  if (verbose_)
458  std::cout << "[TrackingQualityChecker::fillTrackingStatus] ===> gstatus: " << gstatus << std::endl;
460  ibooker.cd();
461 
462  if (verbose_)
463  std::cout << "[TrackingQualityChecker::fillTrackingStatus] DONE" << std::endl;
464 }

References dqm::implementation::NavigatorBase::cd(), gather_cfg::cout, dqm::impl::MonitorElement::Fill(), fillStatusHistogram(), dqmMemoryStats::float, dqm::implementation::IGetter::getContents(), TrackingUtility::goToDir(), hlt_dqm_clientPB-live_cfg::me, Skims_PA_cff::name, dqm::implementation::NavigatorBase::pwd(), mps_update::status, AlCaHLTBitMon_QueryRunRegistry::string, TopFolderName_, TrackGlobalSummaryReportGlobal, TrackGlobalSummaryReportMap, TrackingMEsMap, and verbose_.

Referenced by fillGlobalStatus().

◆ fillTrackingStatusAtLumi()

void TrackingQualityChecker::fillTrackingStatusAtLumi ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
private

Definition at line 478 of file TrackingQualityChecker.cc.

478  {
479  if (verbose_)
480  std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] starting .. " << std::endl;
481  float gstatus = 1.0;
482 
483  ibooker.cd();
484  if (!TrackingUtility::goToDir(ibooker, igetter, TopFolderName_))
485  return;
486 
487  int ibin = 0;
488  for (std::map<std::string, TrackingLSMEs>::iterator it = TrackingLSMEsMap.begin(); it != TrackingLSMEsMap.end();
489  it++) {
490  if (verbose_)
491  std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ME: " << it->first << " ["
492  << it->second.TrackingFlag->getFullname() << "] flag: " << it->second.TrackingFlag->getFloatValue()
493  << std::endl;
494 
495  ibin++;
496 
497  std::string localMEdirpath = it->second.HistoLSDir;
498  std::string MEname = it->second.HistoLSName;
499  float lower_cut = it->second.HistoLSLowerCut;
500  float upper_cut = it->second.HistoLSUpperCut;
501 
502  float status = 1.0;
503 
504  std::vector<MonitorElement*> tmpMEvec = igetter.getContents(ibooker.pwd() + "/" + localMEdirpath);
505  if (verbose_)
506  std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] tmpMEvec: " << tmpMEvec.size() << std::endl;
507 
508  MonitorElement* me = nullptr;
509 
510  size_t nMEs = 0;
511  for (auto ime : tmpMEvec) {
512  std::string name = ime->getName();
513  if (name.find(MEname) != std::string::npos) {
514  me = ime;
515  nMEs++;
516  }
517  }
518  // only one ME found
519  if (nMEs == 1) {
520  for (auto ime : tmpMEvec) {
521  std::string name = ime->getName();
522  if (name.find(MEname) != std::string::npos) {
523  me = ime;
524  }
525  }
526  if (!me)
527  continue;
528 
529  if (me->kind() == MonitorElement::Kind::TH1F) {
530  float x_mean = me->getMean();
531  if (verbose_)
532  std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] MEname: " << MEname << " x_mean: " << x_mean
533  << std::endl;
534  if (x_mean <= lower_cut || x_mean > upper_cut)
535  status = 0.0;
536  else
537  status = 1.0;
538  }
539  } else { // more than 1 ME w/ the same root => they need to be considered together
540  for (auto ime : tmpMEvec) {
541  float tmp_status = 1.;
542  std::string name = ime->getName();
543  if (name.find(MEname) != std::string::npos) {
544  me = ime;
545  if (!me)
546  continue;
547 
548  if (me->kind() == MonitorElement::Kind::TH1F) {
549  float x_mean = me->getMean();
550  if (verbose_)
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)
554  tmp_status = 0.0;
555  else
556  tmp_status = 1.0;
557  if (verbose_)
558  std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] tmp_status: " << tmp_status << std::endl;
559  }
560  }
561  status = fminf(tmp_status, status);
562  if (verbose_)
563  std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ==> status: " << status << std::endl;
564  } // loop on tmpMEvec
565  }
566  it->second.TrackingFlag->Fill(status);
567  if (verbose_)
568  std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ===> status: " << status << " [" << gstatus
569  << "]" << std::endl;
570  if (status == 0.0)
571  gstatus = -1.0;
572  else
573  gstatus = gstatus * status;
574  if (verbose_)
575  std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ===> gstatus: " << gstatus << std::endl;
576  if (verbose_)
577  std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ME: " << it->first << " ["
578  << it->second.TrackingFlag->getFullname() << "] flag: " << it->second.TrackingFlag->getFloatValue()
579  << std::endl;
580  }
582  ibooker.cd();
583 
584  if (verbose_)
585  std::cout << "[TrackingQualityChecker::fillTrackingStatusAtLumi] DONE" << std::endl;
586 }

References dqm::implementation::NavigatorBase::cd(), gather_cfg::cout, dqm::impl::MonitorElement::Fill(), dqm::implementation::IGetter::getContents(), TrackingUtility::goToDir(), hlt_dqm_clientPB-live_cfg::me, Skims_PA_cff::name, dqm::implementation::NavigatorBase::pwd(), mps_update::status, AlCaHLTBitMon_QueryRunRegistry::string, MonitorElementData::TH1F, TopFolderName_, TrackingLSMEsMap, TrackLSSummaryReportGlobal, and verbose_.

Referenced by fillLSStatus().

◆ resetGlobalStatus()

void TrackingQualityChecker::resetGlobalStatus ( )

Definition at line 208 of file TrackingQualityChecker.cc.

208  {
209  if (verbose_)
210  std::cout << "[TrackingQualityChecker::resetGlobalStatus] already booked ? "
211  << (bookedTrackingGlobalStatus_ ? "yes" : "nope") << std::endl;
215 
216  for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin(); it != TrackingMEsMap.end(); it++) {
217  MonitorElement* me = it->second.TrackingFlag;
218  if (verbose_)
219  std::cout << "[TrackingQualityChecker::resetGlobalStatus] " << it->second.HistoName << " exist ? "
220  << (it->second.TrackingFlag == nullptr ? "nope" : "yes") << " ---> " << me << std::endl;
221  me->Reset();
222  }
223  if (verbose_)
224  std::cout << "[TrackingQualityChecker::resetGlobalStatus] DONE w/ TrackingMEsMap" << std::endl;
225  }
226 }

References bookedTrackingGlobalStatus_, gather_cfg::cout, hlt_dqm_clientPB-live_cfg::me, dqm::impl::MonitorElement::Reset(), TrackGlobalSummaryReportGlobal, TrackGlobalSummaryReportMap, TrackingMEsMap, and verbose_.

Referenced by fillDummyGlobalStatus().

◆ resetLSStatus()

void TrackingQualityChecker::resetLSStatus ( )

Definition at line 227 of file TrackingQualityChecker.cc.

227  {
228  if (verbose_)
229  std::cout << "[TrackingQualityChecker::resetLSStatus] already booked ? "
230  << (bookedTrackingLSStatus_ ? "yes" : "nope") << std::endl;
233  for (std::map<std::string, TrackingLSMEs>::iterator it = TrackingLSMEsMap.begin(); it != TrackingLSMEsMap.end();
234  it++) {
235  MonitorElement* me = it->second.TrackingFlag;
236  if (verbose_)
237  std::cout << "[TrackingQualityChecker::resetLSStatus] " << it->second.HistoLSName << " exist ? "
238  << (it->second.TrackingFlag == nullptr ? "nope" : "yes") << " ---> " << me << std::endl;
239  me->Reset();
240  }
241  if (verbose_)
242  std::cout << "[TrackingQualityChecker::resetLSStatus] DONE w/ TrackingLSMEsMap" << std::endl;
243  }
244 }

References bookedTrackingLSStatus_, gather_cfg::cout, hlt_dqm_clientPB-live_cfg::me, dqm::impl::MonitorElement::Reset(), TrackingLSMEsMap, TrackLSSummaryReportGlobal, and verbose_.

Referenced by fillDummyLSStatus().

Member Data Documentation

◆ bookedTrackingGlobalStatus_

bool TrackingQualityChecker::bookedTrackingGlobalStatus_
private

◆ bookedTrackingLSStatus_

bool TrackingQualityChecker::bookedTrackingLSStatus_
private

◆ pSet_

edm::ParameterSet TrackingQualityChecker::pSet_
private

Definition at line 63 of file TrackingQualityChecker.h.

Referenced by TrackingQualityChecker().

◆ TopFolderName_

std::string TrackingQualityChecker::TopFolderName_
private

◆ TrackGlobalSummaryReportGlobal

MonitorElement* TrackingQualityChecker::TrackGlobalSummaryReportGlobal
private

◆ TrackGlobalSummaryReportMap

MonitorElement* TrackingQualityChecker::TrackGlobalSummaryReportMap
private

◆ TrackingLSMEsMap

std::map<std::string, TrackingLSMEs> TrackingQualityChecker::TrackingLSMEsMap
private

◆ TrackingMEsMap

std::map<std::string, TrackingMEs> TrackingQualityChecker::TrackingMEsMap
private

◆ TrackLSSummaryReportGlobal

MonitorElement* TrackingQualityChecker::TrackLSSummaryReportGlobal
private

◆ verbose_

bool TrackingQualityChecker::verbose_
private
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
TrackingQualityChecker::bookGlobalStatus
void bookGlobalStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
Definition: TrackingQualityChecker.cc:72
TrackingQualityChecker::fillTrackingStatusAtLumi
void fillTrackingStatusAtLumi(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
Definition: TrackingQualityChecker.cc:478
mps_update.status
status
Definition: mps_update.py:69
MonitorElementData::Kind::TH1F
TrackingUtility::getTopFolderPath
static void getTopFolderPath(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, std::string top_dir, std::string &path)
Definition: TrackingUtility.cc:251
TrackingQualityChecker::resetLSStatus
void resetLSStatus()
Definition: TrackingQualityChecker.cc:227
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::LogInfo
Definition: MessageLogger.h:254
TrackingQualityChecker::TrackGlobalSummaryReportGlobal
MonitorElement * TrackGlobalSummaryReportGlobal
Definition: TrackingQualityChecker.h:59
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
MonitorElementData::Kind::TH2F
TrackingQualityChecker::TrackGlobalSummaryReportMap
MonitorElement * TrackGlobalSummaryReportMap
Definition: TrackingQualityChecker.h:58
TrackingQualityChecker::bookedTrackingLSStatus_
bool bookedTrackingLSStatus_
Definition: TrackingQualityChecker.h:67
TrackingQualityChecker::bookLSStatus
void bookLSStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
Definition: TrackingQualityChecker.cc:121
TrackingQualityChecker::resetGlobalStatus
void resetGlobalStatus()
Definition: TrackingQualityChecker.cc:208
dqm::impl::MonitorElement::Fill
void Fill(long long x)
Definition: MonitorElement.h:290
dqm::impl::MonitorElement::Reset
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
Definition: MonitorElement.cc:354
TrackingQualityChecker::fillDummyGlobalStatus
void fillDummyGlobalStatus()
Definition: TrackingQualityChecker.cc:166
TrackingQualityChecker::fillTrackingStatus
void fillTrackingStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
Definition: TrackingQualityChecker.cc:280
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TrackingQualityChecker::fillDummyLSStatus
void fillDummyLSStatus()
Definition: TrackingQualityChecker.cc:187
TrackingQualityChecker::TopFolderName_
std::string TopFolderName_
Definition: TrackingQualityChecker.h:69
TrackingQualityChecker::TrackingMEsMap
std::map< std::string, TrackingMEs > TrackingMEsMap
Definition: TrackingQualityChecker.h:55
TrackingQualityChecker::TrackingLSMEsMap
std::map< std::string, TrackingLSMEs > TrackingLSMEsMap
Definition: TrackingQualityChecker.h:56
TrackingQualityChecker::verbose_
bool verbose_
Definition: TrackingQualityChecker.h:64
dqm::impl::MonitorElement::setBinLabel
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)
Definition: MonitorElement.cc:771
TrackingUtility::goToDir
static bool goToDir(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, std::string name)
Definition: TrackingUtility.cc:193
TrackingQualityChecker::TrackLSSummaryReportGlobal
MonitorElement * TrackLSSummaryReportGlobal
Definition: TrackingQualityChecker.h:61
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
heppy_batch.val
val
Definition: heppy_batch.py:351
dqm::impl::MonitorElement::getNbinsX
virtual int getNbinsX() const
get # of bins in X-axis
Definition: MonitorElement.cc:574
TrackingCertification_cfi.TrackingLSQualityMEs
TrackingLSQualityMEs
Definition: TrackingCertification_cfi.py:21
TrackingQualityChecker::bookedTrackingGlobalStatus_
bool bookedTrackingGlobalStatus_
Definition: TrackingQualityChecker.h:66
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
TrackingQualityChecker::pSet_
edm::ParameterSet pSet_
Definition: TrackingQualityChecker.h:63
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:56
TrackingQualityChecker::fillStatusHistogram
void fillStatusHistogram(MonitorElement *, int xbin, int ybin, float val)
Definition: TrackingQualityChecker.cc:469
dqm::impl::MonitorElement::setAxisTitle
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
Definition: MonitorElement.cc:800