File indexing completed on 2024-04-06 12:07:59
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include "DQM/L1TMonitorClient/interface/L1TEMTFEventInfoClient.h"
0015
0016
0017 L1TEMTFEventInfoClient::L1TEMTFEventInfoClient(const edm::ParameterSet& parSet)
0018 : m_verbose(parSet.getUntrackedParameter<bool>("verbose", false)),
0019 m_monitorDir(parSet.getUntrackedParameter<std::string>("monitorDir", "")),
0020 m_histDir(parSet.getUntrackedParameter<std::string>("histDir", "")),
0021 m_runInEventLoop(parSet.getUntrackedParameter<bool>("runInEventLoop", false)),
0022 m_runInEndLumi(parSet.getUntrackedParameter<bool>("runInEndLumi", false)),
0023 m_runInEndRun(parSet.getUntrackedParameter<bool>("runInEndRun", false)),
0024 m_runInEndJob(parSet.getUntrackedParameter<bool>("runInEndJob", false)),
0025 m_trackObjects(parSet.getParameter<std::vector<edm::ParameterSet> >("TrackObjects")),
0026 m_hitObjects(parSet.getParameter<std::vector<edm::ParameterSet> >("HitObjects")),
0027 m_disableTrackObjects(parSet.getParameter<std::vector<std::string> >("DisableTrackObjects")),
0028 m_disableHitObjects(parSet.getParameter<std::vector<std::string> >("DisableHitObjects")),
0029 m_noisyStrip(parSet.getParameter<std::vector<edm::ParameterSet> >("NoisyStrip")),
0030 m_deadStrip(parSet.getParameter<std::vector<edm::ParameterSet> >("DeadStrip")),
0031 m_disableNoisyStrip(parSet.getParameter<std::vector<std::string> >("DisableNoisyStrip")),
0032 m_disableDeadStrip(parSet.getParameter<std::vector<std::string> >("DisableDeadStrip")),
0033 m_nrTrackObjects(0),
0034 m_nrHitObjects(0),
0035 m_nrNoisyStrip(0),
0036 m_nrDeadStrip(0),
0037 m_totalNrQtSummaryEnabled(0) {
0038 initialize();
0039 }
0040
0041
0042 L1TEMTFEventInfoClient::~L1TEMTFEventInfoClient() {
0043
0044 }
0045
0046 void L1TEMTFEventInfoClient::initialize() {
0047 if (m_verbose)
0048 std::cout << "\nMonitor directory = " << m_monitorDir << std::endl;
0049
0050
0051
0052 m_nrTrackObjects = m_trackObjects.size();
0053
0054 m_trackLabel.reserve(m_nrTrackObjects);
0055
0056 m_trackDisable.reserve(m_nrTrackObjects);
0057
0058
0059 m_trackQualityTestName.reserve(5 * m_nrTrackObjects);
0060 m_trackQualityTestHist.reserve(5 * m_nrTrackObjects);
0061 m_trackQtSummaryEnabled.reserve(5 * m_nrTrackObjects);
0062
0063 int indexSys = 0;
0064
0065 int totalNrQualityTests = 0;
0066
0067 for (const auto& itTrack : m_trackObjects) {
0068 m_trackLabel.push_back(itTrack.getParameter<std::string>("SystemLabel"));
0069
0070
0071
0072
0073 m_trackDisable.push_back(itTrack.getParameter<unsigned int>("SystemDisable"));
0074
0075 for (const auto& itSys : m_disableTrackObjects) {
0076 if (itSys == m_trackLabel[indexSys]) {
0077 m_trackDisable[indexSys] = 1;
0078 }
0079 }
0080
0081 std::vector<edm::ParameterSet> qTests = itTrack.getParameter<std::vector<edm::ParameterSet> >("QualityTests");
0082 size_t qtPerSystem = qTests.size();
0083
0084 std::vector<std::string> qtNames;
0085 qtNames.reserve(qtPerSystem);
0086
0087 std::vector<std::string> qtFullPathHists;
0088 qtFullPathHists.reserve(qtPerSystem);
0089
0090 std::vector<unsigned int> qtSumEnabled;
0091 qtSumEnabled.reserve(qtPerSystem);
0092
0093 if (m_verbose)
0094 std::cout << "\nLooping over track quality tests" << std::endl;
0095 for (const auto& itQT : qTests) {
0096 totalNrQualityTests++;
0097
0098 qtNames.push_back(itQT.getParameter<std::string>("QualityTestName"));
0099
0100
0101 qtFullPathHists.push_back(itQT.getParameter<std::string>("QualityTestHist"));
0102 if (m_verbose)
0103 std::cout << qtFullPathHists.back() << std::endl;
0104
0105 unsigned int qtEnabled = itQT.getParameter<unsigned int>("QualityTestSummaryEnabled");
0106
0107 qtSumEnabled.push_back(qtEnabled);
0108
0109 if (qtEnabled) {
0110 m_totalNrQtSummaryEnabled++;
0111 }
0112 }
0113
0114 m_trackQualityTestName.push_back(qtNames);
0115 m_trackQualityTestHist.push_back(qtFullPathHists);
0116 m_trackQtSummaryEnabled.push_back(qtSumEnabled);
0117
0118 indexSys++;
0119 }
0120
0121
0122
0123
0124 m_nrHitObjects = m_hitObjects.size();
0125
0126 m_hitLabel.reserve(m_nrHitObjects);
0127 m_hitDisable.reserve(m_nrHitObjects);
0128
0129
0130 m_hitQualityTestName.reserve(5 * m_nrHitObjects);
0131 m_hitQualityTestHist.reserve(5 * m_nrHitObjects);
0132 m_hitQtSummaryEnabled.reserve(5 * m_nrHitObjects);
0133
0134 int indexObj = 0;
0135
0136 for (const auto& itObject : m_hitObjects) {
0137 m_hitLabel.push_back(itObject.getParameter<std::string>("HitLabel"));
0138
0139 m_hitDisable.push_back(itObject.getParameter<unsigned int>("HitDisable"));
0140
0141 for (const auto& itObj : m_disableHitObjects) {
0142 if (itObj == m_hitLabel[indexObj]) {
0143 m_hitDisable[indexObj] = 1;
0144 }
0145 }
0146
0147 std::vector<edm::ParameterSet> qTests = itObject.getParameter<std::vector<edm::ParameterSet> >("QualityTests");
0148 size_t qtPerObject = qTests.size();
0149
0150 std::vector<std::string> qtNames;
0151 qtNames.reserve(qtPerObject);
0152
0153 std::vector<std::string> qtFullPathHists;
0154 qtFullPathHists.reserve(qtPerObject);
0155
0156 std::vector<unsigned int> qtSumEnabled;
0157 qtSumEnabled.reserve(qtPerObject);
0158
0159 if (m_verbose)
0160 std::cout << "\nLooping over hit quality tests" << std::endl;
0161 for (const auto& itQT : qTests) {
0162 totalNrQualityTests++;
0163
0164 qtNames.push_back(itQT.getParameter<std::string>("QualityTestName"));
0165
0166
0167 qtFullPathHists.push_back(itQT.getParameter<std::string>("QualityTestHist"));
0168 if (m_verbose)
0169 std::cout << qtFullPathHists.back() << std::endl;
0170
0171 unsigned int qtEnabled = itQT.getParameter<unsigned int>("QualityTestSummaryEnabled");
0172
0173 qtSumEnabled.push_back(qtEnabled);
0174
0175 if (qtEnabled) {
0176 m_totalNrQtSummaryEnabled++;
0177 }
0178 }
0179
0180 m_hitQualityTestName.push_back(qtNames);
0181 m_hitQualityTestHist.push_back(qtFullPathHists);
0182 m_hitQtSummaryEnabled.push_back(qtSumEnabled);
0183
0184 indexObj++;
0185 }
0186
0187
0188
0189 m_nrNoisyStrip = m_noisyStrip.size();
0190
0191 m_noisyLabel.reserve(m_nrNoisyStrip);
0192 m_noisyDisable.reserve(m_nrNoisyStrip);
0193
0194
0195 m_noisyQualityTestName.reserve(20 * m_nrNoisyStrip);
0196 m_noisyQualityTestHist.reserve(20 * m_nrNoisyStrip);
0197 m_noisyQtSummaryEnabled.reserve(20 * m_nrNoisyStrip);
0198
0199 int indexNois = 0;
0200
0201 for (const auto& itNoisy : m_noisyStrip) {
0202 m_noisyLabel.push_back(itNoisy.getParameter<std::string>("NoisyLabel"));
0203
0204 m_noisyDisable.push_back(itNoisy.getParameter<unsigned int>("NoisyDisable"));
0205
0206 for (const auto& itNois : m_disableNoisyStrip) {
0207 if (itNois == m_noisyLabel[indexNois]) {
0208 m_noisyDisable[indexNois] = 1;
0209 }
0210 }
0211
0212 std::vector<edm::ParameterSet> qTests = itNoisy.getParameter<std::vector<edm::ParameterSet> >("QualityTests");
0213 size_t qtPerNoisy = qTests.size();
0214
0215 std::vector<std::string> qtNames;
0216 qtNames.reserve(qtPerNoisy);
0217
0218 std::vector<std::string> qtFullPathHists;
0219 qtFullPathHists.reserve(qtPerNoisy);
0220
0221 std::vector<unsigned int> qtSumEnabled;
0222 qtSumEnabled.reserve(qtPerNoisy);
0223
0224 if (m_verbose)
0225 std::cout << "\nLooping over noisy quality tests" << std::endl;
0226 for (const auto& itQT : qTests) {
0227 totalNrQualityTests++;
0228
0229 qtNames.push_back(itQT.getParameter<std::string>("QualityTestName"));
0230
0231 qtFullPathHists.push_back(itQT.getParameter<std::string>("QualityTestHist"));
0232 if (m_verbose)
0233 std::cout << qtFullPathHists.back() << std::endl;
0234
0235 unsigned int qtEnabled = itQT.getParameter<unsigned int>("QualityTestSummaryEnabled");
0236
0237 qtSumEnabled.push_back(qtEnabled);
0238
0239 if (qtEnabled) {
0240 m_totalNrQtSummaryEnabled++;
0241 }
0242 }
0243
0244 m_noisyQualityTestName.push_back(qtNames);
0245 m_noisyQualityTestHist.push_back(qtFullPathHists);
0246 m_noisyQtSummaryEnabled.push_back(qtSumEnabled);
0247
0248 indexNois++;
0249 }
0250
0251
0252
0253 m_nrDeadStrip = m_deadStrip.size();
0254
0255 m_deadLabel.reserve(m_nrDeadStrip);
0256 m_deadDisable.reserve(m_nrDeadStrip);
0257
0258
0259 m_deadQualityTestName.reserve(20 * m_nrDeadStrip);
0260 m_deadQualityTestHist.reserve(20 * m_nrDeadStrip);
0261 m_deadQtSummaryEnabled.reserve(20 * m_nrDeadStrip);
0262
0263 int indexDed = 0;
0264
0265 for (const auto& itDead : m_deadStrip) {
0266 m_deadLabel.push_back(itDead.getParameter<std::string>("DeadLabel"));
0267
0268 m_deadDisable.push_back(itDead.getParameter<unsigned int>("DeadDisable"));
0269
0270 for (const auto& itDed : m_disableDeadStrip) {
0271 if (itDed == m_deadLabel[indexDed]) {
0272 m_deadDisable[indexDed] = 1;
0273 }
0274 }
0275
0276 std::vector<edm::ParameterSet> qTests = itDead.getParameter<std::vector<edm::ParameterSet> >("QualityTests");
0277 size_t qtPerDead = qTests.size();
0278
0279 std::vector<std::string> qtNames;
0280 qtNames.reserve(qtPerDead);
0281
0282 std::vector<std::string> qtFullPathHists;
0283 qtFullPathHists.reserve(qtPerDead);
0284
0285 std::vector<unsigned int> qtSumEnabled;
0286 qtSumEnabled.reserve(qtPerDead);
0287
0288 if (m_verbose)
0289 std::cout << "\nLooping over dead quality tests" << std::endl;
0290 for (const auto& itQT : qTests) {
0291 totalNrQualityTests++;
0292
0293 qtNames.push_back(itQT.getParameter<std::string>("QualityTestName"));
0294
0295 qtFullPathHists.push_back(itQT.getParameter<std::string>("QualityTestHist"));
0296 if (m_verbose)
0297 std::cout << qtFullPathHists.back() << std::endl;
0298
0299 unsigned int qtEnabled = itQT.getParameter<unsigned int>("QualityTestSummaryEnabled");
0300
0301 qtSumEnabled.push_back(qtEnabled);
0302
0303 if (qtEnabled) {
0304 m_totalNrQtSummaryEnabled++;
0305 }
0306 }
0307
0308 m_deadQualityTestName.push_back(qtNames);
0309 m_deadQualityTestHist.push_back(qtFullPathHists);
0310 m_deadQtSummaryEnabled.push_back(qtSumEnabled);
0311
0312 indexDed++;
0313 }
0314
0315 m_summaryContent.reserve(m_nrTrackObjects + m_nrHitObjects + m_nrNoisyStrip + m_nrDeadStrip);
0316 m_meReportSummaryContent.reserve(totalNrQualityTests);
0317 }
0318
0319 void L1TEMTFEventInfoClient::dqmEndLuminosityBlock(DQMStore::IBooker& ibooker,
0320 DQMStore::IGetter& igetter,
0321 const edm::LuminosityBlock& lumiSeg,
0322 const edm::EventSetup& evSetup) {
0323 if (m_verbose)
0324 std::cout << "\nInside void L1TEMTFEventInfoClient::dqmEndLuminosityBlock" << std::endl;
0325 if (m_runInEndLumi) {
0326 book(ibooker, igetter);
0327 readQtResults(ibooker, igetter);
0328
0329 if (m_verbose) {
0330 std::cout << "\n L1TEMTFEventInfoClient::endLuminosityBlock\n" << std::endl;
0331 dumpContentMonitorElements(ibooker, igetter);
0332 }
0333 }
0334 }
0335
0336 void L1TEMTFEventInfoClient::dqmEndJob(DQMStore::IBooker& ibooker, DQMStore::IGetter& igetter) {
0337 if (m_verbose)
0338 std::cout << "\nInside void L1TEMTFEventInfoClient::dqmEndJob" << std::endl;
0339 book(ibooker, igetter);
0340
0341 readQtResults(ibooker, igetter);
0342
0343 if (m_verbose) {
0344 std::cout << "\n L1TEMTFEventInfoClient::endRun\n" << std::endl;
0345 dumpContentMonitorElements(ibooker, igetter);
0346 }
0347 }
0348
0349 void L1TEMTFEventInfoClient::dumpContentMonitorElements(DQMStore::IBooker& ibooker, DQMStore::IGetter& igetter) {
0350 if (m_verbose)
0351 std::cout << "\nSummary report " << std::endl;
0352
0353
0354
0355 MonitorElement* me = igetter.get(m_meReportSummaryMap->getName());
0356
0357 if (m_verbose)
0358 std::cout << "\nSummary content per system and object as filled in histogram\n " << m_meReportSummaryMap->getName()
0359 << std::endl;
0360
0361 if (!me) {
0362 if (m_verbose)
0363 std::cout << "\nNo histogram " << m_meReportSummaryMap->getName()
0364 << "\nNo summary content per system and object as filled in histogram.\n " << std::endl;
0365 return;
0366 }
0367
0368 TH2F* hist = me->getTH2F();
0369
0370 const int nBinsX = hist->GetNbinsX();
0371 const int nBinsY = hist->GetNbinsY();
0372 if (m_verbose)
0373 std::cout << nBinsX << " " << nBinsY;
0374
0375 std::vector<std::vector<int> > meReportSummaryMap(nBinsX, std::vector<int>(nBinsY));
0376
0377
0378
0379
0380
0381
0382
0383
0384 if (m_verbose)
0385 std::cout << "\nL1 systems: " << m_nrTrackObjects << " systems included\n"
0386 << "\n Summary content size: " << (m_summaryContent.size()) << std::endl;
0387
0388 for (unsigned int iTrackObj = 0; iTrackObj < m_nrTrackObjects; ++iTrackObj) {
0389 if (m_verbose)
0390 std::cout << std::setw(10) << m_trackLabel[iTrackObj]
0391 << std::setw(10)
0392
0393 << m_trackDisable[iTrackObj] << " \t" << std::setw(25) << " m_summaryContent[" << std::setw(2)
0394 << iTrackObj << "] = " << meReportSummaryMap[0][iTrackObj] << std::endl;
0395 }
0396
0397 if (m_verbose)
0398 std::cout << "\n L1 trigger objects: " << m_nrHitObjects << " objects included\n" << std::endl;
0399
0400 for (unsigned int iMon = m_nrTrackObjects; iMon < m_nrTrackObjects + m_nrHitObjects; ++iMon) {
0401 if (m_verbose)
0402 std::cout << std::setw(20) << m_hitLabel[iMon - m_nrTrackObjects] << " \t"
0403 << m_hitDisable[iMon - m_nrTrackObjects] << " \t" << std::setw(25) << " m_summaryContent["
0404 << std::setw(2) << iMon << "] = \t" << m_summaryContent[iMon] << std::endl;
0405 }
0406
0407 if (m_verbose)
0408 std::cout << std::endl;
0409
0410
0411
0412 if (m_verbose)
0413 std::cout << "\nQuality test results as filled in "
0414 << "\n " << m_monitorDir << "/EventInfo/reportSummaryContents\n"
0415 << "\n Total number of quality tests: " << (m_meReportSummaryContent.size()) << "\n"
0416 << std::endl;
0417
0418 for (const auto itME : m_meReportSummaryContent) {
0419 if (m_verbose)
0420 std::cout << std::setw(50) << itME->getName() << " \t" << std::setw(25) << itME->getFloatValue() << std::endl;
0421 }
0422
0423 if (m_verbose)
0424 std::cout << std::endl;
0425 }
0426
0427 void L1TEMTFEventInfoClient::book(DQMStore::IBooker& ibooker, DQMStore::IGetter& igetter) {
0428 if (m_verbose)
0429 std::cout << "\nInside void L1TEMTFEventInfoClient::book" << std::endl;
0430 std::string dirEventInfo = m_monitorDir + "/EventInfo";
0431 if (m_verbose)
0432 std::cout << dirEventInfo << std::endl;
0433
0434 ibooker.setCurrentFolder(dirEventInfo);
0435 if (m_verbose)
0436 std::cout << "Ran ibooker.setCurrentFolder(dirEventInfo;" << std::endl;
0437
0438
0439 m_meReportSummary = ibooker.bookFloat("reportSummary");
0440 if (m_verbose)
0441 std::cout << "Ran m_meReportSummary = ibooker.bookFloat" << std::endl;
0442
0443
0444
0445 if (m_meReportSummary) {
0446 if (m_verbose)
0447 std::cout << "Initializing reportSummary to 1" << std::endl;
0448 m_meReportSummary->Fill(1);
0449 if (m_verbose)
0450 std::cout << "Ran m_meReportSummary->Fill(1);" << std::endl;
0451 }
0452
0453
0454
0455
0456
0457 ibooker.setCurrentFolder(dirEventInfo + "/reportSummaryContents");
0458 if (m_verbose)
0459 std::cout << "Ran ibooker.setCurrentFolder(dirEventInfo" << std::endl;
0460
0461
0462 int iAllQTest = 0;
0463
0464 if (m_verbose)
0465 std::cout << "m_nrTrackObjects = " << m_nrTrackObjects << std::endl;
0466 for (unsigned int iMon = 0; iMon < m_nrTrackObjects; ++iMon) {
0467 if (m_verbose)
0468 std::cout << " * iMon = " << iMon << std::endl;
0469
0470 m_summaryContent.push_back(dqm::qstatus::DISABLED);
0471 if (m_verbose)
0472 std::cout << "Ran m_summaryContent.push_back(dqm::qstatus::DISABLED);" << std::endl;
0473
0474 const std::vector<std::string>& trackObjQtName = m_trackQualityTestName[iMon];
0475 if (m_verbose)
0476 std::cout << "Ran const std::vector<std::string>& trackObjQtName = m_trackQualityTestName[iMon];" << std::endl;
0477
0478 for (const auto& itQtName : trackObjQtName) {
0479 if (m_verbose)
0480 std::cout << " - m_monitorDir = " << m_monitorDir << ", m_trackLabel[iMon] = " << m_trackLabel[iMon]
0481 << ", (itQtName) = " << (itQtName) << std::endl;
0482
0483
0484 std::string m_mon_mod = m_monitorDir;
0485 std::replace(m_mon_mod.begin(), m_mon_mod.end(), '/', '_');
0486
0487 const std::string hStr = m_mon_mod + "_L1Sys_" + m_trackLabel[iMon] + "_" + (itQtName);
0488 if (m_verbose)
0489 std::cout << " - " << hStr << std::endl;
0490
0491 m_meReportSummaryContent.push_back(ibooker.bookFloat(hStr));
0492 if (m_verbose)
0493 std::cout << " - Ran m_meReportSummaryContent.push_back(ibooker.bookFloat(hStr));" << std::endl;
0494 m_meReportSummaryContent[iAllQTest]->Fill(0.);
0495 if (m_verbose)
0496 std::cout << " - Ran m_meReportSummaryContent[iAllQTest]->Fill(0.);" << std::endl;
0497
0498 iAllQTest++;
0499 }
0500 }
0501
0502 for (unsigned int iMon = 0; iMon < m_nrHitObjects; ++iMon) {
0503 if (m_verbose)
0504 std::cout << " * iMon = " << iMon << std::endl;
0505
0506 m_summaryContent.push_back(dqm::qstatus::DISABLED);
0507
0508 const std::vector<std::string>& objQtName = m_hitQualityTestName[iMon];
0509
0510 for (const auto& itQtName : objQtName) {
0511
0512 std::string m_mon_mod = m_monitorDir;
0513 std::replace(m_mon_mod.begin(), m_mon_mod.end(), '/', '_');
0514
0515 const std::string hStr = m_mon_mod + "_L1Obj_" + m_hitLabel[iMon] + "_" + (itQtName);
0516 if (m_verbose)
0517 std::cout << " - " << hStr << std::endl;
0518
0519 m_meReportSummaryContent.push_back(ibooker.bookFloat(hStr));
0520 if (m_verbose)
0521 std::cout << " - Ran m_meReportSummaryContent.push_back(ibooker.bookFloat(hStr));" << std::endl;
0522 m_meReportSummaryContent[iAllQTest]->Fill(0.);
0523 if (m_verbose)
0524 std::cout << " - Ran m_meReportSummaryContent[iAllQTest]->Fill(0.);" << std::endl;
0525
0526 iAllQTest++;
0527 }
0528 }
0529
0530
0531 for (unsigned int iMon = 0; iMon < m_nrNoisyStrip; ++iMon) {
0532 m_summaryContent.push_back(dqm::qstatus::DISABLED);
0533
0534 const std::vector<std::string>& objQtName = m_noisyQualityTestName[iMon];
0535
0536 for (const auto& itQtName : objQtName) {
0537
0538 std::string m_mon_mod = m_monitorDir;
0539 std::replace(m_mon_mod.begin(), m_mon_mod.end(), '/', '_');
0540
0541 const std::string hStr = m_mon_mod + "_L1Obj_" + m_noisyLabel[iMon] + "_" + (itQtName);
0542 if (m_verbose)
0543 std::cout << " - " << hStr << std::endl;
0544
0545 m_meReportSummaryContent.push_back(ibooker.bookFloat(hStr));
0546 m_meReportSummaryContent[iAllQTest]->Fill(0.);
0547
0548 iAllQTest++;
0549 }
0550 }
0551
0552 for (unsigned int iMon = 0; iMon < m_nrDeadStrip; ++iMon) {
0553 m_summaryContent.push_back(dqm::qstatus::DISABLED);
0554
0555 const std::vector<std::string>& objQtName = m_deadQualityTestName[iMon];
0556
0557 for (const auto& itQtName : objQtName) {
0558
0559 std::string m_mon_mod = m_monitorDir;
0560 std::replace(m_mon_mod.begin(), m_mon_mod.end(), '/', '_');
0561
0562 const std::string hStr = m_mon_mod + "_L1Obj_" + m_deadLabel[iMon] + "_" + (itQtName);
0563 if (m_verbose)
0564 std::cout << " - " << hStr << std::endl;
0565
0566 m_meReportSummaryContent.push_back(ibooker.bookFloat(hStr));
0567 m_meReportSummaryContent[iAllQTest]->Fill(0.);
0568
0569 iAllQTest++;
0570 }
0571 }
0572
0573 if (m_verbose)
0574 std::cout << "Setting current folder to " << dirEventInfo << std::endl;
0575 ibooker.setCurrentFolder(dirEventInfo);
0576 if (m_verbose)
0577 std::cout << "Ran ibooker.setCurrentFolder(dirEventInfo);" << std::endl;
0578
0579
0580 int nBinsY = std::max(m_nrTrackObjects, m_nrHitObjects);
0581 int nBinsYStrip = std::max(m_nrNoisyStrip, m_nrDeadStrip);
0582
0583 m_meReportSummaryMap =
0584 ibooker.book2D("reportSummaryMap_EMTF", "reportSummaryMap_EMTF", 2, 1, 3, nBinsY, 1, nBinsY + 1);
0585 m_meReportSummaryMap_chamberStrip = ibooker.book2D(
0586 "reportSummaryMap_chamberStrip", "reportSummaryMap_chamberStrip", 2, 1, 3, nBinsYStrip, 1, nBinsYStrip + 1);
0587
0588 if (m_monitorDir == "L1TEMU") {
0589 m_meReportSummaryMap->setTitle("L1TEMU: L1 Emulator vs Data Report Summary Map");
0590
0591 } else if (m_monitorDir == "L1T") {
0592 m_meReportSummaryMap->setTitle("L1T: L1 Trigger Data Report Summary Map");
0593 } else if (m_monitorDir == "L1T2016") {
0594 m_meReportSummaryMap->setTitle("L1T2016: L1 Trigger Data Report Summary Map");
0595 } else {
0596
0597 }
0598
0599 m_meReportSummaryMap->setAxisTitle(" ", 1);
0600 m_meReportSummaryMap->setAxisTitle(" ", 2);
0601
0602 m_meReportSummaryMap->setBinLabel(1, "Noisy Check", 1);
0603 m_meReportSummaryMap->setBinLabel(2, "Dead Check", 1);
0604
0605 m_meReportSummaryMap_chamberStrip->setBinLabel(1, "Noisy Check", 1);
0606 m_meReportSummaryMap_chamberStrip->setBinLabel(2, "Dead Check", 1);
0607
0608
0609
0610
0611 m_meReportSummaryMap->setBinLabel(1, "Hit BX", 2);
0612 m_meReportSummaryMap->setBinLabel(2, "Track BX", 2);
0613
0614
0615 const std::vector<std::string> suffix_name = {"-4/2", "-4/1", "-3/2", "-3/1", "-2/2", "-2/1", "-1/3",
0616 "-1/2", "-1/1b", "-1/1a", "+1/1a", "+1/1b", "+1/2", "+1/3",
0617 "+2/1", "+2/2", "+3/1", "+3/2", "+4/1", "+4/2"};
0618 for (int iBin = 0; iBin < nBinsYStrip; ++iBin) {
0619 m_meReportSummaryMap_chamberStrip->setBinLabel(iBin + 1, "ChamberStrip " + suffix_name[iBin], 2);
0620 }
0621 }
0622
0623 void L1TEMTFEventInfoClient::readQtResults(DQMStore::IBooker& ibooker, DQMStore::IGetter& igetter) {
0624
0625
0626
0627 if (m_verbose)
0628 std::cout << "\nInside L1TEMTFEventInfoClient::readQtResults" << std::endl;
0629
0630 for (std::vector<int>::iterator it = m_summaryContent.begin(); it != m_summaryContent.end(); ++it) {
0631 (*it) = dqm::qstatus::DISABLED;
0632 }
0633
0634 m_summarySum = 0.;
0635
0636 for (const auto& itME : m_meReportSummaryContent) {
0637 itME->Fill(0.);
0638 }
0639
0640
0641
0642
0643 int iAllQTest = 0;
0644 int iAllMon = 0;
0645
0646
0647
0648 for (unsigned int iTrackObj = 0; iTrackObj < m_nrTrackObjects; ++iTrackObj) {
0649
0650
0651 const std::vector<std::string>& trackObjQtName = m_trackQualityTestName[iTrackObj];
0652 const std::vector<std::string>& trackObjQtHist = m_trackQualityTestHist[iTrackObj];
0653 const std::vector<unsigned int>& trackObjQtSummaryEnabled = m_trackQtSummaryEnabled[iTrackObj];
0654
0655
0656 int iTrackObjQTest = 0;
0657
0658 for (const auto& itQtName : trackObjQtName) {
0659
0660
0661 if (m_verbose)
0662 std::cout << " itQtName = " << (itQtName) << std::endl;
0663
0664 MonitorElement* qHist = igetter.get(trackObjQtHist[iTrackObjQTest]);
0665
0666 if (qHist) {
0667 const std::vector<QReport*> qtVec = qHist->getQReports();
0668
0669
0670 if (true) {
0671
0672 if (m_verbose)
0673 std::cout << " - Number of quality tests"
0674
0675 << " for histogram " << trackObjQtHist[iTrackObjQTest] << ": " << qtVec.size() << "\n"
0676 << std::endl;
0677 }
0678
0679 const QReport* sysQReport = qHist->getQReport(itQtName);
0680 if (sysQReport) {
0681 const float trackObjQtResult = sysQReport->getQTresult();
0682 const int trackObjQtStatus = sysQReport->getStatus();
0683 const std::string& trackObjQtMessage = sysQReport->getMessage();
0684
0685 if (m_verbose) {
0686 std::cout << "\n"
0687 << (itQtName) << " quality test:"
0688 << "\n result: " << trackObjQtResult << "\n status: " << trackObjQtStatus
0689 << "\n message: " << trackObjQtMessage << "\n"
0690 << "\nFilling m_meReportSummaryContent[" << iAllQTest << "] with value " << trackObjQtResult
0691 << "\n"
0692 << std::endl;
0693 }
0694
0695 m_meReportSummaryContent[iAllQTest]->Fill(trackObjQtResult);
0696
0697
0698
0699 if (trackObjQtSummaryEnabled[iTrackObjQTest]) {
0700 if (trackObjQtStatus > m_summaryContent[iAllMon]) {
0701 m_summaryContent[iAllMon] = trackObjQtStatus;
0702 }
0703
0704 m_summarySum += trackObjQtResult;
0705 }
0706
0707 } else {
0708
0709
0710
0711 int trackObjQtStatus = dqm::qstatus::INVALID;
0712
0713 if (trackObjQtSummaryEnabled[iTrackObjQTest]) {
0714 if (trackObjQtStatus > m_summaryContent[iAllMon]) {
0715 m_summaryContent[iAllMon] = trackObjQtStatus;
0716 }
0717 }
0718
0719 m_meReportSummaryContent[iAllQTest]->Fill(0.);
0720
0721 if (m_verbose)
0722 std::cout << "\n" << (itQtName) << " quality test not found\n" << std::endl;
0723 }
0724
0725 } else {
0726
0727
0728
0729 int trackObjQtStatus = dqm::qstatus::INVALID;
0730
0731 if (trackObjQtSummaryEnabled[iTrackObjQTest]) {
0732 if (trackObjQtStatus > m_summaryContent[iAllMon]) {
0733 m_summaryContent[iAllMon] = trackObjQtStatus;
0734 }
0735 }
0736
0737 m_meReportSummaryContent[iAllQTest]->Fill(0.);
0738
0739 if (m_verbose)
0740 std::cout << "\nHistogram " << trackObjQtHist[iTrackObjQTest] << " not found\n" << std::endl;
0741 }
0742
0743
0744 iTrackObjQTest++;
0745 iAllQTest++;
0746 }
0747
0748 iAllMon++;
0749 }
0750
0751
0752
0753 for (unsigned int iHitObj = 0; iHitObj < m_nrHitObjects; ++iHitObj) {
0754
0755
0756 const std::vector<std::string>& hitObjQtName = m_hitQualityTestName[iHitObj];
0757 const std::vector<std::string>& hitObjQtHist = m_hitQualityTestHist[iHitObj];
0758 const std::vector<unsigned int>& hitObjQtSummaryEnabled = m_hitQtSummaryEnabled[iHitObj];
0759
0760
0761 int iHitObjQTest = 0;
0762
0763 for (const auto& itQtName : hitObjQtName) {
0764
0765
0766 MonitorElement* qHist = igetter.get(hitObjQtHist[iHitObjQTest]);
0767
0768 if (qHist) {
0769 const std::vector<QReport*> qtVec = qHist->getQReports();
0770
0771 if (m_verbose)
0772 std::cout << "\nNumber of quality tests "
0773 << " for histogram " << hitObjQtHist[iHitObjQTest] << ": " << qtVec.size() << "\n"
0774 << std::endl;
0775
0776 const QReport* objQReport = qHist->getQReport(itQtName);
0777 if (objQReport) {
0778 const float hitObjQtResult = objQReport->getQTresult();
0779 const int hitObjQtStatus = objQReport->getStatus();
0780 const std::string& hitObjQtMessage = objQReport->getMessage();
0781
0782 if (m_verbose) {
0783 std::cout << "\n"
0784 << (itQtName) << " quality test:"
0785 << "\n result: " << hitObjQtResult << "\n status: " << hitObjQtStatus
0786 << "\n message: " << hitObjQtMessage << "\n"
0787 << "\nFilling m_meReportSummaryContent[" << iAllQTest << "] with value " << hitObjQtResult << "\n"
0788 << std::endl;
0789 }
0790
0791 m_meReportSummaryContent[iAllQTest]->Fill(hitObjQtResult);
0792
0793
0794
0795 if (hitObjQtSummaryEnabled[iHitObjQTest]) {
0796 if (hitObjQtStatus > m_summaryContent[iAllMon]) {
0797 m_summaryContent[iAllMon] = hitObjQtStatus;
0798 }
0799
0800 m_summarySum += hitObjQtResult;
0801 }
0802
0803 } else {
0804
0805
0806
0807 int hitObjQtStatus = dqm::qstatus::INVALID;
0808
0809 if (hitObjQtSummaryEnabled[iHitObjQTest]) {
0810 if (hitObjQtStatus > m_summaryContent[iAllMon]) {
0811 m_summaryContent[iAllMon] = hitObjQtStatus;
0812 }
0813 }
0814
0815 m_meReportSummaryContent[iAllQTest]->Fill(0.);
0816
0817 if (m_verbose)
0818 std::cout << "\n" << (itQtName) << " quality test not found\n" << std::endl;
0819 }
0820
0821 } else {
0822
0823
0824
0825 int hitObjQtStatus = dqm::qstatus::INVALID;
0826
0827 if (hitObjQtSummaryEnabled[iHitObjQTest]) {
0828 if (hitObjQtStatus > m_summaryContent[iAllMon]) {
0829 m_summaryContent[iAllMon] = hitObjQtStatus;
0830 }
0831 }
0832
0833 m_meReportSummaryContent[iAllQTest]->Fill(0.);
0834
0835 if (m_verbose)
0836 std::cout << "\nHistogram " << hitObjQtHist[iHitObjQTest] << " not found\n" << std::endl;
0837 }
0838
0839 iHitObjQTest++;
0840 iAllQTest++;
0841 }
0842 iAllMon++;
0843 }
0844
0845
0846
0847 for (unsigned int iNoisyStrp = 0; iNoisyStrp < m_nrNoisyStrip; ++iNoisyStrp) {
0848
0849 const std::vector<std::string>& noisyStrpQtName = m_noisyQualityTestName[iNoisyStrp];
0850 const std::vector<std::string>& noisyStrpQtHist = m_noisyQualityTestHist[iNoisyStrp];
0851 const std::vector<unsigned int>& noisyStrpQtSummaryEnabled = m_noisyQtSummaryEnabled[iNoisyStrp];
0852
0853
0854 int iNoisyStrpQTest = 0;
0855
0856 for (const auto& itQtName : noisyStrpQtName) {
0857
0858 MonitorElement* qHist = igetter.get(noisyStrpQtHist[iNoisyStrpQTest]);
0859
0860 if (qHist) {
0861 const std::vector<QReport*> qtVec = qHist->getQReports();
0862
0863 if (m_verbose)
0864 std::cout << "\nNumber of quality tests "
0865 << " for histogram " << noisyStrpQtHist[iNoisyStrpQTest] << ": " << qtVec.size() << "\n"
0866 << std::endl;
0867
0868 const QReport* objQReport = qHist->getQReport(itQtName);
0869 if (objQReport) {
0870 const float noisyStrpQtResult = objQReport->getQTresult();
0871 const int noisyStrpQtStatus = objQReport->getStatus();
0872 const std::string& noisyStrpQtMessage = objQReport->getMessage();
0873
0874 if (m_verbose) {
0875 std::cout << "\n"
0876 << (itQtName) << " quality test:"
0877 << "\n result: " << noisyStrpQtResult << "\n status: " << noisyStrpQtStatus
0878 << "\n message: " << noisyStrpQtMessage << "\n"
0879 << "\nFilling m_meReportSummaryContent[" << iAllQTest << "] with value " << noisyStrpQtResult
0880 << "\n"
0881 << std::endl;
0882 }
0883
0884 m_meReportSummaryContent[iAllQTest]->Fill(noisyStrpQtResult);
0885
0886
0887
0888 if (noisyStrpQtSummaryEnabled[iNoisyStrpQTest]) {
0889 if (noisyStrpQtStatus > m_summaryContent[iAllMon]) {
0890 m_summaryContent[iAllMon] = noisyStrpQtStatus;
0891 }
0892 m_summarySum += noisyStrpQtResult;
0893 }
0894
0895 } else {
0896
0897
0898
0899 int noisyStrpQtStatus = dqm::qstatus::INVALID;
0900
0901 if (noisyStrpQtSummaryEnabled[iNoisyStrpQTest]) {
0902 if (noisyStrpQtStatus > m_summaryContent[iAllMon]) {
0903 m_summaryContent[iAllMon] = noisyStrpQtStatus;
0904 }
0905 }
0906
0907 m_meReportSummaryContent[iAllQTest]->Fill(0.);
0908
0909 if (m_verbose)
0910 std::cout << "\n" << (itQtName) << " quality test not found\n" << std::endl;
0911 }
0912
0913 } else {
0914
0915
0916
0917 int noisyStrpQtStatus = dqm::qstatus::INVALID;
0918
0919 if (noisyStrpQtSummaryEnabled[iNoisyStrpQTest]) {
0920 if (noisyStrpQtStatus > m_summaryContent[iAllMon]) {
0921 m_summaryContent[iAllMon] = noisyStrpQtStatus;
0922 }
0923 }
0924
0925 m_meReportSummaryContent[iAllQTest]->Fill(0.);
0926
0927 if (m_verbose)
0928 std::cout << "\nHistogram " << noisyStrpQtHist[iNoisyStrpQTest] << " not found\n" << std::endl;
0929 }
0930
0931 iNoisyStrpQTest++;
0932 iAllQTest++;
0933 }
0934 iAllMon++;
0935 }
0936
0937
0938 for (unsigned int iDeadStrp = 0; iDeadStrp < m_nrDeadStrip; ++iDeadStrp) {
0939
0940 const std::vector<std::string>& deadStrpQtName = m_deadQualityTestName[iDeadStrp];
0941 const std::vector<std::string>& deadStrpQtHist = m_deadQualityTestHist[iDeadStrp];
0942 const std::vector<unsigned int>& deadStrpQtSummaryEnabled = m_deadQtSummaryEnabled[iDeadStrp];
0943
0944
0945 int iDeadStrpQTest = 0;
0946
0947 for (const auto& itQtName : deadStrpQtName) {
0948
0949
0950 MonitorElement* qHist = igetter.get(deadStrpQtHist[iDeadStrpQTest]);
0951
0952 if (qHist) {
0953 const std::vector<QReport*> qtVec = qHist->getQReports();
0954
0955 if (m_verbose)
0956 std::cout << "\nNumber of quality tests "
0957 << " for histogram " << deadStrpQtHist[iDeadStrpQTest] << ": " << qtVec.size() << "\n"
0958 << std::endl;
0959
0960 const QReport* objQReport = qHist->getQReport(itQtName);
0961 if (objQReport) {
0962 const float deadStrpQtResult = objQReport->getQTresult();
0963 const int deadStrpQtStatus = objQReport->getStatus();
0964 const std::string& deadStrpQtMessage = objQReport->getMessage();
0965
0966 if (m_verbose) {
0967 std::cout << "\n"
0968 << (itQtName) << " quality test:"
0969 << "\n result: " << deadStrpQtResult << "\n status: " << deadStrpQtStatus
0970 << "\n message: " << deadStrpQtMessage << "\n"
0971 << "\nFilling m_meReportSummaryContent[" << iAllQTest << "] with value " << deadStrpQtResult
0972 << "\n"
0973 << std::endl;
0974 }
0975
0976 m_meReportSummaryContent[iAllQTest]->Fill(deadStrpQtResult);
0977
0978
0979
0980 if (deadStrpQtSummaryEnabled[iDeadStrpQTest]) {
0981 if (deadStrpQtStatus > m_summaryContent[iAllMon]) {
0982 m_summaryContent[iAllMon] = deadStrpQtStatus;
0983 }
0984 m_summarySum += deadStrpQtResult;
0985 }
0986
0987 } else {
0988
0989
0990
0991 int deadStrpQtStatus = dqm::qstatus::INVALID;
0992
0993 if (deadStrpQtSummaryEnabled[iDeadStrpQTest]) {
0994 if (deadStrpQtStatus > m_summaryContent[iAllMon]) {
0995 m_summaryContent[iAllMon] = deadStrpQtStatus;
0996 }
0997 }
0998
0999 m_meReportSummaryContent[iAllQTest]->Fill(0.);
1000
1001 if (m_verbose)
1002 std::cout << "\n" << (itQtName) << " quality test not found\n" << std::endl;
1003 }
1004
1005 } else {
1006
1007
1008
1009 int deadStrpQtStatus = dqm::qstatus::INVALID;
1010
1011 if (deadStrpQtSummaryEnabled[iDeadStrpQTest]) {
1012 if (deadStrpQtStatus > m_summaryContent[iAllMon]) {
1013 m_summaryContent[iAllMon] = deadStrpQtStatus;
1014 }
1015 }
1016
1017 m_meReportSummaryContent[iAllQTest]->Fill(0.);
1018
1019 if (m_verbose)
1020 std::cout << "\nHistogram " << deadStrpQtHist[iDeadStrpQTest] << " not found\n" << std::endl;
1021 }
1022
1023
1024 iDeadStrpQTest++;
1025 iAllQTest++;
1026 }
1027 iAllMon++;
1028 }
1029
1030
1031 m_reportSummary = m_summarySum / float(m_totalNrQtSummaryEnabled);
1032 if (m_meReportSummary) {
1033 m_meReportSummary->Fill(m_reportSummary);
1034 }
1035
1036
1037 for (unsigned int iTrackObj = 0; iTrackObj < m_nrTrackObjects; ++iTrackObj) {
1038 double summCont = static_cast<double>(m_summaryContent[iTrackObj]);
1039 m_meReportSummaryMap->setBinContent(1, iTrackObj + 1, summCont);
1040 }
1041
1042 for (unsigned int iMon = m_nrTrackObjects; iMon < m_nrTrackObjects + m_nrHitObjects; ++iMon) {
1043 double summCont = static_cast<double>(m_summaryContent[iMon]);
1044 m_meReportSummaryMap->setBinContent(2, iMon - m_nrTrackObjects + 1, summCont);
1045 }
1046
1047
1048 for (unsigned int iNoisyStrp = m_nrTrackObjects + m_nrHitObjects;
1049 iNoisyStrp < m_nrTrackObjects + m_nrHitObjects + m_nrNoisyStrip;
1050 ++iNoisyStrp) {
1051 double summCont = static_cast<double>(m_summaryContent[iNoisyStrp]);
1052 m_meReportSummaryMap_chamberStrip->setBinContent(1, iNoisyStrp - m_nrTrackObjects - m_nrHitObjects + 1, summCont);
1053 }
1054
1055 for (unsigned int iDeadStrp = m_nrTrackObjects + m_nrHitObjects + m_nrNoisyStrip;
1056 iDeadStrp < m_nrTrackObjects + m_nrHitObjects + m_nrNoisyStrip + m_nrDeadStrip;
1057 ++iDeadStrp) {
1058 double summCont = static_cast<double>(m_summaryContent[iDeadStrp]);
1059 m_meReportSummaryMap_chamberStrip->setBinContent(
1060 2, iDeadStrp - m_nrTrackObjects - m_nrHitObjects - m_nrNoisyStrip + 1, summCont);
1061 }
1062 }