33 EcalChannelStatusEBMap() :
cond::payloadInspector::PlotImage<
EcalChannelStatus>(
"ECAL Barrel channel status") {
36 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
43 auto iov = iovs.front();
45 run = std::get<0>(iov);
48 if (payload->barrelItems().empty())
return false;
54 if (payload->find(rawid) == payload->end())
continue;
56 Double_t
weight = (Double_t)(*payload)[rawid].getEncodedStatusCode();
57 Double_t
phi = (Double_t)(
EBDetId(rawid)).iphi() - 0.5;
58 Double_t
eta = (Double_t)(
EBDetId(rawid)).ieta();
59 if(eta > 0.) eta = eta - 0.5;
61 ebmap->Fill(phi, eta, weight);
64 ebmap_coarse->Fill(phi, eta);
70 gStyle->SetOptStat(0);
72 gStyle->SetFillColor(10);
73 gStyle->SetFrameFillColor(10);
74 gStyle->SetCanvasColor(10);
75 gStyle->SetPadColor(10);
76 gStyle->SetTitleFillColor(0);
77 gStyle->SetStatColor(10);
79 gStyle->SetFrameBorderMode(0);
80 gStyle->SetCanvasBorderMode(0);
81 gStyle->SetPadBorderMode(0);
83 gStyle->SetPalette(1);
85 Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
86 Double_t
red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
87 Double_t
green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
88 Double_t
blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
89 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
90 gStyle->SetNumberContours(NCont);
92 TCanvas
c1(
"c1",
"c1", 1200, 700);
101 ebmap->SetXTitle(
"i#phi");
102 ebmap->SetYTitle(
"i#eta");
103 ebmap->GetXaxis()->SetNdivisions(-418,kFALSE);
104 ebmap->GetYaxis()->SetNdivisions(-1702,kFALSE);
105 ebmap->GetXaxis()->SetLabelSize(0.03);
106 ebmap->GetYaxis()->SetLabelSize(0.03);
107 ebmap->GetXaxis()->SetTickLength(0.01);
108 ebmap->GetYaxis()->SetTickLength(0.01);
109 ebmap->SetMaximum(15);
114 ebmap_coarse->SetMarkerSize(1.3);
115 ebmap_coarse->Draw(
"text,same");
117 t1.SetTextSize(0.05);
118 t1.DrawLatex(0.5, 0.96, Form(
"EB Channel Status Masks, IOV %i", run));
121 Double_t prop = (Double_t)ebcount/
kEBChannels*100.;
122 sprintf(txt,
"%d/61200 (%4.3f%%)",ebcount, prop);
124 t1.SetTextSize(0.045);
125 t1.DrawLatex(0.5, 0.91, txt);
128 c1.SaveAs(ImageName.c_str());
139 EcalChannelStatusEEMap() :
cond::payloadInspector::PlotImage<
EcalChannelStatus>(
"ECAL Barrel channel status") {
140 setSingleIov(
true );
142 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
146 TH2F *eemap_coarse =
new TH2F(
"eemap_coarse",
"", 2, 0, 2*
IX_MAX, 1, 0,
IY_MAX);
149 unsigned int run = 0;
150 auto iov = iovs.front();
151 std::shared_ptr<EcalChannelStatus> payload = fetchPayload( std::get<1>(iov) );
152 run = std::get<0>(iov);
154 if (payload->endcapItems().empty())
return false;
157 for(
int iz = -1; iz < 2; iz = iz + 2)
162 uint32_t rawid = myEEId.
rawId();
164 if (payload->find(rawid) == payload->end())
continue;
166 float weight = (
float)(*payload)[rawid].getEncodedStatusCode();
169 eemap->Fill(ix -1, iy -1, weight);
172 eemap_coarse->Fill(ix -1, iy -1);
177 eemap->Fill(ix +
IX_MAX -1, iy -1, weight);
180 eemap_coarse->Fill(ix +
IX_MAX -1, iy -1);
186 gStyle->SetOptStat(0);
188 gStyle->SetFillColor(10);
189 gStyle->SetFrameFillColor(10);
190 gStyle->SetCanvasColor(10);
191 gStyle->SetPadColor(10);
192 gStyle->SetTitleFillColor(0);
193 gStyle->SetStatColor(10);
195 gStyle->SetFrameBorderMode(0);
196 gStyle->SetCanvasBorderMode(0);
197 gStyle->SetPadBorderMode(0);
199 gStyle->SetPalette(1);
201 Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
202 Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
203 Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
204 Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
205 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
206 gStyle->SetNumberContours(NCont);
210 for (Int_t j = 1; j <=
IY_MAX; j++) {
214 eetemp->SetBinContent(
i, j, 2);
215 eetemp->SetBinContent(
i +
IX_MAX, j, 2);
220 eetemp->SetFillColor(920);
221 TCanvas
c1(
"c1",
"c1", 1200, 600);
228 t1.SetTextSize(0.06);
230 eetemp->GetXaxis()->SetNdivisions(40,kFALSE);
231 eetemp->GetYaxis()->SetNdivisions(20,kFALSE);
232 eetemp->GetXaxis()->SetLabelSize(0.00);
233 eetemp->GetYaxis()->SetLabelSize(0.00);
234 eetemp->GetXaxis()->SetTickLength(0.01);
235 eetemp->GetYaxis()->SetTickLength(0.01);
236 eetemp->SetMaximum(1.15);
238 eemap->GetXaxis()->SetNdivisions(40,kFALSE);
239 eemap->GetYaxis()->SetNdivisions(20,kFALSE);
240 eemap->GetXaxis()->SetLabelSize(0.00);
241 eemap->GetYaxis()->SetLabelSize(0.00);
242 eemap->GetXaxis()->SetTickLength(0.01);
243 eemap->GetYaxis()->SetTickLength(0.01);
244 eemap->SetMaximum(15);
247 eemap->Draw(
"same,colz");
249 eemap_coarse->SetMarkerSize(2);
250 eemap_coarse->Draw(
"same,text");
253 t1.SetTextSize(0.055);
254 t1.DrawLatex(0.5, 0.96, Form(
"EE Channel Status Masks, IOV %i", run));
257 Double_t prop = (Double_t)eecount/
kEEChannels*100.;
258 sprintf(txt,
"%d/14648 (%4.3f%%)",eecount, prop);
260 t1.SetTextSize(0.045);
261 t1.DrawLatex(0.5, 0.91, txt);
263 t1.SetTextSize(0.05);
264 t1.DrawLatex(0.14, 0.84,
"EE-");
265 t1.DrawLatex(0.86, 0.84,
"EE+");
268 c1.SaveAs(ImageName.c_str());
279 EcalChannelStatusEBDiff() :
cond::payloadInspector::PlotImage<
EcalChannelStatus>(
"ECAL Barrel channel status difference") {
282 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
288 for (
auto const & iov: iovs) {
289 std::shared_ptr<EcalChannelStatus> payload = fetchPayload( std::get<1>(iov) );
292 if (payload->barrelItems().empty())
return false;
293 run[irun] = std::get<0>(iov);
299 if (payload->find(rawid) == payload->end())
continue;
302 status[cellid] = (*payload)[rawid].getEncodedStatusCode();
305 unsigned int new_status = (*payload)[rawid].getEncodedStatusCode();
306 if(new_status !=
status[cellid]) {
308 if (new_status >
status[cellid]) tmp3 = 1;
310 Double_t phi = (Double_t)(
EBDetId(rawid)).iphi() - 0.5;
311 Double_t eta = (Double_t)(
EBDetId(rawid)).ieta();
312 if(eta > 0.) eta = eta - 0.5;
313 else eta = eta + 0.5;
314 ebmap->Fill(phi, eta, 0.05 + 0.95 * (tmp3>0));
316 ebmap_coarse->Fill(phi, eta, tmp3);
325 gStyle->SetOptStat(0);
327 gStyle->SetFillColor(10);
328 gStyle->SetFrameFillColor(10);
329 gStyle->SetCanvasColor(10);
330 gStyle->SetPadColor(10);
331 gStyle->SetTitleFillColor(0);
332 gStyle->SetStatColor(10);
334 gStyle->SetFrameBorderMode(0);
335 gStyle->SetCanvasBorderMode(0);
336 gStyle->SetPadBorderMode(0);
338 gStyle->SetPalette(1);
340 Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
341 Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
342 Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
343 Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
344 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
345 gStyle->SetNumberContours(NCont);
347 TCanvas
c1(
"c1",
"c1", 1200, 700);
354 t1.SetTextSize(0.06);
356 ebmap->SetXTitle(
"i#phi");
357 ebmap->SetYTitle(
"i#eta");
358 ebmap->GetXaxis()->SetNdivisions(-418,kFALSE);
359 ebmap->GetYaxis()->SetNdivisions(-1702,kFALSE);
360 ebmap->GetXaxis()->SetLabelSize(0.03);
361 ebmap->GetYaxis()->SetLabelSize(0.03);
362 ebmap->GetXaxis()->SetTickLength(0.01);
363 ebmap->GetYaxis()->SetTickLength(0.01);
364 ebmap->SetMaximum(1.15);
369 ebmap_coarse->SetMarkerSize(1.3);
370 ebmap_coarse->Draw(
"text,same");
372 t1.SetTextSize(0.05);
373 t1.DrawLatex(0.5, 0.96, Form(
"EB Channel Status Masks (Diff), IOV: %i vs %i", run[0], run[1]));
376 sprintf(txt,
"Net difference: %d channel(s)",ebcount);
378 t1.SetTextSize(0.045);
379 t1.DrawLatex(0.5, 0.91, txt);
382 c1.SaveAs(ImageName.c_str());
393 EcalChannelStatusEEDiff() :
cond::payloadInspector::PlotImage<
EcalChannelStatus>(
"ECAL Endcaps channel status difference") {
394 setSingleIov(
true );
396 bool fill(
const std::vector<std::tuple<cond::Time_t,cond::Hash> >& iovs )
override{
399 TH2F *eemap_coarse =
new TH2F(
"eemap_coarse",
"", 2, 0, 2*
IX_MAX, 1, 0,
IY_MAX);
403 for (
auto const & iov: iovs) {
404 std::shared_ptr<EcalChannelStatus> payload = fetchPayload( std::get<1>(iov) );
405 run[irun] = std::get<0>(iov);
407 if (payload->endcapItems().empty())
return false;
410 for(
int iz = -1; iz < 2; iz = iz + 2)
415 uint32_t rawid = myEEId.
rawId();
418 if (payload->find(rawid) == payload->end())
continue;
420 status[channel] = (*payload)[rawid].getEncodedStatusCode();
423 unsigned int new_status = (*payload)[rawid].getEncodedStatusCode();
424 if(new_status !=
status[channel]) {
426 if (new_status >
status[channel]) tmp3 = 1;
429 eemap->Fill(ix -1, iy -1, 0.05 + 0.95 * (tmp3>0));
431 eemap_coarse->Fill(ix -1, iy -1, tmp3);
434 eemap->Fill(ix +
IX_MAX -1, iy -1, 0.05 + 0.95 * (tmp3>0));
436 eemap_coarse->Fill(ix +
IX_MAX -1, iy -1, tmp3);
445 gStyle->SetOptStat(0);
447 gStyle->SetFillColor(10);
448 gStyle->SetFrameFillColor(10);
449 gStyle->SetCanvasColor(10);
450 gStyle->SetPadColor(10);
451 gStyle->SetTitleFillColor(0);
452 gStyle->SetStatColor(10);
454 gStyle->SetFrameBorderMode(0);
455 gStyle->SetCanvasBorderMode(0);
456 gStyle->SetPadBorderMode(0);
458 gStyle->SetPalette(1);
460 Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
461 Double_t red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
462 Double_t green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
463 Double_t blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
464 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
465 gStyle->SetNumberContours(NCont);
469 for (Int_t j = 1; j <=
IY_MAX; j++) {
471 eetemp->SetBinContent(
i, j, 2);
472 eetemp->SetBinContent(
i +
IX_MAX, j, 2);
477 eetemp->SetFillColor(920);
478 TCanvas
c1(
"c1",
"c1", 1200, 600);
485 t1.SetTextSize(0.06);
487 eetemp->GetXaxis()->SetNdivisions(40,kFALSE);
488 eetemp->GetYaxis()->SetNdivisions(20,kFALSE);
489 eetemp->GetXaxis()->SetLabelSize(0.00);
490 eetemp->GetYaxis()->SetLabelSize(0.00);
491 eetemp->GetXaxis()->SetTickLength(0.01);
492 eetemp->GetYaxis()->SetTickLength(0.01);
493 eetemp->SetMaximum(1.15);
495 eemap->GetXaxis()->SetNdivisions(40,kFALSE);
496 eemap->GetYaxis()->SetNdivisions(20,kFALSE);
497 eemap->GetXaxis()->SetLabelSize(0.00);
498 eemap->GetYaxis()->SetLabelSize(0.00);
499 eemap->GetXaxis()->SetTickLength(0.01);
500 eemap->GetYaxis()->SetTickLength(0.01);
501 eemap->SetMaximum(1.15);
504 eemap->Draw(
"same,colz");
506 eemap_coarse->SetMarkerSize(2);
507 eemap_coarse->Draw(
"same,text");
510 t1.SetTextSize(0.055);
511 t1.DrawLatex(0.5, 0.96, Form(
"EE Channel Status Masks (Diff), IOV %i vs %i", run[0], run[1]));
514 sprintf(txt,
"Net difference: %d channel(s)",eecount);
516 t1.SetTextSize(0.045);
517 t1.DrawLatex(0.5, 0.91, txt);
519 t1.SetTextSize(0.05);
520 t1.DrawLatex(0.14, 0.84,
"EE-");
521 t1.DrawLatex(0.86, 0.84,
"EE+");
524 c1.SaveAs(ImageName.c_str());
535 EcalChannelStatusSummaryPlot() :
540 bool fill(
const std::vector<std::tuple<cond::Time_t, cond::Hash> >& iovs)
override {
542 auto iov = iovs.front();
543 std::shared_ptr < EcalChannelStatus > payload = fetchPayload(std::get < 1 > (iov));
544 unsigned int run = std::get < 0 > (iov);
552 align =
new TH2F(
"Ecal Channel Status Error Summary",
"EB/EE-/EE+ ErrorCount Total Number",NbColumns, 0, NbColumns, NbRows, 0, NbRows);
554 long unsigned int ebErrorCount=0;
555 long unsigned int ee1ErrorCount=0;
556 long unsigned int ee2ErrorCount=0;
558 long unsigned int ebTotal=(payload->barrelItems()).
size();
559 long unsigned int ee1Total=0;
560 long unsigned int ee2Total=0;
562 getBarrelErrorSummary<EcalChannelStatusCode>(payload->barrelItems(),ebErrorCount);
563 getEndCapErrorSummary<EcalChannelStatusCode>(payload->endcapItems(),ee1ErrorCount,ee2ErrorCount,ee1Total,ee2Total);
566 double row = NbRows - 0.5;
569 align->Fill(0.5, row, 1);
570 align->Fill(1.5, row, ebErrorCount);
571 align->Fill(2.5, row, ebTotal);
575 align->Fill(0.5, row, 2);
576 align->Fill(1.5, row, ee1ErrorCount);
577 align->Fill(2.5, row, ee1Total);
581 align->Fill(0.5, row, 3);
582 align->Fill(1.5, row, ee2ErrorCount);
583 align->Fill(2.5, row, ee2Total);
589 gStyle->SetPalette(1);
590 gStyle->SetOptStat(0);
591 TCanvas
canvas(
"CC map",
"CC map", 1000, 1000);
595 t1.SetTextSize(0.045);
597 t1.DrawLatex(0.5, 0.96,Form(
"EcalChannelStatus Error Summary, IOV %i", run));
600 TPad* pad =
new TPad(
"pad",
"pad", 0.0, 0.0, 1.0, 0.94);
607 align->GetXaxis()->SetTickLength(0.);
608 align->GetXaxis()->SetLabelSize(0.);
609 align->GetYaxis()->SetTickLength(0.);
610 align->GetYaxis()->SetLabelSize(0.);
613 canvas.SaveAs(ImageName.c_str());
std::shared_ptr< PayloadType > fetchPayload(const cond::Hash &payloadHash)
constexpr uint32_t rawId() const
get the raw id
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
static const int MIN_HASH
virtual bool fill(const std::vector< std::tuple< cond::Time_t, cond::Hash > > &iovs)=0
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
void setSingleIov(bool flag)
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
void drawTable(int nbRows, int nbColumns)