CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
L1TEMUEventInfoClient Class Reference

#include <L1TEMUEventInfoClient.h>

Inheritance diagram for L1TEMUEventInfoClient:
edm::EDAnalyzer

Public Member Functions

 L1TEMUEventInfoClient (const edm::ParameterSet &)
 Constructor. More...
 
virtual ~L1TEMUEventInfoClient ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 analyze More...
 
void beginJob ()
 begin job More...
 
void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 begin luminosity block More...
 
void beginRun (const edm::Run &, const edm::EventSetup &)
 begin run More...
 
void bookHistograms ()
 book histograms More...
 
void dumpContentMonitorElements ()
 dump the content of the monitoring elements defined in this module More...
 
void endJob ()
 end job More...
 
void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 end luminosity block More...
 
void endRun (const edm::Run &, const edm::EventSetup &)
 end run More...
 
void initialize ()
 private methods More...
 
void readQtResults ()
 read quality test results More...
 

Private Attributes

DQMStorem_dbe
 
std::vector< edm::ParameterSetm_l1Objects
 
std::vector< edm::ParameterSetm_l1Systems
 
std::vector< std::string > m_maskL1Objects
 
std::vector< std::string > m_maskL1Systems
 
MonitorElementm_meReportSummary
 a summary report More...
 
std::vector< MonitorElement * > m_meReportSummaryContent
 monitor elements to report content for all quality tests More...
 
MonitorElementm_meReportSummaryMap
 report summary map More...
 
std::string m_monitorDir
 
size_t m_nrL1Objects
 number of L1 trigger objects More...
 
size_t m_nrL1Systems
 number of L1 trigger systems More...
 
std::vector< std::string > m_objectFolder
 
std::vector< std::string > m_objectLabel
 
std::vector< int > m_objectMask
 
std::vector< std::vector
< unsigned int > > 
m_objectQtSummaryEnabled
 
std::vector< std::vector
< std::string > > 
m_objectQualityTestHist
 
std::vector< std::vector
< std::string > > 
m_objectQualityTestName
 
Float_t m_reportSummary
 summary report More...
 
bool m_runInEndJob
 
bool m_runInEndLumi
 
bool m_runInEndRun
 
bool m_runInEventLoop
 
std::vector< int > m_summaryContent
 
Float_t m_summarySum
 
std::vector< std::string > m_systemFolder
 
std::vector< std::string > m_systemLabel
 
std::vector< std::string > m_systemLabelExt
 
std::vector< int > m_systemMask
 
std::vector< std::vector
< unsigned int > > 
m_systemQtSummaryEnabled
 
std::vector< std::vector
< std::string > > 
m_systemQualityTestHist
 
std::vector< std::vector
< std::string > > 
m_systemQualityTestName
 
size_t m_totalNrQtSummaryEnabled
 
bool m_verbose
 input parameters More...
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Description: fill L1 report summary for emulator DQM.

Implementation: <TODO: enter implementation details>

Author
: Vasile Mihai Ghete - HEPHY Vienna

Re-designed and fully rewritten class. Original version and authors: see CVS history

Date:
2012/04/04 10:00:00
Revision:
1.10

Description: see header file.

Author
: Vasile Mihai Ghete - HEPHY Vienna
Date:
2012/04/04 09:59:52
Revision:
1.20

Definition at line 42 of file L1TEMUEventInfoClient.h.

Constructor & Destructor Documentation

L1TEMUEventInfoClient::L1TEMUEventInfoClient ( const edm::ParameterSet parSet)

Constructor.

Definition at line 46 of file L1TEMUEventInfoClient.cc.

References initialize().

46  :
47  m_verbose(parSet.getUntrackedParameter<bool>("verbose", false)),
48  m_monitorDir(parSet.getUntrackedParameter<std::string>("monitorDir", "")),
49  m_runInEventLoop(parSet.getUntrackedParameter<bool>("runInEventLoop", false)),
50  m_runInEndLumi(parSet.getUntrackedParameter<bool>("runInEndLumi", false)),
51  m_runInEndRun(parSet.getUntrackedParameter<bool>("runInEndRun", false)),
52  m_runInEndJob(parSet.getUntrackedParameter<bool>("runInEndJob", false)),
53  m_l1Systems(parSet.getParameter<std::vector<edm::ParameterSet> >("L1Systems")),
54  m_l1Objects(parSet.getParameter<std::vector<edm::ParameterSet> >("L1Objects")),
55  m_maskL1Systems(parSet.getParameter<std::vector<std::string> >("MaskL1Systems")),
56  m_maskL1Objects(parSet.getParameter<std::vector<std::string> >("MaskL1Objects")),
57  m_nrL1Systems(0),
58  m_nrL1Objects(0),
60 
61  initialize();
62 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
std::vector< edm::ParameterSet > m_l1Objects
std::vector< std::string > m_maskL1Systems
std::vector< edm::ParameterSet > m_l1Systems
size_t m_nrL1Objects
number of L1 trigger objects
size_t m_nrL1Systems
number of L1 trigger systems
void initialize()
private methods
bool m_verbose
input parameters
std::vector< std::string > m_maskL1Objects
L1TEMUEventInfoClient::~L1TEMUEventInfoClient ( )
virtual

Destructor.

Definition at line 65 of file L1TEMUEventInfoClient.cc.

65  {
66 
67  //empty
68 
69 }

Member Function Documentation

void L1TEMUEventInfoClient::analyze ( const edm::Event iEvent,
const edm::EventSetup evSetup 
)
privatevirtual

analyze

Implements edm::EDAnalyzer.

Definition at line 315 of file L1TEMUEventInfoClient.cc.

References m_runInEventLoop, and readQtResults().

316  {
317 
318  // there is no loop on events in the offline harvesting step
319  // code here will not be executed offline
320 
321  if (m_runInEventLoop) {
322 
323  readQtResults();
324 
325  }
326 }
void readQtResults()
read quality test results
void L1TEMUEventInfoClient::beginJob ( void  )
privatevirtual

