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 17 of file TrackingQualityChecker.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 19 of file TrackingQualityChecker.h.

◆ MonitorElement

Definition at line 20 of file TrackingQualityChecker.h.

Constructor & Destructor Documentation

◆ TrackingQualityChecker()

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

◆ ~TrackingQualityChecker()

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

◆ bookGlobalStatus()

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(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, 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:36
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)

◆ bookLSStatus()

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(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, 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:36
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

◆ fillDummyGlobalStatus()

void TrackingQualityChecker::fillDummyGlobalStatus ( )

Definition at line 166 of file TrackingQualityChecker.cc.

References bookedTrackingGlobalStatus_, dqm::impl::MonitorElement::Fill(), fillStatusHistogram(), dqm::impl::MonitorElement::getNbinsX(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, 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)
void fillStatusHistogram(MonitorElement *, int xbin, int ybin, float val)
Log< level::Info, false > LogInfo
MonitorElement * TrackGlobalSummaryReportGlobal
virtual int getNbinsX() const
get # of bins in X-axis

◆ fillDummyLSStatus()

void TrackingQualityChecker::fillDummyLSStatus ( )

Definition at line 189 of file TrackingQualityChecker.cc.

References bookedTrackingLSStatus_, dqm::impl::MonitorElement::Fill(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, 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

◆ fillGlobalStatus()

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)

◆ fillLSStatus()

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)

◆ fillStatusHistogram()

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

Definition at line 480 of file TrackingQualityChecker.cc.

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

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 }

◆ fillTrackingStatus()

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(), nano_mu_digi_cff::float, dqm::implementation::IGetter::getContents(), TrackingUtility::goToDir(), ALPAKA_ACCELERATOR_NAMESPACE::caPixelDoublets::if(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, 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().

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::string pwd()
Definition: DQMStore.cc:20
std::map< std::string, TrackingMEs > TrackingMEsMap
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)
Log< level::Info, false > LogInfo
MonitorElement * TrackGlobalSummaryReportGlobal
if(threadIdxLocalY==0 &&threadIdxLocalX==0)
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:625

◆ fillTrackingStatusAtLumi()

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(), TrackingUtility::goToDir(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, 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().

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  for (std::map<std::string, TrackingLSMEs>::iterator it = TrackingLSMEsMap.begin(); it != TrackingLSMEsMap.end();
500  it++) {
501  if (verbose_)
502  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ME: " << it->first
503  << " [" << it->second.TrackingFlag->getFullname()
504  << "] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
505 
506  std::string localMEdirpath = it->second.HistoLSDir;
507  std::string MEname = it->second.HistoLSName;
508  float lower_cut = it->second.HistoLSLowerCut;
509  float upper_cut = it->second.HistoLSUpperCut;
510 
511  float status = 1.0;
512 
513  std::vector<MonitorElement*> tmpMEvec = igetter.getContents(ibooker.pwd() + "/" + localMEdirpath);
514  if (verbose_)
515  edm::LogInfo("TrackingQualityChecker")
516  << "[TrackingQualityChecker::fillTrackingStatusAtLumi] tmpMEvec: " << tmpMEvec.size() << std::endl;
517 
518  MonitorElement* me = nullptr;
519 
520  size_t nMEs = 0;
521  for (auto ime : tmpMEvec) {
522  std::string name = ime->getName();
523  if (name.find(MEname) != std::string::npos) {
524  me = ime;
525  nMEs++;
526  }
527  }
528  // only one ME found
529  if (nMEs == 1) {
530  for (auto ime : tmpMEvec) {
531  std::string name = ime->getName();
532  if (name.find(MEname) != std::string::npos) {
533  me = ime;
534  }
535  }
536  if (!me)
537  continue;
538 
539  if (me->kind() == MonitorElement::Kind::TH1F) {
540  float x_mean = me->getMean();
541  if (verbose_)
542  edm::LogInfo("TrackingQualityChecker")
543  << "[TrackingQualityChecker::fillTrackingStatusAtLumi] MEname: " << MEname << " x_mean: " << x_mean
544  << std::endl;
545  if (x_mean <= lower_cut || x_mean > upper_cut)
546  status = 0.0;
547  else
548  status = 1.0;
549  }
550  } else { // more than 1 ME w/ the same root => they need to be considered together
551  for (auto ime : tmpMEvec) {
552  float tmp_status = 1.;
553  std::string name = ime->getName();
554  if (name.find(MEname) != std::string::npos) {
555  me = ime;
556  if (!me)
557  continue;
558 
559  if (me->kind() == MonitorElement::Kind::TH1F) {
560  float x_mean = me->getMean();
561  if (verbose_)
562  edm::LogInfo("TrackingQualityChecker")
563  << "[TrackingQualityChecker::fillTrackingStatusAtLumi] MEname: " << MEname << "[" << me->getName()
564  << "] x_mean: " << x_mean << std::endl;
565  if (x_mean <= lower_cut || x_mean > upper_cut)
566  tmp_status = 0.0;
567  else
568  tmp_status = 1.0;
569  if (verbose_)
570  edm::LogInfo("TrackingQualityChecker")
571  << "[TrackingQualityChecker::fillTrackingStatusAtLumi] tmp_status: " << tmp_status << std::endl;
572  }
573  }
574  status = fminf(tmp_status, status);
575  if (verbose_)
576  edm::LogInfo("TrackingQualityChecker")
577  << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ==> status: " << status << std::endl;
578  } // loop on tmpMEvec
579  }
580  it->second.TrackingFlag->Fill(status);
581  if (verbose_)
582  edm::LogInfo("TrackingQualityChecker")
583  << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ===> status: " << status << " [" << gstatus << "]"
584  << std::endl;
585  if (status == 0.0)
586  gstatus = -1.0;
587  else
588  gstatus = gstatus * status;
589  if (verbose_)
590  edm::LogInfo("TrackingQualityChecker")
591  << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ===> gstatus: " << gstatus << std::endl;
592  if (verbose_)
593  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::fillTrackingStatusAtLumi] ME: " << it->first
594  << " [" << it->second.TrackingFlag->getFullname()
595  << "] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
596  }
598  ibooker.cd();
599 
600  if (verbose_)
601  edm::LogInfo("TrackingQualityChecker") << "[TrackingQualityChecker::fillTrackingStatusAtLumi] DONE" << std::endl;
602 }
virtual std::string pwd()
Definition: DQMStore.cc:20
void Fill(long long x)
MonitorElement * TrackLSSummaryReportGlobal
static bool goToDir(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, std::string name)
Log< level::Info, false > LogInfo
std::map< std::string, TrackingLSMEs > TrackingLSMEsMap
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:625

◆ resetGlobalStatus()

void TrackingQualityChecker::resetGlobalStatus ( )

Definition at line 211 of file TrackingQualityChecker.cc.

References bookedTrackingGlobalStatus_, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, 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

◆ resetLSStatus()

void TrackingQualityChecker::resetLSStatus ( )

Definition at line 232 of file TrackingQualityChecker.cc.

References bookedTrackingLSStatus_, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, 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

◆ bookedTrackingGlobalStatus_

bool TrackingQualityChecker::bookedTrackingGlobalStatus_
private

◆ bookedTrackingLSStatus_

bool TrackingQualityChecker::bookedTrackingLSStatus_
private

◆ pSet_

edm::ParameterSet TrackingQualityChecker::pSet_
private

Definition at line 62 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