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", 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();
725 <<
" for histogram " << trackObjQtHist[iTrackObjQTest]
726 <<
": " << qtVec.size() <<
"\n" << std::endl;
729 const QReport* sysQReport = qHist->getQReport(itQtName);
731 const float trackObjQtResult = sysQReport->
getQTresult();
732 const int trackObjQtStatus = sysQReport->
getStatus();
736 std::cout <<
"\n" << (itQtName) <<
" quality test:" 737 <<
"\n result: " << trackObjQtResult
738 <<
"\n status: " << trackObjQtStatus
739 <<
"\n message: " << trackObjQtMessage <<
"\n" 740 <<
"\nFilling m_meReportSummaryContent[" 741 << iAllQTest <<
"] with value " 742 << trackObjQtResult <<
"\n" << std::endl;
745 m_meReportSummaryContent[iAllQTest]->Fill(trackObjQtResult);
749 if (trackObjQtSummaryEnabled[iTrackObjQTest]) {
766 if (trackObjQtSummaryEnabled[iTrackObjQTest]) {
773 m_meReportSummaryContent[iAllQTest]->Fill(0.);
776 <<
" quality test not found\n" << std::endl;
785 if (trackObjQtSummaryEnabled[iTrackObjQTest]) {
792 m_meReportSummaryContent[iAllQTest]->Fill(0.);
795 <<
" not found\n" << std::endl;
810 for (
unsigned int iHitObj = 0; iHitObj <
m_nrHitObjects; ++iHitObj) {
814 const std::vector<std::string>& hitObjQtName =
816 const std::vector<std::string>& hitObjQtHist =
818 const std::vector<unsigned int>& hitObjQtSummaryEnabled =
822 int iHitObjQTest = 0;
824 for (
const auto & itQtName : hitObjQtName) {
831 const std::vector<QReport*> qtVec = qHist->
getQReports();
835 <<
" for histogram " << hitObjQtHist[iHitObjQTest]
836 <<
": " << qtVec.size() <<
"\n" << std::endl;
840 const float hitObjQtResult = objQReport->
getQTresult();
841 const int hitObjQtStatus = objQReport->
getStatus();
845 std::cout <<
"\n" << (itQtName) <<
" quality test:" 846 <<
"\n result: " << hitObjQtResult
847 <<
"\n status: " << hitObjQtStatus
848 <<
"\n message: " << hitObjQtMessage <<
"\n" 849 <<
"\nFilling m_meReportSummaryContent[" 850 << iAllQTest <<
"] with value " 851 << hitObjQtResult <<
"\n" << std::endl;
854 m_meReportSummaryContent[iAllQTest]->Fill(hitObjQtResult);
858 if (hitObjQtSummaryEnabled[iHitObjQTest]) {
874 if (hitObjQtSummaryEnabled[iHitObjQTest]) {
881 m_meReportSummaryContent[iAllQTest]->Fill(0.);
884 <<
" quality test not found\n" << std::endl;
893 if (hitObjQtSummaryEnabled[iHitObjQTest]) {
900 m_meReportSummaryContent[iAllQTest]->Fill(0.);
903 <<
" not found\n" << std::endl;
914 for (
unsigned int iNoisyStrp = 0; iNoisyStrp <
m_nrNoisyStrip; ++iNoisyStrp) {
917 const std::vector<std::string>& noisyStrpQtName =
919 const std::vector<std::string>& noisyStrpQtHist =
921 const std::vector<unsigned int>& noisyStrpQtSummaryEnabled =
925 int iNoisyStrpQTest = 0;
927 for (
const auto & itQtName : noisyStrpQtName) {
933 const std::vector<QReport*> qtVec = qHist->
getQReports();
937 <<
" for histogram " << noisyStrpQtHist[iNoisyStrpQTest]
938 <<
": " << qtVec.size() <<
"\n" << std::endl;
942 const float noisyStrpQtResult = objQReport->
getQTresult();
943 const int noisyStrpQtStatus = objQReport->
getStatus();
947 std::cout <<
"\n" << (itQtName) <<
" quality test:" 948 <<
"\n result: " << noisyStrpQtResult
949 <<
"\n status: " << noisyStrpQtStatus
950 <<
"\n message: " << noisyStrpQtMessage <<
"\n" 951 <<
"\nFilling m_meReportSummaryContent[" 952 << iAllQTest <<
"] with value " 953 << noisyStrpQtResult <<
"\n" << std::endl;
956 m_meReportSummaryContent[iAllQTest]->Fill(noisyStrpQtResult);
960 if (noisyStrpQtSummaryEnabled[iNoisyStrpQTest]) {
975 if (noisyStrpQtSummaryEnabled[iNoisyStrpQTest]) {
982 m_meReportSummaryContent[iAllQTest]->Fill(0.);
985 <<
" quality test not found\n" << std::endl;
994 if (noisyStrpQtSummaryEnabled[iNoisyStrpQTest]) {
1001 m_meReportSummaryContent[iAllQTest]->Fill(0.);
1004 <<
" not found\n" << std::endl;
1014 for (
unsigned int iDeadStrp = 0; iDeadStrp <
m_nrDeadStrip; ++iDeadStrp) {
1017 const std::vector<std::string>& deadStrpQtName =
1019 const std::vector<std::string>& deadStrpQtHist =
1021 const std::vector<unsigned int>& deadStrpQtSummaryEnabled =
1025 int iDeadStrpQTest = 0;
1027 for (
const auto & itQtName : deadStrpQtName) {
1034 const std::vector<QReport*> qtVec = qHist->
getQReports();
1038 <<
" for histogram " << deadStrpQtHist[iDeadStrpQTest]
1039 <<
": " << qtVec.size() <<
"\n" << std::endl;
1043 const float deadStrpQtResult = objQReport->
getQTresult();
1044 const int deadStrpQtStatus = objQReport->
getStatus();
1048 std::cout <<
"\n" << (itQtName) <<
" quality test:" 1049 <<
"\n result: " << deadStrpQtResult
1050 <<
"\n status: " << deadStrpQtStatus
1051 <<
"\n message: " << deadStrpQtMessage <<
"\n" 1052 <<
"\nFilling m_meReportSummaryContent[" 1053 << iAllQTest <<
"] with value " 1054 << deadStrpQtResult <<
"\n" << std::endl;
1057 m_meReportSummaryContent[iAllQTest]->Fill(deadStrpQtResult);
1061 if (deadStrpQtSummaryEnabled[iDeadStrpQTest]) {
1076 if (deadStrpQtSummaryEnabled[iDeadStrpQTest]) {
1083 m_meReportSummaryContent[iAllQTest]->Fill(0.);
1086 <<
" quality test not found\n" << std::endl;
1095 if (deadStrpQtSummaryEnabled[iDeadStrpQTest]) {
1102 m_meReportSummaryContent[iAllQTest]->Fill(0.);
1105 <<
" not found\n" << std::endl;
1122 for (
unsigned int iTrackObj = 0; iTrackObj <
m_nrTrackObjects; ++iTrackObj) {
1128 for (
unsigned int iMon = m_nrTrackObjects; iMon < m_nrTrackObjects
1137 for (
unsigned int iNoisyStrp = m_nrTrackObjects + m_nrHitObjects; iNoisyStrp < m_nrTrackObjects + m_nrHitObjects +
m_nrNoisyStrip; ++iNoisyStrp) {
1142 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