begin job

Reimplemented from edm::EDAnalyzer.

Definition at line 292 of file L1TEMUEventInfoClient.cc.

References m_dbe, and cppFunctionSkipper::operator.

292  {
293 
294 
295  // get backend interface
297 
298 }
void L1TEMUEventInfoClient::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup evSetup 
)
privatevirtual

begin luminosity block

Reimplemented from edm::EDAnalyzer.

Definition at line 309 of file L1TEMUEventInfoClient.cc.

310  {
311 
312 }
void L1TEMUEventInfoClient::beginRun ( const edm::Run run,
const edm::EventSetup evSetup 
)
privatevirtual

begin run

Reimplemented from edm::EDAnalyzer.

Definition at line 301 of file L1TEMUEventInfoClient.cc.

References bookHistograms().

302  {
303 
304  bookHistograms();
305 
306 }
void bookHistograms()
book histograms
void L1TEMUEventInfoClient::bookHistograms ( )
private

book histograms

Definition at line 465 of file L1TEMUEventInfoClient.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), dqm::qstatus::DISABLED, MonitorElement::Fill(), DQMStore::get(), MonitorElement::getName(), m_dbe, m_meReportSummary, m_meReportSummaryContent, m_meReportSummaryMap, m_nrL1Objects, m_nrL1Systems, m_objectLabel, m_objectQualityTestName, m_summaryContent, m_systemLabel, m_systemQualityTestName, max(), DQMStore::removeElement(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), and DQMStore::setCurrentFolder().

Referenced by beginRun().

465  {
466 
467  m_dbe->setCurrentFolder("L1TEMU/EventInfo");
468 
469  // remove m_meReportSummary if it exists
470  if ((m_meReportSummary = m_dbe->get("L1TEMU/EventInfo/reportSummary"))) {
472  }
473 
474  // ...and book it again
475  m_meReportSummary = m_dbe->bookFloat("reportSummary");
476 
477  // initialize reportSummary to 1
478 
479  if (m_meReportSummary) {
481  }
482 
483  // define float histograms for reportSummaryContents (one histogram per quality test),
484  // initialize them to zero
485  // initialize also m_summaryContent to dqm::qstatus::DISABLED
486 
487  m_dbe->setCurrentFolder("L1TEMU/EventInfo/reportSummaryContents");
488 
489  char histoQT[100];
490 
491  // general counters:
492  // iAllQTest: all quality tests for all systems and objects
493  // iAllMon: all monitored systems and objects
494  int iAllQTest = 0;
495  int iAllMon = 0;
496 
497  for (unsigned int iMon = 0; iMon < m_nrL1Systems; ++iMon) {
498 
500 
501  const std::vector<std::string>& sysQtName =
503 
504  for (std::vector<std::string>::const_iterator itQtName =
505  sysQtName.begin(); itQtName != sysQtName.end(); ++itQtName) {
506 
507  const std::string hStr = "L1TEMU_L1Sys_" +m_systemLabel[iMon] + "_" + (*itQtName);
508 
509  const char* cStr = hStr.c_str();
510  sprintf(histoQT, cStr);
511 
512  m_meReportSummaryContent.push_back(m_dbe->bookFloat(histoQT));
513  m_meReportSummaryContent[iAllQTest]->Fill(0.);
514 
515  iAllQTest++;
516  }
517 
518  iAllMon++;
519  }
520 
521 
522  for (unsigned int iMon = 0; iMon < m_nrL1Objects; ++iMon) {
523 
525 
526  const std::vector<std::string>& objQtName =
528 
529  for (std::vector<std::string>::const_iterator itQtName =
530  objQtName.begin(); itQtName != objQtName.end(); ++itQtName) {
531 
532  const std::string hStr = "L1TEMU_L1Obj_" + m_objectLabel[iMon] + "_"
533  + (*itQtName);
534 
535  const char* cStr = hStr.c_str();
536  sprintf(histoQT, cStr);
537 
538  m_meReportSummaryContent.push_back(m_dbe->bookFloat(histoQT));
539  m_meReportSummaryContent[iAllQTest]->Fill(0.);
540 
541  iAllQTest++;
542  }
543 
544  iAllMon++;
545 
546  }
547 
548  m_dbe->setCurrentFolder("L1TEMU/EventInfo");
549 
550  if ((m_meReportSummaryMap = m_dbe->get("L1TEMU/EventInfo/reportSummaryMap"))) {
552  }
553 
554  // define a histogram with two bins on X and maximum of m_nrL1Systems, m_nrL1Objects on Y
555 
556  int nBinsY = std::max(m_nrL1Systems, m_nrL1Objects);
557 
558  m_meReportSummaryMap = m_dbe->book2D("reportSummaryMap",
559  "reportSummaryMap", 2, 1, 3, nBinsY, 1, nBinsY + 1);
560 
563 
564  m_meReportSummaryMap->setBinLabel(1, " ", 1);
565  m_meReportSummaryMap->setBinLabel(2, " ", 1);
566 
567  for (int iBin = 0; iBin < nBinsY; ++iBin) {
568 
569  m_meReportSummaryMap->setBinLabel(iBin + 1, " ", 2);
570  }
571 
572 }
const std::string & getName(void) const
get name of ME
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * bookFloat(const char *name)
Book float.
Definition: DQMStore.cc:654
void Fill(long long x)
MonitorElement * m_meReportSummary
a summary report
const T & max(const T &a, const T &b)
size_t m_nrL1Objects
number of L1 trigger objects
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
static const int DISABLED
std::vector< std::string > m_systemLabel
size_t m_nrL1Systems
number of L1 trigger systems
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
std::vector< std::vector< std::string > > m_systemQualityTestName
std::vector< std::vector< std::string > > m_objectQualityTestName
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:845
std::vector< MonitorElement * > m_meReportSummaryContent
monitor elements to report content for all quality tests
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
std::vector< int > m_summaryContent
std::vector< std::string > m_objectLabel
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
MonitorElement * m_meReportSummaryMap
report summary map
void L1TEMUEventInfoClient::dumpContentMonitorElements ( )
private

