29 EcalDQMChannelStatusEBMap()
34 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> > &iovs)
override {
35 TH2F *ebmap =
new TH2F(
37 TH2F *ebmap_coarse =
new TH2F(
42 auto iov = iovs.front();
44 run = std::get<0>(iov);
48 if (
payload->barrelItems().empty())
56 Double_t
weight = (Double_t)(*
payload)[rawid].getStatusCode();
67 ebmap_coarse->Fill(
phi,
eta);
74 gStyle->SetOptStat(0);
76 gStyle->SetFillColor(10);
77 gStyle->SetFrameFillColor(10);
78 gStyle->SetCanvasColor(10);
79 gStyle->SetPadColor(10);
80 gStyle->SetTitleFillColor(0);
81 gStyle->SetStatColor(10);
83 gStyle->SetFrameBorderMode(0);
84 gStyle->SetCanvasBorderMode(0);
85 gStyle->SetPadBorderMode(0);
87 gStyle->SetPalette(1);
89 Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
90 Double_t
red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
91 Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
92 Double_t
blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
93 TColor::CreateGradientColorTable(NRGBs, stops,
red, green,
blue, NCont);
94 gStyle->SetNumberContours(NCont);
96 TCanvas
c1(
"c1",
"c1", 1200, 700);
103 t1.SetTextSize(0.06);
105 ebmap->SetXTitle(
"i#phi");
106 ebmap->SetYTitle(
"i#eta");
107 ebmap->GetXaxis()->SetNdivisions(-418, kFALSE);
108 ebmap->GetYaxis()->SetNdivisions(-1702, kFALSE);
109 ebmap->GetXaxis()->SetLabelSize(0.03);
110 ebmap->GetYaxis()->SetLabelSize(0.03);
111 ebmap->GetXaxis()->SetTickLength(0.01);
112 ebmap->GetYaxis()->SetTickLength(0.01);
113 ebmap->SetMaximum(15);
118 ebmap_coarse->SetMarkerSize(1.3);
119 ebmap_coarse->Draw(
"text,same");
121 t1.SetTextSize(0.05);
122 t1.DrawLatex(0.5, 0.96, Form(
"EB DQM Channel Status, IOV %i",
run));
125 Double_t prop = (Double_t)ebcount /
kEBChannels * 100.;
126 sprintf(txt,
"%d/61200 (%4.3f%%)", ebcount, prop);
128 t1.SetTextSize(0.045);
129 t1.DrawLatex(0.5, 0.91, txt);
132 c1.SaveAs(ImageName.c_str());
142 EcalDQMChannelStatusEEMap()
147 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> > &iovs)
override {
150 TH2F *eemap_coarse =
new TH2F(
"eemap_coarse",
"", 2, 0, 2 *
IX_MAX, 1, 0,
IY_MAX);
154 unsigned int run = 0;
155 auto iov = iovs.front();
157 run = std::get<0>(iov);
160 if (
payload->endcapItems().empty())
164 for (
int iz = -1; iz < 2; iz = iz + 2)
170 uint32_t rawid = myEEId.
rawId();
178 eemap->Fill(ix - 1, iy - 1,
weight);
181 eemap_coarse->Fill(ix - 1, iy - 1);
188 eemap_coarse->Fill(ix +
IX_MAX - 1, iy - 1);
195 gStyle->SetOptStat(0);
197 gStyle->SetFillColor(10);
198 gStyle->SetFrameFillColor(10);
199 gStyle->SetCanvasColor(10);
200 gStyle->SetPadColor(10);
201 gStyle->SetTitleFillColor(0);
202 gStyle->SetStatColor(10);
204 gStyle->SetFrameBorderMode(0);
205 gStyle->SetCanvasBorderMode(0);
206 gStyle->SetPadBorderMode(0);
208 gStyle->SetPalette(1);
210 Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
211 Double_t
red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
212 Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
213 Double_t
blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
214 TColor::CreateGradientColorTable(NRGBs, stops,
red, green,
blue, NCont);
215 gStyle->SetNumberContours(NCont);
223 eetemp->SetBinContent(
i,
j, 2);
224 eetemp->SetBinContent(
i +
IX_MAX,
j, 2);
229 eetemp->SetFillColor(920);
230 TCanvas
c1(
"c1",
"c1", 1200, 600);
237 t1.SetTextSize(0.06);
239 eetemp->GetXaxis()->SetNdivisions(40, kFALSE);
240 eetemp->GetYaxis()->SetNdivisions(20, kFALSE);
241 eetemp->GetXaxis()->SetLabelSize(0.00);
242 eetemp->GetYaxis()->SetLabelSize(0.00);
243 eetemp->GetXaxis()->SetTickLength(0.01);
244 eetemp->GetYaxis()->SetTickLength(0.01);
245 eetemp->SetMaximum(1.15);
247 eemap->GetXaxis()->SetNdivisions(40, kFALSE);
248 eemap->GetYaxis()->SetNdivisions(20, kFALSE);
249 eemap->GetXaxis()->SetLabelSize(0.00);
250 eemap->GetYaxis()->SetLabelSize(0.00);
251 eemap->GetXaxis()->SetTickLength(0.01);
252 eemap->GetYaxis()->SetTickLength(0.01);
253 eemap->SetMaximum(15);
256 eemap->Draw(
"same,colz");
258 eemap_coarse->SetMarkerSize(2);
259 eemap_coarse->Draw(
"same,text");
262 t1.SetTextSize(0.055);
263 t1.DrawLatex(0.5, 0.96, Form(
"EE DQM Channel Status, IOV %i",
run));
266 Double_t prop = (Double_t)eecount /
kEEChannels * 100.;
267 sprintf(txt,
"%d/14648 (%4.3f%%)", eecount, prop);
269 t1.SetTextSize(0.045);
270 t1.DrawLatex(0.5, 0.91, txt);
272 t1.SetTextSize(0.05);
273 t1.DrawLatex(0.14, 0.84,
"EE-");
274 t1.DrawLatex(0.86, 0.84,
"EE+");
277 c1.SaveAs(ImageName.c_str());
285 template <cond::payloadInspector::IOVMultiplicity nIOVs,
int ntags>
288 EcalDQMChannelStatusEBDiffBase()
290 "ECAL Barrel DQM channel status difference") {}
291 bool fill()
override {
297 auto iovs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
298 l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().
name;
299 auto firstiov = iovs.front();
300 run[0] = std::get<0>(firstiov);
301 std::tuple<cond::Time_t, cond::Hash> lastiov;
303 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
304 l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().
name;
305 lastiov = tag2iovs.front();
307 lastiov = iovs.back();
308 l_tagname[1] = l_tagname[0];
310 run[1] = std::get<0>(lastiov);
311 for (
int irun = 0; irun < nIOVs; irun++) {
312 std::shared_ptr<EcalDQMChannelStatus>
payload;
320 if (
payload->barrelItems().empty())
329 status[cellid] = (*payload)[rawid].getStatusCode();
331 unsigned int new_status = (*payload)[rawid].getStatusCode();
332 if (new_status !=
status[cellid]) {
335 if (new_status >
status[cellid])
347 ebmap->Fill(
phi,
eta, 0.05 + 0.95 * (tmp3 > 0));
349 ebmap_coarse->Fill(
phi,
eta, tmp3);
358 gStyle->SetOptStat(0);
360 gStyle->SetFillColor(10);
361 gStyle->SetFrameFillColor(10);
362 gStyle->SetCanvasColor(10);
363 gStyle->SetPadColor(10);
364 gStyle->SetTitleFillColor(0);
365 gStyle->SetStatColor(10);
367 gStyle->SetFrameBorderMode(0);
368 gStyle->SetCanvasBorderMode(0);
369 gStyle->SetPadBorderMode(0);
371 gStyle->SetPalette(1);
373 Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
374 Double_t
red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
375 Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
376 Double_t
blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
377 TColor::CreateGradientColorTable(NRGBs, stops,
red, green,
blue, NCont);
378 gStyle->SetNumberContours(NCont);
380 TCanvas
c1(
"c1",
"c1", 1200, 700);
387 t1.SetTextSize(0.06);
389 ebmap->SetXTitle(
"i#phi");
390 ebmap->SetYTitle(
"i#eta");
391 ebmap->GetXaxis()->SetNdivisions(-418, kFALSE);
392 ebmap->GetYaxis()->SetNdivisions(-1702, kFALSE);
393 ebmap->GetXaxis()->SetLabelSize(0.03);
394 ebmap->GetYaxis()->SetLabelSize(0.03);
395 ebmap->GetXaxis()->SetTickLength(0.01);
396 ebmap->GetYaxis()->SetTickLength(0.01);
397 ebmap->SetMaximum(1.15);
402 ebmap_coarse->SetMarkerSize(1.3);
403 ebmap_coarse->Draw(
"text,same");
405 int len = l_tagname[0].length() + l_tagname[1].length();
406 if (ntags == 2 && len < 58) {
407 t1.SetTextSize(0.025);
409 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]));
411 t1.SetTextSize(0.05);
412 t1.DrawLatex(0.5, 0.96, Form(
"EB DQM Channel Status (Diff), IOV: %i vs %i",
run[0],
run[1]));
415 sprintf(txt,
"Net difference: %d channel(s)", ebcount);
417 t1.SetTextSize(0.045);
418 t1.DrawLatex(0.5, 0.91, txt);
421 c1.SaveAs(ImageName.c_str());
425 using EcalDQMChannelStatusEBDiffOneTag = EcalDQMChannelStatusEBDiffBase<cond::payloadInspector::SINGLE_IOV, 1>;
426 using EcalDQMChannelStatusEBDiffTwoTags = EcalDQMChannelStatusEBDiffBase<cond::payloadInspector::SINGLE_IOV, 2>;
431 template <cond::payloadInspector::IOVMultiplicity nIOVs,
int ntags>
434 EcalDQMChannelStatusEEDiffBase()
436 "ECAL Endcaps DQM channel status difference") {}
438 bool fill()
override {
440 TH2F *eemap_coarse =
new TH2F(
"eemap_coarse",
"", 2, 0, 2 *
IX_MAX, 1, 0,
IY_MAX);
445 auto iovs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
446 l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().
name;
447 auto firstiov = iovs.front();
448 run[0] = std::get<0>(firstiov);
449 std::tuple<cond::Time_t, cond::Hash> lastiov;
451 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
452 l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().
name;
453 lastiov = tag2iovs.front();
455 lastiov = iovs.back();
456 l_tagname[1] = l_tagname[0];
458 run[1] = std::get<0>(lastiov);
459 for (
int irun = 0; irun < nIOVs; irun++) {
460 std::shared_ptr<EcalDQMChannelStatus>
payload;
467 if (
payload->endcapItems().empty())
471 for (
int iz = -1; iz < 2; iz = iz + 2)
476 uint32_t rawid = myEEId.
rawId();
483 status[channel] = (*payload)[rawid].getStatusCode();
485 unsigned int new_status = (*payload)[rawid].getStatusCode();
486 if (new_status !=
status[channel]) {
488 if (new_status >
status[channel])
494 eemap->Fill(ix - 1, iy - 1, 0.05 + 0.95 * (tmp3 > 0));
496 eemap_coarse->Fill(ix - 1, iy - 1, tmp3);
498 eemap->Fill(ix +
IX_MAX - 1, iy - 1, 0.05 + 0.95 * (tmp3 > 0));
500 eemap_coarse->Fill(ix +
IX_MAX - 1, iy - 1, tmp3);
508 gStyle->SetOptStat(0);
510 gStyle->SetFillColor(10);
511 gStyle->SetFrameFillColor(10);
512 gStyle->SetCanvasColor(10);
513 gStyle->SetPadColor(10);
514 gStyle->SetTitleFillColor(0);
515 gStyle->SetStatColor(10);
517 gStyle->SetFrameBorderMode(0);
518 gStyle->SetCanvasBorderMode(0);
519 gStyle->SetPadBorderMode(0);
521 gStyle->SetPalette(1);
523 Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
524 Double_t
red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
525 Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
526 Double_t
blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
527 TColor::CreateGradientColorTable(NRGBs, stops,
red, green,
blue, NCont);
528 gStyle->SetNumberContours(NCont);
534 eetemp->SetBinContent(
i,
j, 2);
535 eetemp->SetBinContent(
i +
IX_MAX,
j, 2);
540 eetemp->SetFillColor(920);
541 TCanvas
c1(
"c1",
"c1", 1200, 600);
548 t1.SetTextSize(0.06);
550 eetemp->GetXaxis()->SetNdivisions(40, kFALSE);
551 eetemp->GetYaxis()->SetNdivisions(20, kFALSE);
552 eetemp->GetXaxis()->SetLabelSize(0.00);
553 eetemp->GetYaxis()->SetLabelSize(0.00);
554 eetemp->GetXaxis()->SetTickLength(0.01);
555 eetemp->GetYaxis()->SetTickLength(0.01);
556 eetemp->SetMaximum(1.15);
558 eemap->GetXaxis()->SetNdivisions(40, kFALSE);
559 eemap->GetYaxis()->SetNdivisions(20, kFALSE);
560 eemap->GetXaxis()->SetLabelSize(0.00);
561 eemap->GetYaxis()->SetLabelSize(0.00);
562 eemap->GetXaxis()->SetTickLength(0.01);
563 eemap->GetYaxis()->SetTickLength(0.01);
564 eemap->SetMaximum(1.15);
567 eemap->Draw(
"same,colz");
569 eemap_coarse->SetMarkerSize(2);
570 eemap_coarse->Draw(
"same,text");
573 int len = l_tagname[0].length() + l_tagname[1].length();
574 if (ntags == 2 && len < 58) {
575 t1.SetTextSize(0.025);
577 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]));
579 t1.SetTextSize(0.055);
580 t1.DrawLatex(0.5, 0.96, Form(
"EE DQM Channel Status (Diff), IOV %i vs %i",
run[0],
run[1]));
583 sprintf(txt,
"Net difference: %d channel(s)", eecount);
585 t1.SetTextSize(0.045);
586 t1.DrawLatex(0.5, 0.91, txt);
588 t1.SetTextSize(0.05);
589 t1.DrawLatex(0.14, 0.84,
"EE-");
590 t1.DrawLatex(0.86, 0.84,
"EE+");
593 c1.SaveAs(ImageName.c_str());
597 using EcalDQMChannelStatusEEDiffOneTag = EcalDQMChannelStatusEEDiffBase<cond::payloadInspector::SINGLE_IOV, 1>;
598 using EcalDQMChannelStatusEEDiffTwoTags = EcalDQMChannelStatusEEDiffBase<cond::payloadInspector::SINGLE_IOV, 2>;
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
static const int MIN_HASH
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
constexpr uint32_t rawId() const
get the raw id
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)