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:221
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 485 of file TrackingQualityChecker.cc.

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

Referenced by fillDummyGlobalStatus(), and fillTrackingStatus().

485  {
486  if (me && me->kind() == MonitorElement::Kind::TH2F) {
487  TH2F* th2d = me->getTH2F();
488  th2d->SetBinContent(xbin, ybin, val);
489  }
490 }

◆ 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, or, 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  //SeedNStrip and SeedNPixel DQM plots are in SiStrip folder (not inside Tracking folder)
308  if (it->first == "SeedNStrip" or it->first == "SeedNPixel") {
309  tmpMEvec = igetter.getContents(localMEdirpath);
310  }
311  if (verbose_)
312  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus tmpMEvec: " << tmpMEvec.size() << std::endl;
313  MonitorElement* me = nullptr;
314 
315  size_t nMEs = 0;
316  for (auto ime : tmpMEvec) {
317  std::string name = ime->getName();
318  if (verbose_)
319  edm::LogInfo("TrackingQualityChecker") << "name: " << name << " <-- --> " << MEname << std::endl;
320  if (name.find(MEname) != std::string::npos) {
321  me = ime;
322  nMEs++;
323  }
324  }
325  // only one ME found
326  if (verbose_)
327  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus nMEs: " << nMEs << std::endl;
328  if (nMEs == 1) {
329  float status = 0.;
330  for (auto ime : tmpMEvec) {
331  std::string name = ime->getName();
332  if (verbose_)
333  edm::LogInfo("TrackingQualityChecker") << "name: " << name << " [" << MEname << "]" << std::endl;
334  if (name.find(MEname) != std::string::npos) {
335  me = ime;
336  if (verbose_)
337  edm::LogInfo("TrackingQualityChecker") << "inside the loop nQTme: " << me->getQReports().size() << "["
338  << ime->getFullname() << "]" << std::endl;
339  }
340  }
341  if (verbose_)
342  edm::LogInfo("TrackingQualityChecker")
343  << "me: " << me << "[" << me->getName() << ", " << me->getFullname() << "]" << std::endl;
344  if (!me)
345  continue;
346  if (verbose_)
347  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus status: " << status << std::endl;
348  std::vector<QReport*> qt_reports = me->getQReports();
349  size_t nQTme = qt_reports.size();
350  if (verbose_)
351  edm::LogInfo("TrackingQualityChecker") << "nQTme: " << nQTme << std::endl;
352  if (nQTme != 0) {
353  if (verbose_)
354  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus qt_reports: " << qt_reports.size() << std::endl;
355  // loop on possible QTs
356  for (auto iQT : qt_reports) {
357  status += iQT->getQTresult();
358  if (verbose_)
359  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus iQT: " << iQT->getQRName() << std::endl;
360  if (verbose_)
361  edm::LogInfo("TrackingQualityChecker")
362  << "fillTrackingStatus MEname: " << MEname << " status: " << iQT->getQTresult() << " exists ? "
363  << (it->second.TrackingFlag ? "yes " : "no ") << it->second.TrackingFlag << std::endl;
364  if (verbose_)
365  edm::LogInfo("TrackingQualityChecker")
366  << "fillTrackingStatus iQT message: " << iQT->getMessage() << std::endl;
367  if (verbose_)
368  edm::LogInfo("TrackingQualityChecker")
369  << "fillTrackingStatus iQT status: " << iQT->getStatus() << std::endl;
370  }
371  status = status / float(nQTme);
372  if (verbose_)
373  edm::LogInfo("TrackingQualityChecker")
374  << "fillTrackingStatus MEname: " << MEname << " status: " << status << std::endl;
375  it->second.TrackingFlag->Fill(status);
376  if (verbose_)
377  edm::LogInfo("TrackingQualityChecker")
378  << "fillTrackingStatus TrackGlobalSummaryReportMap: " << TrackGlobalSummaryReportMap << std::endl;
380  }
381 
382  if (verbose_)
383  edm::LogInfo("TrackingQualityChecker")
384  << "fillTrackingStatus gstatus: " << gstatus << " x status: " << status << std::endl;
385  if (status < 0.)
386  gstatus = -1.;
387  else
388  gstatus += status;
389  if (verbose_)
390  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus ===> gstatus: " << gstatus << std::endl;
391  if (verbose_)
392  edm::LogInfo("TrackingQualityChecker")
393  << "fillTrackingStatus ME: " << it->first << " [" << it->second.TrackingFlag->getFullname()
394  << "] flag: " << it->second.TrackingFlag->getFloatValue() << std::endl;
395 
396  } else { // more than 1 ME w/ the same root => they need to be considered together
397  float status = 1.;
398  for (auto ime : tmpMEvec) {
399  float tmp_status = 1.;
400  std::string name = ime->getName();
401  if (name.find(MEname) != std::string::npos) {
402  me = ime;
403 
404  if (verbose_)
405  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus status: " << status << std::endl;
406  std::vector<QReport*> qt_reports = me->getQReports();
407  size_t nQTme = qt_reports.size();
408  if (verbose_)
409  edm::LogInfo("TrackingQualityChecker")
410  << "nQTme: " << nQTme << "[" << name << ", " << ime->getFullname() << "]" << std::endl;
411  if (nQTme != 0) {
412  if (verbose_)
413  edm::LogInfo("TrackingQualityChecker")
414  << "fillTrackingStatus qt_reports: " << qt_reports.size() << std::endl;
415  // loop on possible QTs
416  for (auto iQT : qt_reports) {
417  tmp_status = 0; // reset status
418  tmp_status += iQT->getQTresult();
419  if (verbose_)
420  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus iQT: " << iQT->getQRName() << std::endl;
421  if (verbose_)
422  edm::LogInfo("TrackingQualityChecker")
423  << "fillTrackingStatus MEname: " << MEname << " status: " << iQT->getQTresult() << " exists ? "
424  << (it->second.TrackingFlag ? "yes " : "no ") << it->second.TrackingFlag << std::endl;
425  if (verbose_)
426  edm::LogInfo("TrackingQualityChecker")
427  << "fillTrackingStatus iQT message: " << iQT->getMessage() << std::endl;
428  if (verbose_)
429  edm::LogInfo("TrackingQualityChecker")
430  << "fillTrackingStatus iQT status: " << iQT->getStatus() << std::endl;
431  }
432  tmp_status = tmp_status / float(nQTme);
433  }
434  }
435  status = fminf(tmp_status, status);
436  }
437  if (status < 0.)
438  gstatus = -1.;
439  else
440  gstatus += status;
441  if (verbose_)
442  edm::LogInfo("TrackingQualityChecker")
443  << "fillTrackingStatus MEname: " << MEname << " status: " << status << std::endl;
444  it->second.TrackingFlag->Fill(status);
445  if (verbose_)
446  edm::LogInfo("TrackingQualityChecker")
447  << "fillTrackingStatus TrackGlobalSummaryReportMap: " << TrackGlobalSummaryReportMap << std::endl;
448 
450  }
451  }
452 
453  // After harvesting, all per-lumi MEs are reset, to make sure we only get
454  // events of the new lumisection next time.
455  for (std::map<std::string, TrackingMEs>::iterator it = TrackingMEsMap.begin(); it != TrackingMEsMap.end(); it++) {
456  std::string localMEdirpath = it->second.HistoDir;
457  std::vector<MonitorElement*> tmpMEvec = igetter.getContents(ibooker.pwd() + "/" + localMEdirpath);
458  for (auto ime : tmpMEvec) {
459  if (ime->getLumiFlag()) {
460  ime->Reset();
461  }
462  }
463  }
464 
465  if (verbose_)
466  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus gstatus: " << gstatus << std::endl;
467  size_t nQT = TrackingMEsMap.size();
468  if (gstatus < 1.)
469  gstatus = -1.;
470  else
471  gstatus = gstatus / float(nQT);
472 
473  if (verbose_)
474  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus ===> gstatus: " << gstatus << std::endl;
476  ibooker.cd();
477 
478  if (verbose_)
479  edm::LogInfo("TrackingQualityChecker") << "fillTrackingStatus DONE" << std::endl;
480 }
MonitorElement * TrackGlobalSummaryReportMap
virtual std::string pwd()
Definition: DQMStore.cc:20
std::map< std::string, TrackingMEs > TrackingMEsMap
void Fill(long long x)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
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 494 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().

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