18 m_verbose(parSet.getUntrackedParameter<
bool>(
"verbose",
false)),
19 m_monitorDir(parSet.getUntrackedParameter<
std::
string>(
"monitorDir",
"")),
20 m_histDir(parSet.getUntrackedParameter<
std::
string>(
"histDir",
"")),
21 m_runInEventLoop(parSet.getUntrackedParameter<
bool>(
"runInEventLoop",
false)),
22 m_runInEndLumi(parSet.getUntrackedParameter<
bool>(
"runInEndLumi",
false)),
23 m_runInEndRun(parSet.getUntrackedParameter<
bool>(
"runInEndRun",
false)),
24 m_runInEndJob(parSet.getUntrackedParameter<
bool>(
"runInEndJob",
false)),
27 m_disableTrackObjects(parSet.getParameter<
std::vector<
std::
string> >(
"DisableTrackObjects")),
28 m_disableHitObjects(parSet.getParameter<
std::vector<
std::
string> >(
"DisableHitObjects")),
31 m_disableNoisyStrip(parSet.getParameter<
std::vector<
std::
string> >(
"DisableNoisyStrip")),
32 m_disableDeadStrip(parSet.getParameter<
std::vector<
std::
string> >(
"DisableDeadStrip")),
37 m_totalNrQtSummaryEnabled(0) {
66 int totalNrQualityTests = 0;
87 std::vector < edm::ParameterSet > qTests = itTrack.getParameter<
88 std::vector<edm::ParameterSet> > (
"QualityTests");
89 size_t qtPerSystem = qTests.size();
91 std::vector < std::string > qtNames;
92 qtNames.reserve(qtPerSystem);
94 std::vector < std::string > qtFullPathHists;
95 qtFullPathHists.reserve(qtPerSystem);
97 std::vector<unsigned int> qtSumEnabled;
98 qtSumEnabled.reserve(qtPerSystem);
101 for (
const auto & itQT : qTests) {
103 totalNrQualityTests++;
106 itQT.getParameter<
std::string> (
"QualityTestName"));
109 qtFullPathHists.push_back( itQT.getParameter<
std::string> (
"QualityTestHist"));
112 unsigned int qtEnabled = itQT.getParameter<
unsigned int> (
113 "QualityTestSummaryEnabled");
115 qtSumEnabled.push_back(qtEnabled);
150 m_hitDisable.push_back(itObject.getParameter<
unsigned int>(
161 std::vector < edm::ParameterSet > qTests = itObject.getParameter<
162 std::vector<edm::ParameterSet> > (
"QualityTests");
163 size_t qtPerObject = qTests.size();
165 std::vector < std::string > qtNames;
166 qtNames.reserve(qtPerObject);
168 std::vector < std::string > qtFullPathHists;
169 qtFullPathHists.reserve(qtPerObject);
171 std::vector<unsigned int> qtSumEnabled;
172 qtSumEnabled.reserve(qtPerObject);
175 for (
const auto & itQT : qTests) {
177 totalNrQualityTests++;
180 itQT.getParameter<
std::string> (
"QualityTestName"));
183 qtFullPathHists.push_back( itQT.getParameter<
std::string> (
"QualityTestHist") );
186 unsigned int qtEnabled = itQT.getParameter<
unsigned int> (
187 "QualityTestSummaryEnabled");
189 qtSumEnabled.push_back(qtEnabled);
234 std::vector < edm::ParameterSet > qTests = itNoisy.getParameter<
235 std::vector<edm::ParameterSet> > (
"QualityTests");
236 size_t qtPerNoisy = qTests.size();
238 std::vector < std::string > qtNames;
239 qtNames.reserve(qtPerNoisy);
241 std::vector < std::string > qtFullPathHists;
242 qtFullPathHists.reserve(qtPerNoisy);
244 std::vector<unsigned int> qtSumEnabled;
245 qtSumEnabled.reserve(qtPerNoisy);
248 for (
const auto & itQT : qTests) {
250 totalNrQualityTests++;
253 itQT.getParameter<
std::string> (
"QualityTestName"));
255 qtFullPathHists.push_back( itQT.getParameter<
std::string> (
"QualityTestHist"));
258 unsigned int qtEnabled = itQT.getParameter<
unsigned int> (
259 "QualityTestSummaryEnabled");
261 qtSumEnabled.push_back(qtEnabled);
304 std::vector < edm::ParameterSet > qTests = itDead.getParameter<
305 std::vector<edm::ParameterSet> > (
"QualityTests");
306 size_t qtPerDead = qTests.size();
308 std::vector < std::string > qtNames;
309 qtNames.reserve(qtPerDead);
311 std::vector < std::string > qtFullPathHists;
312 qtFullPathHists.reserve(qtPerDead);
314 std::vector<unsigned int> qtSumEnabled;
315 qtSumEnabled.reserve(qtPerDead);
318 for (
const auto & itQT : qTests) {
320 totalNrQualityTests++;
323 itQT.getParameter<
std::string> (
"QualityTestName"));
325 qtFullPathHists.push_back( itQT.getParameter<
std::string> (
"QualityTestHist"));
328 unsigned int qtEnabled = itQT.getParameter<
unsigned int> (
329 "QualityTestSummaryEnabled");
331 qtSumEnabled.push_back(qtEnabled);
352 if (
m_verbose)
std::cout <<
"\nInside void L1TEMTFEventInfoClient::dqmEndLuminosityBlock" << std::endl;
355 book(ibooker, igetter);
359 std::cout <<
"\n L1TEMTFEventInfoClient::endLuminosityBlock\n" << std::endl;
369 if (
m_verbose)
std::cout <<
"\nInside void L1TEMTFEventInfoClient::dqmEndJob" << std::endl;
370 book(ibooker, igetter);
375 std::cout <<
"\n L1TEMTFEventInfoClient::endRun\n" << std::endl;
388 if (
m_verbose)
std::cout <<
"\nSummary content per system and object as filled in histogram\n " 394 <<
"\nNo summary content per system and object as filled in histogram.\n " << std::endl;
400 const int nBinsX = hist->GetNbinsX();
401 const int nBinsY = hist->GetNbinsY();
404 std::vector<std::vector<int> > meReportSummaryMap(nBinsX, std::vector<int>(
417 for (
unsigned int iTrackObj = 0; iTrackObj <
m_nrTrackObjects; ++iTrackObj) {
422 <<
" \t" << std::setw(25) <<
" m_summaryContent[" 423 << std::setw(2) << iTrackObj <<
"] = " << meReportSummaryMap[0][iTrackObj] << std::endl;
427 <<
" objects included\n" << std::endl;
429 for (
unsigned int iMon = m_nrTrackObjects; iMon < m_nrTrackObjects
434 << std::setw(25) <<
" m_summaryContent[" << std::setw(2)
444 <<
"\n Total number of quality tests: " 449 << std::setw(25) << itME->getFloatValue() << std::endl;
460 if (
m_verbose)
std::cout <<
"\nInside void L1TEMTFEventInfoClient::book" << std::endl;
465 if (
m_verbose)
std::cout <<
"Ran ibooker.setCurrentFolder(dirEventInfo;" << std::endl;
471 if (
m_verbose)
std::cout <<
"Ran igetter.removeElement(m_meReportSummary->getName());" << std::endl;
503 if (
m_verbose)
std::cout <<
"Ran m_summaryContent.push_back(dqm::qstatus::DISABLED);" << std::endl;
506 if (
m_verbose)
std::cout <<
"Ran const std::vector<std::string>& trackObjQtName = m_trackQualityTestName[iMon];" << std::endl;
508 for (
const auto & itQtName : trackObjQtName) {
511 <<
", (itQtName) = " << (itQtName) << std::endl;
515 std::replace( m_mon_mod.begin(), m_mon_mod.end(),
'/',
'_' );
521 if (
m_verbose)
std::cout <<
" - Ran m_meReportSummaryContent.push_back(ibooker.bookFloat(hStr));" << std::endl;
523 if (
m_verbose)
std::cout <<
" - Ran m_meReportSummaryContent[iAllQTest]->Fill(0.);" << std::endl;
537 const std::vector<std::string>& objQtName =
540 for (
const auto & itQtName : objQtName) {
544 std::replace( m_mon_mod.begin(), m_mon_mod.end(),
'/',
'_' );
550 if (
m_verbose)
std::cout <<
" - Ran m_meReportSummaryContent.push_back(ibooker.bookFloat(hStr));" << std::endl;
552 if (
m_verbose)
std::cout <<
" - Ran m_meReportSummaryContent[iAllQTest]->Fill(0.);" << std::endl;
566 const std::vector<std::string>& objQtName =
569 for (
const auto & itQtName : objQtName) {
573 std::replace( m_mon_mod.begin(), m_mon_mod.end(),
'/',
'_' );
590 const std::vector<std::string>& objQtName =
593 for (
const auto & itQtName : objQtName) {
597 std::replace( m_mon_mod.begin(), m_mon_mod.end(),
'/',
'_' );
610 if (
m_verbose)
std::cout <<
"Setting current folder to " << dirEventInfo << std::endl;
612 if (
m_verbose)
std::cout <<
"Ran ibooker.setCurrentFolder(dirEventInfo);" << std::endl;
620 int nBinsY =
std::max(m_nrTrackObjects, m_nrHitObjects);
621 int nBinsYStrip =
std::max(m_nrNoisyStrip, m_nrDeadStrip);
624 "reportSummaryMap_EMTF", 2, 1, 3, nBinsY, 1, nBinsY + 1);
626 "reportSummaryMap_chamberStrip", 2, 1, 3, nBinsYStrip, 1, nBinsYStrip + 1);
630 "L1TEMU: L1 Emulator vs Data Report Summary Map");
634 "L1T: L1 Trigger Data Report Summary Map");
637 "L1T2016: L1 Trigger Data Report Summary Map");
658 const std::vector<std::string> suffix_name = {
"-4/2",
"-4/1",
"-3/2",
"-3/1",
"-2/2",
"-2/1",
659 "-1/3",
"-1/2",
"-1/1b",
"-1/1a",
660 "+1/1a",
"+1/1b",
"+1/2",
"+1/3",
661 "+2/1",
"+2/2",
"+3/1",
"+3/2",
"+4/1",
"+4/2"};
662 for (
int iBin = 0; iBin < nBinsYStrip; ++iBin) {
673 if (
m_verbose)
std::cout <<
"\nInside L1TEMTFEventInfoClient::readQtResults" << std::endl;
694 for (
unsigned int iTrackObj = 0; iTrackObj <
m_nrTrackObjects; ++iTrackObj) {
698 const std::vector<std::string>& trackObjQtName =
700 const std::vector<std::string>& trackObjQtHist =
702 const std::vector<unsigned int>& trackObjQtSummaryEnabled =
706 int iTrackObjQTest = 0;
708 for (
const auto & itQtName : trackObjQtName) {
717 const std::vector<QReport*> qtVec = qHist->
getQReports();
724 <<
" for histogram " << trackObjQtHist[iTrackObjQTest]
725 <<
": " << qtVec.size() <<
"\n" << std::endl;
728 const QReport* sysQReport = qHist->getQReport(itQtName);
730 const float trackObjQtResult = sysQReport->
getQTresult();
731 const int trackObjQtStatus = sysQReport->
getStatus();
735 std::cout <<
"\n" << (itQtName) <<
" quality test:" 736 <<
"\n result: " << trackObjQtResult
737 <<
"\n status: " << trackObjQtStatus
738 <<
"\n message: " << trackObjQtMessage <<
"\n" 739 <<
"\nFilling m_meReportSummaryContent[" 740 << iAllQTest <<
"] with value " 741 << trackObjQtResult <<
"\n" << std::endl;
744 m_meReportSummaryContent[iAllQTest]->Fill(trackObjQtResult);
748 if (trackObjQtSummaryEnabled[iTrackObjQTest]) {
765 if (trackObjQtSummaryEnabled[iTrackObjQTest]) {
772 m_meReportSummaryContent[iAllQTest]->Fill(0.);
775 <<
" quality test not found\n" << std::endl;
784 if (trackObjQtSummaryEnabled[iTrackObjQTest]) {
791 m_meReportSummaryContent[iAllQTest]->Fill(0.);
794 <<
" not found\n" << std::endl;
809 for (
unsigned int iHitObj = 0; iHitObj <
m_nrHitObjects; ++iHitObj) {
813 const std::vector<std::string>& hitObjQtName =
815 const std::vector<std::string>& hitObjQtHist =
817 const std::vector<unsigned int>& hitObjQtSummaryEnabled =
821 int iHitObjQTest = 0;
823 for (
const auto & itQtName : hitObjQtName) {
830 const std::vector<QReport*> qtVec = qHist->
getQReports();
833 <<
" for histogram " << hitObjQtHist[iHitObjQTest]
834 <<
": " << qtVec.size() <<
"\n" << std::endl;
838 const float hitObjQtResult = objQReport->
getQTresult();
839 const int hitObjQtStatus = objQReport->
getStatus();
843 std::cout <<
"\n" << (itQtName) <<
" quality test:" 844 <<
"\n result: " << hitObjQtResult
845 <<
"\n status: " << hitObjQtStatus
846 <<
"\n message: " << hitObjQtMessage <<
"\n" 847 <<
"\nFilling m_meReportSummaryContent[" 848 << iAllQTest <<
"] with value " 849 << hitObjQtResult <<
"\n" << std::endl;
852 m_meReportSummaryContent[iAllQTest]->Fill(hitObjQtResult);
856 if (hitObjQtSummaryEnabled[iHitObjQTest]) {
872 if (hitObjQtSummaryEnabled[iHitObjQTest]) {
879 m_meReportSummaryContent[iAllQTest]->Fill(0.);
882 <<
" quality test not found\n" << std::endl;
891 if (hitObjQtSummaryEnabled[iHitObjQTest]) {
898 m_meReportSummaryContent[iAllQTest]->Fill(0.);
901 <<
" not found\n" << std::endl;
912 for (
unsigned int iNoisyStrp = 0; iNoisyStrp <
m_nrNoisyStrip; ++iNoisyStrp) {
915 const std::vector<std::string>& noisyStrpQtName =
917 const std::vector<std::string>& noisyStrpQtHist =
919 const std::vector<unsigned int>& noisyStrpQtSummaryEnabled =
923 int iNoisyStrpQTest = 0;
925 for (
const auto & itQtName : noisyStrpQtName) {
931 const std::vector<QReport*> qtVec = qHist->
getQReports();
934 <<
" for histogram " << noisyStrpQtHist[iNoisyStrpQTest]
935 <<
": " << qtVec.size() <<
"\n" << std::endl;
939 const float noisyStrpQtResult = objQReport->
getQTresult();
940 const int noisyStrpQtStatus = objQReport->
getStatus();
944 std::cout <<
"\n" << (itQtName) <<
" quality test:" 945 <<
"\n result: " << noisyStrpQtResult
946 <<
"\n status: " << noisyStrpQtStatus
947 <<
"\n message: " << noisyStrpQtMessage <<
"\n" 948 <<
"\nFilling m_meReportSummaryContent[" 949 << iAllQTest <<
"] with value " 950 << noisyStrpQtResult <<
"\n" << std::endl;
953 m_meReportSummaryContent[iAllQTest]->Fill(noisyStrpQtResult);
957 if (noisyStrpQtSummaryEnabled[iNoisyStrpQTest]) {
972 if (noisyStrpQtSummaryEnabled[iNoisyStrpQTest]) {
979 m_meReportSummaryContent[iAllQTest]->Fill(0.);
982 <<
" quality test not found\n" << std::endl;
991 if (noisyStrpQtSummaryEnabled[iNoisyStrpQTest]) {
998 m_meReportSummaryContent[iAllQTest]->Fill(0.);
1001 <<
" not found\n" << std::endl;
1011 for (
unsigned int iDeadStrp = 0; iDeadStrp <
m_nrDeadStrip; ++iDeadStrp) {
1014 const std::vector<std::string>& deadStrpQtName =
1016 const std::vector<std::string>& deadStrpQtHist =
1018 const std::vector<unsigned int>& deadStrpQtSummaryEnabled =
1022 int iDeadStrpQTest = 0;
1024 for (
const auto & itQtName : deadStrpQtName) {
1031 const std::vector<QReport*> qtVec = qHist->
getQReports();
1034 <<
" for histogram " << deadStrpQtHist[iDeadStrpQTest]
1035 <<
": " << qtVec.size() <<
"\n" << std::endl;
1039 const float deadStrpQtResult = objQReport->
getQTresult();
1040 const int deadStrpQtStatus = objQReport->
getStatus();
1044 std::cout <<
"\n" << (itQtName) <<
" quality test:" 1045 <<
"\n result: " << deadStrpQtResult
1046 <<
"\n status: " << deadStrpQtStatus
1047 <<
"\n message: " << deadStrpQtMessage <<
"\n" 1048 <<
"\nFilling m_meReportSummaryContent[" 1049 << iAllQTest <<
"] with value " 1050 << deadStrpQtResult <<
"\n" << std::endl;
1053 m_meReportSummaryContent[iAllQTest]->Fill(deadStrpQtResult);
1057 if (deadStrpQtSummaryEnabled[iDeadStrpQTest]) {
1072 if (deadStrpQtSummaryEnabled[iDeadStrpQTest]) {
1079 m_meReportSummaryContent[iAllQTest]->Fill(0.);
1082 <<
" quality test not found\n" << std::endl;
1091 if (deadStrpQtSummaryEnabled[iDeadStrpQTest]) {
1098 m_meReportSummaryContent[iAllQTest]->Fill(0.);
1101 <<
" not found\n" << std::endl;
1118 for (
unsigned int iTrackObj = 0; iTrackObj <
m_nrTrackObjects; ++iTrackObj) {
1124 for (
unsigned int iMon = m_nrTrackObjects; iMon < m_nrTrackObjects
1133 for (
unsigned int iNoisyStrp = m_nrTrackObjects + m_nrHitObjects; iNoisyStrp < m_nrTrackObjects + m_nrHitObjects +
m_nrNoisyStrip; ++iNoisyStrp) {
1138 for (
unsigned int iDeadStrp = m_nrTrackObjects + m_nrHitObjects + m_nrNoisyStrip; iDeadStrp < m_nrTrackObjects + m_nrHitObjects + m_nrNoisyStrip +
m_nrDeadStrip; ++iDeadStrp) {
void readQtResults(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
read quality test results
std::vector< std::vector< std::string > > m_trackQualityTestName
const QReport * getQReport(const std::string &qtname) const
get QReport corresponding to <qtname> (null pointer if QReport does not exist)
std::vector< std::string > m_disableDeadStrip
void setBinContent(int binx, double content)
set content of bin (1-D)
std::vector< edm::ParameterSet > m_deadStrip
void book(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
book histograms
std::vector< std::string > m_disableTrackObjects
std::vector< MonitorElement * > m_meReportSummaryContent
monitor elements to report content for all quality tests
bool m_verbose
input parameters
MonitorElement * get(const std::string &path)
std::vector< std::string > m_noisyLabel
size_t m_nrHitObjects
number of L1 trigger objects
std::vector< std::vector< std::string > > m_deadQualityTestHist
std::vector< std::vector< unsigned int > > m_deadQtSummaryEnabled
std::vector< int > m_deadDisable
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)
def replace(string, replacements)
const std::string & getName() const
get name of ME
std::vector< std::string > m_deadLabel
void dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override
end job
std::vector< std::vector< std::string > > m_hitQualityTestName
void initialize()
private methods
virtual ~L1TEMTFEventInfoClient()
Destructor.
std::vector< edm::ParameterSet > m_hitObjects
MonitorElement * m_meReportSummary
a summary report
std::vector< std::vector< std::string > > m_noisyQualityTestName
std::vector< std::vector< unsigned int > > m_trackQtSummaryEnabled
std::vector< std::vector< std::string > > m_trackQualityTestHist
std::vector< std::vector< std::string > > m_hitQualityTestHist
static const int DISABLED
size_t m_nrDeadStrip
number of L1 trigger dead strips
size_t m_totalNrQtSummaryEnabled
const std::string & getMessage() const
get message attached to test
std::vector< std::vector< unsigned int > > m_hitQtSummaryEnabled
void dumpContentMonitorElements(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
dump the content of the monitoring elements defined in this module
std::vector< std::string > m_disableHitObjects
void setTitle(const std::string &title)
set (ie. change) histogram/profile title
MonitorElement * m_meReportSummaryMap_chamberStrip
std::vector< std::string > m_trackLabel
std::vector< int > m_trackDisable
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
std::vector< std::vector< std::string > > m_noisyQualityTestHist
MonitorElement * m_meReportSummaryMap
report summary map
std::vector< std::vector< std::string > > m_deadQualityTestName
std::vector< std::string > m_hitLabel
std::vector< QReport * > getQReports() const
get map of QReports
void dqmEndLuminosityBlock(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const edm::LuminosityBlock &, const edm::EventSetup &)
int getStatus() const
get test status (see Core/interface/QTestStatus.h)
L1TEMTFEventInfoClient(const edm::ParameterSet &)
Constructor.
std::vector< edm::ParameterSet > m_trackObjects
Float_t m_reportSummary
summary report
std::vector< std::string > m_disableNoisyStrip
std::vector< int > m_noisyDisable
std::vector< int > m_summaryContent
std::vector< std::vector< unsigned int > > m_noisyQtSummaryEnabled
float getQTresult() const
get test result i.e. prob value
MonitorElement * bookFloat(Args &&...args)
size_t m_nrTrackObjects
number of L1 trigger systems
std::vector< int > m_hitDisable
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void removeElement(Args &&...args)
size_t m_nrNoisyStrip
number of L1 trigger noisy strips
std::vector< edm::ParameterSet > m_noisyStrip