dump the content of the monitoring elements defined in this module

Definition at line 379 of file L1TEMUEventInfoClient.cc.

References gather_cfg::cout, DQMStore::get(), MonitorElement::getName(), MonitorElement::getTH2F(), estimatePileup::hist, m_dbe, m_meReportSummaryContent, m_meReportSummaryMap, m_nrL1Objects, m_nrL1Systems, m_objectLabel, m_objectMask, m_summaryContent, m_systemLabel, m_systemLabelExt, and m_systemMask.

Referenced by endJob(), endLuminosityBlock(), and endRun().

379  {
380 
381  std::cout << "\nSummary report " << std::endl;
382 
383  // summary content
384 
386 
387  std::cout
388  << "\nSummary content per system and object as filled in histogram\n "
389  << m_meReportSummaryMap->getName() << std::endl;
390 
391  if (!me) {
392 
393  std::cout << "\nNo histogram " << m_meReportSummaryMap->getName()
394  << "\nNo summary content per system and object as filled in histogram.\n "
395  << std::endl;
396  return;
397 
398  }
399 
400  TH2F* hist = me->getTH2F();
401 
402  const int nBinsX = hist->GetNbinsX();
403  const int nBinsY = hist->GetNbinsY();
404  std::cout << nBinsX << " " << nBinsY;
405 
406  std::vector<std::vector<int> > meReportSummaryMap(nBinsX, std::vector<int>(
407  nBinsY));
408 
409 // for (int iBinX = 0; iBinX < nBinsX; iBinX++) {
410 // for (int iBinY = 0; iBinY < nBinsY; iBinY++) {
411 // meReportSummaryMap[iBinX][iBinY]
412 // = static_cast<int>(me->GetBinContent(iBinX + 1, iBinY + 1));
413 // }
414 // }
415 
416  std::cout << "\nL1 systems: " << m_nrL1Systems << " systems included\n"
417  << "\n Summary content size: " << (m_summaryContent.size())
418  << std::endl;
419 
420  for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
421 
422  std::cout << std::setw(10) << m_systemLabel[iSys] << std::setw(10)
423  << m_systemLabelExt[iSys] << " \t" << m_systemMask[iSys]
424  << " \t" << std::setw(25) << " m_summaryContent["
425  << std::setw(2) << iSys << "] = " << meReportSummaryMap[0][iSys]
426  << std::endl;
427  }
428 
429  std::cout << "\n L1 trigger objects: " << m_nrL1Objects
430  << " objects included\n" << std::endl;
431 
432  for (unsigned int iMon = m_nrL1Systems; iMon < m_nrL1Systems
433  + m_nrL1Objects; ++iMon) {
434 
435  std::cout << std::setw(20) << m_objectLabel[iMon - m_nrL1Systems]
436  << " \t" << m_objectMask[iMon - m_nrL1Systems] << " \t"
437  << std::setw(25) << " m_summaryContent[" << std::setw(2)
438  << iMon << "] = \t" << m_summaryContent[iMon] << std::endl;
439  }
440 
441  std::cout << std::endl;
442 
443  // quality tests
444 
445  std::cout << "\nQuality test results as filled in "
446  << "\n L1TEMU/EventInfo/reportSummaryContents\n"
447  << "\n Total number of quality tests: "
448  << (m_meReportSummaryContent.size()) << "\n" << std::endl;
449 
450  for (std::vector<MonitorElement*>::const_iterator itME =
451  m_meReportSummaryContent.begin(); itME
452  != m_meReportSummaryContent.end(); ++itME) {
453 
454  std::cout << std::setw(50) << (*itME)->getName() << " \t"
455  << std::setw(25) << (*itME)->getFloatValue() << std::endl;
456 
457  }
458 
459  std::cout << std::endl;
460 
461 }
const std::string & getName(void) const
get name of ME
std::vector< int > m_objectMask
std::vector< int > m_systemMask
size_t m_nrL1Objects
number of L1 trigger objects
std::vector< std::string > m_systemLabel
size_t m_nrL1Systems
number of L1 trigger systems
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
tuple cout
Definition: gather_cfg.py:121
TH2F * getTH2F(void) const
std::vector< MonitorElement * > m_meReportSummaryContent
monitor elements to report content for all quality tests
std::vector< int > m_summaryContent
std::vector< std::string > m_systemLabelExt
std::vector< std::string > m_objectLabel
MonitorElement * m_meReportSummaryMap
report summary map
void L1TEMUEventInfoClient::endJob ( void  )
privatevirtual

end job

Reimplemented from edm::EDAnalyzer.

Definition at line 364 of file L1TEMUEventInfoClient.cc.

References gather_cfg::cout, dumpContentMonitorElements(), m_runInEndJob, m_verbose, and readQtResults().

364  {
365 
366  if (m_runInEndJob) {
367 
368  readQtResults();
369 
370  if (m_verbose) {
371 
372  std::cout << "\n L1TEMUEventInfoClient::endRun\n" << std::endl;
374  }
375  }
376 }
void readQtResults()
read quality test results
void dumpContentMonitorElements()
dump the content of the monitoring elements defined in this module
tuple cout
Definition: gather_cfg.py:121
bool m_verbose
input parameters
void L1TEMUEventInfoClient::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup evSetup 
)
privatevirtual

end luminosity block

Reimplemented from edm::EDAnalyzer.

Definition at line 329 of file L1TEMUEventInfoClient.cc.

References gather_cfg::cout, dumpContentMonitorElements(), m_runInEndLumi, m_verbose, and readQtResults().

