30 EcalChannelStatusEBMap() :
cond::payloadInspector::PlotImage<
EcalChannelStatus>(
"ECAL Barrel channel status") {
33 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> > &iovs)
override {
39 auto iov = iovs.front();
41 run = std::get<0>(iov);
44 if (
payload->barrelItems().empty())
52 Double_t
weight = (Double_t)(*
payload)[rawid].getEncodedStatusCode();
62 ebmap_coarse->Fill(
phi,
eta);
69 gStyle->SetOptStat(0);
71 gStyle->SetFillColor(10);
72 gStyle->SetFrameFillColor(10);
73 gStyle->SetCanvasColor(10);
74 gStyle->SetPadColor(10);
75 gStyle->SetTitleFillColor(0);
76 gStyle->SetStatColor(10);
78 gStyle->SetFrameBorderMode(0);
79 gStyle->SetCanvasBorderMode(0);
80 gStyle->SetPadBorderMode(0);
82 gStyle->SetPalette(1);
84 Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
85 Double_t
red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
86 Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
87 Double_t
blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
88 TColor::CreateGradientColorTable(NRGBs, stops,
red, green,
blue, NCont);
89 gStyle->SetNumberContours(NCont);
91 TCanvas
c1(
"c1",
"c1", 1200, 700);
100 ebmap->SetXTitle(
"i#phi");
101 ebmap->SetYTitle(
"i#eta");
102 ebmap->GetXaxis()->SetNdivisions(-418, kFALSE);
103 ebmap->GetYaxis()->SetNdivisions(-1702, kFALSE);
104 ebmap->GetXaxis()->SetLabelSize(0.03);
105 ebmap->GetYaxis()->SetLabelSize(0.03);
106 ebmap->GetXaxis()->SetTickLength(0.01);
107 ebmap->GetYaxis()->SetTickLength(0.01);
108 ebmap->SetMaximum(15);
113 ebmap_coarse->SetMarkerSize(1.3);
114 ebmap_coarse->Draw(
"text,same");
116 t1.SetTextSize(0.05);
117 t1.DrawLatex(0.5, 0.96, Form(
"EB Channel Status Masks, IOV %i",
run));
120 Double_t prop = (Double_t)ebcount /
kEBChannels * 100.;
121 sprintf(txt,
"%d/61200 (%4.3f%%)", ebcount, prop);
123 t1.SetTextSize(0.045);
124 t1.DrawLatex(0.5, 0.91, txt);
127 c1.SaveAs(ImageName.c_str());
137 EcalChannelStatusEEMap() :
cond::payloadInspector::PlotImage<
EcalChannelStatus>(
"ECAL Barrel channel status") {
140 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> > &iovs)
override {
143 TH2F *eemap_coarse =
new TH2F(
"eemap_coarse",
"", 2, 0, 2 *
IX_MAX, 1, 0,
IY_MAX);
146 unsigned int run = 0;
147 auto iov = iovs.front();
149 run = std::get<0>(iov);
151 if (
payload->endcapItems().empty())
155 for (
int iz = -1; iz < 2; iz = iz + 2)
160 uint32_t rawid = myEEId.
rawId();
171 eemap_coarse->Fill(
ix - 1,
iy - 1);
184 gStyle->SetOptStat(0);
186 gStyle->SetFillColor(10);
187 gStyle->SetFrameFillColor(10);
188 gStyle->SetCanvasColor(10);
189 gStyle->SetPadColor(10);
190 gStyle->SetTitleFillColor(0);
191 gStyle->SetStatColor(10);
193 gStyle->SetFrameBorderMode(0);
194 gStyle->SetCanvasBorderMode(0);
195 gStyle->SetPadBorderMode(0);
197 gStyle->SetPalette(1);
199 Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
200 Double_t
red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
201 Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
202 Double_t
blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
203 TColor::CreateGradientColorTable(NRGBs, stops,
red, green,
blue, NCont);
204 gStyle->SetNumberContours(NCont);
212 eetemp->SetBinContent(
i,
j, 2);
213 eetemp->SetBinContent(
i +
IX_MAX,
j, 2);
218 eetemp->SetFillColor(920);
219 TCanvas
c1(
"c1",
"c1", 1200, 600);
226 t1.SetTextSize(0.06);
228 eetemp->GetXaxis()->SetNdivisions(40, kFALSE);
229 eetemp->GetYaxis()->SetNdivisions(20, kFALSE);
230 eetemp->GetXaxis()->SetLabelSize(0.00);
231 eetemp->GetYaxis()->SetLabelSize(0.00);
232 eetemp->GetXaxis()->SetTickLength(0.01);
233 eetemp->GetYaxis()->SetTickLength(0.01);
234 eetemp->SetMaximum(1.15);
236 eemap->GetXaxis()->SetNdivisions(40, kFALSE);
237 eemap->GetYaxis()->SetNdivisions(20, kFALSE);
238 eemap->GetXaxis()->SetLabelSize(0.00);
239 eemap->GetYaxis()->SetLabelSize(0.00);
240 eemap->GetXaxis()->SetTickLength(0.01);
241 eemap->GetYaxis()->SetTickLength(0.01);
242 eemap->SetMaximum(15);
245 eemap->Draw(
"same,colz");
247 eemap_coarse->SetMarkerSize(2);
248 eemap_coarse->Draw(
"same,text");
251 t1.SetTextSize(0.055);
252 t1.DrawLatex(0.5, 0.96, Form(
"EE Channel Status Masks, IOV %i",
run));
255 Double_t prop = (Double_t)eecount /
kEEChannels * 100.;
256 sprintf(txt,
"%d/14648 (%4.3f%%)", eecount, prop);
258 t1.SetTextSize(0.045);
259 t1.DrawLatex(0.5, 0.91, txt);
261 t1.SetTextSize(0.05);
262 t1.DrawLatex(0.14, 0.84,
"EE-");
263 t1.DrawLatex(0.86, 0.84,
"EE+");
266 c1.SaveAs(ImageName.c_str());
274 template <cond::payloadInspector::IOVMultiplicity nIOVs,
int ntags>
277 EcalChannelStatusEBDiffBase()
278 :
cond::payloadInspector::PlotImage<
EcalChannelStatus, nIOVs, ntags>(
"ECAL Barrel channel status difference") {}
279 bool fill()
override {
285 auto iovs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
286 l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().
name;
287 auto firstiov = iovs.front();
288 run[0] = std::get<0>(firstiov);
289 std::tuple<cond::Time_t, cond::Hash> lastiov;
291 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
292 l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().
name;
293 lastiov = tag2iovs.front();
295 lastiov = iovs.back();
296 l_tagname[1] = l_tagname[0];
298 run[1] = std::get<0>(lastiov);
299 for (
int irun = 0; irun < nIOVs; irun++) {
300 std::shared_ptr<EcalChannelStatus>
payload;
308 if (
payload->barrelItems().empty())
317 status[cellid] = (*payload)[rawid].getEncodedStatusCode();
319 unsigned int new_status = (*payload)[rawid].getEncodedStatusCode();
320 if (new_status !=
status[cellid]) {
322 if (new_status >
status[cellid])
332 ebmap->Fill(
phi,
eta, 0.05 + 0.95 * (tmp3 > 0));
334 ebmap_coarse->Fill(
phi,
eta, tmp3);
343 gStyle->SetOptStat(0);
345 gStyle->SetFillColor(10);
346 gStyle->SetFrameFillColor(10);
347 gStyle->SetCanvasColor(10);
348 gStyle->SetPadColor(10);
349 gStyle->SetTitleFillColor(0);
350 gStyle->SetStatColor(10);
352 gStyle->SetFrameBorderMode(0);
353 gStyle->SetCanvasBorderMode(0);
354 gStyle->SetPadBorderMode(0);
356 gStyle->SetPalette(1);
358 Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
359 Double_t
red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
360 Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
361 Double_t
blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
362 TColor::CreateGradientColorTable(NRGBs, stops,
red, green,
blue, NCont);
363 gStyle->SetNumberContours(NCont);
365 TCanvas
c1(
"c1",
"c1", 1200, 700);
372 t1.SetTextSize(0.06);
374 ebmap->SetXTitle(
"i#phi");
375 ebmap->SetYTitle(
"i#eta");
376 ebmap->GetXaxis()->SetNdivisions(-418, kFALSE);
377 ebmap->GetYaxis()->SetNdivisions(-1702, kFALSE);
378 ebmap->GetXaxis()->SetLabelSize(0.03);
379 ebmap->GetYaxis()->SetLabelSize(0.03);
380 ebmap->GetXaxis()->SetTickLength(0.01);
381 ebmap->GetYaxis()->SetTickLength(0.01);
382 ebmap->SetMaximum(1.15);
387 ebmap_coarse->SetMarkerSize(1.3);
388 ebmap_coarse->Draw(
"text,same");
390 int len = l_tagname[0].length() + l_tagname[1].length();
393 t1.SetTextSize(0.03);
395 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]));
397 t1.SetTextSize(0.05);
398 t1.DrawLatex(0.5, 0.96, Form(
"EB Channel Status Masks (Diff), IOV %i - IOV %i",
run[1],
run[0]));
400 t1.SetTextSize(0.05);
401 t1.DrawLatex(0.5, 0.96, Form(
"%s IOV: %i - %i", l_tagname[0].c_str(),
run[1],
run[0]));
405 sprintf(txt,
"Net difference: %d channel(s)", ebcount);
407 t1.SetTextSize(0.045);
408 t1.DrawLatex(0.5, 0.91, txt);
411 c1.SaveAs(ImageName.c_str());
415 using EcalChannelStatusEBDiffOneTag = EcalChannelStatusEBDiffBase<cond::payloadInspector::SINGLE_IOV, 1>;
416 using EcalChannelStatusEBDiffTwoTags = EcalChannelStatusEBDiffBase<cond::payloadInspector::SINGLE_IOV, 2>;
421 template <cond::payloadInspector::IOVMultiplicity nIOVs,
int ntags>
424 EcalChannelStatusEEDiffBase()
425 :
cond::payloadInspector::PlotImage<
EcalChannelStatus, nIOVs, ntags>(
"ECAL Endcaps channel status difference") {
427 bool fill()
override {
429 TH2F *eemap_coarse =
new TH2F(
"eemap_coarse",
"", 2, 0, 2 *
IX_MAX, 1, 0,
IY_MAX);
434 auto iovs = cond::payloadInspector::PlotBase::getTag<0>().iovs;
435 l_tagname[0] = cond::payloadInspector::PlotBase::getTag<0>().
name;
436 auto firstiov = iovs.front();
437 run[0] = std::get<0>(firstiov);
438 std::tuple<cond::Time_t, cond::Hash> lastiov;
440 auto tag2iovs = cond::payloadInspector::PlotBase::getTag<1>().iovs;
441 l_tagname[1] = cond::payloadInspector::PlotBase::getTag<1>().
name;
442 lastiov = tag2iovs.front();
443 lastiov = tag2iovs.front();
445 lastiov = iovs.back();
446 l_tagname[1] = l_tagname[0];
448 run[1] = std::get<0>(lastiov);
449 for (
int irun = 0; irun < nIOVs; irun++) {
450 std::shared_ptr<EcalChannelStatus>
payload;
457 if (
payload->endcapItems().empty())
461 for (
int iz = -1; iz < 2; iz = iz + 2)
466 uint32_t rawid = myEEId.
rawId();
472 status[channel] = (*payload)[rawid].getEncodedStatusCode();
474 unsigned int new_status = (*payload)[rawid].getEncodedStatusCode();
475 if (new_status !=
status[channel]) {
477 if (new_status >
status[channel])
482 eemap->Fill(
ix - 1,
iy - 1, 0.05 + 0.95 * (tmp3 > 0));
484 eemap_coarse->Fill(
ix - 1,
iy - 1, tmp3);
486 eemap->Fill(
ix +
IX_MAX - 1,
iy - 1, 0.05 + 0.95 * (tmp3 > 0));
488 eemap_coarse->Fill(
ix +
IX_MAX - 1,
iy - 1, tmp3);
496 gStyle->SetOptStat(0);
498 gStyle->SetFillColor(10);
499 gStyle->SetFrameFillColor(10);
500 gStyle->SetCanvasColor(10);
501 gStyle->SetPadColor(10);
502 gStyle->SetTitleFillColor(0);
503 gStyle->SetStatColor(10);
505 gStyle->SetFrameBorderMode(0);
506 gStyle->SetCanvasBorderMode(0);
507 gStyle->SetPadBorderMode(0);
509 gStyle->SetPalette(1);
511 Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
512 Double_t
red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
513 Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
514 Double_t
blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
515 TColor::CreateGradientColorTable(NRGBs, stops,
red, green,
blue, NCont);
516 gStyle->SetNumberContours(NCont);
522 eetemp->SetBinContent(
i,
j, 2);
523 eetemp->SetBinContent(
i +
IX_MAX,
j, 2);
528 eetemp->SetFillColor(920);
529 TCanvas
c1(
"c1",
"c1", 1200, 600);
536 t1.SetTextSize(0.06);
538 eetemp->GetXaxis()->SetNdivisions(40, kFALSE);
539 eetemp->GetYaxis()->SetNdivisions(20, kFALSE);
540 eetemp->GetXaxis()->SetLabelSize(0.00);
541 eetemp->GetYaxis()->SetLabelSize(0.00);
542 eetemp->GetXaxis()->SetTickLength(0.01);
543 eetemp->GetYaxis()->SetTickLength(0.01);
544 eetemp->SetMaximum(1.15);
546 eemap->GetXaxis()->SetNdivisions(40, kFALSE);
547 eemap->GetYaxis()->SetNdivisions(20, kFALSE);
548 eemap->GetXaxis()->SetLabelSize(0.00);
549 eemap->GetYaxis()->SetLabelSize(0.00);
550 eemap->GetXaxis()->SetTickLength(0.01);
551 eemap->GetYaxis()->SetTickLength(0.01);
552 eemap->SetMaximum(1.15);
555 eemap->Draw(
"same,colz");
557 eemap_coarse->SetMarkerSize(2);
558 eemap_coarse->Draw(
"same,text");
561 int len = l_tagname[0].length() + l_tagname[1].length();
564 t1.SetTextSize(0.03);
566 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]));
568 t1.SetTextSize(0.05);
569 t1.DrawLatex(0.5, 0.96, Form(
"EE Channel Status Masks (Diff), IOV %i - IOV %i",
run[1],
run[0]));
572 t1.SetTextSize(0.05);
573 t1.DrawLatex(0.5, 0.96, Form(
"%s IOV: %i - %i", l_tagname[0].c_str(),
run[1],
run[0]));
577 sprintf(txt,
"Net difference: %d channel(s)", eecount);
579 t1.SetTextSize(0.045);
580 t1.DrawLatex(0.5, 0.91, txt);
582 t1.SetTextSize(0.05);
583 t1.DrawLatex(0.14, 0.84,
"EE-");
584 t1.DrawLatex(0.86, 0.84,
"EE+");
587 c1.SaveAs(ImageName.c_str());
591 using EcalChannelStatusEEDiffOneTag = EcalChannelStatusEEDiffBase<cond::payloadInspector::SINGLE_IOV, 1>;
592 using EcalChannelStatusEEDiffTwoTags = EcalChannelStatusEEDiffBase<cond::payloadInspector::SINGLE_IOV, 2>;
599 EcalChannelStatusSummaryPlot()
604 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> > &iovs)
override {
605 auto iov = iovs.front();
606 std::shared_ptr<EcalChannelStatus>
payload =
608 unsigned int run = std::get<0>(iov);
616 align =
new TH2F(
"Ecal Channel Status Error Summary",
617 "EB/EE-/EE+ ErrorCount Total Number",
625 long unsigned int ebErrorCount = 0;
626 long unsigned int ee1ErrorCount = 0;
627 long unsigned int ee2ErrorCount = 0;
629 long unsigned int ebTotal = (
payload->barrelItems()).
size();
630 long unsigned int ee1Total = 0;
631 long unsigned int ee2Total = 0;
633 getBarrelErrorSummary<EcalChannelStatusCode>(
payload->barrelItems(), ebErrorCount);
634 getEndCapErrorSummary<EcalChannelStatusCode>(
635 payload->endcapItems(), ee1ErrorCount, ee2ErrorCount, ee1Total, ee2Total);
637 double row = NbRows - 0.5;
640 align->Fill(0.5, row, 1);
641 align->Fill(1.5, row, ebErrorCount);
642 align->Fill(2.5, row, ebTotal);
646 align->Fill(0.5, row, 2);
647 align->Fill(1.5, row, ee1ErrorCount);
648 align->Fill(2.5, row, ee1Total);
652 align->Fill(0.5, row, 3);
653 align->Fill(1.5, row, ee2ErrorCount);
654 align->Fill(2.5, row, ee2Total);
660 gStyle->SetPalette(1);
661 gStyle->SetOptStat(0);
662 TCanvas
canvas(
"CC map",
"CC map", 1000, 1000);
666 t1.SetTextSize(0.045);
668 t1.DrawLatex(0.5, 0.96, Form(
"EcalChannelStatus Error Summary, IOV %i",
run));
670 TPad *pad =
new TPad(
"pad",
"pad", 0.0, 0.0, 1.0, 0.94);
677 align->GetXaxis()->SetTickLength(0.);
678 align->GetXaxis()->SetLabelSize(0.);
679 align->GetYaxis()->SetTickLength(0.);
680 align->GetYaxis()->SetLabelSize(0.);
683 canvas.SaveAs(ImageName.c_str());
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
static const int MIN_HASH
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
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
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
void drawTable(int nbRows, int nbColumns)
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)