18 #include <TDirectory.h> 32 cout <<
"[L1TTestsSummary:] Called constructor" << endl;
44 mL1TOccupancyPath = ps.
getUntrackedParameter<
string>(
"L1TOccupancyPath",
"L1T/L1TOccupancy/Certification/");
53 cout <<
"[L1TTestsSummary:] Called destructor" << endl;
66 cout <<
"[L1TTestsSummary:] Called beginRun" << endl;
71 if (mMonitorL1TRate) {
73 cout <<
"[L1TTestsSummary:] Initializing L1TRate Module Monitoring" << endl;
77 vector<string> histToMonitor = igetter.
getMEs();
78 int histLines = histToMonitor.size() + 1;
81 mL1TRateMonitor = ibooker.
book2D(
82 "RateQualitySummary",
"L1T Rates Monitor Summary", maxLS, +0.5,
double(maxLS) + 0.5, histLines, 0, histLines);
85 mL1TRateMonitor->setBinLabel(1,
"Summary", 2);
86 for (
unsigned int i = 0;
i < histToMonitor.size();
i++) {
87 string name = igetter.
get(mL1TRatePath + histToMonitor[
i])->
getTH1()->GetName();
88 mL1TRateMonitor->setBinLabel(i + 2, name, 2);
91 if (mMonitorL1TSync) {
93 cout <<
"[L1TTestsSummary:] Initializing L1TSync Module Monitoring" << endl;
97 vector<string> histToMonitor = igetter.
getMEs();
98 int histLines = histToMonitor.size() + 1;
101 mL1TSyncMonitor = ibooker.
book2D(
"SyncQualitySummary",
102 "L1T Synchronization Monitor Summary",
111 mL1TSyncMonitor->setBinLabel(1,
"Summary", 2);
112 for (
unsigned int i = 0;
i < histToMonitor.size();
i++) {
113 string name = igetter.
get(mL1TSyncPath + histToMonitor[
i])->
getTH1()->GetName();
114 mL1TSyncMonitor->setBinLabel(i + 2, name, 2);
117 if (mMonitorL1TOccupancy) {
119 cout <<
"[L1TTestsSummary:] Initializing L1TOccupancy Module Monitoring" << endl;
123 vector<string> histToMonitor = igetter.
getMEs();
124 int histLines = histToMonitor.size() + 1;
127 mL1TOccupancyMonitor = ibooker.
book2D(
128 "OccupancySummary",
"L1T Occupancy Monitor Summary", maxLS, +0.5,
double(maxLS) + 0.5, histLines, 0, histLines);
131 mL1TOccupancyMonitor->setBinLabel(1,
"Summary", 2);
132 for (
unsigned int i = 0;
i < histToMonitor.size();
i++) {
133 string name = igetter.
get(mL1TOccupancyPath + histToMonitor[
i])->
getTH1()->GetName();
134 mL1TOccupancyMonitor->setBinLabel(i + 2, name, 2);
139 int testsToMonitor = 1;
140 if (mMonitorL1TRate) {
143 if (mMonitorL1TSync) {
146 if (mMonitorL1TOccupancy) {
152 mL1TSummary = ibooker.
book2D(
153 "L1TQualitySummary",
"L1 Tests Summary", maxLS, +0.5,
double(maxLS) + 0.5, testsToMonitor, 0, testsToMonitor);
155 mL1TSummary->setBinLabel(1,
"L1T Summary", 2);
158 if (mMonitorL1TRate) {
159 mL1TSummary->setBinLabel(it,
"Rates", 2);
163 if (mMonitorL1TSync) {
164 mL1TSummary->setBinLabel(it,
"Synchronization", 2);
168 if (mMonitorL1TOccupancy) {
169 mL1TSummary->setBinLabel(it,
"Occupancy", 2);
182 book(ibooker, igetter);
185 cout <<
"[L1TTestsSummary:] Called endRun()" << endl;
188 if (mMonitorL1TRate) {
189 updateL1TRateMonitor(ibooker, igetter);
191 if (mMonitorL1TSync) {
192 updateL1TSyncMonitor(ibooker, igetter);
194 if (mMonitorL1TOccupancy) {
195 updateL1TOccupancyMonitor(ibooker, igetter);
197 updateL1TSummary(ibooker, igetter);
213 book(ibooker, igetter);
215 mProcessedLS.push_back(eventLS);
218 cout <<
"[L1TTestsSummary:] Called endLuminosityBlock()" << endl;
219 cout <<
"[L1TTestsSummary:] Lumisection: " << eventLS << endl;
222 if (mMonitorL1TRate) {
223 updateL1TRateMonitor(ibooker, igetter);
225 if (mMonitorL1TSync) {
226 updateL1TSyncMonitor(ibooker, igetter);
228 if (mMonitorL1TOccupancy) {
229 updateL1TOccupancyMonitor(ibooker, igetter);
231 updateL1TSummary(ibooker, igetter);
240 vector<string> histToMonitor = igetter.
getMEs();
242 for (
unsigned int i = 0;
i < histToMonitor.size();
i++) {
245 cout <<
"[L1TTestsSummary:] Found ME: " << me->
getTH1()->GetName() << endl;
252 const string &qtmessage = myQReport->
getMessage();
256 cout <<
"[L1TTestsSummary:] Found QReport for ME: " << me->
getTH1()->GetName() << endl;
257 cout <<
"[L1TTestsSummary:] Result=" << qtresult <<
" status=" << qtstatus <<
" message=" << qtmessage << endl;
258 cout <<
"[L1TTestsSummary:] Bad Channels size=" << qtBadChannels.size() << endl;
261 for (
unsigned int i = 0; i < mProcessedLS.size() - 1; i++) {
262 int binx = mL1TRateMonitor->getTH2F()->GetXaxis()->FindBin(mProcessedLS[i]);
263 int biny = mL1TRateMonitor->getTH2F()->GetYaxis()->FindBin(me->
getTH1()->GetName());
264 mL1TRateMonitor->setBinContent(binx, biny, 100);
267 for (
unsigned int a = 0;
a < qtBadChannels.size();
a++) {
268 for (
unsigned int b = 0;
b < mProcessedLS.size() - 1;
b++) {
270 double valueBinBad = me->
getTH1()->GetBinCenter(qtBadChannels[
a].
getBin());
272 if (valueBinBad == (mProcessedLS[
b])) {
273 int binx = mL1TRateMonitor->getTH2F()->GetXaxis()->FindBin(valueBinBad);
274 int biny = mL1TRateMonitor->getTH2F()->GetYaxis()->FindBin(me->
getTH1()->GetName());
275 mL1TRateMonitor->setBinContent(binx, biny, 300);
283 int nBinX = mL1TRateMonitor->getTH2F()->GetXaxis()->GetNbins();
284 int nBinY = mL1TRateMonitor->getTH2F()->GetYaxis()->GetNbins();
285 for (
int binx = 1; binx <=
nBinX; binx++) {
286 int GlobalStatus = 0;
287 for (
int biny = 2; biny <=
nBinY; biny++) {
288 double flag = mL1TRateMonitor->getBinContent(binx, biny);
289 if (GlobalStatus < flag) {
295 mL1TRateMonitor->setBinContent(binx, 1, GlobalStatus);
296 mL1TSummary->setBinContent(binx, binYRate, GlobalStatus);
308 vector<string> histToMonitor = igetter.
getMEs();
310 for (
unsigned int i = 0;
i < histToMonitor.size();
i++) {
313 cout <<
"[L1TTestsSummary:] Found ME: " << me->
getTH1()->GetName() << endl;
320 const string &qtmessage = myQReport->
getMessage();
324 cout <<
"[L1TTestsSummary:] Found QReport for ME: " << me->
getTH1()->GetName() << endl;
325 cout <<
"[L1TTestsSummary:] Result=" << qtresult <<
" status=" << qtstatus <<
" message=" << qtmessage << endl;
326 cout <<
"[L1TTestsSummary:] Bad Channels size=" << qtBadChannels.size() << endl;
329 for (
unsigned int i = 0; i < mProcessedLS.size(); i++) {
330 int binx = mL1TSyncMonitor->getTH2F()->GetXaxis()->FindBin(mProcessedLS[i]);
331 int biny = mL1TSyncMonitor->getTH2F()->GetYaxis()->FindBin(me->
getTH1()->GetName());
332 mL1TSyncMonitor->setBinContent(binx, biny, 100);
335 for (
unsigned int a = 0;
a < qtBadChannels.size();
a++) {
336 for (
unsigned int b = 0;
b < mProcessedLS.size();
b++) {
338 double valueBinBad = me->
getTH1()->GetBinCenter(qtBadChannels[
a].
getBin());
340 if (valueBinBad == mProcessedLS[
b]) {
341 int binx = mL1TSyncMonitor->getTH2F()->GetXaxis()->FindBin(valueBinBad);
342 int biny = mL1TSyncMonitor->getTH2F()->GetYaxis()->FindBin(me->
getTH1()->GetName());
343 mL1TSyncMonitor->setBinContent(binx, biny, 300);
351 int nBinX = mL1TSyncMonitor->getTH2F()->GetXaxis()->GetNbins();
352 int nBinY = mL1TSyncMonitor->getTH2F()->GetYaxis()->GetNbins();
353 for (
int binx = 1; binx <=
nBinX; binx++) {
354 int GlobalStatus = 0;
355 for (
int biny = 2; biny <=
nBinY; biny++) {
356 double flag = mL1TSyncMonitor->getBinContent(binx, biny);
357 if (GlobalStatus < flag) {
363 mL1TSyncMonitor->setBinContent(binx, 1, GlobalStatus);
364 mL1TSummary->setBinContent(binx, binYSync, GlobalStatus);
374 vector<string> histToMonitor = igetter.
getMEs();
376 for (
unsigned int i = 0;
i < histToMonitor.size();
i++) {
379 cout <<
"[L1TTestsSummary:] Found ME: " << me->
getTH1()->GetName() << endl;
386 const string &qtmessage = myQReport->
getMessage();
390 cout <<
"[L1TTestsSummary:] Found QReport for ME: " << me->
getTH1()->GetName() << endl;
391 cout <<
"[L1TTestsSummary:] Result=" << qtresult <<
" status=" << qtstatus <<
" message=" << qtmessage << endl;
392 cout <<
"[L1TTestsSummary:] Bad Channels size=" << qtBadChannels.size() << endl;
395 for (
unsigned int i = 0; i < mProcessedLS.size(); i++) {
396 int binx = mL1TOccupancyMonitor->getTH2F()->GetXaxis()->FindBin(mProcessedLS[i]);
397 int biny = mL1TOccupancyMonitor->getTH2F()->GetYaxis()->FindBin(me->
getTH1()->GetName());
398 mL1TOccupancyMonitor->setBinContent(binx, biny, 100);
401 for (
unsigned int a = 0;
a < qtBadChannels.size();
a++) {
402 for (
unsigned int b = 0;
b < mProcessedLS.size();
b++) {
404 double valueBinBad = me->
getTH1()->GetBinCenter(qtBadChannels[
a].
getBin());
406 if (valueBinBad == mProcessedLS[
b]) {
407 int binx = mL1TOccupancyMonitor->getTH2F()->GetXaxis()->FindBin(valueBinBad);
408 int biny = mL1TOccupancyMonitor->getTH2F()->GetYaxis()->FindBin(me->
getTH1()->GetName());
409 mL1TOccupancyMonitor->setBinContent(binx, biny, 300);
417 int nBinX = mL1TOccupancyMonitor->getTH2F()->GetXaxis()->GetNbins();
418 int nBinY = mL1TOccupancyMonitor->getTH2F()->GetYaxis()->GetNbins();
419 for (
int binx = 1; binx <=
nBinX; binx++) {
420 int GlobalStatus = 0;
421 for (
int biny = 2; biny <=
nBinY; biny++) {
422 double flag = mL1TOccupancyMonitor->getBinContent(binx, biny);
423 if (GlobalStatus < flag) {
429 mL1TOccupancyMonitor->setBinContent(binx, 1, GlobalStatus);
430 mL1TSummary->setBinContent(binx, binYOccpancy, GlobalStatus);
439 int nBinX = mL1TSummary->getTH2F()->GetXaxis()->GetNbins();
440 for (
int binx = 1; binx <=
nBinX; binx++) {
441 int GlobalStatus = 0;
442 if (mMonitorL1TRate) {
443 if (mL1TSummary->getBinContent(binx, binYRate) > GlobalStatus) {
444 GlobalStatus = mL1TSummary->getBinContent(binx, binYRate);
447 if (mMonitorL1TSync) {
448 if (mL1TSummary->getBinContent(binx, binYSync) > GlobalStatus) {
449 GlobalStatus = mL1TSummary->getBinContent(binx, binYSync);
452 if (mMonitorL1TOccupancy) {
453 if (mL1TSummary->getBinContent(binx, binYOccpancy) > GlobalStatus) {
454 GlobalStatus = mL1TSummary->getBinContent(binx, binYOccpancy);
457 mL1TSummary->setBinContent(binx, 1, GlobalStatus);
LuminosityBlockID id() const
void updateL1TRateMonitor(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
T getUntrackedParameter(std::string const &, T const &) const
~L1TTestsSummary() override
const std::vector< DQMChannel > & getBadChannels() const
void dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override
void updateL1TSummary(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void setCurrentFolder(std::string const &fullpath)
virtual void book(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void updateL1TOccupancyMonitor(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
const QReport * getQReport(const std::string &qtname) const
get QReport corresponding to <qtname> (null pointer if QReport does not exist)
#define DEFINE_FWK_MODULE(type)
std::vector< std::string > getMEs()
const std::string & getMessage() const
get message attached to test
int getBin(double x, std::vector< double > boundaries)
void updateL1TSyncMonitor(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void dqmEndLuminosityBlock(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c) override
LuminosityBlockNumber_t luminosityBlock() const
int getStatus() const
get test status (see Core/interface/QTestStatus.h)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
L1TTestsSummary(const edm::ParameterSet &ps)
float getQTresult() const
get test result i.e. prob value
MonitorElement * get(std::string const &path)
virtual TH1 * getTH1() const
void setCurrentFolder(std::string const &fullpath)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)