330  {
331 
332  if (m_runInEndLumi) {
333 
334  readQtResults();
335 
336  if (m_verbose) {
337 
338  std::cout << "\n L1TEMUEventInfoClient::endLuminosityBlock\n"
339  << std::endl;
341  }
342 
343  }
344 }
void readQtResults()
read quality test results
void dumpContentMonitorElements()
dump the content of the monitoring elements defined in this module
tuple cout
Definition: gather_cfg.py:121
bool m_verbose
input parameters
void L1TEMUEventInfoClient::endRun ( const edm::Run run,
const edm::EventSetup evSetup 
)
privatevirtual

end run

Reimplemented from edm::EDAnalyzer.

Definition at line 347 of file L1TEMUEventInfoClient.cc.

References gather_cfg::cout, dumpContentMonitorElements(), m_runInEndRun, m_verbose, and readQtResults().

348  {
349 
350  if (m_runInEndRun) {
351 
352  readQtResults();
353 
354  if (m_verbose) {
355 
356  std::cout << "\n L1TEMUEventInfoClient::endRun\n" << std::endl;
358  }
359 
360  }
361 }
void readQtResults()
read quality test results
void dumpContentMonitorElements()
dump the content of the monitoring elements defined in this module
tuple cout
Definition: gather_cfg.py:121
bool m_verbose
input parameters
void L1TEMUEventInfoClient::initialize ( )
private

private methods

initialize properly all elements

Definition at line 71 of file L1TEMUEventInfoClient.cc.

References gather_cfg::cout, edm::hlt::Exception, estimatePileup::hist, m_dbe, m_l1Objects, m_l1Systems, m_maskL1Objects, m_maskL1Systems, m_meReportSummaryContent, m_monitorDir, m_nrL1Objects, m_nrL1Systems, m_objectFolder, m_objectLabel, m_objectMask, m_objectQtSummaryEnabled, m_objectQualityTestHist, m_objectQualityTestName, m_summaryContent, m_systemFolder, m_systemLabel, m_systemLabelExt, m_systemMask, m_systemQtSummaryEnabled, m_systemQualityTestHist, m_systemQualityTestName, m_totalNrQtSummaryEnabled, m_verbose, and cppFunctionSkipper::operator.

Referenced by L1TEMUEventInfoClient().

