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) {
65 int totalNrQualityTests = 0;
73 m_trackDisable.push_back(itTrack.getParameter<
unsigned int>(
"SystemDisable"));
81 std::vector<edm::ParameterSet> qTests = itTrack.getParameter<std::vector<edm::ParameterSet> >(
"QualityTests");
82 size_t qtPerSystem = qTests.size();
84 std::vector<std::string> qtNames;
85 qtNames.reserve(qtPerSystem);
87 std::vector<std::string> qtFullPathHists;
88 qtFullPathHists.reserve(qtPerSystem);
90 std::vector<unsigned int> qtSumEnabled;
91 qtSumEnabled.reserve(qtPerSystem);
94 std::cout <<
"\nLooping over track quality tests" << std::endl;
95 for (
const auto& itQT : qTests) {
96 totalNrQualityTests++;
98 qtNames.push_back(itQT.getParameter<
std::string>(
"QualityTestName"));
101 qtFullPathHists.push_back(itQT.getParameter<
std::string>(
"QualityTestHist"));
103 std::cout << qtFullPathHists.back() << std::endl;
105 unsigned int qtEnabled = itQT.getParameter<
unsigned int>(
"QualityTestSummaryEnabled");
107 qtSumEnabled.push_back(qtEnabled);
139 m_hitDisable.push_back(itObject.getParameter<
unsigned int>(
"HitDisable"));
147 std::vector<edm::ParameterSet> qTests = itObject.getParameter<std::vector<edm::ParameterSet> >(
"QualityTests");
148 size_t qtPerObject = qTests.size();
150 std::vector<std::string> qtNames;
151 qtNames.reserve(qtPerObject);
153 std::vector<std::string> qtFullPathHists;
154 qtFullPathHists.reserve(qtPerObject);
156 std::vector<unsigned int> qtSumEnabled;
157 qtSumEnabled.reserve(qtPerObject);
160 std::cout <<
"\nLooping over hit quality tests" << std::endl;
161 for (
const auto& itQT : qTests) {
162 totalNrQualityTests++;
164 qtNames.push_back(itQT.getParameter<
std::string>(
"QualityTestName"));
167 qtFullPathHists.push_back(itQT.getParameter<
std::string>(
"QualityTestHist"));
169 std::cout << qtFullPathHists.back() << std::endl;
171 unsigned int qtEnabled = itQT.getParameter<
unsigned int>(
"QualityTestSummaryEnabled");
173 qtSumEnabled.push_back(qtEnabled);
204 m_noisyDisable.push_back(itNoisy.getParameter<
unsigned int>(
"NoisyDisable"));
212 std::vector<edm::ParameterSet> qTests = itNoisy.getParameter<std::vector<edm::ParameterSet> >(
"QualityTests");
213 size_t qtPerNoisy = qTests.size();
215 std::vector<std::string> qtNames;
216 qtNames.reserve(qtPerNoisy);
218 std::vector<std::string> qtFullPathHists;
219 qtFullPathHists.reserve(qtPerNoisy);
221 std::vector<unsigned int> qtSumEnabled;
222 qtSumEnabled.reserve(qtPerNoisy);
225 std::cout <<
"\nLooping over noisy quality tests" << std::endl;
226 for (
const auto& itQT : qTests) {
227 totalNrQualityTests++;
229 qtNames.push_back(itQT.getParameter<
std::string>(
"QualityTestName"));
231 qtFullPathHists.push_back(itQT.getParameter<
std::string>(
"QualityTestHist"));
233 std::cout << qtFullPathHists.back() << std::endl;
235 unsigned int qtEnabled = itQT.getParameter<
unsigned int>(
"QualityTestSummaryEnabled");
237 qtSumEnabled.push_back(qtEnabled);
268 m_deadDisable.push_back(itDead.getParameter<
unsigned int>(
"DeadDisable"));
276 std::vector<edm::ParameterSet> qTests = itDead.getParameter<std::vector<edm::ParameterSet> >(
"QualityTests");
277 size_t qtPerDead = qTests.size();
279 std::vector<std::string> qtNames;
280 qtNames.reserve(qtPerDead);
282 std::vector<std::string> qtFullPathHists;
283 qtFullPathHists.reserve(qtPerDead);
285 std::vector<unsigned int> qtSumEnabled;
286 qtSumEnabled.reserve(qtPerDead);
289 std::cout <<
"\nLooping over dead quality tests" << std::endl;
290 for (
const auto& itQT : qTests) {
291 totalNrQualityTests++;
293 qtNames.push_back(itQT.getParameter<
std::string>(
"QualityTestName"));
295 qtFullPathHists.push_back(itQT.getParameter<
std::string>(
"QualityTestHist"));
297 std::cout << qtFullPathHists.back() << std::endl;
299 unsigned int qtEnabled = itQT.getParameter<
unsigned int>(
"QualityTestSummaryEnabled");
301 qtSumEnabled.push_back(qtEnabled);
324 std::cout <<
"\nInside void L1TEMTFEventInfoClient::dqmEndLuminosityBlock" << std::endl;
326 book(ibooker, igetter);
330 std::cout <<
"\n L1TEMTFEventInfoClient::endLuminosityBlock\n" << std::endl;
338 std::cout <<
"\nInside void L1TEMTFEventInfoClient::dqmEndJob" << std::endl;
339 book(ibooker, igetter);
344 std::cout <<
"\n L1TEMTFEventInfoClient::endRun\n" << std::endl;
351 std::cout <<
"\nSummary report " << std::endl;
364 <<
"\nNo summary content per system and object as filled in histogram.\n " << std::endl;
370 const int nBinsX = hist->GetNbinsX();
371 const int nBinsY = hist->GetNbinsY();
375 std::vector<std::vector<int> > meReportSummaryMap(nBinsX, std::vector<int>(nBinsY));
388 for (
unsigned int iTrackObj = 0; iTrackObj <
m_nrTrackObjects; ++iTrackObj) {
393 <<
m_trackDisable[iTrackObj] <<
" \t" << std::setw(25) <<
" m_summaryContent[" << std::setw(2)
394 << iTrackObj <<
"] = " << meReportSummaryMap[0][iTrackObj] << std::endl;
400 for (
unsigned int iMon = m_nrTrackObjects; iMon < m_nrTrackObjects +
m_nrHitObjects; ++iMon) {
413 std::cout <<
"\nQuality test results as filled in " 414 <<
"\n " <<
m_monitorDir <<
"/EventInfo/reportSummaryContents\n" 420 std::cout << std::setw(50) << itME->getName() <<
" \t" << std::setw(25) << itME->getFloatValue() << std::endl;
429 std::cout <<
"\nInside void L1TEMTFEventInfoClient::book" << std::endl;
436 std::cout <<
"Ran ibooker.setCurrentFolder(dirEventInfo;" << std::endl;
441 std::cout <<
"Ran m_meReportSummary = ibooker.bookFloat" << std::endl;
447 std::cout <<
"Initializing reportSummary to 1" << std::endl;
450 std::cout <<
"Ran m_meReportSummary->Fill(1);" << std::endl;
459 std::cout <<
"Ran ibooker.setCurrentFolder(dirEventInfo" << std::endl;
470 std::cout <<
" * iMon = " << iMon << std::endl;
474 std::cout <<
"Ran m_summaryContent.push_back(dqm::qstatus::DISABLED);" << std::endl;
478 std::cout <<
"Ran const std::vector<std::string>& trackObjQtName = m_trackQualityTestName[iMon];" << std::endl;
480 for (
const auto& itQtName : trackObjQtName) {
483 <<
", (itQtName) = " << (itQtName) << std::endl;
487 std::replace(m_mon_mod.begin(), m_mon_mod.end(),
'/',
'_');
495 std::cout <<
" - Ran m_meReportSummaryContent.push_back(ibooker.bookFloat(hStr));" << std::endl;
498 std::cout <<
" - Ran m_meReportSummaryContent[iAllQTest]->Fill(0.);" << std::endl;
508 std::cout <<
" * iMon = " << iMon << std::endl;
514 for (
const auto& itQtName : objQtName) {
517 std::replace(m_mon_mod.begin(), m_mon_mod.end(),
'/',
'_');
525 std::cout <<
" - Ran m_meReportSummaryContent.push_back(ibooker.bookFloat(hStr));" << std::endl;
528 std::cout <<
" - Ran m_meReportSummaryContent[iAllQTest]->Fill(0.);" << std::endl;
542 for (
const auto& itQtName : objQtName) {
545 std::replace(m_mon_mod.begin(), m_mon_mod.end(),
'/',
'_');
564 for (
const auto& itQtName : objQtName) {
567 std::replace(m_mon_mod.begin(), m_mon_mod.end(),
'/',
'_');
582 std::cout <<
"Setting current folder to " << dirEventInfo << std::endl;
585 std::cout <<
"Ran ibooker.setCurrentFolder(dirEventInfo);" << std::endl;
588 int nBinsY =
std::max(m_nrTrackObjects, m_nrHitObjects);
589 int nBinsYStrip =
std::max(m_nrNoisyStrip, m_nrDeadStrip);
592 ibooker.
book2D(
"reportSummaryMap_EMTF",
"reportSummaryMap_EMTF", 2, 1, 3, nBinsY, 1, nBinsY + 1);
594 "reportSummaryMap_chamberStrip",
"reportSummaryMap_chamberStrip", 2, 1, 3, nBinsYStrip, 1, nBinsYStrip + 1);
623 const std::vector<std::string> suffix_name = {
"-4/2",
"-4/1",
"-3/2",
"-3/1",
"-2/2",
"-2/1",
"-1/3",
624 "-1/2",
"-1/1b",
"-1/1a",
"+1/1a",
"+1/1b",
"+1/2",
"+1/3",
625 "+2/1",
"+2/2",
"+3/1",
"+3/2",
"+4/1",
"+4/2"};
626 for (
int iBin = 0; iBin < nBinsYStrip; ++iBin) {
636 std::cout <<
"\nInside L1TEMTFEventInfoClient::readQtResults" << std::endl;
656 for (
unsigned int iTrackObj = 0; iTrackObj <
m_nrTrackObjects; ++iTrackObj) {
664 int iTrackObjQTest = 0;
666 for (
const auto& itQtName : trackObjQtName) {
670 std::cout <<
" itQtName = " << (itQtName) << std::endl;
675 const std::vector<QReport*> qtVec = qHist->
getQReports();
681 std::cout <<
" - Number of quality tests" 683 <<
" for histogram " << trackObjQtHist[iTrackObjQTest] <<
": " << qtVec.size() <<
"\n" 687 const QReport* sysQReport = qHist->getQReport(itQtName);
689 const float trackObjQtResult = sysQReport->
getQTresult();
690 const int trackObjQtStatus = sysQReport->
getStatus();
695 << (itQtName) <<
" quality test:" 696 <<
"\n result: " << trackObjQtResult <<
"\n status: " << trackObjQtStatus
697 <<
"\n message: " << trackObjQtMessage <<
"\n" 698 <<
"\nFilling m_meReportSummaryContent[" << iAllQTest <<
"] with value " << trackObjQtResult
703 m_meReportSummaryContent[iAllQTest]->Fill(trackObjQtResult);
707 if (trackObjQtSummaryEnabled[iTrackObjQTest]) {
721 if (trackObjQtSummaryEnabled[iTrackObjQTest]) {
727 m_meReportSummaryContent[iAllQTest]->Fill(0.);
730 std::cout <<
"\n" << (itQtName) <<
" quality test not found\n" << std::endl;
739 if (trackObjQtSummaryEnabled[iTrackObjQTest]) {
745 m_meReportSummaryContent[iAllQTest]->Fill(0.);
748 std::cout <<
"\nHistogram " << trackObjQtHist[iTrackObjQTest] <<
" not found\n" << std::endl;
761 for (
unsigned int iHitObj = 0; iHitObj <
m_nrHitObjects; ++iHitObj) {
769 int iHitObjQTest = 0;
771 for (
const auto& itQtName : hitObjQtName) {
777 const std::vector<QReport*> qtVec = qHist->
getQReports();
780 std::cout <<
"\nNumber of quality tests " 781 <<
" for histogram " << hitObjQtHist[iHitObjQTest] <<
": " << qtVec.size() <<
"\n" 786 const float hitObjQtResult = objQReport->
getQTresult();
787 const int hitObjQtStatus = objQReport->
getStatus();
792 << (itQtName) <<
" quality test:" 793 <<
"\n result: " << hitObjQtResult <<
"\n status: " << hitObjQtStatus
794 <<
"\n message: " << hitObjQtMessage <<
"\n" 795 <<
"\nFilling m_meReportSummaryContent[" << iAllQTest <<
"] with value " << hitObjQtResult <<
"\n" 799 m_meReportSummaryContent[iAllQTest]->Fill(hitObjQtResult);
803 if (hitObjQtSummaryEnabled[iHitObjQTest]) {
817 if (hitObjQtSummaryEnabled[iHitObjQTest]) {
823 m_meReportSummaryContent[iAllQTest]->Fill(0.);
826 std::cout <<
"\n" << (itQtName) <<
" quality test not found\n" << std::endl;
835 if (hitObjQtSummaryEnabled[iHitObjQTest]) {
841 m_meReportSummaryContent[iAllQTest]->Fill(0.);
844 std::cout <<
"\nHistogram " << hitObjQtHist[iHitObjQTest] <<
" not found\n" << std::endl;
855 for (
unsigned int iNoisyStrp = 0; iNoisyStrp <
m_nrNoisyStrip; ++iNoisyStrp) {
862 int iNoisyStrpQTest = 0;
864 for (
const auto& itQtName : noisyStrpQtName) {
869 const std::vector<QReport*> qtVec = qHist->
getQReports();
872 std::cout <<
"\nNumber of quality tests " 873 <<
" for histogram " << noisyStrpQtHist[iNoisyStrpQTest] <<
": " << qtVec.size() <<
"\n" 878 const float noisyStrpQtResult = objQReport->
getQTresult();
879 const int noisyStrpQtStatus = objQReport->
getStatus();
884 << (itQtName) <<
" quality test:" 885 <<
"\n result: " << noisyStrpQtResult <<
"\n status: " << noisyStrpQtStatus
886 <<
"\n message: " << noisyStrpQtMessage <<
"\n" 887 <<
"\nFilling m_meReportSummaryContent[" << iAllQTest <<
"] with value " << noisyStrpQtResult
892 m_meReportSummaryContent[iAllQTest]->Fill(noisyStrpQtResult);
896 if (noisyStrpQtSummaryEnabled[iNoisyStrpQTest]) {
909 if (noisyStrpQtSummaryEnabled[iNoisyStrpQTest]) {
915 m_meReportSummaryContent[iAllQTest]->Fill(0.);
918 std::cout <<
"\n" << (itQtName) <<
" quality test not found\n" << std::endl;
927 if (noisyStrpQtSummaryEnabled[iNoisyStrpQTest]) {
933 m_meReportSummaryContent[iAllQTest]->Fill(0.);
936 std::cout <<
"\nHistogram " << noisyStrpQtHist[iNoisyStrpQTest] <<
" not found\n" << std::endl;
946 for (
unsigned int iDeadStrp = 0; iDeadStrp <
m_nrDeadStrip; ++iDeadStrp) {
953 int iDeadStrpQTest = 0;
955 for (
const auto& itQtName : deadStrpQtName) {
961 const std::vector<QReport*> qtVec = qHist->
getQReports();
964 std::cout <<
"\nNumber of quality tests " 965 <<
" for histogram " << deadStrpQtHist[iDeadStrpQTest] <<
": " << qtVec.size() <<
"\n" 970 const float deadStrpQtResult = objQReport->
getQTresult();
971 const int deadStrpQtStatus = objQReport->
getStatus();
976 << (itQtName) <<
" quality test:" 977 <<
"\n result: " << deadStrpQtResult <<
"\n status: " << deadStrpQtStatus
978 <<
"\n message: " << deadStrpQtMessage <<
"\n" 979 <<
"\nFilling m_meReportSummaryContent[" << iAllQTest <<
"] with value " << deadStrpQtResult
984 m_meReportSummaryContent[iAllQTest]->Fill(deadStrpQtResult);
988 if (deadStrpQtSummaryEnabled[iDeadStrpQTest]) {
1001 if (deadStrpQtSummaryEnabled[iDeadStrpQTest]) {
1007 m_meReportSummaryContent[iAllQTest]->Fill(0.);
1010 std::cout <<
"\n" << (itQtName) <<
" quality test not found\n" << std::endl;
1019 if (deadStrpQtSummaryEnabled[iDeadStrpQTest]) {
1025 m_meReportSummaryContent[iAllQTest]->Fill(0.);
1028 std::cout <<
"\nHistogram " << deadStrpQtHist[iDeadStrpQTest] <<
" not found\n" << std::endl;
1045 for (
unsigned int iTrackObj = 0; iTrackObj <
m_nrTrackObjects; ++iTrackObj) {
1050 for (
unsigned int iMon = m_nrTrackObjects; iMon < m_nrTrackObjects +
m_nrHitObjects; ++iMon) {
1056 for (
unsigned int iNoisyStrp = m_nrTrackObjects + m_nrHitObjects;
1063 for (
unsigned int iDeadStrp = m_nrTrackObjects + m_nrHitObjects + m_nrNoisyStrip;
1064 iDeadStrp < m_nrTrackObjects + m_nrHitObjects + m_nrNoisyStrip +
m_nrDeadStrip;
1068 2, iDeadStrp - m_nrTrackObjects - m_nrHitObjects - m_nrNoisyStrip + 1, summCont);
void readQtResults(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
read quality test results
std::vector< std::vector< std::string > > m_trackQualityTestName
virtual void setTitle(const std::string &title)
set (ie. change) histogram/profile title
std::vector< std::string > m_disableDeadStrip
virtual TH2F * getTH2F() const
std::vector< edm::ParameterSet > m_deadStrip
MonitorElement * bookFloat(TString const &name)
void book(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
book histograms
std::vector< std::string > m_disableTrackObjects
bool m_verbose
input parameters
void setCurrentFolder(std::string const &fullpath)
void dqmEndLuminosityBlock(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const edm::LuminosityBlock &, const edm::EventSetup &) override
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
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
const QReport * getQReport(const std::string &qtname) const
get QReport corresponding to <qtname> (null pointer if QReport does not exist)
std::vector< std::vector< std::string > > m_hitQualityTestName
void initialize()
private methods
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
std::vector< MonitorElement * > m_meReportSummaryContent
monitor elements to report content for all quality tests
static const int DISABLED
size_t m_nrDeadStrip
number of L1 trigger dead strips
size_t m_totalNrQtSummaryEnabled
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)
const std::string & getMessage() const
get message attached to test
std::vector< std::vector< unsigned int > > m_hitQtSummaryEnabled
std::vector< QReport * > getQReports() const
get map of QReports
~L1TEMTFEventInfoClient() override
Destructor.
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
MonitorElement * m_meReportSummaryMap_chamberStrip
std::vector< std::string > m_trackLabel
std::vector< int > m_trackDisable
virtual void setBinContent(int binx, double content)
set content of bin (1-D)
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
int getStatus() const
get test status (see Core/interface/QTestStatus.h)
L1TEMTFEventInfoClient(const edm::ParameterSet &)
Constructor.
std::vector< edm::ParameterSet > m_trackObjects
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
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
size_t m_nrTrackObjects
number of L1 trigger systems
MonitorElement * get(std::string const &path)
std::vector< int > m_hitDisable
size_t m_nrNoisyStrip
number of L1 trigger noisy strips
std::vector< edm::ParameterSet > m_noisyStrip
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)