1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
|
#include "CondCore/Utilities/interface/PayloadInspectorModule.h"
#include "CondCore/Utilities/interface/PayloadInspector.h"
#include "CondCore/CondDB/interface/Time.h"
// the data format of the condition to be inspected
#include "CondFormats/EcalObjects/interface/EcalDQMChannelStatus.h"
#include "DataFormats/EcalDetId/interface/EBDetId.h"
#include "DataFormats/EcalDetId/interface/EEDetId.h"
#include <memory>
#include <sstream>
#include "TStyle.h"
#include "TH2F.h"
#include "TCanvas.h"
#include "TLine.h"
#include "TLatex.h"
namespace {
constexpr int kEBChannels = 61200, kEEChannels = 14648, NRGBs = 5, NCont = 255;
constexpr int MAX_IETA = 85, MAX_IPHI = 360; // barrel lower and upper bounds on eta and phi
constexpr int IX_MIN = 1, IY_MIN = 1, IX_MAX = 100, IY_MAX = 100; // endcaps lower and upper bounds on x and y
/*******************************************************
2d plot of ECAL barrel DQM channel status of 1 IOV
*******************************************************/
class EcalDQMChannelStatusEBMap : public cond::payloadInspector::PlotImage<EcalDQMChannelStatus> {
public:
EcalDQMChannelStatusEBMap()
: cond::payloadInspector::PlotImage<EcalDQMChannelStatus>("ECAL Barrel DQM channel status") {
setSingleIov(true);
}
bool fill(const std::vector<std::tuple<cond::Time_t, cond::Hash> > &iovs) override {
TH2F *ebmap = new TH2F(
"ebmap", "", MAX_IPHI, 0, MAX_IPHI, 2 * MAX_IETA, -MAX_IETA, MAX_IETA); //drawing the whole map (barels)
TH2F *ebmap_coarse = new TH2F(
"ebmap_coarse", "", MAX_IPHI / 20, 0, MAX_IPHI, 2, -MAX_IETA, MAX_IETA); //drawing the halves (18 by 2)
Int_t ebcount = 0;
unsigned int run = 0;
// for ( auto const & iov: iovs) {
auto iov = iovs.front();
std::shared_ptr<EcalDQMChannelStatus> payload = fetchPayload(std::get<1>(iov));
run = std::get<0>(iov);
if (payload.get()) {
// looping over the EB channels, via the dense-index, mapped into EBDetId's
if (payload->barrelItems().empty())
return false;
for (int cellid = EBDetId::MIN_HASH; cellid < EBDetId::kSizeForDenseIndexing; ++cellid) {
uint32_t rawid = EBDetId::unhashIndex(cellid);
// check the existence of ECAL channel status, for a given ECAL barrel channel
if (payload->find(rawid) == payload->end())
continue;
//if (!(*payload)[rawid].getEncodedStatusCode()) continue;
Double_t weight = (Double_t)(*payload)[rawid].getStatusCode();
Double_t phi = (Double_t)(EBDetId(rawid)).iphi() - 0.5;
Double_t eta = (Double_t)(EBDetId(rawid)).ieta();
if (eta > 0.)
eta = eta - 0.5; // 0.5 to 84.5
else
eta = eta + 0.5; // -84.5 to -0.5
ebmap->Fill(phi, eta, weight);
if (weight > 0) {
ebcount++;
ebmap_coarse->Fill(phi, eta);
}
} // loop over cellid
} // if payload.get()
else
return false;
gStyle->SetOptStat(0);
//set the background color to white
gStyle->SetFillColor(10);
gStyle->SetFrameFillColor(10);
gStyle->SetCanvasColor(10);
gStyle->SetPadColor(10);
gStyle->SetTitleFillColor(0);
gStyle->SetStatColor(10);
//dont put a colored frame around the plots
gStyle->SetFrameBorderMode(0);
gStyle->SetCanvasBorderMode(0);
gStyle->SetPadBorderMode(0);
//use the primary color palette
gStyle->SetPalette(1);
Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
Double_t red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
Double_t blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
gStyle->SetNumberContours(NCont);
TCanvas c1("c1", "c1", 1200, 700);
c1.SetGridx(1);
c1.SetGridy(1);
TLatex t1;
t1.SetNDC();
t1.SetTextAlign(26);
t1.SetTextSize(0.06);
ebmap->SetXTitle("i#phi");
ebmap->SetYTitle("i#eta");
ebmap->GetXaxis()->SetNdivisions(-418, kFALSE);
ebmap->GetYaxis()->SetNdivisions(-1702, kFALSE);
ebmap->GetXaxis()->SetLabelSize(0.03);
ebmap->GetYaxis()->SetLabelSize(0.03);
ebmap->GetXaxis()->SetTickLength(0.01);
ebmap->GetYaxis()->SetTickLength(0.01);
ebmap->SetMaximum(15);
c1.cd();
ebmap->Draw("colz");
ebmap_coarse->SetMarkerSize(1.3);
ebmap_coarse->Draw("text,same");
t1.SetTextSize(0.05);
t1.DrawLatex(0.5, 0.96, Form("EB DQM Channel Status, IOV %i", run));
char txt[80];
Double_t prop = (Double_t)ebcount / kEBChannels * 100.;
sprintf(txt, "%d/61200 (%4.3f%%)", ebcount, prop);
t1.SetTextColor(2);
t1.SetTextSize(0.045);
t1.DrawLatex(0.5, 0.91, txt);
std::string ImageName(m_imageFileName);
c1.SaveAs(ImageName.c_str());
return true;
}
};
/*******************************************************
2d plot of ECAL Endcap DQM channel status of 1 IOV
*******************************************************/
class EcalDQMChannelStatusEEMap : public cond::payloadInspector::PlotImage<EcalDQMChannelStatus> {
public:
EcalDQMChannelStatusEEMap()
: cond::payloadInspector::PlotImage<EcalDQMChannelStatus>("ECAL EndCaps DQM channel status") {
setSingleIov(true);
}
bool fill(const std::vector<std::tuple<cond::Time_t, cond::Hash> > &iovs) override {
//TH2F *eemap = new TH2F("eemap","", 2*IX_MAX, IX_MIN, 2*IX_MAX+1, IY_MAX, IY_MIN, IY_MAX+IY_MIN);
TH2F *eemap = new TH2F("eemap", "", 2 * IX_MAX, 0, 2 * IX_MAX, IY_MAX, 0, IY_MAX);
TH2F *eemap_coarse = new TH2F("eemap_coarse", "", 2, 0, 2 * IX_MAX, 1, 0, IY_MAX);
TH2F *eetemp = new TH2F("eetemp", "", 2 * IX_MAX, 0, 2 * IX_MAX, IY_MAX, 0, IY_MAX);
Int_t eecount = 0;
unsigned int run = 0;
auto iov = iovs.front();
std::shared_ptr<EcalDQMChannelStatus> payload = fetchPayload(std::get<1>(iov));
run = std::get<0>(iov); //Time_t parameter
if (payload.get()) {
if (payload->endcapItems().empty())
return false;
// looping over the EE channels
for (int iz = -1; iz < 2; iz = iz + 2) // -1 or +1
for (int iy = IY_MIN; iy < IY_MAX + IY_MIN; iy++)
for (int ix = IX_MIN; ix < IX_MAX + IX_MIN; ix++)
if (EEDetId::validDetId(ix, iy, iz)) {
EEDetId myEEId = EEDetId(ix, iy, iz, EEDetId::XYMODE);
uint32_t rawid = myEEId.rawId();
// check the existence of ECAL channel status, for a given ECAL endcap channel
if (payload->find(rawid) == payload->end())
continue;
// if (!(*payload)[rawid].getEncodedStatusCode()) continue;
float weight = (float)(*payload)[rawid].getStatusCode();
if (iz == -1) {
// eemap->Fill(ix, iy, weight);
eemap->Fill(ix - 1, iy - 1, weight);
if (weight > 0) {
eecount++;
eemap_coarse->Fill(ix - 1, iy - 1);
}
} else {
// eemap->Fill(ix+IX_MAX, iy, weight);
eemap->Fill(ix + IX_MAX - 1, iy - 1, weight);
if (weight > 0) {
eecount++;
eemap_coarse->Fill(ix + IX_MAX - 1, iy - 1);
}
}
} // validDetId
} // payload
gStyle->SetOptStat(0);
//set the background color to white
gStyle->SetFillColor(10);
gStyle->SetFrameFillColor(10);
gStyle->SetCanvasColor(10);
gStyle->SetPadColor(10);
gStyle->SetTitleFillColor(0);
gStyle->SetStatColor(10);
//dont put a colored frame around the plots
gStyle->SetFrameBorderMode(0);
gStyle->SetCanvasBorderMode(0);
gStyle->SetPadBorderMode(0);
//use the primary color palette
gStyle->SetPalette(1);
Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
Double_t red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
Double_t blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
gStyle->SetNumberContours(NCont);
// set the EE contours
for (Int_t i = 1; i <= IX_MAX; i++) {
for (Int_t j = 1; j <= IY_MAX; j++) {
if (EEDetId::validDetId(i, j, 1)) {
// eetemp->SetBinContent(i + 1, j + 1, 2);
// eetemp->SetBinContent(i + IX_MAX + 1, j +1, 2);
eetemp->SetBinContent(i, j, 2);
eetemp->SetBinContent(i + IX_MAX, j, 2);
}
}
}
eetemp->SetFillColor(920);
TCanvas c1("c1", "c1", 1200, 600);
c1.SetGridx(1);
c1.SetGridy(1);
TLatex t1;
t1.SetNDC();
t1.SetTextAlign(26);
t1.SetTextSize(0.06);
eetemp->GetXaxis()->SetNdivisions(40, kFALSE);
eetemp->GetYaxis()->SetNdivisions(20, kFALSE);
eetemp->GetXaxis()->SetLabelSize(0.00);
eetemp->GetYaxis()->SetLabelSize(0.00);
eetemp->GetXaxis()->SetTickLength(0.01);
eetemp->GetYaxis()->SetTickLength(0.01);
eetemp->SetMaximum(1.15);
eemap->GetXaxis()->SetNdivisions(40, kFALSE);
eemap->GetYaxis()->SetNdivisions(20, kFALSE);
eemap->GetXaxis()->SetLabelSize(0.00);
eemap->GetYaxis()->SetLabelSize(0.00);
eemap->GetXaxis()->SetTickLength(0.01);
eemap->GetYaxis()->SetTickLength(0.01);
eemap->SetMaximum(15);
eetemp->Draw("box");
eemap->Draw("same,colz");
eemap_coarse->SetMarkerSize(2);
eemap_coarse->Draw("same,text");
t1.SetTextColor(1);
t1.SetTextSize(0.055);
t1.DrawLatex(0.5, 0.96, Form("EE DQM Channel Status, IOV %i", run));
char txt[80];
Double_t prop = (Double_t)eecount / kEEChannels * 100.;
sprintf(txt, "%d/14648 (%4.3f%%)", eecount, prop);
t1.SetTextColor(2);
t1.SetTextSize(0.045);
t1.DrawLatex(0.5, 0.91, txt);
t1.SetTextColor(1);
t1.SetTextSize(0.05);
t1.DrawLatex(0.14, 0.84, "EE-");
t1.DrawLatex(0.86, 0.84, "EE+");
std::string ImageName(m_imageFileName);
c1.SaveAs(ImageName.c_str());
return true;
}
};
/**********************************************************************
2d plot of ECAL barrel DQM channel status difference between 2 IOVs
***********************************************************************/
template <cond::payloadInspector::IOVMultiplicity nIOVs, int ntags>
class EcalDQMChannelStatusEBDiffBase : public cond::payloadInspector::PlotImage<EcalDQMChannelStatus, nIOVs, ntags> {
public:
EcalDQMChannelStatusEBDiffBase()
: cond::payloadInspector::PlotImage<EcalDQMChannelStatus, nIOVs, ntags>(
"ECAL Barrel DQM channel status difference") {}
bool fill() override {
TH2F *ebmap = new TH2F("ebmap", "", MAX_IPHI, 0, MAX_IPHI, 2 * MAX_IETA, -MAX_IETA, MAX_IETA);
TH2F *ebmap_coarse = new TH2F("ebmap_coarse", "", MAX_IPHI / 20, 0, MAX_IPHI, 2, -MAX_IETA, MAX_IETA);
Int_t ebcount = 0;
unsigned int run[2], status[kEBChannels];
std::string l_tagname[2];
auto iovs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().name;
auto firstiov = iovs.front();
run[0] = std::get<0>(firstiov);
std::tuple<cond::Time_t, cond::Hash> lastiov;
if (ntags == 2) {
auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().name;
lastiov = tag2iovs.front();
} else {
lastiov = iovs.back();
l_tagname[1] = l_tagname[0];
}
run[1] = std::get<0>(lastiov);
for (int irun = 0; irun < nIOVs; irun++) {
std::shared_ptr<EcalDQMChannelStatus> payload;
if (irun == 0) {
payload = this->fetchPayload(std::get<1>(firstiov));
} else {
payload = this->fetchPayload(std::get<1>(lastiov));
}
if (payload.get()) {
// looping over the EB channels, via the dense-index, mapped into EBDetId's
if (payload->barrelItems().empty())
return false;
for (int cellid = EBDetId::MIN_HASH; cellid < EBDetId::kSizeForDenseIndexing; ++cellid) {
uint32_t rawid = EBDetId::unhashIndex(cellid);
// check the existence of ECAL channel status, for a given ECAL barrel channel
if (payload->find(rawid) == payload->end())
continue;
if (irun == 0) {
status[cellid] = (*payload)[rawid].getStatusCode();
} else {
unsigned int new_status = (*payload)[rawid].getStatusCode();
if (new_status != status[cellid]) {
int tmp3 = 0;
if (new_status > status[cellid])
tmp3 = 1;
else
tmp3 = -1;
Double_t phi = (Double_t)(EBDetId(rawid)).iphi() - 0.5;
Double_t eta = (Double_t)(EBDetId(rawid)).ieta();
if (eta > 0.)
eta = eta - 0.5; // 0.5 to 84.5
else
eta = eta + 0.5; // -84.5 to -0.5
ebmap->Fill(phi, eta, 0.05 + 0.95 * (tmp3 > 0));
ebcount++;
ebmap_coarse->Fill(phi, eta, tmp3);
}
}
} // loop over cellid
} // if payload.get()
else
return false;
} // loop over IOV's
gStyle->SetOptStat(0);
//set the background color to white
gStyle->SetFillColor(10);
gStyle->SetFrameFillColor(10);
gStyle->SetCanvasColor(10);
gStyle->SetPadColor(10);
gStyle->SetTitleFillColor(0);
gStyle->SetStatColor(10);
//dont put a colored frame around the plots
gStyle->SetFrameBorderMode(0);
gStyle->SetCanvasBorderMode(0);
gStyle->SetPadBorderMode(0);
//use the primary color palette
gStyle->SetPalette(1);
Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
Double_t red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
Double_t blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
gStyle->SetNumberContours(NCont);
TCanvas c1("c1", "c1", 1200, 700);
c1.SetGridx(1);
c1.SetGridy(1);
TLatex t1;
t1.SetNDC();
t1.SetTextAlign(26);
t1.SetTextSize(0.06);
ebmap->SetXTitle("i#phi");
ebmap->SetYTitle("i#eta");
ebmap->GetXaxis()->SetNdivisions(-418, kFALSE);
ebmap->GetYaxis()->SetNdivisions(-1702, kFALSE);
ebmap->GetXaxis()->SetLabelSize(0.03);
ebmap->GetYaxis()->SetLabelSize(0.03);
ebmap->GetXaxis()->SetTickLength(0.01);
ebmap->GetYaxis()->SetTickLength(0.01);
ebmap->SetMaximum(1.15);
c1.cd();
ebmap->Draw("colz");
ebmap_coarse->SetMarkerSize(1.3);
ebmap_coarse->Draw("text,same");
int len = l_tagname[0].length() + l_tagname[1].length();
if (ntags == 2 && len < 58) {
t1.SetTextSize(0.025);
t1.DrawLatex(
0.5, 0.96, Form("%s IOV %i - %s IOV %i", l_tagname[1].c_str(), run[1], l_tagname[0].c_str(), run[0]));
} else {
t1.SetTextSize(0.05);
t1.DrawLatex(0.5, 0.96, Form("EB DQM Channel Status (Diff), IOV: %i vs %i", run[0], run[1]));
}
char txt[80];
sprintf(txt, "Net difference: %d channel(s)", ebcount);
t1.SetTextColor(2);
t1.SetTextSize(0.045);
t1.DrawLatex(0.5, 0.91, txt);
std::string ImageName(this->m_imageFileName);
c1.SaveAs(ImageName.c_str());
return true;
} // fill method
}; // class EcalDQMChannelStatusEBDiffBase
using EcalDQMChannelStatusEBDiffOneTag = EcalDQMChannelStatusEBDiffBase<cond::payloadInspector::SINGLE_IOV, 1>;
using EcalDQMChannelStatusEBDiffTwoTags = EcalDQMChannelStatusEBDiffBase<cond::payloadInspector::SINGLE_IOV, 2>;
/************************************************************************
2d plot of ECAL endcaps DQM channel status difference between 2 IOVs
************************************************************************/
template <cond::payloadInspector::IOVMultiplicity nIOVs, int ntags>
class EcalDQMChannelStatusEEDiffBase : public cond::payloadInspector::PlotImage<EcalDQMChannelStatus, nIOVs, ntags> {
public:
EcalDQMChannelStatusEEDiffBase()
: cond::payloadInspector::PlotImage<EcalDQMChannelStatus, nIOVs, ntags>(
"ECAL Endcaps DQM channel status difference") {}
bool fill() override {
TH2F *eemap = new TH2F("eemap", "", 2 * IX_MAX, 0, 2 * IX_MAX, IY_MAX, 0, IY_MAX);
TH2F *eemap_coarse = new TH2F("eemap_coarse", "", 2, 0, 2 * IX_MAX, 1, 0, IY_MAX);
TH2F *eetemp = new TH2F("eetemp", "", 2 * IX_MAX, 0, 2 * IX_MAX, IY_MAX, 0, IY_MAX);
Int_t eecount = 0;
unsigned int run[2], status[kEEChannels];
std::string l_tagname[2];
auto iovs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().name;
auto firstiov = iovs.front();
run[0] = std::get<0>(firstiov);
std::tuple<cond::Time_t, cond::Hash> lastiov;
if (ntags == 2) {
auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().name;
lastiov = tag2iovs.front();
} else {
lastiov = iovs.back();
l_tagname[1] = l_tagname[0];
}
run[1] = std::get<0>(lastiov);
for (int irun = 0; irun < nIOVs; irun++) {
std::shared_ptr<EcalDQMChannelStatus> payload;
if (irun == 0) {
payload = this->fetchPayload(std::get<1>(firstiov));
} else {
payload = this->fetchPayload(std::get<1>(lastiov));
}
if (payload.get()) {
if (payload->endcapItems().empty())
return false;
// looping over the EE channels
for (int iz = -1; iz < 2; iz = iz + 2) // -1 or +1
for (int iy = IY_MIN; iy < IY_MAX + IY_MIN; iy++)
for (int ix = IX_MIN; ix < IX_MAX + IX_MIN; ix++)
if (EEDetId::validDetId(ix, iy, iz)) {
EEDetId myEEId = EEDetId(ix, iy, iz, EEDetId::XYMODE);
uint32_t rawid = myEEId.rawId();
int channel = myEEId.hashedIndex();
// check the existence of ECAL channel status, for a given ECAL endcap channel
if (payload->find(rawid) == payload->end())
continue;
if (irun == 0) {
status[channel] = (*payload)[rawid].getStatusCode();
} else {
unsigned int new_status = (*payload)[rawid].getStatusCode();
if (new_status != status[channel]) {
int tmp3 = 0;
if (new_status > status[channel])
tmp3 = 1;
else
tmp3 = -1;
if (iz == -1) {
eemap->Fill(ix - 1, iy - 1, 0.05 + 0.95 * (tmp3 > 0));
eecount++;
eemap_coarse->Fill(ix - 1, iy - 1, tmp3);
} else {
eemap->Fill(ix + IX_MAX - 1, iy - 1, 0.05 + 0.95 * (tmp3 > 0));
eecount++;
eemap_coarse->Fill(ix + IX_MAX - 1, iy - 1, tmp3);
} // z side
} // any difference ?
} // 2nd IOV, fill the plots
} // validDetId
} // get the payload
} // loop over payloads
gStyle->SetOptStat(0);
//set the background color to white
gStyle->SetFillColor(10);
gStyle->SetFrameFillColor(10);
gStyle->SetCanvasColor(10);
gStyle->SetPadColor(10);
gStyle->SetTitleFillColor(0);
gStyle->SetStatColor(10);
//dont put a colored frame around the plots
gStyle->SetFrameBorderMode(0);
gStyle->SetCanvasBorderMode(0);
gStyle->SetPadBorderMode(0);
//use the primary color palette
gStyle->SetPalette(1);
Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
Double_t red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
Double_t blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
gStyle->SetNumberContours(NCont);
// set the EE contours
for (Int_t i = 1; i <= IX_MAX; i++) {
for (Int_t j = 1; j <= IY_MAX; j++) {
if (EEDetId::validDetId(i, j, 1)) {
eetemp->SetBinContent(i, j, 2);
eetemp->SetBinContent(i + IX_MAX, j, 2);
}
}
}
eetemp->SetFillColor(920);
TCanvas c1("c1", "c1", 1200, 600);
c1.SetGridx(1);
c1.SetGridy(1);
TLatex t1;
t1.SetNDC();
t1.SetTextAlign(26);
t1.SetTextSize(0.06);
eetemp->GetXaxis()->SetNdivisions(40, kFALSE);
eetemp->GetYaxis()->SetNdivisions(20, kFALSE);
eetemp->GetXaxis()->SetLabelSize(0.00);
eetemp->GetYaxis()->SetLabelSize(0.00);
eetemp->GetXaxis()->SetTickLength(0.01);
eetemp->GetYaxis()->SetTickLength(0.01);
eetemp->SetMaximum(1.15);
eemap->GetXaxis()->SetNdivisions(40, kFALSE);
eemap->GetYaxis()->SetNdivisions(20, kFALSE);
eemap->GetXaxis()->SetLabelSize(0.00);
eemap->GetYaxis()->SetLabelSize(0.00);
eemap->GetXaxis()->SetTickLength(0.01);
eemap->GetYaxis()->SetTickLength(0.01);
eemap->SetMaximum(1.15);
eetemp->Draw("box");
eemap->Draw("same,colz");
eemap_coarse->SetMarkerSize(2);
eemap_coarse->Draw("same,text");
t1.SetTextColor(1);
int len = l_tagname[0].length() + l_tagname[1].length();
if (ntags == 2 && len < 58) {
t1.SetTextSize(0.025);
t1.DrawLatex(
0.5, 0.96, Form("%s IOV %i - %s IOV %i", l_tagname[1].c_str(), run[1], l_tagname[0].c_str(), run[0]));
} else {
t1.SetTextSize(0.055);
t1.DrawLatex(0.5, 0.96, Form("EE DQM Channel Status (Diff), IOV %i vs %i", run[0], run[1]));
}
char txt[80];
sprintf(txt, "Net difference: %d channel(s)", eecount);
t1.SetTextColor(2);
t1.SetTextSize(0.045);
t1.DrawLatex(0.5, 0.91, txt);
t1.SetTextColor(1);
t1.SetTextSize(0.05);
t1.DrawLatex(0.14, 0.84, "EE-");
t1.DrawLatex(0.86, 0.84, "EE+");
std::string ImageName(this->m_imageFileName);
c1.SaveAs(ImageName.c_str());
return true;
} // fill method
}; // class EcalDQMChannelStatusEEDiffBase
using EcalDQMChannelStatusEEDiffOneTag = EcalDQMChannelStatusEEDiffBase<cond::payloadInspector::SINGLE_IOV, 1>;
using EcalDQMChannelStatusEEDiffTwoTags = EcalDQMChannelStatusEEDiffBase<cond::payloadInspector::SINGLE_IOV, 2>;
} // namespace
// Register the classes as boost python plugin
PAYLOAD_INSPECTOR_MODULE(EcalDQMChannelStatus) {
PAYLOAD_INSPECTOR_CLASS(EcalDQMChannelStatusEBMap);
PAYLOAD_INSPECTOR_CLASS(EcalDQMChannelStatusEEMap);
PAYLOAD_INSPECTOR_CLASS(EcalDQMChannelStatusEBDiffOneTag);
PAYLOAD_INSPECTOR_CLASS(EcalDQMChannelStatusEBDiffTwoTags);
PAYLOAD_INSPECTOR_CLASS(EcalDQMChannelStatusEEDiffOneTag);
PAYLOAD_INSPECTOR_CLASS(EcalDQMChannelStatusEEDiffTwoTags);
}
|