71  {
72 
73  // get back-end interface
75 
76  if (m_verbose) {
77  std::cout << "\nMonitor directory = " << m_monitorDir
78  << std::endl;
79  }
80 
81  //
82 
83  m_nrL1Systems = m_l1Systems.size();
84 
87  m_systemMask.reserve(m_nrL1Systems);
89 
90  // on average two quality test per system - just a best guess
94 
95  int indexSys = 0;
96 
97  int totalNrQualityTests = 0;
98 
99  for (std::vector<edm::ParameterSet>::const_iterator itSystem =
100  m_l1Systems.begin(); itSystem != m_l1Systems.end(); ++itSystem) {
101 
102  m_systemLabel.push_back(itSystem->getParameter<std::string>(
103  "SystemLabel"));
104 
105  m_systemLabelExt.push_back(itSystem->getParameter<std::string>(
106  "HwValLabel"));
107 
108  m_systemMask.push_back(itSystem->getParameter<unsigned int>(
109  "SystemMask"));
110  // check the additional mask from m_maskL1Systems
111  for (std::vector<std::string>::const_iterator itSys =
112  m_maskL1Systems.begin(); itSys != m_maskL1Systems.end(); ++itSys) {
113 
114  if (*itSys == m_systemLabel[indexSys]) {
115  m_systemMask[indexSys] = 1;
116 
117  }
118  }
119 
120  //
121  std::string sysFolder = itSystem->getParameter<std::string> (
122  "SystemFolder");
123  m_systemFolder.push_back(sysFolder);
124 
125  //
126  std::vector<std::string> qtNames = itSystem->getParameter<
127  std::vector<std::string> >("QualityTestName");
128  m_systemQualityTestName.push_back(qtNames);
129 
130  totalNrQualityTests = totalNrQualityTests + qtNames.size();
131 
132  //
133  std::vector<std::string> qtHists = itSystem->getParameter<
134  std::vector<std::string> > ("QualityTestHist");
135 
136  std::vector<std::string> qtFullPathHists;
137  qtFullPathHists.reserve(qtHists.size());
138 
139  for (std::vector<std::string>::const_iterator itQtHist =
140  qtHists.begin(); itQtHist != qtHists.end(); ++itQtHist) {
141 
142  std::string hist = *itQtHist;
143 
144  if (sysFolder == "") {
145  hist = "L1TEMU/" + m_systemLabel[indexSys] + "/" + hist;
146  } else {
147  hist = sysFolder + "/" + hist;
148  }
149 
150  qtFullPathHists.push_back(hist);
151  }
152 
153  m_systemQualityTestHist.push_back(qtFullPathHists);
154 
155  //
156  std::vector<unsigned int> qtSumEnabled = itSystem->getParameter<
157  std::vector<unsigned int> >("QualityTestSummaryEnabled");
158  m_systemQtSummaryEnabled.push_back(qtSumEnabled);
159 
160  for (std::vector<unsigned int>::const_iterator itQtSumEnabled =
161  qtSumEnabled.begin(); itQtSumEnabled != qtSumEnabled.end(); ++itQtSumEnabled) {
162 
164  }
165 
166  // consistency check - throw exception, it will crash anyway if not consistent
167  if (
168  (qtNames.size() != qtHists.size()) ||
169  (qtNames.size() != qtSumEnabled.size()) ||
170  (qtHists.size() != qtSumEnabled.size())) {
171 
172  throw cms::Exception("FailModule")
173  << "\nError: inconsistent size of input vector parameters"
174  << "\n QualityTestName, QualityTestHistQuality, TestSummaryEnabled"
175  << "\nfor system " << m_systemLabel[indexSys]
176  << "\n They must have equal size.\n"
177  << std::endl;
178  }
179 
180 
181  indexSys++;
182 
183  }
184 
185  // L1 objects
186 
187  //
188  m_nrL1Objects = m_l1Objects.size();
189 
190  m_objectLabel.reserve(m_nrL1Objects);
191  m_objectMask.reserve(m_nrL1Objects);
192  m_objectFolder.reserve(m_nrL1Objects);
193 
194  // on average two quality test per object - just a best guess
198 
199  int indexObj = 0;
200 
201  for (std::vector<edm::ParameterSet>::const_iterator itObject =
202  m_l1Objects.begin(); itObject != m_l1Objects.end(); ++itObject) {
203 
204  m_objectLabel.push_back(itObject->getParameter<std::string>(
205  "ObjectLabel"));
206 
207  m_objectMask.push_back(itObject->getParameter<unsigned int>(
208  "ObjectMask"));
209  // check the additional mask from m_maskL1Objects
210  for (std::vector<std::string>::const_iterator itObj =
211  m_maskL1Objects.begin(); itObj != m_maskL1Objects.end(); ++itObj) {
212 
213  if (*itObj == m_objectLabel[indexObj]) {
214  m_objectMask[indexObj] = 1;
215 
216  }
217  }
218 
219  //
220  std::string objFolder = itObject->getParameter<std::string> (
221  "ObjectFolder");
222  m_objectFolder.push_back(objFolder);
223 
224  //
225  std::vector<std::string> qtNames = itObject->getParameter<
226  std::vector<std::string> >("QualityTestName");
227  m_objectQualityTestName.push_back(qtNames);
228 
229  totalNrQualityTests = totalNrQualityTests + qtNames.size();
230 
231  //
232  std::vector<std::string> qtHists = itObject->getParameter<
233  std::vector<std::string> > ("QualityTestHist");
234 
235  std::vector<std::string> qtFullPathHists;
236  qtFullPathHists.reserve(qtHists.size());
237 
238  for (std::vector<std::string>::const_iterator itQtHist =
239  qtHists.begin(); itQtHist != qtHists.end(); ++itQtHist) {
240 
241  std::string hist = *itQtHist;
242 
243  if (objFolder == "") {
244  hist = "L1TEMU/" + m_objectLabel[indexObj] + "/" + hist;
245  } else {
246  hist = objFolder + hist;
247  }
248 
249  qtFullPathHists.push_back(hist);
250  }
251 
252  m_objectQualityTestHist.push_back(qtFullPathHists);
253 
254  //
255  std::vector<unsigned int> qtSumEnabled = itObject->getParameter<
256  std::vector<unsigned int> >("QualityTestSummaryEnabled");
257  m_objectQtSummaryEnabled.push_back(qtSumEnabled);
258 
259  for (std::vector<unsigned int>::const_iterator itQtSumEnabled =
260  qtSumEnabled.begin(); itQtSumEnabled != qtSumEnabled.end(); ++itQtSumEnabled) {
261 
263  }
264 
265  // consistency check - throw exception, it will crash anyway if not consistent
266  if (
267  (qtNames.size() != qtHists.size()) ||
268  (qtNames.size() != qtSumEnabled.size()) ||
269  (qtHists.size() != qtSumEnabled.size())) {
270 
271  throw cms::Exception("FailModule")
272  << "\nError: inconsistent size of input vector parameters"
273  << "\n QualityTestName, QualityTestHistQuality, TestSummaryEnabled"
274  << "\nfor object " << m_objectLabel[indexObj]
275  << "\nThe three vectors must have equal size.\n"
276  << std::endl;
277  }
278 
279 
280 
281 
282  indexObj++;
283 
284  }
285 
287  m_meReportSummaryContent.reserve(totalNrQualityTests);
288 
289 }
std::vector< int > m_objectMask
std::vector< edm::ParameterSet > m_l1Objects
std::vector< std::vector< std::string > > m_objectQualityTestHist
std::vector< std::string > m_maskL1Systems
std::vector< std::vector< unsigned int > > m_systemQtSummaryEnabled
std::vector< int > m_systemMask
std::vector< edm::ParameterSet > m_l1Systems
size_t m_nrL1Objects
number of L1 trigger objects
std::vector< std::string > m_systemLabel
size_t m_nrL1Systems
number of L1 trigger systems
std::vector< std::vector< std::string > > m_systemQualityTestName
std::vector< std::vector< unsigned int > > m_objectQtSummaryEnabled
std::vector< std::vector< std::string > > m_systemQualityTestHist
std::vector< std::vector< std::string > > m_objectQualityTestName
std::vector< std::string > m_systemFolder
tuple cout
Definition: gather_cfg.py:121
bool m_verbose
input parameters
std::vector< MonitorElement * > m_meReportSummaryContent
monitor elements to report content for all quality tests
std::vector< int > m_summaryContent
std::vector< std::string > m_maskL1Objects
std::vector< std::string > m_systemLabelExt
std::vector< std::string > m_objectLabel
std::vector< std::string > m_objectFolder
void L1TEMUEventInfoClient::readQtResults ( )
private

read quality test results

Definition at line 575 of file L1TEMUEventInfoClient.cc.

References gather_cfg::cout, dqm::qstatus::DISABLED, MonitorElement::Fill(), DQMStore::get(), QReport::getMessage(), MonitorElement::getName(), MonitorElement::getQReport(), MonitorElement::getQReports(), QReport::getQTresult(), QReport::getStatus(), dqm::qstatus::INVALID, m_dbe, m_meReportSummary, m_meReportSummaryContent, m_meReportSummaryMap, m_nrL1Objects, m_nrL1Systems, m_objectQtSummaryEnabled, m_objectQualityTestHist, m_objectQualityTestName, m_reportSummary, m_summaryContent, m_summarySum, m_systemQtSummaryEnabled, m_systemQualityTestHist, m_systemQualityTestName, m_totalNrQtSummaryEnabled, m_verbose, and MonitorElement::setBinContent().

Referenced by analyze(), endJob(), endLuminosityBlock(), and endRun().

