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

Definition at line 20 of file TrackingQualityChecker.h.

Definition at line 21 of file TrackingQualityChecker.h.

Constructor & Destructor Documentation

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

Definition at line 19 of file TrackingQualityChecker.cc.

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_.

20  : pSet_(ps), verbose_(pSet_.getUntrackedParameter<bool>("verbose", false)) {
21  edm::LogInfo("TrackingQualityChecker") << " Creating TrackingQualityChecker "
22  << "\n";
23 
26 
27  TopFolderName_ = pSet_.getUntrackedParameter<std::string>("TopFolderName", "Tracking");
28 
29  TrackingMEs tracking_mes;
30  std::vector<edm::ParameterSet> TrackingGlobalQualityMEs =
31  pSet_.getParameter<std::vector<edm::ParameterSet> >("TrackingGlobalQualityPSets");
32  for (auto meQTset : TrackingGlobalQualityMEs) {
33  std::string QTname = meQTset.getParameter<std::string>("QT");
34  tracking_mes.HistoDir = meQTset.getParameter<std::string>("dir");
35  tracking_mes.HistoName = meQTset.getParameter<std::string>("name");
36  if (verbose_)
37  std::cout << "[TrackingQualityChecker::TrackingQualityChecker] inserting " << QTname << " in TrackingMEsMap"
38  << std::endl;
39  TrackingMEsMap.insert(std::pair<std::string, TrackingMEs>(QTname, tracking_mes));
40  }
41  if (verbose_)
42  std::cout << "[TrackingQualityChecker::TrackingQualityChecker] created TrackingMEsMap" << std::endl;
43 
44  TrackingLSMEs tracking_ls_mes;
45  std::vector<edm::ParameterSet> TrackingLSQualityMEs =
46  pSet_.getParameter<std::vector<edm::ParameterSet> >("TrackingLSQualityPSets");
47  for (auto meQTset : TrackingLSQualityMEs) {
48  std::string QTname = meQTset.getParameter<std::string>("QT");
49  tracking_ls_mes.HistoLSDir = meQTset.exists("LSdir") ? meQTset.getParameter<std::string>("LSdir") : "";
50  tracking_ls_mes.HistoLSName = meQTset.exists("LSname") ? meQTset.getParameter<std::string>("LSname") : "";
51  tracking_ls_mes.HistoLSLowerCut = meQTset.exists("LSlowerCut") ? meQTset.getParameter<double>("LSlowerCut") : -1.;
52  tracking_ls_mes.HistoLSUpperCut = meQTset.exists("LSupperCut") ? meQTset.getParameter<double>("LSupperCut") : -1.;
53  tracking_ls_mes.TrackingFlag = nullptr;
54 
55  if (verbose_)
56  std::cout << "[TrackingQualityChecker::TrackingQualityChecker] inserting " << QTname << " in TrackingMEsMap"
57  << std::endl;
58  TrackingLSMEsMap.insert(std::pair<std::string, TrackingLSMEs>(QTname, tracking_ls_mes));
59  }
60  if (verbose_)
61  std::cout << "[TrackingQualityChecker::TrackingQualityChecker] created TrackingLSMEsMap" << std::endl;
62 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::map< std::string, TrackingMEs > TrackingMEsMap
std::map< std::string, TrackingLSMEs > TrackingLSMEsMap
TrackingQualityChecker::~TrackingQualityChecker ( )
virtual

Definition at line 66 of file TrackingQualityChecker.cc.

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

Member Function Documentation

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

Definition at line 73 of file TrackingQualityChecker.cc.

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

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

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

Definition at line 122 of file TrackingQualityChecker.cc.

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

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

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

Definition at line 167 of file TrackingQualityChecker.cc.

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().

167  {
168  if (verbose_)
169  std::cout << "[TrackingQualityChecker::fillDummyGlobalStatus] starting ..." << std::endl;
170 
172  if (verbose_)
173  std::cout << "[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  std::cout << "[TrackingQualityChecker::fillDummyGlobalStatus] DONE w/ TrackingMEsMap" << std::endl;
186  }
187 }
MonitorElement * TrackGlobalSummaryReportMap
std::map< std::string, TrackingMEs > TrackingMEsMap
void Fill(long long x)
virtual int getNbinsX() const
get # of bins in X-axis
void fillStatusHistogram(MonitorElement *, int xbin, int ybin, float val)
MonitorElement * TrackGlobalSummaryReportGlobal
void TrackingQualityChecker::fillDummyLSStatus ( )

Definition at line 188 of file TrackingQualityChecker.cc.

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

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

