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")),
59 m_totalNrQtSummaryEnabled(0) {
97 int totalNrQualityTests = 0;
99 for (std::vector<edm::ParameterSet>::const_iterator itSystem =
108 m_systemMask.push_back(itSystem->getParameter<
unsigned int>(
111 for (std::vector<std::string>::const_iterator itSys =
121 std::string sysFolder = itSystem->getParameter<std::string> (
126 std::vector<std::string> qtNames = itSystem->getParameter<
127 std::vector<std::string> >(
"QualityTestName");
130 totalNrQualityTests = totalNrQualityTests + qtNames.size();
133 std::vector<std::string> qtHists = itSystem->getParameter<
134 std::vector<std::string> > (
"QualityTestHist");
136 std::vector<std::string> qtFullPathHists;
137 qtFullPathHists.reserve(qtHists.size());
139 for (std::vector<std::string>::const_iterator itQtHist =
140 qtHists.begin(); itQtHist != qtHists.end(); ++itQtHist) {
142 std::string
hist = *itQtHist;
144 if (sysFolder ==
"") {
147 hist = sysFolder +
"/" +
hist;
150 qtFullPathHists.push_back(hist);
156 std::vector<unsigned int> qtSumEnabled = itSystem->getParameter<
157 std::vector<unsigned int> >(
"QualityTestSummaryEnabled");
160 for (std::vector<unsigned int>::const_iterator itQtSumEnabled =
161 qtSumEnabled.begin(); itQtSumEnabled != qtSumEnabled.end(); ++itQtSumEnabled) {
168 (qtNames.size() != qtHists.size()) ||
169 (qtNames.size() != qtSumEnabled.size()) ||
170 (qtHists.size() != qtSumEnabled.size())) {
173 <<
"\nError: inconsistent size of input vector parameters"
174 <<
"\n QualityTestName, QualityTestHistQuality, TestSummaryEnabled"
176 <<
"\n They must have equal size.\n"
201 for (std::vector<edm::ParameterSet>::const_iterator itObject =
207 m_objectMask.push_back(itObject->getParameter<
unsigned int>(
210 for (std::vector<std::string>::const_iterator itObj =
220 std::string objFolder = itObject->getParameter<std::string> (
225 std::vector<std::string> qtNames = itObject->getParameter<
226 std::vector<std::string> >(
"QualityTestName");
229 totalNrQualityTests = totalNrQualityTests + qtNames.size();
232 std::vector<std::string> qtHists = itObject->getParameter<
233 std::vector<std::string> > (
"QualityTestHist");
235 std::vector<std::string> qtFullPathHists;
236 qtFullPathHists.reserve(qtHists.size());
238 for (std::vector<std::string>::const_iterator itQtHist =
239 qtHists.begin(); itQtHist != qtHists.end(); ++itQtHist) {
241 std::string
hist = *itQtHist;
243 if (objFolder ==
"") {
246 hist = objFolder +
hist;
249 qtFullPathHists.push_back(hist);
255 std::vector<unsigned int> qtSumEnabled = itObject->getParameter<
256 std::vector<unsigned int> >(
"QualityTestSummaryEnabled");
259 for (std::vector<unsigned int>::const_iterator itQtSumEnabled =
260 qtSumEnabled.begin(); itQtSumEnabled != qtSumEnabled.end(); ++itQtSumEnabled) {
267 (qtNames.size() != qtHists.size()) ||
268 (qtNames.size() != qtSumEnabled.size()) ||
269 (qtHists.size() != qtSumEnabled.size())) {
272 <<
"\nError: inconsistent size of input vector parameters"
273 <<
"\n QualityTestName, QualityTestHistQuality, TestSummaryEnabled"
275 <<
"\nThe three vectors must have equal size.\n"
338 std::cout <<
"\n L1TEMUEventInfoClient::endLuminosityBlock\n"
356 std::cout <<
"\n L1TEMUEventInfoClient::endRun\n" << std::endl;
372 std::cout <<
"\n L1TEMUEventInfoClient::endRun\n" << std::endl;
381 std::cout <<
"\nSummary report " << std::endl;
388 <<
"\nSummary content per system and object as filled in histogram\n "
394 <<
"\nNo summary content per system and object as filled in histogram.\n "
402 const int nBinsX = hist->GetNbinsX();
403 const int nBinsY = hist->GetNbinsY();
406 std::vector<std::vector<int> > meReportSummaryMap(nBinsX, std::vector<int>(
424 <<
" \t" << std::setw(25) <<
" m_summaryContent["
425 << std::setw(2) << iSys <<
"] = " << meReportSummaryMap[0][iSys]
430 <<
" objects included\n" << std::endl;
432 for (
unsigned int iMon = m_nrL1Systems; iMon < m_nrL1Systems
437 << std::setw(25) <<
" m_summaryContent[" << std::setw(2)
445 std::cout <<
"\nQuality test results as filled in "
446 <<
"\n L1TEMU/EventInfo/reportSummaryContents\n"
447 <<
"\n Total number of quality tests: "
450 for (std::vector<MonitorElement*>::const_iterator itME =
454 std::cout << std::setw(50) << (*itME)->getName() <<
" \t"
455 << std::setw(25) << (*itME)->getFloatValue() << std::endl;
501 const std::vector<std::string>& sysQtName =
504 for (std::vector<std::string>::const_iterator itQtName =
505 sysQtName.begin(); itQtName != sysQtName.end(); ++itQtName) {
507 const std::string hStr =
"L1TEMU_L1Sys_" +
m_systemLabel[iMon] +
"_" + (*itQtName);
509 const char* cStr = hStr.c_str();
510 sprintf(histoQT, cStr);
526 const std::vector<std::string>& objQtName =
529 for (std::vector<std::string>::const_iterator itQtName =
530 objQtName.begin(); itQtName != objQtName.end(); ++itQtName) {
532 const std::string hStr =
"L1TEMU_L1Obj_" +
m_objectLabel[iMon] +
"_"
535 const char* cStr = hStr.c_str();
536 sprintf(histoQT, cStr);
556 int nBinsY =
std::max(m_nrL1Systems, m_nrL1Objects);
559 "reportSummaryMap", 2, 1, 3, nBinsY, 1, nBinsY + 1);
567 for (
int iBin = 0; iBin < nBinsY; ++iBin) {
589 for (std::vector<MonitorElement*>::iterator itME =
611 const std::vector<std::string>& sysQtName =
613 const std::vector<std::string>& sysQtHist =
615 const std::vector<unsigned int>& sysQtSummaryEnabled =
621 for (std::vector<std::string>::const_iterator itQtName =
622 sysQtName.begin(); itQtName != sysQtName.end(); ++itQtName) {
629 const std::vector<QReport*> qtVec = qHist->
getQReports();
630 const std::string hName = qHist->
getName();
634 std::cout <<
"\nNumber of quality tests "
635 <<
" for histogram " << sysQtHist[iSysQTest]
636 <<
": " << qtVec.size() <<
"\n" << std::endl;
641 const float sysQtResult = sysQReport->
getQTresult();
642 const int sysQtStatus = sysQReport->
getStatus();
643 const std::string& sysQtMessage = sysQReport->
getMessage();
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;
659 if (sysQtSummaryEnabled[iSysQTest]) {
676 if (sysQtSummaryEnabled[iSysQTest]) {
688 <<
" quality test not found\n" << std::endl;
698 if (sysQtSummaryEnabled[iSysQTest]) {
709 std::cout <<
"\nHistogram " << sysQtHist[iSysQTest]
710 <<
" not found\n" << std::endl;
731 const std::vector<std::string>& objQtName =
733 const std::vector<std::string>& objQtHist =
735 const std::vector<unsigned int>& objQtSummaryEnabled =
741 for (std::vector<std::string>::const_iterator itQtName =
742 objQtName.begin(); itQtName != objQtName.end(); ++itQtName) {
749 const std::vector<QReport*> qtVec = qHist->
getQReports();
750 const std::string hName = qHist->
getName();
754 std::cout <<
"\nNumber of quality tests "
755 <<
" for histogram " << objQtHist[iObjQTest]
756 <<
": " << qtVec.size() <<
"\n" << std::endl;
761 const float objQtResult = objQReport->
getQTresult();
762 const int objQtStatus = objQReport->
getStatus();
763 const std::string& objQtMessage = objQReport->
getMessage();
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;
779 if (objQtSummaryEnabled[iObjQTest]) {
795 if (objQtSummaryEnabled[iObjQTest]) {
807 <<
" quality test not found\n" << std::endl;
818 if (objQtSummaryEnabled[iObjQTest]) {
828 std::cout <<
"\nHistogram " << objQtHist[iObjQTest]
829 <<
" not found\n" << std::endl;
859 for (
unsigned int iMon = m_nrL1Systems; iMon < m_nrL1Systems
void bookHistograms()
book histograms
const std::string & getName(void) const
get name of ME
std::vector< int > m_objectMask
const QReport * getQReport(const std::string &qtname) const
get QReport corresponding to <qtname> (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< edm::ParameterSet > m_l1Objects
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)
void readQtResults()
read quality test results
void endRun(const edm::Run &, const edm::EventSetup &)
end run
std::vector< std::vector< std::string > > m_objectQualityTestHist
virtual ~L1TEMUEventInfoClient()
Destructor.
void beginLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
begin luminosity block
std::vector< std::string > m_maskL1Systems
const std::string & getMessage(void) const
get message attached to test
MonitorElement * bookFloat(const char *name)
Book float.
std::vector< std::vector< unsigned int > > m_systemQtSummaryEnabled
std::vector< int > m_systemMask
MonitorElement * m_meReportSummary
a summary report
std::vector< edm::ParameterSet > m_l1Systems
const T & max(const T &a, const T &b)
size_t m_nrL1Objects
number of L1 trigger objects
void removeElement(const std::string &name)
L1TEMUEventInfoClient(const edm::ParameterSet &)
Constructor.
void endLuminosityBlock(const edm::LuminosityBlock &, const edm::EventSetup &)
end luminosity block
int getStatus(void) const
get test status (see Core/interface/QTestStatus.h)
static const int DISABLED
std::vector< std::string > m_systemLabel
size_t m_nrL1Systems
number of L1 trigger systems
size_t m_totalNrQtSummaryEnabled
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
std::vector< std::vector< std::string > > m_systemQualityTestName
void beginRun(const edm::Run &, const edm::EventSetup &)
begin run
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
void dumpContentMonitorElements()
dump the content of the monitoring elements defined in this module
float getQTresult(void) const
get test result i.e. prob value
std::vector< std::string > m_systemFolder
void initialize()
private methods
bool m_verbose
input parameters
TH2F * getTH2F(void) const
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
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_maskL1Objects
std::vector< std::string > m_systemLabelExt
std::vector< std::string > m_objectLabel
void setCurrentFolder(const std::string &fullpath)
void analyze(const edm::Event &, const edm::EventSetup &)
analyze
MonitorElement * m_meReportSummaryMap
report summary map
std::vector< std::string > m_objectFolder