575  {
576 
577  // initialize summary content, summary sum and ReportSummaryContent float histograms
578  // for all L1 systems and L1 objects
579 
580  for (std::vector<int>::iterator it = m_summaryContent.begin(); it
581  != m_summaryContent.end(); ++it) {
582 
583  (*it) = dqm::qstatus::DISABLED;
584 
585  }
586 
587  m_summarySum = 0.;
588 
589  for (std::vector<MonitorElement*>::iterator itME =
590  m_meReportSummaryContent.begin(); itME
591  != m_meReportSummaryContent.end(); ++itME) {
592 
593  (*itME)->Fill(0.);
594 
595  }
596 
597 
598  // general counters:
599  // iAllQTest: all quality tests for all systems and objects
600  // iAllMon: all monitored systems and objects
601  int iAllQTest = 0;
602  int iAllMon = 0;
603 
604 
605  // quality tests for all L1 systems
606 
607  for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
608 
609  // get the reports for each quality test
610 
611  const std::vector<std::string>& sysQtName =
613  const std::vector<std::string>& sysQtHist =
615  const std::vector<unsigned int>& sysQtSummaryEnabled =
617 
618  // pro system counter for quality tests
619  int iSysQTest = 0;
620 
621  for (std::vector<std::string>::const_iterator itQtName =
622  sysQtName.begin(); itQtName != sysQtName.end(); ++itQtName) {
623 
624  // get results, status and message
625 
626  MonitorElement* qHist = m_dbe->get(sysQtHist[iSysQTest]);
627 
628  if (qHist) {
629  const std::vector<QReport*> qtVec = qHist->getQReports();
630  const std::string hName = qHist->getName();
631 
632  if (m_verbose) {
633 
634  std::cout << "\nNumber of quality tests "
635  << " for histogram " << sysQtHist[iSysQTest]
636  << ": " << qtVec.size() << "\n" << std::endl;
637  }
638 
639  const QReport* sysQReport = qHist->getQReport(*itQtName);
640  if (sysQReport) {
641  const float sysQtResult = sysQReport->getQTresult();
642  const int sysQtStatus = sysQReport->getStatus();
643  const std::string& sysQtMessage = sysQReport->getMessage();
644 
645  if (m_verbose) {
646  std::cout << "\n" << (*itQtName) << " quality test:"
647  << "\n result: " << sysQtResult
648  << "\n status: " << sysQtStatus
649  << "\n message: " << sysQtMessage << "\n"
650  << "\nFilling m_meReportSummaryContent["
651  << iAllQTest << "] with value "
652  << sysQtResult << "\n" << std::endl;
653  }
654 
655  m_meReportSummaryContent[iAllQTest]->Fill(sysQtResult);
656 
657  // for the summary map, keep the highest status value ("ERROR") of all tests
658  // which are considered for the summary plot
659  if (sysQtSummaryEnabled[iSysQTest]) {
660 
661  if (sysQtStatus > m_summaryContent[iAllMon]) {
662  m_summaryContent[iAllMon] = sysQtStatus;
663  }
664 
665  m_summarySum += sysQtResult;
666  }
667 
668 
669  } else {
670 
671  // for the summary map, if the test was not found but it is assumed to be
672  // considered for the summary plot, set it to dqm::qstatus::INVALID
673 
674  int sysQtStatus = dqm::qstatus::INVALID;
675 
676  if (sysQtSummaryEnabled[iSysQTest]) {
677 
678  if (sysQtStatus > m_summaryContent[iAllMon]) {
679  m_summaryContent[iAllMon] = sysQtStatus;
680  }
681  }
682 
683  m_meReportSummaryContent[iAllQTest]->Fill(0.);
684 
685  if (m_verbose) {
686 
687  std::cout << "\n" << (*itQtName)
688  << " quality test not found\n" << std::endl;
689  }
690  }
691 
692  } else {
693  // for the summary map, if the histogram was not found but it is assumed
694  // to have a test be considered for the summary plot, set it to dqm::qstatus::INVALID
695 
696  int sysQtStatus = dqm::qstatus::INVALID;
697 
698  if (sysQtSummaryEnabled[iSysQTest]) {
699 
700  if (sysQtStatus > m_summaryContent[iAllMon]) {
701  m_summaryContent[iAllMon] = sysQtStatus;
702  }
703  }
704 
705  m_meReportSummaryContent[iAllQTest]->Fill(0.);
706 
707  if (m_verbose) {
708 
709  std::cout << "\nHistogram " << sysQtHist[iSysQTest]
710  << " not found\n" << std::endl;
711  }
712 
713  }
714 
715  // increase counters for quality tests
716  iSysQTest++;
717  iAllQTest++;
718 
719  }
720 
721  iAllMon++;
722 
723  }
724 
725  // quality tests for all L1 objects
726 
727  for (unsigned int iObj = 0; iObj < m_nrL1Objects; ++iObj) {
728 
729  // get the reports for each quality test
730 
731  const std::vector<std::string>& objQtName =
733  const std::vector<std::string>& objQtHist =
735  const std::vector<unsigned int>& objQtSummaryEnabled =
737 
738  // pro object counter for quality tests
739  int iObjQTest = 0;
740 
741  for (std::vector<std::string>::const_iterator itQtName =
742  objQtName.begin(); itQtName != objQtName.end(); ++itQtName) {
743 
744  // get results, status and message
745 
746  MonitorElement* qHist = m_dbe->get(objQtHist[iObjQTest]);
747 
748  if (qHist) {
749  const std::vector<QReport*> qtVec = qHist->getQReports();
750  const std::string hName = qHist->getName();
751 
752  if (m_verbose) {
753 
754  std::cout << "\nNumber of quality tests "
755  << " for histogram " << objQtHist[iObjQTest]
756  << ": " << qtVec.size() << "\n" << std::endl;
757  }
758 
759  const QReport* objQReport = qHist->getQReport(*itQtName);
760  if (objQReport) {
761  const float objQtResult = objQReport->getQTresult();
762  const int objQtStatus = objQReport->getStatus();
763  const std::string& objQtMessage = objQReport->getMessage();
764 
765  if (m_verbose) {
766  std::cout << "\n" << (*itQtName) << " quality test:"
767  << "\n result: " << objQtResult
768  << "\n status: " << objQtStatus
769  << "\n message: " << objQtMessage << "\n"
770  << "\nFilling m_meReportSummaryContent["
771  << iAllQTest << "] with value "
772  << objQtResult << "\n" << std::endl;
773  }
774 
775  m_meReportSummaryContent[iAllQTest]->Fill(objQtResult);
776 
777  // for the summary map, keep the highest status value ("ERROR") of all tests
778  // which are considered for the summary plot
779  if (objQtSummaryEnabled[iObjQTest]) {
780 
781  if (objQtStatus > m_summaryContent[iAllMon]) {
782  m_summaryContent[iAllMon] = objQtStatus;
783  }
784 
785  m_summarySum += objQtResult;
786  }
787 
788  } else {
789 
790  // for the summary map, if the test was not found but it is assumed to be
791  // considered for the summary plot, set it to dqm::qstatus::INVALID
792 
793  int objQtStatus = dqm::qstatus::INVALID;
794 
795  if (objQtSummaryEnabled[iObjQTest]) {
796 
797  if (objQtStatus > m_summaryContent[iAllMon]) {
798  m_summaryContent[iAllMon] = objQtStatus;
799  }
800  }
801 
802  m_meReportSummaryContent[iAllQTest]->Fill(0.);
803 
804  if (m_verbose) {
805 
806  std::cout << "\n" << (*itQtName)
807  << " quality test not found\n" << std::endl;
808  }
809 
810  }
811 
812  } else {
813  // for the summary map, if the histogram was not found but it is assumed
814  // to have a test be considered for the summary plot, set it to dqm::qstatus::INVALID
815 
816  int objQtStatus = dqm::qstatus::INVALID;
817 
818  if (objQtSummaryEnabled[iObjQTest]) {
819 
820  if (objQtStatus > m_summaryContent[iAllMon]) {
821  m_summaryContent[iAllMon] = objQtStatus;
822  }
823  }
824 
825  m_meReportSummaryContent[iAllQTest]->Fill(0.);
826 
827  if (m_verbose) {
828  std::cout << "\nHistogram " << objQtHist[iObjQTest]
829  << " not found\n" << std::endl;
830  }
831 
832  }
833 
834  // increase counters for quality tests
835  iObjQTest++;
836  iAllQTest++;
837  }
838 
839  iAllMon++;
840 
841  }
842 
843 
844 
845  // reportSummary value
847  if (m_meReportSummary) {
849  }
850 
851  // fill the ReportSummaryMap for L1 systems (bin 1 on X)
852  for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
853 
854  double summCont = static_cast<double>(m_summaryContent[iSys]);
855  m_meReportSummaryMap->setBinContent(1, iSys + 1, summCont);
856  }
857 
858  // fill the ReportSummaryMap for L1 objects (bin 2 on X)
859  for (unsigned int iMon = m_nrL1Systems; iMon < m_nrL1Systems
860  + m_nrL1Objects; ++iMon) {
861 
862  double summCont = static_cast<double>(m_summaryContent[iMon]);
863  m_meReportSummaryMap->setBinContent(2, iMon - m_nrL1Systems + 1, summCont);
864 
865  }
866 
867 }
const std::string & getName(void) const
get name of ME
const QReport * getQReport(const std::string &qtname) const
get QReport corresponding to &lt;qtname&gt; (null pointer if QReport does not exist)
void setBinContent(int binx, double content)
set content of bin (1-D)
Float_t m_reportSummary
summary report
std::vector< std::vector< std::string > > m_objectQualityTestHist
const std::string & getMessage(void) const
get message attached to test
Definition: QReport.h:24
void Fill(long long x)
std::vector< std::vector< unsigned int > > m_systemQtSummaryEnabled
MonitorElement * m_meReportSummary
a summary report
static const int INVALID
size_t m_nrL1Objects
number of L1 trigger objects
int getStatus(void) const
get test status (see Core/interface/QTestStatus.h)
Definition: QReport.h:16
static const int DISABLED
size_t m_nrL1Systems
number of L1 trigger systems
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
std::vector< std::vector< std::string > > m_systemQualityTestName
std::vector< std::vector< unsigned int > > m_objectQtSummaryEnabled
std::vector< QReport * > getQReports(void) const
get map of QReports
std::vector< std::vector< std::string > > m_systemQualityTestHist
std::vector< std::vector< std::string > > m_objectQualityTestName
float getQTresult(void) const
get test result i.e. prob value
Definition: QReport.h:20
tuple cout
Definition: gather_cfg.py:121
bool m_verbose
input parameters
std::vector< MonitorElement * > m_meReportSummaryContent
monitor elements to report content for all quality tests
std::vector< int > m_summaryContent
MonitorElement * m_meReportSummaryMap
report summary map