188  {
189  if (verbose_)
190  std::cout << "[TrackingQualityChecker::fillDummyLSStatus] starting ..." << std::endl;
191 
192  resetLSStatus();
193  if (verbose_)
194  std::cout << "[TrackingQualityChecker::fillDummyLSStatus] already booked ? "
195  << (bookedTrackingLSStatus_ ? "yes" : "nope") << std::endl;
198  for (std::map<std::string, TrackingLSMEs>::iterator it = TrackingLSMEsMap.begin(); it != TrackingLSMEsMap.end();
199  it++)
200  it->second.TrackingFlag->Fill(-1.0);
201  if (verbose_)
202  std::cout << "[TrackingQualityChecker::fillDummyLSStatus] DONE w/ TrackingLSMEsMap" << std::endl;
203  }
204 }
void Fill(long long x)
MonitorElement * TrackLSSummaryReportGlobal
std::map< std::string, TrackingLSMEs > TrackingLSMEsMap
void TrackingQualityChecker::fillGlobalStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 250 of file TrackingQualityChecker.cc.

References bookedTrackingGlobalStatus_, bookGlobalStatus(), dqm::dqmstoreimpl::DQMStore::IBooker::cd(), gather_cfg::cout, fillDummyGlobalStatus(), fillTrackingStatus(), and verbose_.

Referenced by TrackingActionExecutor::fillGlobalStatus().

250  {
251  if (verbose_)
252  std::cout << "[TrackingQualityChecker::fillGlobalStatus] already booked ? "
253  << (bookedTrackingGlobalStatus_ ? "yes" : "nope") << std::endl;
255  bookGlobalStatus(ibooker, igetter);
256 
258  fillTrackingStatus(ibooker, igetter);
259  if (verbose_)
260  std::cout << "[TrackingQualityChecker::fillGlobalStatus] DONE" << std::endl;
261  ibooker.cd();
262 }
void bookGlobalStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void fillTrackingStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void TrackingQualityChecker::fillLSStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 264 of file TrackingQualityChecker.cc.

References bookedTrackingLSStatus_, bookLSStatus(), dqm::dqmstoreimpl::DQMStore::IBooker::cd(), gather_cfg::cout, fillDummyLSStatus(), fillTrackingStatusAtLumi(), and verbose_.

Referenced by TrackingActionExecutor::fillStatusAtLumi().

264  {
265  if (verbose_)
266  std::cout << "[TrackingQualityChecker::fillLSStatus] already booked ? "
267  << (bookedTrackingLSStatus_ ? "yes" : "nope") << std::endl;
269  bookLSStatus(ibooker, igetter);
270 
272  fillTrackingStatusAtLumi(ibooker, igetter);
273  if (verbose_)
274  std::cout << "[TrackingQualityChecker::fillLSStatus] DONE" << std::endl;
275  ibooker.cd();
276 }
void bookLSStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void fillTrackingStatusAtLumi(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void TrackingQualityChecker::fillStatusHistogram ( MonitorElement me,
int  xbin,
int  ybin,
float  val 
)
private

Definition at line 470 of file TrackingQualityChecker.cc.

References dqm::legacy::MonitorElement::getTH2F(), dqm::impl::MonitorElement::kind(), and MonitorElementData::TH2F.

Referenced by fillDummyGlobalStatus(), and fillTrackingStatus().

470  {
471  if (me && me->kind() == MonitorElement::Kind::TH2F) {
472  TH2F* th2d = me->getTH2F();
473  th2d->SetBinContent(xbin, ybin, val);
474  }
475 }
virtual TH2F * getTH2F() const
Kind kind() const
Get the type of the monitor element.
void TrackingQualityChecker::fillTrackingStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
private

Definition at line 281 of file TrackingQualityChecker.cc.

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

Referenced by fillGlobalStatus().

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

Definition at line 479 of file TrackingQualityChecker.cc.

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

Referenced by fillLSStatus().

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

Definition at line 209 of file TrackingQualityChecker.cc.

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

Referenced by fillDummyGlobalStatus().

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

Definition at line 228 of file TrackingQualityChecker.cc.

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

Referenced by fillDummyLSStatus().

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

Member Data Documentation

bool TrackingQualityChecker::bookedTrackingGlobalStatus_
private
bool TrackingQualityChecker::bookedTrackingLSStatus_
private
edm::ParameterSet TrackingQualityChecker::pSet_
private

Definition at line 63 of file TrackingQualityChecker.h.

Referenced by TrackingQualityChecker().

std::string TrackingQualityChecker::TopFolderName_
private
MonitorElement* TrackingQualityChecker::TrackGlobalSummaryReportGlobal
private
MonitorElement* TrackingQualityChecker::TrackGlobalSummaryReportMap
private
std::map<std::string, TrackingLSMEs> TrackingQualityChecker::TrackingLSMEsMap
private
std::map<std::string, TrackingMEs> TrackingQualityChecker::TrackingMEsMap
private
MonitorElement* TrackingQualityChecker::TrackLSSummaryReportGlobal
private
bool TrackingQualityChecker::verbose_
private