CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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,
TrackingLSMEs
TrackingLSMEsMap
 
std::map< std::string,
TrackingMEs
TrackingMEsMap
 
MonitorElementTrackLSSummaryReportGlobal
 
bool verbose_
 

Detailed Description

Definition at line 17 of file TrackingQualityChecker.h.

Member Typedef Documentation

Definition at line 19 of file TrackingQualityChecker.h.

Definition at line 20 of file TrackingQualityChecker.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file TrackingQualityChecker.cc.

References bookedTrackingGlobalStatus_, bookedTrackingLSStatus_, 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, TrackingMEsMap, and verbose_.

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 }
T getUntrackedParameter(std::string const &, T const &) const
std::map< std::string, TrackingMEs > TrackingMEsMap
Log< level::Info, false > LogInfo
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::map< std::string, TrackingLSMEs > TrackingLSMEsMap
TrackingQualityChecker::~TrackingQualityChecker ( )
virtual

Definition at line 63 of file TrackingQualityChecker.cc.

63  {
64  edm::LogInfo("TrackingQualityChecker") << " Deleting TrackingQualityChecker "
65  << "\n";
66 }
Log< level::Info, false > LogInfo

Member Function Documentation

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

Definition at line 70 of file TrackingQualityChecker.cc.

References dqm::implementation::IBooker::book2D(), bookedTrackingGlobalStatus_, dqm::implementation::IBooker::bookFloat(), dqm::implementation::NavigatorBase::cd(), 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().

70  {
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 }
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
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)
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
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 120 of file TrackingQualityChecker.cc.

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

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

120  {
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 }
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
MonitorElement * TrackLSSummaryReportGlobal
Log< level::Info, false > LogInfo
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 166 of file TrackingQualityChecker.cc.

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

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

166  {
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 }
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)
Log< level::Info, false > LogInfo
MonitorElement * TrackGlobalSummaryReportGlobal
void TrackingQualityChecker::fillDummyLSStatus ( )

Definition at line 189 of file TrackingQualityChecker.cc.

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

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

189  {
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 }
void Fill(long long x)
MonitorElement * TrackLSSummaryReportGlobal
Log< level::Info, false > LogInfo
std::map< std::string, TrackingLSMEs > TrackingLSMEsMap
void TrackingQualityChecker::fillGlobalStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 256 of file TrackingQualityChecker.cc.

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

Referenced by TrackingActionExecutor::fillGlobalStatus().

256  {
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 }
Log< level::Info, false > LogInfo
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 270 of file TrackingQualityChecker.cc.

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

Referenced by TrackingActionExecutor::fillStatusAtLumi().

270  {
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 }
Log< level::Info, false > LogInfo
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 480 of file TrackingQualityChecker.cc.

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

Referenced by fillDummyGlobalStatus(), and fillTrackingStatus().

480  {
481  if (me && me->kind() == MonitorElement::Kind::TH2F) {
482  TH2F* th2d = me->getTH2F();
483  th2d->SetBinContent(xbin, ybin, val);
484  }
485 }
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 287 of file TrackingQualityChecker.cc.

References dqm::implementation::NavigatorBase::cd(), dqm::impl::MonitorElement::Fill(), fillStatusHistogram(), dqm::implementation::IGetter::getContents(), dqm::impl::MonitorElement::getFullname(), dqm::impl::MonitorElement::getName(), dqm::impl::MonitorElement::getQReports(), TrackingUtility::goToDir(), if(), hlt_dqm_clientPB-live_cfg::me, mergeVDriftHistosByStation::name, dqm::implementation::NavigatorBase::pwd(), mps_update::status, AlCaHLTBitMon_QueryRunRegistry::string, TopFolderName_, TrackGlobalSummaryReportGlobal, TrackGlobalSummaryReportMap, TrackingMEsMap, and verbose_.

Referenced by fillGlobalStatus().

287  {
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 }
MonitorElement * TrackGlobalSummaryReportMap
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:593
virtual std::string pwd()
Definition: DQMStore.cc:16
std::map< std::string, TrackingMEs > TrackingMEsMap
list status
Definition: mps_update.py:107
const std::string & getName() const
get name of ME
void Fill(long long x)
std::vector< MonitorElementData::QReport * > getQReports() const
get map of QReports
if(conf_.getParameter< bool >("UseStripCablingDB"))
static bool goToDir(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, std::string name)
void fillStatusHistogram(MonitorElement *, int xbin, int ybin, float val)
Log< level::Info, false > LogInfo
std::string getFullname() const
get full name of ME including Pathname
MonitorElement * TrackGlobalSummaryReportGlobal
void TrackingQualityChecker::fillTrackingStatusAtLumi ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
private

Definition at line 489 of file TrackingQualityChecker.cc.

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

Referenced by fillLSStatus().

489  {
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 }
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:593
virtual std::string pwd()
Definition: DQMStore.cc:16
list status
Definition: mps_update.py:107
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)
Log< level::Info, false > LogInfo
virtual double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
std::map< std::string, TrackingLSMEs > TrackingLSMEsMap
void TrackingQualityChecker::resetGlobalStatus ( )

Definition at line 211 of file TrackingQualityChecker.cc.

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

Referenced by fillDummyGlobalStatus().

211  {
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 }
MonitorElement * TrackGlobalSummaryReportMap
std::map< std::string, TrackingMEs > TrackingMEsMap
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
Log< level::Info, false > LogInfo
MonitorElement * TrackGlobalSummaryReportGlobal
void TrackingQualityChecker::resetLSStatus ( )

Definition at line 232 of file TrackingQualityChecker.cc.

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

Referenced by fillDummyLSStatus().

232  {
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 }
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
MonitorElement * TrackLSSummaryReportGlobal
Log< level::Info, false > LogInfo
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 62 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