Member Data Documentation

DQMStore* L1TEMUEventInfoClient::m_dbe
private
std::vector<edm::ParameterSet> L1TEMUEventInfoClient::m_l1Objects
private

Definition at line 90 of file L1TEMUEventInfoClient.h.

Referenced by initialize().

std::vector<edm::ParameterSet> L1TEMUEventInfoClient::m_l1Systems
private

Definition at line 89 of file L1TEMUEventInfoClient.h.

Referenced by initialize().

std::vector<std::string> L1TEMUEventInfoClient::m_maskL1Objects
private

Definition at line 92 of file L1TEMUEventInfoClient.h.

Referenced by initialize().

std::vector<std::string> L1TEMUEventInfoClient::m_maskL1Systems
private

Definition at line 91 of file L1TEMUEventInfoClient.h.

Referenced by initialize().

MonitorElement* L1TEMUEventInfoClient::m_meReportSummary
private

a summary report

Definition at line 143 of file L1TEMUEventInfoClient.h.

Referenced by bookHistograms(), and readQtResults().

std::vector<MonitorElement*> L1TEMUEventInfoClient::m_meReportSummaryContent
private

monitor elements to report content for all quality tests

Definition at line 146 of file L1TEMUEventInfoClient.h.

Referenced by bookHistograms(), dumpContentMonitorElements(), initialize(), and readQtResults().

MonitorElement* L1TEMUEventInfoClient::m_meReportSummaryMap
private

report summary map

Definition at line 149 of file L1TEMUEventInfoClient.h.

Referenced by bookHistograms(), dumpContentMonitorElements(), and readQtResults().

std::string L1TEMUEventInfoClient::m_monitorDir
private

Definition at line 82 of file L1TEMUEventInfoClient.h.

Referenced by initialize().

size_t L1TEMUEventInfoClient::m_nrL1Objects
private

number of L1 trigger objects

Definition at line 112 of file L1TEMUEventInfoClient.h.

Referenced by bookHistograms(), dumpContentMonitorElements(), initialize(), and readQtResults().

size_t L1TEMUEventInfoClient::m_nrL1Systems
private

number of L1 trigger systems

Definition at line 109 of file L1TEMUEventInfoClient.h.

Referenced by bookHistograms(), dumpContentMonitorElements(), initialize(), and readQtResults().

std::vector<std::string> L1TEMUEventInfoClient::m_objectFolder
private

Definition at line 129 of file L1TEMUEventInfoClient.h.

Referenced by initialize().

std::vector<std::string> L1TEMUEventInfoClient::m_objectLabel
private

Definition at line 128 of file L1TEMUEventInfoClient.h.

Referenced by bookHistograms(), dumpContentMonitorElements(), and initialize().

std::vector<int> L1TEMUEventInfoClient::m_objectMask
private

Definition at line 127 of file L1TEMUEventInfoClient.h.

Referenced by dumpContentMonitorElements(), and initialize().

std::vector<std::vector<unsigned int> > L1TEMUEventInfoClient::m_objectQtSummaryEnabled
private

Definition at line 133 of file L1TEMUEventInfoClient.h.

Referenced by initialize(), and readQtResults().

std::vector<std::vector<std::string> > L1TEMUEventInfoClient::m_objectQualityTestHist
private

Definition at line 132 of file L1TEMUEventInfoClient.h.

Referenced by initialize(), and readQtResults().

std::vector<std::vector<std::string> > L1TEMUEventInfoClient::m_objectQualityTestName
private

Definition at line 131 of file L1TEMUEventInfoClient.h.

Referenced by bookHistograms(), initialize(), and readQtResults().

Float_t L1TEMUEventInfoClient::m_reportSummary
private

summary report

Definition at line 137 of file L1TEMUEventInfoClient.h.

Referenced by readQtResults().

bool L1TEMUEventInfoClient::m_runInEndJob
private

Definition at line 87 of file L1TEMUEventInfoClient.h.

Referenced by endJob().

bool L1TEMUEventInfoClient::m_runInEndLumi
private

Definition at line 85 of file L1TEMUEventInfoClient.h.

Referenced by endLuminosityBlock().

bool L1TEMUEventInfoClient::m_runInEndRun
private

Definition at line 86 of file L1TEMUEventInfoClient.h.

Referenced by endRun().

bool L1TEMUEventInfoClient::m_runInEventLoop
private

Definition at line 84 of file L1TEMUEventInfoClient.h.

Referenced by analyze().

std::vector<int> L1TEMUEventInfoClient::m_summaryContent
private
Float_t L1TEMUEventInfoClient::m_summarySum
private

Definition at line 138 of file L1TEMUEventInfoClient.h.

Referenced by readQtResults().

std::vector<std::string> L1TEMUEventInfoClient::m_systemFolder
private

Definition at line 121 of file L1TEMUEventInfoClient.h.

Referenced by initialize().

std::vector<std::string> L1TEMUEventInfoClient::m_systemLabel
private

Definition at line 118 of file L1TEMUEventInfoClient.h.

Referenced by bookHistograms(), dumpContentMonitorElements(), and initialize().

std::vector<std::string> L1TEMUEventInfoClient::m_systemLabelExt
private

Definition at line 119 of file L1TEMUEventInfoClient.h.

Referenced by dumpContentMonitorElements(), and initialize().

std::vector<int> L1TEMUEventInfoClient::m_systemMask
private

Definition at line 120 of file L1TEMUEventInfoClient.h.

Referenced by dumpContentMonitorElements(), and initialize().

std::vector<std::vector<unsigned int> > L1TEMUEventInfoClient::m_systemQtSummaryEnabled
private

Definition at line 125 of file L1TEMUEventInfoClient.h.

Referenced by initialize(), and readQtResults().

std::vector<std::vector<std::string> > L1TEMUEventInfoClient::m_systemQualityTestHist
private

Definition at line 124 of file L1TEMUEventInfoClient.h.

Referenced by initialize(), and readQtResults().

std::vector<std::vector<std::string> > L1TEMUEventInfoClient::m_systemQualityTestName
private

Definition at line 123 of file L1TEMUEventInfoClient.h.

Referenced by bookHistograms(), initialize(), and readQtResults().

size_t L1TEMUEventInfoClient::m_totalNrQtSummaryEnabled
private

total number of quality tests enabled for summary report for L1 trigger systems and L1 trigger objects

Definition at line 116 of file L1TEMUEventInfoClient.h.

Referenced by initialize(), and readQtResults().

bool L1TEMUEventInfoClient::m_verbose
private

input parameters

Definition at line 81 of file L1TEMUEventInfoClient.h.

Referenced by endJob(), endLuminosityBlock(), endRun(), initialize(), and readQtResults().